From 52912235485eeda65b386359715942384055bc51 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 13 Jan 2023 00:19:01 +0000 Subject: [PATCH 001/130] sync with cpython 55a26de6 --- library/enum.po | 6 +++--- library/sys.po | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/library/enum.po b/library/enum.po index b5b1a9be30..96814a8d46 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-04 00:15+0000\n" +"POT-Creation-Date: 2023-01-13 00: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-" @@ -898,8 +898,8 @@ msgstr "" #: ../../library/enum.rst:822 msgid "" -"in 3.13 the default ``\"generate_next_value_`` will always return the " -"highest member value incremented by 1, and will fail if any member is an " +"in 3.13 the default ``_generate_next_value_`` will always return the highest " +"member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" diff --git a/library/sys.po b/library/sys.po index 1cadd66e8a..f6ee2572ac 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-12 06:58+0000\n" +"POT-Creation-Date: 2023-01-13 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2583,9 +2583,9 @@ msgstr "" msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " -"first three characters of :const:`version`. It is provided in the :mod:" -"`sys` module for informational purposes; modifying this value has no effect " -"on the registry keys used by Python." +"major and minor versions of the running Python interpreter. It is provided " +"in the :mod:`sys` module for informational purposes; modifying this value " +"has no effect on the registry keys used by Python." msgstr "" #: ../../library/sys.rst:1817 From 948ae73e4d3047048c24a3350441461d9e4fee1e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 14 Jan 2023 00:17:36 +0000 Subject: [PATCH 002/130] sync with cpython d06315a6 --- library/asyncio-policy.po | 9 +- using/windows.po | 287 ++++++++++++++++++++------------------ 2 files changed, 155 insertions(+), 141 deletions(-) diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index fc94297ca9..c45f22e4aa 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-11 00:15+0000\n" +"POT-Creation-Date: 2023-01-14 00:15+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-" @@ -147,9 +147,10 @@ msgstr "" #: ../../library/asyncio-policy.rst:116 msgid "" -"In Python versions 3.10.9, 3.11.1 and 3.12 this function emits a :exc:" -"`DeprecationWarning` if there is no running event loop and no current loop " -"is set. In some future Python release this will become an error." +"In Python versions 3.10.9, 3.11.1 and 3.12 the :meth:`get_event_loop` method " +"of the default asyncio policy emits a :exc:`DeprecationWarning` if there is " +"no running event loop and no current loop is set. In some future Python " +"release this will become an error." msgstr "" #: ../../library/asyncio-policy.rst:124 diff --git a/using/windows.po b/using/windows.po index 8aba9bd2e9..7e7af59447 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-01 00:23+0000\n" +"POT-Creation-Date: 2023-01-14 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -199,8 +199,8 @@ msgid "" "In the latest versions of Windows, this limitation can be expanded to " "approximately 32,000 characters. Your administrator will need to activate " "the \"Enable Win32 long paths\" group policy, or set ``LongPathsEnabled`` to " -"``1`` in the registry key ``HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet" -"\\Control\\FileSystem``." +"``1`` in the registry key " +"``HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\FileSystem``." msgstr "" #: ../../using/windows.rst:110 @@ -245,11 +245,11 @@ msgid "" "list of available options is shown below." msgstr "" -#: ../../using/windows.rst:140 ../../using/windows.rst:1028 +#: ../../using/windows.rst:140 ../../using/windows.rst:1043 msgid "Name" msgstr "" -#: ../../using/windows.rst:140 ../../using/windows.rst:1028 +#: ../../using/windows.rst:140 ../../using/windows.rst:1043 msgid "Description" msgstr "描述" @@ -308,9 +308,9 @@ msgstr "預設安裝目錄給 只有給我 安裝方式" #: ../../using/windows.rst:152 msgid "" -":file:`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY` or :file:`" -"%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-32` or :file:`" -"%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-64`" +":file:`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY` or :file:" +"`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-32` or :file:" +"`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-64`" msgstr "" #: ../../using/windows.rst:162 @@ -686,18 +686,19 @@ msgid "" "At runtime, Python will use a private copy of well-known Windows folders and " "the registry. For example, if the environment variable :envvar:`%APPDATA%` " "is :file:`c:\\\\Users\\\\\\\\AppData\\\\`, then when writing to :file:" -"`C:\\\\Users\\\\\\\\AppData\\\\Local` will write to :file:`C:\\\\Users" -"\\\\\\\\AppData\\\\Local\\\\Packages\\\\PythonSoftwareFoundation." -"Python.3.8_qbz5n2kfra8p0\\\\LocalCache\\\\Local\\\\`." +"`C:\\\\Users\\\\\\\\AppData\\\\Local` will write to :file:`C:\\" +"\\Users\\\\\\\\AppData\\\\Local\\\\Packages\\" +"\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\\\LocalCache\\\\Local\\" +"\\`." msgstr "" #: ../../using/windows.rst:361 msgid "" "When reading files, Windows will return the file from the private folder, or " "if that does not exist, the real Windows directory. For example reading :" -"file:`C:\\\\Windows\\\\System32` returns the contents of :file:`C:\\\\Windows" -"\\\\System32` plus the contents of :file:`C:\\\\Program Files\\\\WindowsApps" -"\\\\package_name\\\\VFS\\\\SystemX86`." +"file:`C:\\\\Windows\\\\System32` returns the contents of :file:`C:\\" +"\\Windows\\\\System32` plus the contents of :file:`C:\\\\Program Files\\" +"\\WindowsApps\\\\package_name\\\\VFS\\\\SystemX86`." msgstr "" #: ../../using/windows.rst:365 @@ -1089,9 +1090,9 @@ msgstr "" #: ../../using/windows.rst:629 msgid "" -"On the first page of the installer, an option labelled \"Add Python to PATH" -"\" may be selected to have the installer add the install location into the :" -"envvar:`PATH`. The location of the :file:`Scripts\\\\` folder is also " +"On the first page of the installer, an option labelled \"Add Python to " +"PATH\" may be selected to have the installer add the install location into " +"the :envvar:`PATH`. The location of the :file:`Scripts\\\\` folder is also " "added. This allows you to type :command:`python` to run the interpreter, " "and :command:`pip` for the package installer. Thus, you can also execute " "your scripts with command line options, see :ref:`using-on-cmdline` " @@ -1344,7 +1345,8 @@ msgid "" msgstr "" #: ../../using/windows.rst:821 -msgid "``/usr/bin/env python``" +#, fuzzy +msgid "``/usr/bin/env``" msgstr "``/usr/bin/env python``" #: ../../using/windows.rst:822 @@ -1399,18 +1401,30 @@ msgstr "" msgid "" "The ``/usr/bin/env`` form of shebang line has one further special property. " "Before looking for installed Python interpreters, this form will search the " -"executable :envvar:`PATH` for a Python executable. This corresponds to the " -"behaviour of the Unix ``env`` program, which performs a :envvar:`PATH` " -"search. If an executable matching the first argument after the ``env`` " -"command cannot be found, it will be handled as described below. " -"Additionally, the environment variable :envvar:`PYLAUNCHER_NO_SEARCH_PATH` " -"may be set (to any value) to skip this additional search." +"executable :envvar:`PATH` for a Python executable matching the name provided " +"as the first argument. This corresponds to the behaviour of the Unix ``env`` " +"program, which performs a :envvar:`PATH` search. If an executable matching " +"the first argument after the ``env`` command cannot be found, but the " +"argument starts with ``python``, it will be handled as described for the " +"other virtual commands. The environment variable :envvar:" +"`PYLAUNCHER_NO_SEARCH_PATH` may be set (to any value) to skip this search " +"of :envvar:`PATH`." msgstr "" -#: ../../using/windows.rst:865 +#: ../../using/windows.rst:867 msgid "" -"Shebang lines that do not match any of these patterns are treated as " -"**Windows** paths that are absolute or relative to the directory containing " +"Shebang lines that do not match any of these patterns are looked up in the " +"``[commands]`` section of the launcher's :ref:`.INI file `. " +"This may be used to handle certain commands in a way that makes sense for " +"your system. The name of the command must be a single argument (no spaces), " +"and the value substituted is the full path to the executable (no arguments " +"may be added)." +msgstr "" + +#: ../../using/windows.rst:879 +msgid "" +"Any commands not found in the .INI file are treated as **Windows** " +"executable paths that are absolute or relative to the directory containing " "the script file. This is a convenience for Windows-only scripts, such as " "those generated by an installer, since the behavior is not compatible with " "Unix-style shells. These paths may be quoted, and may include multiple " @@ -1418,39 +1432,38 @@ msgid "" "will be appended." msgstr "" -#: ../../using/windows.rst:874 +#: ../../using/windows.rst:888 msgid "Arguments in shebang lines" msgstr "" -#: ../../using/windows.rst:876 +#: ../../using/windows.rst:890 msgid "" "The shebang lines can also specify additional options to be passed to the " "Python interpreter. For example, if you have a shebang line:" msgstr "" -#: ../../using/windows.rst:883 +#: ../../using/windows.rst:897 msgid "Then Python will be started with the ``-v`` option" msgstr "" -#: ../../using/windows.rst:886 +#: ../../using/windows.rst:900 msgid "Customization" msgstr "" -#: ../../using/windows.rst:889 +#: ../../using/windows.rst:905 msgid "Customization via INI files" msgstr "" -#: ../../using/windows.rst:891 +#: ../../using/windows.rst:907 msgid "" "Two .ini files will be searched by the launcher - ``py.ini`` in the current " -"user's \"application data\" directory (i.e. the directory returned by " -"calling the Windows function ``SHGetFolderPath`` with " -"``CSIDL_LOCAL_APPDATA``) and ``py.ini`` in the same directory as the " -"launcher. The same .ini files are used for both the 'console' version of the " -"launcher (i.e. py.exe) and for the 'windows' version (i.e. pyw.exe)." +"user's application data directory (``%LOCALAPPDATA%`` or ``$env:" +"LocalAppData``) and ``py.ini`` in the same directory as the launcher. The " +"same .ini files are used for both the 'console' version of the launcher (i." +"e. py.exe) and for the 'windows' version (i.e. pyw.exe)." msgstr "" -#: ../../using/windows.rst:898 +#: ../../using/windows.rst:913 msgid "" "Customization specified in the \"application directory\" will have " "precedence over the one next to the executable, so a user, who may not have " @@ -1458,11 +1471,11 @@ msgid "" "that global .ini file." msgstr "" -#: ../../using/windows.rst:903 +#: ../../using/windows.rst:918 msgid "Customizing default Python versions" msgstr "" -#: ../../using/windows.rst:905 +#: ../../using/windows.rst:920 msgid "" "In some cases, a version qualifier can be included in a command to dictate " "which version of Python will be used by the command. A version qualifier " @@ -1472,13 +1485,13 @@ msgid "" "\"-32\" or \"-64\"." msgstr "" -#: ../../using/windows.rst:911 +#: ../../using/windows.rst:926 msgid "" "For example, a shebang line of ``#!python`` has no version qualifier, while " "``#!python3`` has a version qualifier which specifies only a major version." msgstr "" -#: ../../using/windows.rst:914 +#: ../../using/windows.rst:929 msgid "" "If no version qualifiers are found in a command, the environment variable :" "envvar:`PY_PYTHON` can be set to specify the default version qualifier. If " @@ -1488,7 +1501,7 @@ msgid "" "launcher included with Python 3.7 or newer.)" msgstr "" -#: ../../using/windows.rst:921 +#: ../../using/windows.rst:936 msgid "" "If no minor version qualifiers are found, the environment variable " "``PY_PYTHON{major}`` (where ``{major}`` is the current major version " @@ -1499,7 +1512,7 @@ msgid "" "version in that family." msgstr "" -#: ../../using/windows.rst:929 +#: ../../using/windows.rst:944 msgid "" "On 64-bit Windows with both 32-bit and 64-bit implementations of the same " "(major.minor) Python version installed, the 64-bit version will always be " @@ -1513,30 +1526,30 @@ msgid "" "suffix can be used on a version specifier to change this behaviour." msgstr "" -#: ../../using/windows.rst:940 +#: ../../using/windows.rst:955 msgid "Examples:" msgstr "範例:" -#: ../../using/windows.rst:942 +#: ../../using/windows.rst:957 msgid "" "If no relevant options are set, the commands ``python`` and ``python2`` will " "use the latest Python 2.x version installed and the command ``python3`` will " "use the latest Python 3.x installed." msgstr "" -#: ../../using/windows.rst:946 +#: ../../using/windows.rst:961 msgid "" "The command ``python3.7`` will not consult any options at all as the " "versions are fully specified." msgstr "" -#: ../../using/windows.rst:949 +#: ../../using/windows.rst:964 msgid "" "If ``PY_PYTHON=3``, the commands ``python`` and ``python3`` will both use " "the latest installed Python 3 version." msgstr "" -#: ../../using/windows.rst:952 +#: ../../using/windows.rst:967 msgid "" "If ``PY_PYTHON=3.7-32``, the command ``python`` will use the 32-bit " "implementation of 3.7 whereas the command ``python3`` will use the latest " @@ -1544,13 +1557,13 @@ msgid "" "specified.)" msgstr "" -#: ../../using/windows.rst:957 +#: ../../using/windows.rst:972 msgid "" "If ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7``, the commands ``python`` and " "``python3`` will both use specifically 3.7" msgstr "" -#: ../../using/windows.rst:960 +#: ../../using/windows.rst:975 msgid "" "In addition to environment variables, the same settings can be configured in " "the .INI file used by the launcher. The section in the INI file is called " @@ -1560,25 +1573,25 @@ msgid "" "will override things specified in the INI file." msgstr "" -#: ../../using/windows.rst:967 +#: ../../using/windows.rst:982 msgid "For example:" msgstr "" -#: ../../using/windows.rst:969 +#: ../../using/windows.rst:984 msgid "Setting ``PY_PYTHON=3.7`` is equivalent to the INI file containing:" msgstr "" -#: ../../using/windows.rst:976 +#: ../../using/windows.rst:991 msgid "" "Setting ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7`` is equivalent to the INI file " "containing:" msgstr "" -#: ../../using/windows.rst:986 +#: ../../using/windows.rst:1001 msgid "Diagnostics" msgstr "" -#: ../../using/windows.rst:988 +#: ../../using/windows.rst:1003 msgid "" "If an environment variable :envvar:`PYLAUNCHER_DEBUG` is set (to any value), " "the launcher will print diagnostic information to stderr (i.e. to the " @@ -1588,11 +1601,11 @@ msgid "" "the target Python. It is primarily intended for testing and debugging." msgstr "" -#: ../../using/windows.rst:996 +#: ../../using/windows.rst:1011 msgid "Dry Run" msgstr "" -#: ../../using/windows.rst:998 +#: ../../using/windows.rst:1013 msgid "" "If an environment variable :envvar:`PYLAUNCHER_DRYRUN` is set (to any " "value), the launcher will output the command it would have run, but will not " @@ -1602,11 +1615,11 @@ msgid "" "correctly in the console." msgstr "" -#: ../../using/windows.rst:1006 +#: ../../using/windows.rst:1021 msgid "Install on demand" msgstr "安裝隨選" -#: ../../using/windows.rst:1008 +#: ../../using/windows.rst:1023 msgid "" "If an environment variable :envvar:`PYLAUNCHER_ALLOW_INSTALL` is set (to any " "value), and the requested Python version is not installed but is available " @@ -1615,7 +1628,7 @@ msgid "" "again." msgstr "" -#: ../../using/windows.rst:1013 +#: ../../using/windows.rst:1028 msgid "" "An additional :envvar:`PYLAUNCHER_ALWAYS_INSTALL` variable causes the " "launcher to always try to install Python, even if it is detected. This is " @@ -1623,137 +1636,137 @@ msgid "" "`PYLAUNCHER_DRYRUN`)." msgstr "" -#: ../../using/windows.rst:1018 +#: ../../using/windows.rst:1033 msgid "Return codes" msgstr "" -#: ../../using/windows.rst:1020 +#: ../../using/windows.rst:1035 msgid "" "The following exit codes may be returned by the Python launcher. " "Unfortunately, there is no way to distinguish these from the exit code of " "Python itself." msgstr "" -#: ../../using/windows.rst:1023 +#: ../../using/windows.rst:1038 msgid "" "The names of codes are as used in the sources, and are only for reference. " "There is no way to access or resolve them apart from reading this page. " "Entries are listed in alphabetical order of names." msgstr "" -#: ../../using/windows.rst:1028 +#: ../../using/windows.rst:1043 msgid "Value" msgstr "" -#: ../../using/windows.rst:1030 +#: ../../using/windows.rst:1045 msgid "RC_BAD_VENV_CFG" msgstr "RC_BAD_VENV_CFG" -#: ../../using/windows.rst:1030 +#: ../../using/windows.rst:1045 msgid "107" msgstr "107" -#: ../../using/windows.rst:1030 +#: ../../using/windows.rst:1045 msgid "A :file:`pyvenv.cfg` was found but is corrupt." msgstr "" -#: ../../using/windows.rst:1032 +#: ../../using/windows.rst:1047 msgid "RC_CREATE_PROCESS" msgstr "RC_CREATE_PROCESS" -#: ../../using/windows.rst:1032 +#: ../../using/windows.rst:1047 msgid "101" msgstr "101" -#: ../../using/windows.rst:1032 +#: ../../using/windows.rst:1047 msgid "Failed to launch Python." msgstr "" -#: ../../using/windows.rst:1034 +#: ../../using/windows.rst:1049 msgid "RC_INSTALLING" msgstr "RC_INSTALLING" -#: ../../using/windows.rst:1034 +#: ../../using/windows.rst:1049 msgid "111" msgstr "111" -#: ../../using/windows.rst:1034 +#: ../../using/windows.rst:1049 msgid "" "An install was started, but the command will need to be re-run after it " "completes." msgstr "" -#: ../../using/windows.rst:1037 +#: ../../using/windows.rst:1052 msgid "RC_INTERNAL_ERROR" msgstr "RC_INTERNAL_ERROR" -#: ../../using/windows.rst:1037 +#: ../../using/windows.rst:1052 msgid "109" msgstr "109" -#: ../../using/windows.rst:1037 +#: ../../using/windows.rst:1052 msgid "Unexpected error. Please report a bug." msgstr "" -#: ../../using/windows.rst:1039 +#: ../../using/windows.rst:1054 msgid "RC_NO_COMMANDLINE" msgstr "RC_NO_COMMANDLINE" -#: ../../using/windows.rst:1039 +#: ../../using/windows.rst:1054 msgid "108" msgstr "108" -#: ../../using/windows.rst:1039 +#: ../../using/windows.rst:1054 msgid "Unable to obtain command line from the operating system." msgstr "" -#: ../../using/windows.rst:1042 +#: ../../using/windows.rst:1057 msgid "RC_NO_PYTHON" msgstr "RC_NO_PYTHON" -#: ../../using/windows.rst:1042 +#: ../../using/windows.rst:1057 msgid "103" msgstr "103" -#: ../../using/windows.rst:1042 +#: ../../using/windows.rst:1057 msgid "Unable to locate the requested version." msgstr "" -#: ../../using/windows.rst:1044 +#: ../../using/windows.rst:1059 msgid "RC_NO_VENV_CFG" msgstr "RC_NO_VENV_CFG" -#: ../../using/windows.rst:1044 +#: ../../using/windows.rst:1059 msgid "106" msgstr "106" -#: ../../using/windows.rst:1044 +#: ../../using/windows.rst:1059 msgid "A :file:`pyvenv.cfg` was required but not found." msgstr "" -#: ../../using/windows.rst:1052 +#: ../../using/windows.rst:1067 msgid "Finding modules" msgstr "" -#: ../../using/windows.rst:1054 +#: ../../using/windows.rst:1069 msgid "" "These notes supplement the description at :ref:`sys-path-init` with detailed " "Windows notes." msgstr "" -#: ../../using/windows.rst:1057 +#: ../../using/windows.rst:1072 msgid "" "When no ``._pth`` file is found, this is how :data:`sys.path` is populated " "on Windows:" msgstr "" -#: ../../using/windows.rst:1060 +#: ../../using/windows.rst:1075 msgid "" "An empty entry is added at the start, which corresponds to the current " "directory." msgstr "" -#: ../../using/windows.rst:1063 +#: ../../using/windows.rst:1078 msgid "" "If the environment variable :envvar:`PYTHONPATH` exists, as described in :" "ref:`using-on-envvars`, its entries are added next. Note that on Windows, " @@ -1761,7 +1774,7 @@ msgid "" "from the colon used in drive identifiers (``C:\\`` etc.)." msgstr "" -#: ../../using/windows.rst:1068 +#: ../../using/windows.rst:1083 msgid "" "Additional \"application paths\" can be added in the registry as subkeys of :" "samp:`\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\{version}\\\\PythonPath` under " @@ -1771,7 +1784,7 @@ msgid "" "installers only use HKLM, so HKCU is typically empty.)" msgstr "" -#: ../../using/windows.rst:1075 +#: ../../using/windows.rst:1090 msgid "" "If the environment variable :envvar:`PYTHONHOME` is set, it is assumed as " "\"Python Home\". Otherwise, the path of the main Python executable is used " @@ -1782,31 +1795,31 @@ msgid "" "PythonPath stored in the registry." msgstr "" -#: ../../using/windows.rst:1083 +#: ../../using/windows.rst:1098 msgid "" "If the Python Home cannot be located, no :envvar:`PYTHONPATH` is specified " "in the environment, and no registry entries can be found, a default path " "with relative entries is used (e.g. ``.\\Lib;.\\plat-win``, etc)." msgstr "" -#: ../../using/windows.rst:1087 +#: ../../using/windows.rst:1102 msgid "" "If a ``pyvenv.cfg`` file is found alongside the main executable or in the " "directory one level above the executable, the following variations apply:" msgstr "" -#: ../../using/windows.rst:1090 +#: ../../using/windows.rst:1105 msgid "" "If ``home`` is an absolute path and :envvar:`PYTHONHOME` is not set, this " "path is used instead of the path to the main executable when deducing the " "home location." msgstr "" -#: ../../using/windows.rst:1094 +#: ../../using/windows.rst:1109 msgid "The end result of all this is:" msgstr "最終這所有的結果為:" -#: ../../using/windows.rst:1096 +#: ../../using/windows.rst:1111 msgid "" "When running :file:`python.exe`, or any other .exe in the main Python " "directory (either an installed version, or directly from the PCbuild " @@ -1814,7 +1827,7 @@ msgid "" "ignored. Other \"application paths\" in the registry are always read." msgstr "" -#: ../../using/windows.rst:1101 +#: ../../using/windows.rst:1116 msgid "" "When Python is hosted in another .exe (different directory, embedded via " "COM, etc), the \"Python Home\" will not be deduced, so the core path from " @@ -1822,20 +1835,20 @@ msgid "" "always read." msgstr "" -#: ../../using/windows.rst:1105 +#: ../../using/windows.rst:1120 msgid "" "If Python can't find its home and there are no registry value (frozen .exe, " "some very strange installation setup) you get a path with some default, but " "relative, paths." msgstr "" -#: ../../using/windows.rst:1109 +#: ../../using/windows.rst:1124 msgid "" "For those who want to bundle Python into their application or distribution, " "the following advice will prevent conflicts with other installations:" msgstr "" -#: ../../using/windows.rst:1112 +#: ../../using/windows.rst:1127 msgid "" "Include a ``._pth`` file alongside your executable containing the " "directories to include. This will ignore paths listed in the registry and " @@ -1843,20 +1856,20 @@ msgid "" "listed." msgstr "" -#: ../../using/windows.rst:1117 +#: ../../using/windows.rst:1132 msgid "" "If you are loading :file:`python3.dll` or :file:`python37.dll` in your own " "executable, explicitly call :c:func:`Py_SetPath` or (at least) :c:func:" "`Py_SetProgramName` before :c:func:`Py_Initialize`." msgstr "" -#: ../../using/windows.rst:1121 +#: ../../using/windows.rst:1136 msgid "" "Clear and/or overwrite :envvar:`PYTHONPATH` and set :envvar:`PYTHONHOME` " "before launching :file:`python.exe` from your application." msgstr "" -#: ../../using/windows.rst:1124 +#: ../../using/windows.rst:1139 msgid "" "If you cannot use the previous suggestions (for example, you are a " "distribution that allows people to run :file:`python.exe` directly), ensure " @@ -1865,7 +1878,7 @@ msgid "" "correctly named ZIP file will be detected instead.)" msgstr "" -#: ../../using/windows.rst:1130 +#: ../../using/windows.rst:1145 msgid "" "These will ensure that the files in a system-wide installation will not take " "precedence over the copy of the standard library bundled with your " @@ -1875,19 +1888,19 @@ msgid "" "packages." msgstr "" -#: ../../using/windows.rst:1139 +#: ../../using/windows.rst:1154 msgid "" "Adds ``._pth`` file support and removes ``applocal`` option from ``pyvenv." "cfg``." msgstr "" -#: ../../using/windows.rst:1141 +#: ../../using/windows.rst:1156 msgid "" "Adds ``pythonXX.zip`` as a potential landmark when directly adjacent to the " "executable." msgstr "" -#: ../../using/windows.rst:1147 +#: ../../using/windows.rst:1162 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " @@ -1895,88 +1908,88 @@ msgid "" "explicitly added to :attr:`sys.meta_path` in the future." msgstr "" -#: ../../using/windows.rst:1153 +#: ../../using/windows.rst:1168 msgid "Additional modules" msgstr "" -#: ../../using/windows.rst:1155 +#: ../../using/windows.rst:1170 msgid "" "Even though Python aims to be portable among all platforms, there are " "features that are unique to Windows. A couple of modules, both in the " "standard library and external, and snippets exist to use these features." msgstr "" -#: ../../using/windows.rst:1159 +#: ../../using/windows.rst:1174 msgid "" "The Windows-specific standard modules are documented in :ref:`mswin-specific-" "services`." msgstr "" -#: ../../using/windows.rst:1163 +#: ../../using/windows.rst:1178 msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1165 +#: ../../using/windows.rst:1180 msgid "" "The `PyWin32 `_ module by Mark Hammond is " "a collection of modules for advanced Windows-specific support. This " "includes utilities for:" msgstr "" -#: ../../using/windows.rst:1169 +#: ../../using/windows.rst:1184 msgid "" "`Component Object Model `_ (COM)" msgstr "" -#: ../../using/windows.rst:1172 +#: ../../using/windows.rst:1187 msgid "Win32 API calls" msgstr "Win32 API 呼叫" -#: ../../using/windows.rst:1173 +#: ../../using/windows.rst:1188 msgid "Registry" msgstr "登錄檔(Registry)" -#: ../../using/windows.rst:1174 +#: ../../using/windows.rst:1189 msgid "Event log" msgstr "事件日誌(Event log)" -#: ../../using/windows.rst:1175 +#: ../../using/windows.rst:1190 msgid "" "`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" -#: ../../using/windows.rst:1179 +#: ../../using/windows.rst:1194 msgid "" "`PythonWin `_ is a sample MFC application shipped with PyWin32. " "It is an embeddable IDE with a built-in debugger." msgstr "" -#: ../../using/windows.rst:1186 +#: ../../using/windows.rst:1201 msgid "" "`Win32 How Do I...? `_" msgstr "" "`Win32 How Do I...? `_" -#: ../../using/windows.rst:1186 +#: ../../using/windows.rst:1201 msgid "by Tim Golden" msgstr "由 Tim Golden 所著" -#: ../../using/windows.rst:1188 +#: ../../using/windows.rst:1203 msgid "`Python and COM `_" msgstr "`Python and COM `_" -#: ../../using/windows.rst:1189 +#: ../../using/windows.rst:1204 msgid "by David and Paul Boddie" msgstr "由 David 與 Paul Boddie 所著" -#: ../../using/windows.rst:1193 +#: ../../using/windows.rst:1208 msgid "cx_Freeze" msgstr "cx_Freeze" -#: ../../using/windows.rst:1195 +#: ../../using/windows.rst:1210 msgid "" "`cx_Freeze `_ is a :mod:" "`distutils` extension (see :ref:`extending-distutils`) which wraps Python " @@ -1985,11 +1998,11 @@ msgid "" "users to install Python." msgstr "" -#: ../../using/windows.rst:1203 +#: ../../using/windows.rst:1218 msgid "Compiling Python on Windows" msgstr "編譯 Python 在 Windows" -#: ../../using/windows.rst:1205 +#: ../../using/windows.rst:1220 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -1997,48 +2010,48 @@ msgid "" "devguide.python.org/setup/#get-the-source-code>`_." msgstr "" -#: ../../using/windows.rst:1210 +#: ../../using/windows.rst:1225 msgid "" "The source tree contains a build solution and project files for Microsoft " "Visual Studio, which is the compiler used to build the official Python " "releases. These files are in the :file:`PCbuild` directory." msgstr "" -#: ../../using/windows.rst:1214 +#: ../../using/windows.rst:1229 msgid "" "Check :file:`PCbuild/readme.txt` for general information on the build " "process." msgstr "" -#: ../../using/windows.rst:1216 +#: ../../using/windows.rst:1231 msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" -#: ../../using/windows.rst:1220 +#: ../../using/windows.rst:1235 msgid "Other Platforms" msgstr "其他平台" -#: ../../using/windows.rst:1222 +#: ../../using/windows.rst:1237 msgid "" "With ongoing development of Python, some platforms that used to be supported " "earlier are no longer supported (due to the lack of users or developers). " "Check :pep:`11` for details on all unsupported platforms." msgstr "" -#: ../../using/windows.rst:1226 +#: ../../using/windows.rst:1241 msgid "" "`Windows CE `_ is `no longer supported " "`__ since Python 3 (if it " "ever was)." msgstr "" -#: ../../using/windows.rst:1229 +#: ../../using/windows.rst:1244 msgid "" "The `Cygwin `_ installer offers to install the `Python " "interpreter `__ as well" msgstr "" -#: ../../using/windows.rst:1233 +#: ../../using/windows.rst:1248 msgid "" "See `Python for Windows `_ for " "detailed information about platforms with pre-compiled installers." From 46f68ec205f0186d92b7441d2243897e94482631 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Jan 2023 00:20:17 +0000 Subject: [PATCH 003/130] sync with cpython c7aa3928 --- library/email.mime.po | 12 ++-- library/sqlite3.po | 129 ++++++++++++++++++++++-------------------- 2 files changed, 75 insertions(+), 66 deletions(-) diff --git a/library/email.mime.po b/library/email.mime.po index d10dbddb73..527ac023ab 100644 --- a/library/email.mime.po +++ b/library/email.mime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-01-15 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:00+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -165,9 +165,9 @@ msgstr "模組:\\ :mod:`email.mime.application`" msgid "" "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" "`MIMEApplication` class is used to represent MIME message objects of major " -"type :mimetype:`application`. *_data* is a string containing the raw byte " -"data. Optional *_subtype* specifies the MIME subtype and defaults to :" -"mimetype:`octet-stream`." +"type :mimetype:`application`. *_data* contains the bytes for the raw " +"application data. Optional *_subtype* specifies the MIME subtype and " +"defaults to :mimetype:`octet-stream`." msgstr "" #: ../../library/email.mime.rst:121 @@ -194,7 +194,7 @@ msgstr "模組:\\ :mod:`email.mime.audio`" msgid "" "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" "`MIMEAudio` class is used to create MIME message objects of major type :" -"mimetype:`audio`. *_audiodata* is a string containing the raw audio data. " +"mimetype:`audio`. *_audiodata* contains the bytes for the raw audio data. " "If this data can be decoded as au, wav, aiff, or aifc, then the subtype will " "be automatically included in the :mailheader:`Content-Type` header. " "Otherwise you can explicitly specify the audio subtype via the *_subtype* " @@ -222,7 +222,7 @@ msgstr "模組:\\ :mod:`email.mime.image`" msgid "" "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" "`MIMEImage` class is used to create MIME message objects of major type :" -"mimetype:`image`. *_imagedata* is a string containing the raw image data. " +"mimetype:`image`. *_imagedata* contains the bytes for the raw image data. " "If this data type can be detected (jpeg, png, gif, tiff, rgb, pbm, pgm, ppm, " "rast, xbm, bmp, webp, and exr attempted), then the subtype will be " "automatically included in the :mailheader:`Content-Type` header. Otherwise " diff --git a/library/sqlite3.po b/library/sqlite3.po index 0dbc82d770..965d306ef0 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-02 00:15+0000\n" +"POT-Creation-Date: 2023-01-15 00:18+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-" @@ -1759,29 +1759,38 @@ msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " "values into the query by providing them as a :class:`tuple` of values to the " -"second argument of the cursor's :meth:`~Cursor.execute` method. An SQL " -"statement may use one of two kinds of placeholders: question marks (qmark " -"style) or named placeholders (named style). For the qmark style, " -"``parameters`` must be a :term:`sequence `. For the named style, " -"it can be either a :term:`sequence ` or :class:`dict` instance. " -"The length of the :term:`sequence ` must match the number of " -"placeholders, or a :exc:`ProgrammingError` is raised. If a :class:`dict` is " -"given, it must contain keys for all named parameters. Any extra items are " -"ignored. Here's an example of both styles:" -msgstr "" - -#: ../../library/sqlite3.rst:1865 +"second argument of the cursor's :meth:`~Cursor.execute` method." +msgstr "" + +#: ../../library/sqlite3.rst:1828 +msgid "" +"An SQL statement may use one of two kinds of placeholders: question marks " +"(qmark style) or named placeholders (named style). For the qmark style, " +"*parameters* must be a :term:`sequence` whose length must match the number " +"of placeholders, or a :exc:`ProgrammingError` is raised. For the named " +"style, *parameters* should be an instance of a :class:`dict` (or a " +"subclass), which must contain keys for all named parameters; any extra items " +"are ignored. Here's an example of both styles:" +msgstr "" + +#: ../../library/sqlite3.rst:1866 +msgid "" +":pep:`249` numeric placeholders are *not* supported. If used, they will be " +"interpreted as named placeholders." +msgstr "" + +#: ../../library/sqlite3.rst:1873 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1867 +#: ../../library/sqlite3.rst:1875 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1871 +#: ../../library/sqlite3.rst:1879 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1791,11 +1800,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1883 +#: ../../library/sqlite3.rst:1891 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1885 +#: ../../library/sqlite3.rst:1893 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1805,84 +1814,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1916 +#: ../../library/sqlite3.rst:1924 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1918 +#: ../../library/sqlite3.rst:1926 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1948 +#: ../../library/sqlite3.rst:1956 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1950 +#: ../../library/sqlite3.rst:1958 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1955 +#: ../../library/sqlite3.rst:1963 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1958 +#: ../../library/sqlite3.rst:1966 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1971 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1972 +#: ../../library/sqlite3.rst:1980 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1976 +#: ../../library/sqlite3.rst:1984 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1977 +#: ../../library/sqlite3.rst:1985 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1978 +#: ../../library/sqlite3.rst:1986 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1982 +#: ../../library/sqlite3.rst:1990 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2033 +#: ../../library/sqlite3.rst:2041 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2035 +#: ../../library/sqlite3.rst:2043 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2097 +#: ../../library/sqlite3.rst:2105 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2099 +#: ../../library/sqlite3.rst:2107 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1894,11 +1903,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2140 +#: ../../library/sqlite3.rst:2148 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2142 +#: ../../library/sqlite3.rst:2150 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1908,58 +1917,58 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2151 +#: ../../library/sqlite3.rst:2159 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2156 +#: ../../library/sqlite3.rst:2164 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2189 +#: ../../library/sqlite3.rst:2197 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2191 +#: ../../library/sqlite3.rst:2199 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2193 +#: ../../library/sqlite3.rst:2201 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2202 +#: ../../library/sqlite3.rst:2210 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2212 +#: ../../library/sqlite3.rst:2220 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2226 +#: ../../library/sqlite3.rst:2234 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2235 +#: ../../library/sqlite3.rst:2243 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2237 +#: ../../library/sqlite3.rst:2245 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`." msgstr "" -#: ../../library/sqlite3.rst:2242 +#: ../../library/sqlite3.rst:2250 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -1967,7 +1976,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2247 +#: ../../library/sqlite3.rst:2255 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -1975,51 +1984,51 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2257 +#: ../../library/sqlite3.rst:2265 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2272 +#: ../../library/sqlite3.rst:2280 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2281 +#: ../../library/sqlite3.rst:2289 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2291 +#: ../../library/sqlite3.rst:2299 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2302 +#: ../../library/sqlite3.rst:2310 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2317 +#: ../../library/sqlite3.rst:2325 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`." msgstr "" -#: ../../library/sqlite3.rst:2325 +#: ../../library/sqlite3.rst:2333 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2330 +#: ../../library/sqlite3.rst:2338 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2332 +#: ../../library/sqlite3.rst:2340 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2335 +#: ../../library/sqlite3.rst:2343 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2033,7 +2042,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2348 +#: ../../library/sqlite3.rst:2356 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2043,14 +2052,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2356 +#: ../../library/sqlite3.rst:2364 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2360 +#: ../../library/sqlite3.rst:2368 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." From 9f2ce90129e47bec09a5f45638dfd1a8a0fdbff5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 17 Jan 2023 00:18:33 +0000 Subject: [PATCH 004/130] sync with cpython 31b82abb --- using/windows.po | 225 ++++++++++++++++++++++++----------------------- 1 file changed, 113 insertions(+), 112 deletions(-) diff --git a/using/windows.po b/using/windows.po index 7e7af59447..beb3333808 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-14 00:15+0000\n" +"POT-Creation-Date: 2023-01-17 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -245,11 +245,11 @@ msgid "" "list of available options is shown below." msgstr "" -#: ../../using/windows.rst:140 ../../using/windows.rst:1043 +#: ../../using/windows.rst:140 ../../using/windows.rst:1044 msgid "Name" msgstr "" -#: ../../using/windows.rst:140 ../../using/windows.rst:1043 +#: ../../using/windows.rst:140 ../../using/windows.rst:1044 msgid "Description" msgstr "描述" @@ -1416,12 +1416,13 @@ msgid "" "Shebang lines that do not match any of these patterns are looked up in the " "``[commands]`` section of the launcher's :ref:`.INI file `. " "This may be used to handle certain commands in a way that makes sense for " -"your system. The name of the command must be a single argument (no spaces), " -"and the value substituted is the full path to the executable (no arguments " -"may be added)." +"your system. The name of the command must be a single argument (no spaces in " +"the shebang executable), and the value substituted is the full path to the " +"executable (additional arguments specified in the .INI will be quoted as " +"part of the filename)." msgstr "" -#: ../../using/windows.rst:879 +#: ../../using/windows.rst:880 msgid "" "Any commands not found in the .INI file are treated as **Windows** " "executable paths that are absolute or relative to the directory containing " @@ -1432,29 +1433,29 @@ msgid "" "will be appended." msgstr "" -#: ../../using/windows.rst:888 +#: ../../using/windows.rst:889 msgid "Arguments in shebang lines" msgstr "" -#: ../../using/windows.rst:890 +#: ../../using/windows.rst:891 msgid "" "The shebang lines can also specify additional options to be passed to the " "Python interpreter. For example, if you have a shebang line:" msgstr "" -#: ../../using/windows.rst:897 +#: ../../using/windows.rst:898 msgid "Then Python will be started with the ``-v`` option" msgstr "" -#: ../../using/windows.rst:900 +#: ../../using/windows.rst:901 msgid "Customization" msgstr "" -#: ../../using/windows.rst:905 +#: ../../using/windows.rst:906 msgid "Customization via INI files" msgstr "" -#: ../../using/windows.rst:907 +#: ../../using/windows.rst:908 msgid "" "Two .ini files will be searched by the launcher - ``py.ini`` in the current " "user's application data directory (``%LOCALAPPDATA%`` or ``$env:" @@ -1463,7 +1464,7 @@ msgid "" "e. py.exe) and for the 'windows' version (i.e. pyw.exe)." msgstr "" -#: ../../using/windows.rst:913 +#: ../../using/windows.rst:914 msgid "" "Customization specified in the \"application directory\" will have " "precedence over the one next to the executable, so a user, who may not have " @@ -1471,11 +1472,11 @@ msgid "" "that global .ini file." msgstr "" -#: ../../using/windows.rst:918 +#: ../../using/windows.rst:919 msgid "Customizing default Python versions" msgstr "" -#: ../../using/windows.rst:920 +#: ../../using/windows.rst:921 msgid "" "In some cases, a version qualifier can be included in a command to dictate " "which version of Python will be used by the command. A version qualifier " @@ -1485,13 +1486,13 @@ msgid "" "\"-32\" or \"-64\"." msgstr "" -#: ../../using/windows.rst:926 +#: ../../using/windows.rst:927 msgid "" "For example, a shebang line of ``#!python`` has no version qualifier, while " "``#!python3`` has a version qualifier which specifies only a major version." msgstr "" -#: ../../using/windows.rst:929 +#: ../../using/windows.rst:930 msgid "" "If no version qualifiers are found in a command, the environment variable :" "envvar:`PY_PYTHON` can be set to specify the default version qualifier. If " @@ -1501,7 +1502,7 @@ msgid "" "launcher included with Python 3.7 or newer.)" msgstr "" -#: ../../using/windows.rst:936 +#: ../../using/windows.rst:937 msgid "" "If no minor version qualifiers are found, the environment variable " "``PY_PYTHON{major}`` (where ``{major}`` is the current major version " @@ -1512,7 +1513,7 @@ msgid "" "version in that family." msgstr "" -#: ../../using/windows.rst:944 +#: ../../using/windows.rst:945 msgid "" "On 64-bit Windows with both 32-bit and 64-bit implementations of the same " "(major.minor) Python version installed, the 64-bit version will always be " @@ -1526,30 +1527,30 @@ msgid "" "suffix can be used on a version specifier to change this behaviour." msgstr "" -#: ../../using/windows.rst:955 +#: ../../using/windows.rst:956 msgid "Examples:" msgstr "範例:" -#: ../../using/windows.rst:957 +#: ../../using/windows.rst:958 msgid "" "If no relevant options are set, the commands ``python`` and ``python2`` will " "use the latest Python 2.x version installed and the command ``python3`` will " "use the latest Python 3.x installed." msgstr "" -#: ../../using/windows.rst:961 +#: ../../using/windows.rst:962 msgid "" "The command ``python3.7`` will not consult any options at all as the " "versions are fully specified." msgstr "" -#: ../../using/windows.rst:964 +#: ../../using/windows.rst:965 msgid "" "If ``PY_PYTHON=3``, the commands ``python`` and ``python3`` will both use " "the latest installed Python 3 version." msgstr "" -#: ../../using/windows.rst:967 +#: ../../using/windows.rst:968 msgid "" "If ``PY_PYTHON=3.7-32``, the command ``python`` will use the 32-bit " "implementation of 3.7 whereas the command ``python3`` will use the latest " @@ -1557,13 +1558,13 @@ msgid "" "specified.)" msgstr "" -#: ../../using/windows.rst:972 +#: ../../using/windows.rst:973 msgid "" "If ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7``, the commands ``python`` and " "``python3`` will both use specifically 3.7" msgstr "" -#: ../../using/windows.rst:975 +#: ../../using/windows.rst:976 msgid "" "In addition to environment variables, the same settings can be configured in " "the .INI file used by the launcher. The section in the INI file is called " @@ -1573,25 +1574,25 @@ msgid "" "will override things specified in the INI file." msgstr "" -#: ../../using/windows.rst:982 +#: ../../using/windows.rst:983 msgid "For example:" msgstr "" -#: ../../using/windows.rst:984 +#: ../../using/windows.rst:985 msgid "Setting ``PY_PYTHON=3.7`` is equivalent to the INI file containing:" msgstr "" -#: ../../using/windows.rst:991 +#: ../../using/windows.rst:992 msgid "" "Setting ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7`` is equivalent to the INI file " "containing:" msgstr "" -#: ../../using/windows.rst:1001 +#: ../../using/windows.rst:1002 msgid "Diagnostics" msgstr "" -#: ../../using/windows.rst:1003 +#: ../../using/windows.rst:1004 msgid "" "If an environment variable :envvar:`PYLAUNCHER_DEBUG` is set (to any value), " "the launcher will print diagnostic information to stderr (i.e. to the " @@ -1601,11 +1602,11 @@ msgid "" "the target Python. It is primarily intended for testing and debugging." msgstr "" -#: ../../using/windows.rst:1011 +#: ../../using/windows.rst:1012 msgid "Dry Run" msgstr "" -#: ../../using/windows.rst:1013 +#: ../../using/windows.rst:1014 msgid "" "If an environment variable :envvar:`PYLAUNCHER_DRYRUN` is set (to any " "value), the launcher will output the command it would have run, but will not " @@ -1615,11 +1616,11 @@ msgid "" "correctly in the console." msgstr "" -#: ../../using/windows.rst:1021 +#: ../../using/windows.rst:1022 msgid "Install on demand" msgstr "安裝隨選" -#: ../../using/windows.rst:1023 +#: ../../using/windows.rst:1024 msgid "" "If an environment variable :envvar:`PYLAUNCHER_ALLOW_INSTALL` is set (to any " "value), and the requested Python version is not installed but is available " @@ -1628,7 +1629,7 @@ msgid "" "again." msgstr "" -#: ../../using/windows.rst:1028 +#: ../../using/windows.rst:1029 msgid "" "An additional :envvar:`PYLAUNCHER_ALWAYS_INSTALL` variable causes the " "launcher to always try to install Python, even if it is detected. This is " @@ -1636,137 +1637,137 @@ msgid "" "`PYLAUNCHER_DRYRUN`)." msgstr "" -#: ../../using/windows.rst:1033 +#: ../../using/windows.rst:1034 msgid "Return codes" msgstr "" -#: ../../using/windows.rst:1035 +#: ../../using/windows.rst:1036 msgid "" "The following exit codes may be returned by the Python launcher. " "Unfortunately, there is no way to distinguish these from the exit code of " "Python itself." msgstr "" -#: ../../using/windows.rst:1038 +#: ../../using/windows.rst:1039 msgid "" "The names of codes are as used in the sources, and are only for reference. " "There is no way to access or resolve them apart from reading this page. " "Entries are listed in alphabetical order of names." msgstr "" -#: ../../using/windows.rst:1043 +#: ../../using/windows.rst:1044 msgid "Value" msgstr "" -#: ../../using/windows.rst:1045 +#: ../../using/windows.rst:1046 msgid "RC_BAD_VENV_CFG" msgstr "RC_BAD_VENV_CFG" -#: ../../using/windows.rst:1045 +#: ../../using/windows.rst:1046 msgid "107" msgstr "107" -#: ../../using/windows.rst:1045 +#: ../../using/windows.rst:1046 msgid "A :file:`pyvenv.cfg` was found but is corrupt." msgstr "" -#: ../../using/windows.rst:1047 +#: ../../using/windows.rst:1048 msgid "RC_CREATE_PROCESS" msgstr "RC_CREATE_PROCESS" -#: ../../using/windows.rst:1047 +#: ../../using/windows.rst:1048 msgid "101" msgstr "101" -#: ../../using/windows.rst:1047 +#: ../../using/windows.rst:1048 msgid "Failed to launch Python." msgstr "" -#: ../../using/windows.rst:1049 +#: ../../using/windows.rst:1050 msgid "RC_INSTALLING" msgstr "RC_INSTALLING" -#: ../../using/windows.rst:1049 +#: ../../using/windows.rst:1050 msgid "111" msgstr "111" -#: ../../using/windows.rst:1049 +#: ../../using/windows.rst:1050 msgid "" "An install was started, but the command will need to be re-run after it " "completes." msgstr "" -#: ../../using/windows.rst:1052 +#: ../../using/windows.rst:1053 msgid "RC_INTERNAL_ERROR" msgstr "RC_INTERNAL_ERROR" -#: ../../using/windows.rst:1052 +#: ../../using/windows.rst:1053 msgid "109" msgstr "109" -#: ../../using/windows.rst:1052 +#: ../../using/windows.rst:1053 msgid "Unexpected error. Please report a bug." msgstr "" -#: ../../using/windows.rst:1054 +#: ../../using/windows.rst:1055 msgid "RC_NO_COMMANDLINE" msgstr "RC_NO_COMMANDLINE" -#: ../../using/windows.rst:1054 +#: ../../using/windows.rst:1055 msgid "108" msgstr "108" -#: ../../using/windows.rst:1054 +#: ../../using/windows.rst:1055 msgid "Unable to obtain command line from the operating system." msgstr "" -#: ../../using/windows.rst:1057 +#: ../../using/windows.rst:1058 msgid "RC_NO_PYTHON" msgstr "RC_NO_PYTHON" -#: ../../using/windows.rst:1057 +#: ../../using/windows.rst:1058 msgid "103" msgstr "103" -#: ../../using/windows.rst:1057 +#: ../../using/windows.rst:1058 msgid "Unable to locate the requested version." msgstr "" -#: ../../using/windows.rst:1059 +#: ../../using/windows.rst:1060 msgid "RC_NO_VENV_CFG" msgstr "RC_NO_VENV_CFG" -#: ../../using/windows.rst:1059 +#: ../../using/windows.rst:1060 msgid "106" msgstr "106" -#: ../../using/windows.rst:1059 +#: ../../using/windows.rst:1060 msgid "A :file:`pyvenv.cfg` was required but not found." msgstr "" -#: ../../using/windows.rst:1067 +#: ../../using/windows.rst:1068 msgid "Finding modules" msgstr "" -#: ../../using/windows.rst:1069 +#: ../../using/windows.rst:1070 msgid "" "These notes supplement the description at :ref:`sys-path-init` with detailed " "Windows notes." msgstr "" -#: ../../using/windows.rst:1072 +#: ../../using/windows.rst:1073 msgid "" "When no ``._pth`` file is found, this is how :data:`sys.path` is populated " "on Windows:" msgstr "" -#: ../../using/windows.rst:1075 +#: ../../using/windows.rst:1076 msgid "" "An empty entry is added at the start, which corresponds to the current " "directory." msgstr "" -#: ../../using/windows.rst:1078 +#: ../../using/windows.rst:1079 msgid "" "If the environment variable :envvar:`PYTHONPATH` exists, as described in :" "ref:`using-on-envvars`, its entries are added next. Note that on Windows, " @@ -1774,7 +1775,7 @@ msgid "" "from the colon used in drive identifiers (``C:\\`` etc.)." msgstr "" -#: ../../using/windows.rst:1083 +#: ../../using/windows.rst:1084 msgid "" "Additional \"application paths\" can be added in the registry as subkeys of :" "samp:`\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\{version}\\\\PythonPath` under " @@ -1784,7 +1785,7 @@ msgid "" "installers only use HKLM, so HKCU is typically empty.)" msgstr "" -#: ../../using/windows.rst:1090 +#: ../../using/windows.rst:1091 msgid "" "If the environment variable :envvar:`PYTHONHOME` is set, it is assumed as " "\"Python Home\". Otherwise, the path of the main Python executable is used " @@ -1795,31 +1796,31 @@ msgid "" "PythonPath stored in the registry." msgstr "" -#: ../../using/windows.rst:1098 +#: ../../using/windows.rst:1099 msgid "" "If the Python Home cannot be located, no :envvar:`PYTHONPATH` is specified " "in the environment, and no registry entries can be found, a default path " "with relative entries is used (e.g. ``.\\Lib;.\\plat-win``, etc)." msgstr "" -#: ../../using/windows.rst:1102 +#: ../../using/windows.rst:1103 msgid "" "If a ``pyvenv.cfg`` file is found alongside the main executable or in the " "directory one level above the executable, the following variations apply:" msgstr "" -#: ../../using/windows.rst:1105 +#: ../../using/windows.rst:1106 msgid "" "If ``home`` is an absolute path and :envvar:`PYTHONHOME` is not set, this " "path is used instead of the path to the main executable when deducing the " "home location." msgstr "" -#: ../../using/windows.rst:1109 +#: ../../using/windows.rst:1110 msgid "The end result of all this is:" msgstr "最終這所有的結果為:" -#: ../../using/windows.rst:1111 +#: ../../using/windows.rst:1112 msgid "" "When running :file:`python.exe`, or any other .exe in the main Python " "directory (either an installed version, or directly from the PCbuild " @@ -1827,7 +1828,7 @@ msgid "" "ignored. Other \"application paths\" in the registry are always read." msgstr "" -#: ../../using/windows.rst:1116 +#: ../../using/windows.rst:1117 msgid "" "When Python is hosted in another .exe (different directory, embedded via " "COM, etc), the \"Python Home\" will not be deduced, so the core path from " @@ -1835,20 +1836,20 @@ msgid "" "always read." msgstr "" -#: ../../using/windows.rst:1120 +#: ../../using/windows.rst:1121 msgid "" "If Python can't find its home and there are no registry value (frozen .exe, " "some very strange installation setup) you get a path with some default, but " "relative, paths." msgstr "" -#: ../../using/windows.rst:1124 +#: ../../using/windows.rst:1125 msgid "" "For those who want to bundle Python into their application or distribution, " "the following advice will prevent conflicts with other installations:" msgstr "" -#: ../../using/windows.rst:1127 +#: ../../using/windows.rst:1128 msgid "" "Include a ``._pth`` file alongside your executable containing the " "directories to include. This will ignore paths listed in the registry and " @@ -1856,20 +1857,20 @@ msgid "" "listed." msgstr "" -#: ../../using/windows.rst:1132 +#: ../../using/windows.rst:1133 msgid "" "If you are loading :file:`python3.dll` or :file:`python37.dll` in your own " "executable, explicitly call :c:func:`Py_SetPath` or (at least) :c:func:" "`Py_SetProgramName` before :c:func:`Py_Initialize`." msgstr "" -#: ../../using/windows.rst:1136 +#: ../../using/windows.rst:1137 msgid "" "Clear and/or overwrite :envvar:`PYTHONPATH` and set :envvar:`PYTHONHOME` " "before launching :file:`python.exe` from your application." msgstr "" -#: ../../using/windows.rst:1139 +#: ../../using/windows.rst:1140 msgid "" "If you cannot use the previous suggestions (for example, you are a " "distribution that allows people to run :file:`python.exe` directly), ensure " @@ -1878,7 +1879,7 @@ msgid "" "correctly named ZIP file will be detected instead.)" msgstr "" -#: ../../using/windows.rst:1145 +#: ../../using/windows.rst:1146 msgid "" "These will ensure that the files in a system-wide installation will not take " "precedence over the copy of the standard library bundled with your " @@ -1888,19 +1889,19 @@ msgid "" "packages." msgstr "" -#: ../../using/windows.rst:1154 +#: ../../using/windows.rst:1155 msgid "" "Adds ``._pth`` file support and removes ``applocal`` option from ``pyvenv." "cfg``." msgstr "" -#: ../../using/windows.rst:1156 +#: ../../using/windows.rst:1157 msgid "" "Adds ``pythonXX.zip`` as a potential landmark when directly adjacent to the " "executable." msgstr "" -#: ../../using/windows.rst:1162 +#: ../../using/windows.rst:1163 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " @@ -1908,88 +1909,88 @@ msgid "" "explicitly added to :attr:`sys.meta_path` in the future." msgstr "" -#: ../../using/windows.rst:1168 +#: ../../using/windows.rst:1169 msgid "Additional modules" msgstr "" -#: ../../using/windows.rst:1170 +#: ../../using/windows.rst:1171 msgid "" "Even though Python aims to be portable among all platforms, there are " "features that are unique to Windows. A couple of modules, both in the " "standard library and external, and snippets exist to use these features." msgstr "" -#: ../../using/windows.rst:1174 +#: ../../using/windows.rst:1175 msgid "" "The Windows-specific standard modules are documented in :ref:`mswin-specific-" "services`." msgstr "" -#: ../../using/windows.rst:1178 +#: ../../using/windows.rst:1179 msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1180 +#: ../../using/windows.rst:1181 msgid "" "The `PyWin32 `_ module by Mark Hammond is " "a collection of modules for advanced Windows-specific support. This " "includes utilities for:" msgstr "" -#: ../../using/windows.rst:1184 +#: ../../using/windows.rst:1185 msgid "" "`Component Object Model `_ (COM)" msgstr "" -#: ../../using/windows.rst:1187 +#: ../../using/windows.rst:1188 msgid "Win32 API calls" msgstr "Win32 API 呼叫" -#: ../../using/windows.rst:1188 +#: ../../using/windows.rst:1189 msgid "Registry" msgstr "登錄檔(Registry)" -#: ../../using/windows.rst:1189 +#: ../../using/windows.rst:1190 msgid "Event log" msgstr "事件日誌(Event log)" -#: ../../using/windows.rst:1190 +#: ../../using/windows.rst:1191 msgid "" "`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" -#: ../../using/windows.rst:1194 +#: ../../using/windows.rst:1195 msgid "" "`PythonWin `_ is a sample MFC application shipped with PyWin32. " "It is an embeddable IDE with a built-in debugger." msgstr "" -#: ../../using/windows.rst:1201 +#: ../../using/windows.rst:1202 msgid "" "`Win32 How Do I...? `_" msgstr "" "`Win32 How Do I...? `_" -#: ../../using/windows.rst:1201 +#: ../../using/windows.rst:1202 msgid "by Tim Golden" msgstr "由 Tim Golden 所著" -#: ../../using/windows.rst:1203 +#: ../../using/windows.rst:1204 msgid "`Python and COM `_" msgstr "`Python and COM `_" -#: ../../using/windows.rst:1204 +#: ../../using/windows.rst:1205 msgid "by David and Paul Boddie" msgstr "由 David 與 Paul Boddie 所著" -#: ../../using/windows.rst:1208 +#: ../../using/windows.rst:1209 msgid "cx_Freeze" msgstr "cx_Freeze" -#: ../../using/windows.rst:1210 +#: ../../using/windows.rst:1211 msgid "" "`cx_Freeze `_ is a :mod:" "`distutils` extension (see :ref:`extending-distutils`) which wraps Python " @@ -1998,11 +1999,11 @@ msgid "" "users to install Python." msgstr "" -#: ../../using/windows.rst:1218 +#: ../../using/windows.rst:1219 msgid "Compiling Python on Windows" msgstr "編譯 Python 在 Windows" -#: ../../using/windows.rst:1220 +#: ../../using/windows.rst:1221 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -2010,48 +2011,48 @@ msgid "" "devguide.python.org/setup/#get-the-source-code>`_." msgstr "" -#: ../../using/windows.rst:1225 +#: ../../using/windows.rst:1226 msgid "" "The source tree contains a build solution and project files for Microsoft " "Visual Studio, which is the compiler used to build the official Python " "releases. These files are in the :file:`PCbuild` directory." msgstr "" -#: ../../using/windows.rst:1229 +#: ../../using/windows.rst:1230 msgid "" "Check :file:`PCbuild/readme.txt` for general information on the build " "process." msgstr "" -#: ../../using/windows.rst:1231 +#: ../../using/windows.rst:1232 msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" -#: ../../using/windows.rst:1235 +#: ../../using/windows.rst:1236 msgid "Other Platforms" msgstr "其他平台" -#: ../../using/windows.rst:1237 +#: ../../using/windows.rst:1238 msgid "" "With ongoing development of Python, some platforms that used to be supported " "earlier are no longer supported (due to the lack of users or developers). " "Check :pep:`11` for details on all unsupported platforms." msgstr "" -#: ../../using/windows.rst:1241 +#: ../../using/windows.rst:1242 msgid "" "`Windows CE `_ is `no longer supported " "`__ since Python 3 (if it " "ever was)." msgstr "" -#: ../../using/windows.rst:1244 +#: ../../using/windows.rst:1245 msgid "" "The `Cygwin `_ installer offers to install the `Python " "interpreter `__ as well" msgstr "" -#: ../../using/windows.rst:1248 +#: ../../using/windows.rst:1249 msgid "" "See `Python for Windows `_ for " "detailed information about platforms with pre-compiled installers." From 1bfbdbc448b6a1cf13e3b83122e50eb6dc265b48 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 18 Jan 2023 00:19:17 +0000 Subject: [PATCH 005/130] sync with cpython 3ef9f6b5 --- library/enum.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/enum.po b/library/enum.po index 96814a8d46..d42a76969b 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-13 00:17+0000\n" +"POT-Creation-Date: 2023-01-18 00: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-" @@ -693,7 +693,7 @@ msgstr "" #: ../../library/enum.rst:616 msgid "" -":class:`!ReprEum` uses the :meth:`repr() ` of :class:`Enum`, " +":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" msgstr "" From a2f8f78ec8703a6731bd3bf52d17dbc01e0e9d51 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 19 Jan 2023 00:18:55 +0000 Subject: [PATCH 006/130] sync with cpython db65a326 --- library/sqlite3.po | 100 ++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/library/sqlite3.po b/library/sqlite3.po index 965d306ef0..33d08f519e 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-15 00:18+0000\n" +"POT-Creation-Date: 2023-01-19 00:17+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-" @@ -1773,24 +1773,24 @@ msgid "" "are ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1866 +#: ../../library/sqlite3.rst:1865 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:1873 +#: ../../library/sqlite3.rst:1872 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1875 +#: ../../library/sqlite3.rst:1874 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1879 +#: ../../library/sqlite3.rst:1878 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1800,11 +1800,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1891 +#: ../../library/sqlite3.rst:1890 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1893 +#: ../../library/sqlite3.rst:1892 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1814,84 +1814,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1924 +#: ../../library/sqlite3.rst:1923 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1926 +#: ../../library/sqlite3.rst:1925 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1956 +#: ../../library/sqlite3.rst:1955 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1958 +#: ../../library/sqlite3.rst:1957 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1962 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1966 +#: ../../library/sqlite3.rst:1965 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1971 +#: ../../library/sqlite3.rst:1970 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1980 +#: ../../library/sqlite3.rst:1979 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1984 +#: ../../library/sqlite3.rst:1983 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1985 +#: ../../library/sqlite3.rst:1984 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1986 +#: ../../library/sqlite3.rst:1985 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1990 +#: ../../library/sqlite3.rst:1989 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2041 +#: ../../library/sqlite3.rst:2040 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2043 +#: ../../library/sqlite3.rst:2042 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2105 +#: ../../library/sqlite3.rst:2104 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2107 +#: ../../library/sqlite3.rst:2106 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1903,11 +1903,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2148 +#: ../../library/sqlite3.rst:2147 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2150 +#: ../../library/sqlite3.rst:2149 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1917,58 +1917,58 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2159 +#: ../../library/sqlite3.rst:2158 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2164 +#: ../../library/sqlite3.rst:2163 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2197 +#: ../../library/sqlite3.rst:2196 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2199 +#: ../../library/sqlite3.rst:2198 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2201 +#: ../../library/sqlite3.rst:2200 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2210 +#: ../../library/sqlite3.rst:2209 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2220 +#: ../../library/sqlite3.rst:2219 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2234 +#: ../../library/sqlite3.rst:2233 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2243 +#: ../../library/sqlite3.rst:2242 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2245 +#: ../../library/sqlite3.rst:2244 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`." msgstr "" -#: ../../library/sqlite3.rst:2250 +#: ../../library/sqlite3.rst:2249 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -1976,7 +1976,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2255 +#: ../../library/sqlite3.rst:2254 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -1984,51 +1984,51 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2265 +#: ../../library/sqlite3.rst:2264 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2280 +#: ../../library/sqlite3.rst:2279 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2289 +#: ../../library/sqlite3.rst:2288 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2299 +#: ../../library/sqlite3.rst:2298 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2310 +#: ../../library/sqlite3.rst:2309 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2325 +#: ../../library/sqlite3.rst:2324 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`." msgstr "" -#: ../../library/sqlite3.rst:2333 +#: ../../library/sqlite3.rst:2332 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2338 +#: ../../library/sqlite3.rst:2337 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2340 +#: ../../library/sqlite3.rst:2339 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2343 +#: ../../library/sqlite3.rst:2342 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2042,7 +2042,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2356 +#: ../../library/sqlite3.rst:2355 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2052,14 +2052,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2364 +#: ../../library/sqlite3.rst:2363 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2368 +#: ../../library/sqlite3.rst:2367 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." From 8ed7acd23442dddf37dc578043ccb32870033685 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Thu, 19 Jan 2023 16:53:35 +0800 Subject: [PATCH 007/130] fix(using/windows): resolve fuzzy entry --- using/windows.po | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/using/windows.po b/using/windows.po index beb3333808..e46e2c99fe 100644 --- a/using/windows.po +++ b/using/windows.po @@ -1345,9 +1345,8 @@ msgid "" msgstr "" #: ../../using/windows.rst:821 -#, fuzzy msgid "``/usr/bin/env``" -msgstr "``/usr/bin/env python``" +msgstr "``/usr/bin/env``" #: ../../using/windows.rst:822 msgid "``/usr/bin/python``" From 3a4779454718a22f0d2f10bea74d8e1614c30ced Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 21 Jan 2023 00:18:45 +0000 Subject: [PATCH 008/130] sync with cpython db0eeb38 --- howto/logging-cookbook.po | 300 +++++++++++++++++++------------------- library/datetime.po | 6 +- library/enum.po | 46 +++--- library/optparse.po | 70 ++++----- library/pathlib.po | 11 +- library/ssl.po | 34 ++--- library/zipfile.po | 206 +++++++++++++------------- 7 files changed, 341 insertions(+), 332 deletions(-) diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 55f800175c..9f10861ecc 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-02 00:20+0000\n" +"POT-Creation-Date: 2023-01-21 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-" @@ -1063,27 +1063,27 @@ msgid "" "kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1903 ../../howto/logging-cookbook.rst:3923 +#: ../../howto/logging-cookbook.rst:1903 ../../howto/logging-cookbook.rst:3944 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:1903 ../../howto/logging-cookbook.rst:3923 +#: ../../howto/logging-cookbook.rst:1903 ../../howto/logging-cookbook.rst:3944 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1906 ../../howto/logging-cookbook.rst:3926 +#: ../../howto/logging-cookbook.rst:1906 ../../howto/logging-cookbook.rst:3947 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:1906 ../../howto/logging-cookbook.rst:3926 +#: ../../howto/logging-cookbook.rst:1906 ../../howto/logging-cookbook.rst:3947 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1909 ../../howto/logging-cookbook.rst:3929 +#: ../../howto/logging-cookbook.rst:1909 ../../howto/logging-cookbook.rst:3950 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:1909 ../../howto/logging-cookbook.rst:3929 +#: ../../howto/logging-cookbook.rst:1909 ../../howto/logging-cookbook.rst:3950 msgid "Useful handlers included with the logging module." msgstr "" @@ -1121,21 +1121,19 @@ msgstr "" #: ../../howto/logging-cookbook.rst:1984 msgid "" "An example of how you can define a namer and rotator is given in the " -"following snippet, which shows zlib-based compression of the log file::" +"following runnable script, which shows gzip compression of the log file::" msgstr "" -#: ../../howto/logging-cookbook.rst:2002 +#: ../../howto/logging-cookbook.rst:2015 msgid "" -"These are not \"true\" .gz files, as they are bare compressed data, with no " -"\"container\" such as you’d find in an actual gzip file. This snippet is " -"just for illustration purposes." +"After running this, you will see six new files, five of which are compressed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2007 +#: ../../howto/logging-cookbook.rst:2028 msgid "A more elaborate multiprocessing example" msgstr "" -#: ../../howto/logging-cookbook.rst:2009 +#: ../../howto/logging-cookbook.rst:2030 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -1143,7 +1141,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2014 +#: ../../howto/logging-cookbook.rst:2035 msgid "" "In the example, the main process spawns a listener process and some worker " "processes. Each of the main process, the listener and the workers have three " @@ -1156,17 +1154,17 @@ msgid "" "own scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2024 +#: ../../howto/logging-cookbook.rst:2045 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: ../../howto/logging-cookbook.rst:2236 +#: ../../howto/logging-cookbook.rst:2257 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: ../../howto/logging-cookbook.rst:2238 +#: ../../howto/logging-cookbook.rst:2259 msgid "" ":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a " "set of bytes which have the following structure: an optional pure-ASCII " @@ -1175,7 +1173,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: ../../howto/logging-cookbook.rst:2244 +#: ../../howto/logging-cookbook.rst:2265 msgid "" "In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to " "insert a BOM into the message, but unfortunately, it was implemented " @@ -1183,7 +1181,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: ../../howto/logging-cookbook.rst:2250 +#: ../../howto/logging-cookbook.rst:2271 msgid "" "As this behaviour is broken, the incorrect BOM insertion code is being " "removed from Python 3.2.4 and later. However, it is not being replaced, and " @@ -1192,33 +1190,33 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: ../../howto/logging-cookbook.rst:2256 +#: ../../howto/logging-cookbook.rst:2277 msgid "" "Attach a :class:`~logging.Formatter` instance to your :class:`~logging." "handlers.SysLogHandler` instance, with a format string such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2262 +#: ../../howto/logging-cookbook.rst:2283 msgid "" "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as " "a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." msgstr "" -#: ../../howto/logging-cookbook.rst:2265 +#: ../../howto/logging-cookbook.rst:2286 msgid "" "Replace the ASCII section with whatever placeholders you like, but make sure " "that the data that appears in there after substitution is always ASCII (that " "way, it will remain unchanged after UTF-8 encoding)." msgstr "" -#: ../../howto/logging-cookbook.rst:2269 +#: ../../howto/logging-cookbook.rst:2290 msgid "" "Replace the Unicode section with whatever placeholders you like; if the data " "which appears there after substitution contains characters outside the ASCII " "range, that's fine -- it will be encoded using UTF-8." msgstr "" -#: ../../howto/logging-cookbook.rst:2273 +#: ../../howto/logging-cookbook.rst:2294 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -1227,11 +1225,11 @@ msgid "" "daemon may complain." msgstr "" -#: ../../howto/logging-cookbook.rst:2280 +#: ../../howto/logging-cookbook.rst:2301 msgid "Implementing structured logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2282 +#: ../../howto/logging-cookbook.rst:2303 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -1243,31 +1241,31 @@ msgid "" "machine-parseable manner::" msgstr "" -#: ../../howto/logging-cookbook.rst:2306 +#: ../../howto/logging-cookbook.rst:2327 msgid "If the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2312 ../../howto/logging-cookbook.rst:2354 +#: ../../howto/logging-cookbook.rst:2333 ../../howto/logging-cookbook.rst:2375 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: ../../howto/logging-cookbook.rst:2315 +#: ../../howto/logging-cookbook.rst:2336 msgid "" "If you need more specialised processing, you can use a custom JSON encoder, " "as in the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2348 +#: ../../howto/logging-cookbook.rst:2369 msgid "When the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2363 +#: ../../howto/logging-cookbook.rst:2384 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2365 +#: ../../howto/logging-cookbook.rst:2386 msgid "" "There are times when you want to customize logging handlers in particular " "ways, and if you use :func:`dictConfig` you may be able to do this without " @@ -1277,24 +1275,24 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2379 +#: ../../howto/logging-cookbook.rst:2400 msgid "" "You can then specify, in a logging configuration passed to :func:" "`dictConfig`, that a logging handler be created by calling this function::" msgstr "" -#: ../../howto/logging-cookbook.rst:2412 +#: ../../howto/logging-cookbook.rst:2433 msgid "" "In this example I am setting the ownership using the ``pulse`` user and " "group, just for the purposes of illustration. Putting it together into a " "working script, ``chowntest.py``::" msgstr "" -#: ../../howto/logging-cookbook.rst:2459 +#: ../../howto/logging-cookbook.rst:2480 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2469 +#: ../../howto/logging-cookbook.rst:2490 msgid "" "Note that this example uses Python 3.3 because that's where :func:`shutil." "chown` makes an appearance. This approach should work with any Python " @@ -1303,17 +1301,17 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: ../../howto/logging-cookbook.rst:2475 +#: ../../howto/logging-cookbook.rst:2496 msgid "" "In practice, the handler-creating function may be in a utility module " "somewhere in your project. Instead of the line in the configuration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2480 +#: ../../howto/logging-cookbook.rst:2501 msgid "you could use e.g.::" msgstr "" -#: ../../howto/logging-cookbook.rst:2484 +#: ../../howto/logging-cookbook.rst:2505 msgid "" "where ``project.util`` can be replaced with the actual name of the package " "where the function resides. In the above working script, using ``'ext://" @@ -1321,25 +1319,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: ../../howto/logging-cookbook.rst:2489 +#: ../../howto/logging-cookbook.rst:2510 msgid "" "This example hopefully also points the way to how you could implement other " "types of file change - e.g. setting specific POSIX permission bits - in the " "same way, using :func:`os.chmod`." msgstr "" -#: ../../howto/logging-cookbook.rst:2493 +#: ../../howto/logging-cookbook.rst:2514 msgid "" "Of course, the approach could also be extended to types of handler other " "than a :class:`~logging.FileHandler` - for example, one of the rotating file " "handlers, or a different type of handler altogether." msgstr "" -#: ../../howto/logging-cookbook.rst:2503 +#: ../../howto/logging-cookbook.rst:2524 msgid "Using particular formatting styles throughout your application" msgstr "" -#: ../../howto/logging-cookbook.rst:2505 +#: ../../howto/logging-cookbook.rst:2526 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -1350,7 +1348,7 @@ msgid "" "is constructed." msgstr "" -#: ../../howto/logging-cookbook.rst:2512 +#: ../../howto/logging-cookbook.rst:2533 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -1365,7 +1363,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: ../../howto/logging-cookbook.rst:2524 +#: ../../howto/logging-cookbook.rst:2545 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -1373,7 +1371,7 @@ msgid "" "formatting." msgstr "" -#: ../../howto/logging-cookbook.rst:2528 +#: ../../howto/logging-cookbook.rst:2549 msgid "" "For logging to work interoperably between any third-party libraries and your " "code, decisions about formatting need to be made at the level of the " @@ -1381,11 +1379,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: ../../howto/logging-cookbook.rst:2535 +#: ../../howto/logging-cookbook.rst:2556 msgid "Using LogRecord factories" msgstr "" -#: ../../howto/logging-cookbook.rst:2537 +#: ../../howto/logging-cookbook.rst:2558 msgid "" "In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned " "above, the logging package gained the ability to allow users to set their " @@ -1400,17 +1398,17 @@ msgid "" "implementation does." msgstr "" -#: ../../howto/logging-cookbook.rst:2548 +#: ../../howto/logging-cookbook.rst:2569 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: ../../howto/logging-cookbook.rst:2553 +#: ../../howto/logging-cookbook.rst:2574 msgid "Using custom message objects" msgstr "" -#: ../../howto/logging-cookbook.rst:2555 +#: ../../howto/logging-cookbook.rst:2576 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -1420,7 +1418,7 @@ msgid "" "following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:2580 +#: ../../howto/logging-cookbook.rst:2601 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -1431,17 +1429,17 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: ../../howto/logging-cookbook.rst:2588 +#: ../../howto/logging-cookbook.rst:2609 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2602 +#: ../../howto/logging-cookbook.rst:2623 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2609 +#: ../../howto/logging-cookbook.rst:2630 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -1453,11 +1451,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2623 +#: ../../howto/logging-cookbook.rst:2644 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2625 +#: ../../howto/logging-cookbook.rst:2646 msgid "" "You *can* configure filters using :func:`~logging.config.dictConfig`, though " "it might not be obvious at first glance how to do it (hence this recipe). " @@ -1472,22 +1470,22 @@ msgid "" "complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2678 +#: ../../howto/logging-cookbook.rst:2699 msgid "" "This example shows how you can pass configuration data to the callable which " "constructs the instance, in the form of keyword parameters. When run, the " "above script will print:" msgstr "" -#: ../../howto/logging-cookbook.rst:2686 +#: ../../howto/logging-cookbook.rst:2707 msgid "which shows that the filter is working as configured." msgstr "" -#: ../../howto/logging-cookbook.rst:2688 +#: ../../howto/logging-cookbook.rst:2709 msgid "A couple of extra points to note:" msgstr "" -#: ../../howto/logging-cookbook.rst:2690 +#: ../../howto/logging-cookbook.rst:2711 msgid "" "If you can't refer to the callable directly in the configuration (e.g. if it " "lives in a different module, and you can't import it directly where the " @@ -1497,7 +1495,7 @@ msgid "" "the above example." msgstr "" -#: ../../howto/logging-cookbook.rst:2697 +#: ../../howto/logging-cookbook.rst:2718 msgid "" "As well as for filters, this technique can also be used to configure custom " "handlers and formatters. See :ref:`logging-config-dict-userdef` for more " @@ -1506,11 +1504,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2706 +#: ../../howto/logging-cookbook.rst:2727 msgid "Customized exception formatting" msgstr "" -#: ../../howto/logging-cookbook.rst:2708 +#: ../../howto/logging-cookbook.rst:2729 msgid "" "There might be times when you want to do customized exception formatting - " "for argument's sake, let's say you want exactly one line per logged event, " @@ -1518,22 +1516,22 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2749 +#: ../../howto/logging-cookbook.rst:2770 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: ../../howto/logging-cookbook.rst:2756 +#: ../../howto/logging-cookbook.rst:2777 msgid "" "While the above treatment is simplistic, it points the way to how exception " "information can be formatted to your liking. The :mod:`traceback` module may " "be helpful for more specialized needs." msgstr "" -#: ../../howto/logging-cookbook.rst:2763 +#: ../../howto/logging-cookbook.rst:2784 msgid "Speaking logging messages" msgstr "" -#: ../../howto/logging-cookbook.rst:2765 +#: ../../howto/logging-cookbook.rst:2786 msgid "" "There might be situations when it is desirable to have logging messages " "rendered in an audible rather than a visible format. This is easy to do if " @@ -1550,24 +1548,24 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: ../../howto/logging-cookbook.rst:2807 +#: ../../howto/logging-cookbook.rst:2828 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: ../../howto/logging-cookbook.rst:2809 +#: ../../howto/logging-cookbook.rst:2830 msgid "" "The above approach can, of course, be adapted to other TTS systems and even " "other systems altogether which can process messages via external programs " "run from a command line." msgstr "" -#: ../../howto/logging-cookbook.rst:2817 +#: ../../howto/logging-cookbook.rst:2838 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: ../../howto/logging-cookbook.rst:2819 +#: ../../howto/logging-cookbook.rst:2840 msgid "" "There might be situations where you want to log messages in a temporary area " "and only output them if a certain condition occurs. For example, you may " @@ -1577,7 +1575,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: ../../howto/logging-cookbook.rst:2826 +#: ../../howto/logging-cookbook.rst:2847 msgid "" "Here is an example which shows how you could do this using a decorator for " "your functions where you want logging to behave this way. It makes use of " @@ -1590,7 +1588,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: ../../howto/logging-cookbook.rst:2836 +#: ../../howto/logging-cookbook.rst:2857 msgid "" "The example script has a simple function, ``foo``, which just cycles through " "all the logging levels, writing to ``sys.stderr`` to say what level it's " @@ -1599,7 +1597,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: ../../howto/logging-cookbook.rst:2842 +#: ../../howto/logging-cookbook.rst:2863 msgid "" "The script just arranges to decorate ``foo`` with a decorator which will do " "the conditional logging that's required. The decorator takes a logger as a " @@ -1611,30 +1609,30 @@ msgid "" "respectively." msgstr "" -#: ../../howto/logging-cookbook.rst:2850 +#: ../../howto/logging-cookbook.rst:2871 msgid "Here's the script::" msgstr "" -#: ../../howto/logging-cookbook.rst:2913 +#: ../../howto/logging-cookbook.rst:2934 msgid "When this script is run, the following output should be observed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2943 +#: ../../howto/logging-cookbook.rst:2964 msgid "" "As you can see, actual logging output only occurs when an event is logged " "whose severity is ERROR or greater, but in that case, any previous events at " "lower severities are also logged." msgstr "" -#: ../../howto/logging-cookbook.rst:2947 +#: ../../howto/logging-cookbook.rst:2968 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2957 +#: ../../howto/logging-cookbook.rst:2978 msgid "Sending logging messages to email, with buffering" msgstr "" -#: ../../howto/logging-cookbook.rst:2959 +#: ../../howto/logging-cookbook.rst:2980 msgid "" "To illustrate how you can send log messages via email, so that a set number " "of messages are sent per email, you can subclass :class:`~logging.handlers." @@ -1645,7 +1643,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: ../../howto/logging-cookbook.rst:3031 +#: ../../howto/logging-cookbook.rst:3052 msgid "" "If you run this script and your SMTP server is correctly set up, you should " "find that it sends eleven emails to the addressee you specify. The first ten " @@ -1653,17 +1651,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: ../../howto/logging-cookbook.rst:3039 +#: ../../howto/logging-cookbook.rst:3060 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3041 +#: ../../howto/logging-cookbook.rst:3062 msgid "" "Sometimes you want to format times using UTC, which can be done using a " "class such as ``UTCFormatter``, shown below::" msgstr "" -#: ../../howto/logging-cookbook.rst:3050 +#: ../../howto/logging-cookbook.rst:3071 msgid "" "and you can then use the ``UTCFormatter`` in your code instead of :class:" "`~logging.Formatter`. If you want to do that via configuration, you can use " @@ -1671,21 +1669,21 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:3093 +#: ../../howto/logging-cookbook.rst:3114 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:3100 +#: ../../howto/logging-cookbook.rst:3121 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:3107 +#: ../../howto/logging-cookbook.rst:3128 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3109 +#: ../../howto/logging-cookbook.rst:3130 msgid "" "There are times when it would be useful to temporarily change the logging " "configuration and revert it back after doing something. For this, a context " @@ -1695,7 +1693,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:3142 +#: ../../howto/logging-cookbook.rst:3163 msgid "" "If you specify a level value, the logger's level is set to that value in the " "scope of the with block covered by the context manager. If you specify a " @@ -1704,13 +1702,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:3148 +#: ../../howto/logging-cookbook.rst:3169 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:3166 +#: ../../howto/logging-cookbook.rst:3187 msgid "" "We initially set the logger's level to ``INFO``, so message #1 appears and " "message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the " @@ -1723,56 +1721,56 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:3176 +#: ../../howto/logging-cookbook.rst:3197 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:3187 +#: ../../howto/logging-cookbook.rst:3208 msgid "" "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " "following, which is the only message written to ``stdout``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3195 +#: ../../howto/logging-cookbook.rst:3216 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:3205 +#: ../../howto/logging-cookbook.rst:3226 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:3207 +#: ../../howto/logging-cookbook.rst:3228 msgid "" "Of course, the approach described here can be generalised, for example to " "attach logging filters temporarily. Note that the above code works in Python " "2 as well as Python 3." msgstr "" -#: ../../howto/logging-cookbook.rst:3215 +#: ../../howto/logging-cookbook.rst:3236 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:3217 +#: ../../howto/logging-cookbook.rst:3238 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:3219 +#: ../../howto/logging-cookbook.rst:3240 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:3220 +#: ../../howto/logging-cookbook.rst:3241 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:3222 +#: ../../howto/logging-cookbook.rst:3243 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3224 +#: ../../howto/logging-cookbook.rst:3245 msgid "" "Suppose we have a command-line application whose job is to stop, start or " "restart some services. This could be organised for the purposes of " @@ -1783,53 +1781,53 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:3273 +#: ../../howto/logging-cookbook.rst:3294 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3286 +#: ../../howto/logging-cookbook.rst:3307 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:3307 +#: ../../howto/logging-cookbook.rst:3328 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3328 +#: ../../howto/logging-cookbook.rst:3349 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3341 +#: ../../howto/logging-cookbook.rst:3362 msgid "" "The first word is the logging level, and the second word is the module or " "package name of the place where the event was logged." msgstr "" -#: ../../howto/logging-cookbook.rst:3344 +#: ../../howto/logging-cookbook.rst:3365 msgid "" "If we change the logging level, then we can change the information sent to " "the log. For example, if we want more information:" msgstr "" -#: ../../howto/logging-cookbook.rst:3361 +#: ../../howto/logging-cookbook.rst:3382 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3369 +#: ../../howto/logging-cookbook.rst:3390 msgid "" "In this case, the commands don't print anything to the console, since " "nothing at ``WARNING`` level or above is logged by them." msgstr "" -#: ../../howto/logging-cookbook.rst:3375 +#: ../../howto/logging-cookbook.rst:3396 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3377 +#: ../../howto/logging-cookbook.rst:3398 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" @@ -1837,7 +1835,7 @@ msgid "" "project/PySide2/>`_ or `PyQt5 `_ libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3383 +#: ../../howto/logging-cookbook.rst:3404 msgid "" "The following example shows how to log to a Qt GUI. This introduces a simple " "``QtHandler`` class which takes a callable, which should be a slot in the " @@ -1847,14 +1845,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3390 +#: ../../howto/logging-cookbook.rst:3411 msgid "" "The worker thread is implemented using Qt's ``QThread`` class rather than " "the :mod:`threading` module, as there are circumstances where one has to use " "``QThread``, which offers better integration with other ``Qt`` components." msgstr "" -#: ../../howto/logging-cookbook.rst:3394 +#: ../../howto/logging-cookbook.rst:3415 msgid "" "The code should work with recent releases of either ``PySide2`` or " "``PyQt5``. You should be able to adapt the approach to earlier versions of " @@ -1862,11 +1860,11 @@ msgid "" "information." msgstr "" -#: ../../howto/logging-cookbook.rst:3608 +#: ../../howto/logging-cookbook.rst:3629 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3610 +#: ../../howto/logging-cookbook.rst:3631 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "detault to use the older :rfc:`3164`, which hails from 2001. When " @@ -1876,14 +1874,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3617 +#: ../../howto/logging-cookbook.rst:3638 msgid "" "RFC 5424 contains some useful features such as support for structured data, " "and if you need to be able to log to a syslog server with support for it, " "you can do so with a subclassed handler which looks something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3683 +#: ../../howto/logging-cookbook.rst:3704 msgid "" "You'll need to be familiar with RFC 5424 to fully understand the above code, " "and it may be that you have slightly different needs (e.g. for how you pass " @@ -1892,11 +1890,11 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3697 +#: ../../howto/logging-cookbook.rst:3718 msgid "How to treat a logger like an output stream" msgstr "" -#: ../../howto/logging-cookbook.rst:3699 +#: ../../howto/logging-cookbook.rst:3720 msgid "" "Sometimes, you need to interface to a third-party API which expects a file-" "like object to write to, but you want to direct the API's output to a " @@ -1904,17 +1902,17 @@ msgid "" "API. Here's a short script illustrating such a class:" msgstr "" -#: ../../howto/logging-cookbook.rst:3739 +#: ../../howto/logging-cookbook.rst:3760 msgid "When this script is run, it prints" msgstr "" -#: ../../howto/logging-cookbook.rst:3746 +#: ../../howto/logging-cookbook.rst:3767 msgid "" "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." "stderr`` by doing something like this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3756 +#: ../../howto/logging-cookbook.rst:3777 msgid "" "You should do this *after* configuring logging for your needs. In the above " "example, the :func:`~logging.basicConfig` call does this (using the ``sys." @@ -1922,25 +1920,25 @@ msgid "" "Then, you'd get this kind of result:" msgstr "" -#: ../../howto/logging-cookbook.rst:3769 +#: ../../howto/logging-cookbook.rst:3790 msgid "" "Of course, the examples above show output according to the format used by :" "func:`~logging.basicConfig`, but you can use a different formatter when you " "configure logging." msgstr "" -#: ../../howto/logging-cookbook.rst:3773 +#: ../../howto/logging-cookbook.rst:3794 msgid "" "Note that with the above scheme, you are somewhat at the mercy of buffering " "and the sequence of write calls which you are intercepting. For example, " "with the definition of ``LoggerWriter`` above, if you have the snippet" msgstr "" -#: ../../howto/logging-cookbook.rst:3782 +#: ../../howto/logging-cookbook.rst:3803 msgid "then running the script results in" msgstr "" -#: ../../howto/logging-cookbook.rst:3800 +#: ../../howto/logging-cookbook.rst:3821 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes mutiple writes, each of which results " @@ -1950,17 +1948,17 @@ msgid "" "``LoggerWriter``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3825 +#: ../../howto/logging-cookbook.rst:3846 msgid "" "This just buffers up stuff until a newline is seen, and then logs complete " "lines. With this approach, you get better output:" msgstr "" -#: ../../howto/logging-cookbook.rst:3841 +#: ../../howto/logging-cookbook.rst:3862 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:3843 +#: ../../howto/logging-cookbook.rst:3864 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 " @@ -1968,11 +1966,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:3849 +#: ../../howto/logging-cookbook.rst:3870 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:3851 +#: ../../howto/logging-cookbook.rst:3872 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. " @@ -1980,32 +1978,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:3856 +#: ../../howto/logging-cookbook.rst:3877 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:3859 +#: ../../howto/logging-cookbook.rst:3880 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:3862 +#: ../../howto/logging-cookbook.rst:3883 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:3866 +#: ../../howto/logging-cookbook.rst:3887 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:3869 +#: ../../howto/logging-cookbook.rst:3890 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 " @@ -2014,7 +2012,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:3875 +#: ../../howto/logging-cookbook.rst:3896 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 " @@ -2024,17 +2022,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:3882 +#: ../../howto/logging-cookbook.rst:3903 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:3886 +#: ../../howto/logging-cookbook.rst:3907 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:3888 +#: ../../howto/logging-cookbook.rst:3909 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 " @@ -2045,12 +2043,12 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:3897 +#: ../../howto/logging-cookbook.rst:3918 msgid "" "Adding handlers other than :class:`NullHandler` to a logger in a library" msgstr "" -#: ../../howto/logging-cookbook.rst:3899 +#: ../../howto/logging-cookbook.rst:3920 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -2058,11 +2056,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:3905 +#: ../../howto/logging-cookbook.rst:3926 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:3907 +#: ../../howto/logging-cookbook.rst:3928 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. " @@ -2073,14 +2071,14 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:3918 +#: ../../howto/logging-cookbook.rst:3939 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:3931 +#: ../../howto/logging-cookbook.rst:3952 msgid ":ref:`Basic Tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:3933 +#: ../../howto/logging-cookbook.rst:3954 msgid ":ref:`Advanced Tutorial `" msgstr "" diff --git a/library/datetime.po b/library/datetime.po index 66bcbd488f..69e69d90a8 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-11 00:18+0000\n" +"POT-Creation-Date: 2023-01-21 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1636,8 +1636,8 @@ msgstr "" msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " -"UTC; as a result, using ``utcfromtimetuple`` may give misleading results. If " -"you have a naive ``datetime`` representing UTC, use ``datetime." +"UTC; as a result, using :meth:`datetime.utctimetuple` may give misleading " +"results. If you have a naive ``datetime`` representing UTC, use ``datetime." "replace(tzinfo=timezone.utc)`` to make it aware, at which point you can use :" "meth:`.datetime.timetuple`." msgstr "" diff --git a/library/enum.po b/library/enum.po index d42a76969b..15fbce62af 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-18 00:17+0000\n" +"POT-Creation-Date: 2023-01-21 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -84,19 +84,19 @@ msgid "Nomenclature" msgstr "" #: ../../library/enum.rst:55 -msgid "The class :class:`Color` is an *enumeration* (or *enum*)" +msgid "The class :class:`!Color` is an *enumeration* (or *enum*)" msgstr "" #: ../../library/enum.rst:56 msgid "" -"The attributes :attr:`Color.RED`, :attr:`Color.GREEN`, etc., are " +"The attributes :attr:`!Color.RED`, :attr:`!Color.GREEN`, etc., are " "*enumeration members* (or *members*) and are functionally constants." msgstr "" #: ../../library/enum.rst:58 msgid "" -"The enum members have *names* and *values* (the name of :attr:`Color.RED` is " -"``RED``, the value of :attr:`Color.BLUE` is ``3``, etc.)" +"The enum members have *names* and *values* (the name of :attr:`!Color.RED` " +"is ``RED``, the value of :attr:`!Color.BLUE` is ``3``, etc.)" msgstr "" #: ../../library/enum.rst:65 @@ -292,8 +292,8 @@ msgstr "" #: ../../library/enum.rst:168 msgid "" -"*EnumType* is responsible for setting the correct :meth:`__repr__`, :meth:" -"`__str__`, :meth:`__format__`, and :meth:`__reduce__` methods on the final " +"*EnumType* is responsible for setting the correct :meth:`!__repr__`, :meth:`!" +"__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the final " "*enum*, as well as creating the enum members, properly handling duplicates, " "providing iteration over the enum class, etc." msgstr "" @@ -548,9 +548,9 @@ msgstr "" #: ../../library/enum.rst:425 msgid "" -":meth:`__str__` is now :func:`int.__str__` to better support the " -"*replacement of existing constants* use-case. :meth:`__format__` was " -"already :func:`int.__format__` for that same reason." +":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " +"*replacement of existing constants* use-case. :meth:`~object.__format__` was " +"already :meth:`!int.__format__` for that same reason." msgstr "" #: ../../library/enum.rst:432 @@ -775,15 +775,15 @@ msgstr "" #: ../../library/enum.rst:756 msgid "" -":attr:`__members__` is a read-only ordered mapping of ``member_name``:" -"``member`` items. It is only available on the class." +":attr:`~EnumType.__members__` is a read-only ordered mapping of " +"``member_name``:``member`` items. It is only available on the class." msgstr "" #: ../../library/enum.rst:759 msgid "" -":meth:`__new__`, if specified, must create and return the enum members; it " -"is also a very good idea to set the member's :attr:`_value_` appropriately. " -"Once all the members are created it is no longer used." +":meth:`~object.__new__`, if specified, must create and return the enum " +"members; it is also a very good idea to set the member's :attr:`!_value_` " +"appropriately. Once all the members are created it is no longer used." msgstr "" #: ../../library/enum.rst:765 @@ -851,12 +851,12 @@ msgstr "" #: ../../library/enum.rst:798 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " -"call an *Enum*'s :meth:`_generate_next_value_` to get an appropriate value. " -"For *Enum* and *IntEnum* that appropriate value will be the last value plus " -"one; for *Flag* and *IntFlag* it will be the first power-of-two greater than " -"the highest value; for *StrEnum* it will be the lower-cased version of the " -"member's name. Care must be taken if mixing *auto()* with manually " -"specified values." +"call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " +"value. For *Enum* and *IntEnum* that appropriate value will be the last " +"value plus one; for *Flag* and *IntFlag* it will be the first power-of-two " +"greater than the highest value; for *StrEnum* it will be the lower-cased " +"version of the member's name. Care must be taken if mixing *auto()* with " +"manually specified values." msgstr "" #: ../../library/enum.rst:806 @@ -921,8 +921,8 @@ msgstr "" #: ../../library/enum.rst:841 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " -"enumeration's :attr:`__members__`, gathering any aliases it finds; if any " -"are found :exc:`ValueError` is raised with the details::" +"enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " +"if any are found :exc:`ValueError` is raised with the details::" msgstr "" #: ../../library/enum.rst:859 diff --git a/library/optparse.po b/library/optparse.po index 2699c5116f..d5803d16c8 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2023-01-21 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -152,8 +152,8 @@ msgstr "" #: ../../library/optparse.rst:125 msgid "" -"a plus sign followed by a single letter, or a few letters, or a word, e.g. ``" -"+f``, ``+rgb``" +"a plus sign followed by a single letter, or a few letters, or a word, e.g. " +"``+f``, ``+rgb``" msgstr "" #: ../../library/optparse.rst:128 @@ -527,7 +527,7 @@ msgid "``\"store_const\"``" msgstr "``\"store_const\"``" #: ../../library/optparse.rst:407 ../../library/optparse.rst:928 -msgid "store a constant value" +msgid "store a constant value, pre-set via :attr:`Option.const`" msgstr "" #: ../../library/optparse.rst:410 ../../library/optparse.rst:937 @@ -566,10 +566,10 @@ msgstr "" #: ../../library/optparse.rst:427 msgid "" -"All of the above examples involve setting some variable (the \"destination" -"\") when certain command-line options are seen. What happens if those " -"options are never seen? Since we didn't supply any defaults, they are all " -"set to ``None``. This is usually fine, but sometimes you want more " +"All of the above examples involve setting some variable (the " +"\"destination\") when certain command-line options are seen. What happens " +"if those options are never seen? Since we didn't supply any defaults, they " +"are all set to ``None``. This is usually fine, but sometimes you want more " "control. :mod:`optparse` lets you supply a default value for each " "destination, which is assigned before the command line is parsed." msgstr "" @@ -813,8 +813,8 @@ msgstr "" #: ../../library/optparse.rst:692 msgid "" "Print the version message for the current program (``self.version``) to " -"*file* (default stdout). As with :meth:`print_usage`, any occurrence of ``" -"%prog`` in ``self.version`` is replaced with the name of the current " +"*file* (default stdout). As with :meth:`print_usage`, any occurrence of " +"``%prog`` in ``self.version`` is replaced with the name of the current " "program. Does nothing if ``self.version`` is empty or undefined." msgstr "" @@ -916,8 +916,8 @@ msgstr "" #: ../../library/optparse.rst:810 msgid "" "The usage summary to print when your program is run incorrectly or with a " -"help option. When :mod:`optparse` prints the usage string, it expands ``" -"%prog`` to ``os.path.basename(sys.argv[0])`` (or to ``prog`` if you passed " +"help option. When :mod:`optparse` prints the usage string, it expands " +"``%prog`` to ``os.path.basename(sys.argv[0])`` (or to ``prog`` if you passed " "that keyword argument). To suppress a usage message, pass the special " "value :data:`optparse.SUPPRESS_USAGE`." msgstr "" @@ -951,8 +951,8 @@ msgstr "" msgid "" "A version string to print when the user supplies a version option. If you " "supply a true value for ``version``, :mod:`optparse` automatically adds a " -"version option with the single option string ``--version``. The substring ``" -"%prog`` is expanded the same as for ``usage``." +"version option with the single option string ``--version``. The substring " +"``%prog`` is expanded the same as for ``usage``." msgstr "" #: ../../library/optparse.rst:835 @@ -1123,7 +1123,7 @@ msgid "``\"append_const\"``" msgstr "``\"append_const\"``" #: ../../library/optparse.rst:940 -msgid "append a constant value to a list" +msgid "append a constant value to a list, pre-set via :attr:`Option.const`" msgstr "" #: ../../library/optparse.rst:949 ../../library/optparse.rst:1226 @@ -1214,8 +1214,8 @@ msgstr "" #: ../../library/optparse.rst:1011 msgid "" -"The argument type expected by this option (e.g., ``\"string\"`` or ``\"int" -"\"``); the available option types are documented :ref:`here `." msgstr "" @@ -1770,11 +1770,11 @@ msgstr "" #: ../../library/optparse.rst:1452 msgid "" "At this point, :mod:`optparse` detects that a previously added option is " -"already using the ``-n`` option string. Since ``conflict_handler`` is ``" -"\"resolve\"``, it resolves the situation by removing ``-n`` from the earlier " -"option's list of option strings. Now ``--dry-run`` is the only way for the " -"user to activate that option. If the user asks for help, the help message " -"will reflect that::" +"already using the ``-n`` option string. Since ``conflict_handler`` is " +"``\"resolve\"``, it resolves the situation by removing ``-n`` from the " +"earlier option's list of option strings. Now ``--dry-run`` is the only way " +"for the user to activate that option. If the user asks for help, the help " +"message will reflect that::" msgstr "" #: ../../library/optparse.rst:1463 @@ -1982,8 +1982,8 @@ msgid "" "is the option string seen on the command-line that's triggering the " "callback. (If an abbreviated long option was used, ``opt_str`` will be the " "full, canonical option string---e.g. if the user puts ``--foo`` on the " -"command-line as an abbreviation for ``--foobar``, then ``opt_str`` will be ``" -"\"--foobar\"``.)" +"command-line as an abbreviation for ``--foobar``, then ``opt_str`` will be " +"``\"--foobar\"``.)" msgstr "" #: ../../library/optparse.rst:1637 @@ -2333,10 +2333,10 @@ msgstr "" #: ../../library/optparse.rst:1950 msgid "" -"These are overlapping sets: some default \"store\" actions are ``\"store" -"\"``, ``\"store_const\"``, ``\"append\"``, and ``\"count\"``, while the " -"default \"typed\" actions are ``\"store\"``, ``\"append\"``, and ``\"callback" -"\"``." +"These are overlapping sets: some default \"store\" actions are " +"``\"store\"``, ``\"store_const\"``, ``\"append\"``, and ``\"count\"``, while " +"the default \"typed\" actions are ``\"store\"``, ``\"append\"``, and " +"``\"callback\"``." msgstr "" #: ../../library/optparse.rst:1954 @@ -2425,11 +2425,11 @@ msgstr "" msgid "" "If the ``attr`` attribute of ``values`` doesn't exist or is ``None``, then " "ensure_value() first sets it to ``value``, and then returns 'value. This is " -"very handy for actions like ``\"extend\"``, ``\"append\"``, and ``\"count" -"\"``, all of which accumulate data in a variable and expect that variable to " -"be of a certain type (a list for the first two, an integer for the latter). " -"Using :meth:`ensure_value` means that scripts using your action don't have " -"to worry about setting a default value for the option destinations in " -"question; they can just leave the default as ``None`` and :meth:" -"`ensure_value` will take care of getting it right when it's needed." +"very handy for actions like ``\"extend\"``, ``\"append\"``, and " +"``\"count\"``, all of which accumulate data in a variable and expect that " +"variable to be of a certain type (a list for the first two, an integer for " +"the latter). Using :meth:`ensure_value` means that scripts using your " +"action don't have to worry about setting a default value for the option " +"destinations in question; they can just leave the default as ``None`` and :" +"meth:`ensure_value` will take care of getting it right when it's needed." msgstr "" diff --git a/library/pathlib.po b/library/pathlib.po index acec6f16a4..6ed8c44371 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-06 03:11+0000\n" +"POT-Creation-Date: 2023-01-21 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1159,7 +1159,8 @@ msgid ":func:`os.path.basename`" msgstr ":func:`os.path.basename`" #: ../../library/pathlib.rst:1326 -msgid ":data:`PurePath.name`" +#, fuzzy +msgid ":attr:`PurePath.name`" msgstr ":data:`PurePath.name`" #: ../../library/pathlib.rst:1327 @@ -1167,7 +1168,8 @@ msgid ":func:`os.path.dirname`" msgstr ":func:`os.path.dirname`" #: ../../library/pathlib.rst:1327 -msgid ":data:`PurePath.parent`" +#, fuzzy +msgid ":attr:`PurePath.parent`" msgstr ":data:`PurePath.parent`" #: ../../library/pathlib.rst:1328 @@ -1183,7 +1185,8 @@ msgid ":func:`os.path.splitext`" msgstr ":func:`os.path.splitext`" #: ../../library/pathlib.rst:1329 -msgid ":data:`PurePath.stem` and :data:`PurePath.suffix`" +#, fuzzy +msgid ":attr:`PurePath.stem` and :attr:`PurePath.suffix`" msgstr ":data:`PurePath.stem` 和 :data:`PurePath.suffix`" #: ../../library/pathlib.rst:1334 diff --git a/library/ssl.po b/library/ssl.po index 64c59bdae7..8743fbaf13 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-01-21 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-" @@ -433,8 +433,8 @@ msgstr "" #: ../../library/ssl.rst:405 msgid "" "Return the time in seconds since the Epoch, given the ``cert_time`` string " -"representing the \"notBefore\" or \"notAfter\" date from a certificate in ``" -"\"%b %d %H:%M:%S %Y %Z\"`` strptime format (C locale)." +"representing the \"notBefore\" or \"notAfter\" date from a certificate in " +"``\"%b %d %H:%M:%S %Y %Z\"`` strptime format (C locale)." msgstr "" #: ../../library/ssl.rst:410 @@ -1216,8 +1216,8 @@ msgstr "" #: ../../library/ssl.rst:1143 msgid "" "The :meth:`shutdown` does not reset the socket timeout each time bytes are " -"received or sent. The socket timeout is now to maximum total duration of the " -"shutdown." +"received or sent. The socket timeout is now the maximum total duration of " +"the shutdown." msgstr "" #: ../../library/ssl.rst:1148 @@ -1265,8 +1265,8 @@ msgstr "" #: ../../library/ssl.rst:1177 msgid "" -"The socket timeout is no more reset each time bytes are received or sent. " -"The socket timeout is now to maximum total duration to read up to *len* " +"The socket timeout is no longer reset each time bytes are received or sent. " +"The socket timeout is now the maximum total duration to read up to *len* " "bytes." msgstr "" @@ -1294,8 +1294,8 @@ msgstr "" #: ../../library/ssl.rst:1196 msgid "" -"The socket timeout is no more reset each time bytes are received or sent. " -"The socket timeout is now to maximum total duration to write *buf*." +"The socket timeout is no longer reset each time bytes are received or sent. " +"The socket timeout is now the maximum total duration to write *buf*." msgstr "" #: ../../library/ssl.rst:1200 @@ -1330,8 +1330,8 @@ msgstr "" #: ../../library/ssl.rst:1224 msgid "" -"The socket timeout is no more reset each time bytes are received or sent. " -"The socket timeout is now to maximum total duration of the handshake." +"The socket timeout is no longer reset each time bytes are received or sent. " +"The socket timeout is now the maximum total duration of the handshake." msgstr "" #: ../../library/ssl.rst:1228 @@ -1339,7 +1339,7 @@ msgid "" "Hostname or IP address is matched by OpenSSL during handshake. The function :" "func:`match_hostname` is no longer used. In case OpenSSL refuses a hostname " "or IP address, the handshake is aborted early and a TLS alert message is " -"send to the peer." +"sent to the peer." msgstr "" #: ../../library/ssl.rst:1236 @@ -1520,8 +1520,8 @@ msgstr "" msgid "" "Return the actual SSL protocol version negotiated by the connection as a " "string, or ``None`` if no secure connection is established. As of this " -"writing, possible return values include ``\"SSLv2\"``, ``\"SSLv3\"``, ``" -"\"TLSv1\"``, ``\"TLSv1.1\"`` and ``\"TLSv1.2\"``. Recent OpenSSL versions " +"writing, possible return values include ``\"SSLv2\"``, ``\"SSLv3\"``, " +"``\"TLSv1\"``, ``\"TLSv1.1\"`` and ``\"TLSv1.2\"``. Recent OpenSSL versions " "may define more return values." msgstr "" @@ -2356,9 +2356,9 @@ msgstr "" #: ../../library/ssl.rst:2122 msgid "" -"Python uses files to contain certificates. They should be formatted as \"PEM" -"\" (see :rfc:`1422`), which is a base-64 encoded form wrapped with a header " -"line and a footer line::" +"Python uses files to contain certificates. They should be formatted as " +"\"PEM\" (see :rfc:`1422`), which is a base-64 encoded form wrapped with a " +"header line and a footer line::" msgstr "" #: ../../library/ssl.rst:2131 diff --git a/library/zipfile.po b/library/zipfile.po index 67de71aaca..6fd3c7394d 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-18 00:16+0000\n" +"POT-Creation-Date: 2023-01-21 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -205,7 +205,7 @@ msgid "" "accepted (see :class:`bz2 ` for more information)." msgstr "" -#: ../../library/zipfile.rst:181 ../../library/zipfile.rst:721 +#: ../../library/zipfile.rst:181 ../../library/zipfile.rst:733 msgid "" "The *strict_timestamps* argument, when set to ``False``, allows to zip files " "older than 1980-01-01 at the cost of setting the timestamp to 1980-01-01. " @@ -258,7 +258,7 @@ msgstr "" msgid "Added support for :mod:`bzip2 ` and :mod:`lzma` compression." msgstr "" -#: ../../library/zipfile.rst:221 ../../library/zipfile.rst:635 +#: ../../library/zipfile.rst:221 ../../library/zipfile.rst:647 msgid "ZIP64 extensions are enabled by default." msgstr "" @@ -282,7 +282,7 @@ msgstr "" msgid "Add the *compresslevel* parameter." msgstr "" -#: ../../library/zipfile.rst:238 ../../library/zipfile.rst:732 +#: ../../library/zipfile.rst:238 ../../library/zipfile.rst:744 msgid "The *strict_timestamps* keyword-only argument" msgstr "" @@ -643,117 +643,125 @@ msgid "" "Added support for text and binary modes for open. Default mode is now text." msgstr "" -#: ../../library/zipfile.rst:556 +#: ../../library/zipfile.rst:554 ../../library/zipfile.rst:605 +msgid "" +"The ``encoding`` parameter can be supplied as a positional argument without " +"causing a :exc:`TypeError`. As it could in 3.9. Code needing to be " +"compatible with unpatched 3.10 and 3.11 versions must pass all :class:`io." +"TextIOWrapper` arguments, ``encoding`` included, as keywords." +msgstr "" + +#: ../../library/zipfile.rst:562 msgid "Enumerate the children of the current directory." msgstr "" -#: ../../library/zipfile.rst:560 +#: ../../library/zipfile.rst:566 msgid "Return ``True`` if the current context references a directory." msgstr "" -#: ../../library/zipfile.rst:564 +#: ../../library/zipfile.rst:570 msgid "Return ``True`` if the current context references a file." msgstr "" -#: ../../library/zipfile.rst:568 +#: ../../library/zipfile.rst:574 msgid "" "Return ``True`` if the current context references a file or directory in the " "zip file." msgstr "" -#: ../../library/zipfile.rst:573 +#: ../../library/zipfile.rst:579 msgid "The file extension of the final component." msgstr "" -#: ../../library/zipfile.rst:575 +#: ../../library/zipfile.rst:581 msgid "Added :data:`Path.suffix` property." msgstr "" -#: ../../library/zipfile.rst:580 +#: ../../library/zipfile.rst:586 msgid "The final path component, without its suffix." msgstr "" -#: ../../library/zipfile.rst:582 +#: ../../library/zipfile.rst:588 msgid "Added :data:`Path.stem` property." msgstr "" -#: ../../library/zipfile.rst:587 +#: ../../library/zipfile.rst:593 msgid "A list of the path’s file extensions." msgstr "" -#: ../../library/zipfile.rst:589 +#: ../../library/zipfile.rst:595 msgid "Added :data:`Path.suffixes` property." msgstr "" -#: ../../library/zipfile.rst:594 +#: ../../library/zipfile.rst:600 msgid "" "Read the current file as unicode text. Positional and keyword arguments are " "passed through to :class:`io.TextIOWrapper` (except ``buffer``, which is " "implied by the context)." msgstr "" -#: ../../library/zipfile.rst:601 +#: ../../library/zipfile.rst:613 msgid "Read the current file as bytes." msgstr "" -#: ../../library/zipfile.rst:605 +#: ../../library/zipfile.rst:617 msgid "" "Return a new Path object with each of the *other* arguments joined. The " "following are equivalent::" msgstr "" -#: ../../library/zipfile.rst:612 +#: ../../library/zipfile.rst:624 msgid "" "Prior to 3.10, ``joinpath`` was undocumented and accepted exactly one " "parameter." msgstr "" -#: ../../library/zipfile.rst:616 +#: ../../library/zipfile.rst:628 msgid "" "The `zipp `_ project provides backports of " "the latest path object functionality to older Pythons. Use ``zipp.Path`` in " "place of ``zipfile.Path`` for early access to changes." msgstr "" -#: ../../library/zipfile.rst:624 +#: ../../library/zipfile.rst:636 msgid "PyZipFile Objects" msgstr "PyZipFile 物件" -#: ../../library/zipfile.rst:626 +#: ../../library/zipfile.rst:638 msgid "" "The :class:`PyZipFile` constructor takes the same parameters as the :class:" "`ZipFile` constructor, and one additional parameter, *optimize*." msgstr "" -#: ../../library/zipfile.rst:632 +#: ../../library/zipfile.rst:644 msgid "The *optimize* parameter." msgstr "*optimize* 參數。" -#: ../../library/zipfile.rst:638 +#: ../../library/zipfile.rst:650 msgid "" "Instances have one method in addition to those of :class:`ZipFile` objects:" msgstr "" -#: ../../library/zipfile.rst:642 +#: ../../library/zipfile.rst:654 msgid "" "Search for files :file:`\\*.py` and add the corresponding file to the " "archive." msgstr "" -#: ../../library/zipfile.rst:645 +#: ../../library/zipfile.rst:657 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was not given or ``-1``, " "the corresponding file is a :file:`\\*.pyc` file, compiling if necessary." msgstr "" -#: ../../library/zipfile.rst:648 +#: ../../library/zipfile.rst:660 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was ``0``, ``1`` or ``2``, " "only files with that optimization level (see :func:`compile`) are added to " "the archive, compiling if necessary." msgstr "" -#: ../../library/zipfile.rst:652 +#: ../../library/zipfile.rst:664 msgid "" "If *pathname* is a file, the filename must end with :file:`.py`, and just " "the (corresponding :file:`\\*.pyc`) file is added at the top level (no path " @@ -766,11 +774,11 @@ msgid "" "in sorted order." msgstr "" -#: ../../library/zipfile.rst:662 +#: ../../library/zipfile.rst:674 msgid "*basename* is intended for internal use only." msgstr "" -#: ../../library/zipfile.rst:664 +#: ../../library/zipfile.rst:676 msgid "" "*filterfunc*, if given, must be a function taking a single string argument. " "It will be passed each path (including each individual full file path) " @@ -781,286 +789,286 @@ msgid "" "exclude them::" msgstr "" -#: ../../library/zipfile.rst:678 +#: ../../library/zipfile.rst:690 msgid "The :meth:`writepy` method makes archives with file names like this::" msgstr "" -#: ../../library/zipfile.rst:687 +#: ../../library/zipfile.rst:699 msgid "The *filterfunc* parameter." msgstr "*filterfunc* 參數。" -#: ../../library/zipfile.rst:690 +#: ../../library/zipfile.rst:702 msgid "The *pathname* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:693 +#: ../../library/zipfile.rst:705 msgid "Recursion sorts directory entries." msgstr "" -#: ../../library/zipfile.rst:700 +#: ../../library/zipfile.rst:712 msgid "ZipInfo Objects" msgstr "ZipInfo 物件" -#: ../../library/zipfile.rst:702 +#: ../../library/zipfile.rst:714 msgid "" "Instances of the :class:`ZipInfo` class are returned by the :meth:`.getinfo` " "and :meth:`.infolist` methods of :class:`ZipFile` objects. Each object " "stores information about a single member of the ZIP archive." msgstr "" -#: ../../library/zipfile.rst:706 +#: ../../library/zipfile.rst:718 msgid "" "There is one classmethod to make a :class:`ZipInfo` instance for a " "filesystem file:" msgstr "" -#: ../../library/zipfile.rst:712 +#: ../../library/zipfile.rst:724 msgid "" "Construct a :class:`ZipInfo` instance for a file on the filesystem, in " "preparation for adding it to a zip file." msgstr "" -#: ../../library/zipfile.rst:715 +#: ../../library/zipfile.rst:727 msgid "*filename* should be the path to a file or directory on the filesystem." msgstr "" -#: ../../library/zipfile.rst:717 +#: ../../library/zipfile.rst:729 msgid "" "If *arcname* is specified, it is used as the name within the archive. If " "*arcname* is not specified, the name will be the same as *filename*, but " "with any drive letter and leading path separators removed." msgstr "" -#: ../../library/zipfile.rst:729 +#: ../../library/zipfile.rst:741 msgid "The *filename* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:736 +#: ../../library/zipfile.rst:748 msgid "Instances have the following methods and attributes:" msgstr "" -#: ../../library/zipfile.rst:740 +#: ../../library/zipfile.rst:752 msgid "Return ``True`` if this archive member is a directory." msgstr "" -#: ../../library/zipfile.rst:742 +#: ../../library/zipfile.rst:754 msgid "This uses the entry's name: directories should always end with ``/``." msgstr "" -#: ../../library/zipfile.rst:749 +#: ../../library/zipfile.rst:761 msgid "Name of the file in the archive." msgstr "" -#: ../../library/zipfile.rst:754 +#: ../../library/zipfile.rst:766 msgid "" "The time and date of the last modification to the archive member. This is a " "tuple of six values:" msgstr "" -#: ../../library/zipfile.rst:758 +#: ../../library/zipfile.rst:770 msgid "Index" msgstr "" -#: ../../library/zipfile.rst:758 +#: ../../library/zipfile.rst:770 msgid "Value" msgstr "" -#: ../../library/zipfile.rst:760 +#: ../../library/zipfile.rst:772 msgid "``0``" msgstr "``0``" -#: ../../library/zipfile.rst:760 +#: ../../library/zipfile.rst:772 msgid "Year (>= 1980)" msgstr "" -#: ../../library/zipfile.rst:762 +#: ../../library/zipfile.rst:774 msgid "``1``" msgstr "``1``" -#: ../../library/zipfile.rst:762 +#: ../../library/zipfile.rst:774 msgid "Month (one-based)" msgstr "" -#: ../../library/zipfile.rst:764 +#: ../../library/zipfile.rst:776 msgid "``2``" msgstr "``2``" -#: ../../library/zipfile.rst:764 +#: ../../library/zipfile.rst:776 msgid "Day of month (one-based)" msgstr "" -#: ../../library/zipfile.rst:766 +#: ../../library/zipfile.rst:778 msgid "``3``" msgstr "``3``" -#: ../../library/zipfile.rst:766 +#: ../../library/zipfile.rst:778 msgid "Hours (zero-based)" msgstr "" -#: ../../library/zipfile.rst:768 +#: ../../library/zipfile.rst:780 msgid "``4``" msgstr "``4``" -#: ../../library/zipfile.rst:768 +#: ../../library/zipfile.rst:780 msgid "Minutes (zero-based)" msgstr "" -#: ../../library/zipfile.rst:770 +#: ../../library/zipfile.rst:782 msgid "``5``" msgstr "``5``" -#: ../../library/zipfile.rst:770 +#: ../../library/zipfile.rst:782 msgid "Seconds (zero-based)" msgstr "" -#: ../../library/zipfile.rst:775 +#: ../../library/zipfile.rst:787 msgid "The ZIP file format does not support timestamps before 1980." msgstr "" -#: ../../library/zipfile.rst:780 +#: ../../library/zipfile.rst:792 msgid "Type of compression for the archive member." msgstr "" -#: ../../library/zipfile.rst:785 +#: ../../library/zipfile.rst:797 msgid "Comment for the individual archive member as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:790 +#: ../../library/zipfile.rst:802 msgid "" "Expansion field data. The `PKZIP Application Note`_ contains some comments " "on the internal structure of the data contained in this :class:`bytes` " "object." msgstr "" -#: ../../library/zipfile.rst:797 +#: ../../library/zipfile.rst:809 msgid "System which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:802 +#: ../../library/zipfile.rst:814 msgid "PKZIP version which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:807 +#: ../../library/zipfile.rst:819 msgid "PKZIP version needed to extract archive." msgstr "" -#: ../../library/zipfile.rst:812 +#: ../../library/zipfile.rst:824 msgid "Must be zero." msgstr "" -#: ../../library/zipfile.rst:817 +#: ../../library/zipfile.rst:829 msgid "ZIP flag bits." msgstr "" -#: ../../library/zipfile.rst:822 +#: ../../library/zipfile.rst:834 msgid "Volume number of file header." msgstr "" -#: ../../library/zipfile.rst:827 +#: ../../library/zipfile.rst:839 msgid "Internal attributes." msgstr "" -#: ../../library/zipfile.rst:832 +#: ../../library/zipfile.rst:844 msgid "External file attributes." msgstr "" -#: ../../library/zipfile.rst:837 +#: ../../library/zipfile.rst:849 msgid "Byte offset to the file header." msgstr "" -#: ../../library/zipfile.rst:842 +#: ../../library/zipfile.rst:854 msgid "CRC-32 of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:847 +#: ../../library/zipfile.rst:859 msgid "Size of the compressed data." msgstr "" -#: ../../library/zipfile.rst:852 +#: ../../library/zipfile.rst:864 msgid "Size of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:859 +#: ../../library/zipfile.rst:871 msgid "Command-Line Interface" msgstr "" -#: ../../library/zipfile.rst:861 +#: ../../library/zipfile.rst:873 msgid "" "The :mod:`zipfile` module provides a simple command-line interface to " "interact with ZIP archives." msgstr "" -#: ../../library/zipfile.rst:864 +#: ../../library/zipfile.rst:876 msgid "" "If you want to create a new ZIP archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/zipfile.rst:871 +#: ../../library/zipfile.rst:883 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/zipfile.rst:877 +#: ../../library/zipfile.rst:889 msgid "" "If you want to extract a ZIP archive into the specified directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/zipfile.rst:884 +#: ../../library/zipfile.rst:896 msgid "For a list of the files in a ZIP archive, use the :option:`-l` option:" msgstr "" -#: ../../library/zipfile.rst:892 +#: ../../library/zipfile.rst:904 msgid "Command-line options" msgstr "" -#: ../../library/zipfile.rst:897 +#: ../../library/zipfile.rst:909 msgid "List files in a zipfile." msgstr "" -#: ../../library/zipfile.rst:902 +#: ../../library/zipfile.rst:914 msgid "Create zipfile from source files." msgstr "" -#: ../../library/zipfile.rst:907 +#: ../../library/zipfile.rst:919 msgid "Extract zipfile into target directory." msgstr "" -#: ../../library/zipfile.rst:912 +#: ../../library/zipfile.rst:924 msgid "Test whether the zipfile is valid or not." msgstr "" -#: ../../library/zipfile.rst:916 +#: ../../library/zipfile.rst:928 msgid "" "Specify encoding of member names for :option:`-l`, :option:`-e` and :option:" "`-t`." msgstr "" -#: ../../library/zipfile.rst:923 +#: ../../library/zipfile.rst:935 msgid "Decompression pitfalls" msgstr "" -#: ../../library/zipfile.rst:925 +#: ../../library/zipfile.rst:937 msgid "" "The extraction in zipfile module might fail due to some pitfalls listed " "below." msgstr "" -#: ../../library/zipfile.rst:928 +#: ../../library/zipfile.rst:940 msgid "From file itself" msgstr "" -#: ../../library/zipfile.rst:930 +#: ../../library/zipfile.rst:942 msgid "" "Decompression may fail due to incorrect password / CRC checksum / ZIP format " "or unsupported compression method / decryption." msgstr "" -#: ../../library/zipfile.rst:934 +#: ../../library/zipfile.rst:946 msgid "File System limitations" msgstr "" -#: ../../library/zipfile.rst:936 +#: ../../library/zipfile.rst:948 msgid "" "Exceeding limitations on different file systems can cause decompression " "failed. Such as allowable characters in the directory entries, length of the " @@ -1068,33 +1076,33 @@ msgid "" "files, etc." msgstr "" -#: ../../library/zipfile.rst:943 +#: ../../library/zipfile.rst:955 msgid "Resources limitations" msgstr "" -#: ../../library/zipfile.rst:945 +#: ../../library/zipfile.rst:957 msgid "" "The lack of memory or disk volume would lead to decompression failed. For " "example, decompression bombs (aka `ZIP bomb`_) apply to zipfile library that " "can cause disk volume exhaustion." msgstr "" -#: ../../library/zipfile.rst:950 +#: ../../library/zipfile.rst:962 msgid "Interruption" msgstr "" -#: ../../library/zipfile.rst:952 +#: ../../library/zipfile.rst:964 msgid "" "Interruption during the decompression, such as pressing control-C or killing " "the decompression process may result in incomplete decompression of the " "archive." msgstr "" -#: ../../library/zipfile.rst:956 +#: ../../library/zipfile.rst:968 msgid "Default behaviors of extraction" msgstr "" -#: ../../library/zipfile.rst:958 +#: ../../library/zipfile.rst:970 msgid "" "Not knowing the default extraction behaviors can cause unexpected " "decompression results. For example, when extracting the same archive twice, " From 14eab84ed5954326ed4e52d803e53944c6eea6d1 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Sat, 21 Jan 2023 17:13:22 +0800 Subject: [PATCH 009/130] fix(library/pathlib): resolve fuzzy entries --- library/pathlib.po | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/library/pathlib.po b/library/pathlib.po index 6ed8c44371..388563f8a7 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -1159,18 +1159,16 @@ msgid ":func:`os.path.basename`" msgstr ":func:`os.path.basename`" #: ../../library/pathlib.rst:1326 -#, fuzzy msgid ":attr:`PurePath.name`" -msgstr ":data:`PurePath.name`" +msgstr ":attr:`PurePath.name`" #: ../../library/pathlib.rst:1327 msgid ":func:`os.path.dirname`" msgstr ":func:`os.path.dirname`" #: ../../library/pathlib.rst:1327 -#, fuzzy msgid ":attr:`PurePath.parent`" -msgstr ":data:`PurePath.parent`" +msgstr ":attr:`PurePath.parent`" #: ../../library/pathlib.rst:1328 msgid ":func:`os.path.samefile`" @@ -1185,9 +1183,8 @@ msgid ":func:`os.path.splitext`" msgstr ":func:`os.path.splitext`" #: ../../library/pathlib.rst:1329 -#, fuzzy msgid ":attr:`PurePath.stem` and :attr:`PurePath.suffix`" -msgstr ":data:`PurePath.stem` 和 :data:`PurePath.suffix`" +msgstr ":attr:`PurePath.stem` 和 :attr:`PurePath.suffix`" #: ../../library/pathlib.rst:1334 msgid "Footnotes" From 937fe52cbe2a08366982c25d0bd88981fd8c8e42 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Jan 2023 00:18:24 +0000 Subject: [PATCH 010/130] sync with cpython 69d12d86 --- library/random.po | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/library/random.po b/library/random.po index 1a372a270c..dbe448fb02 100644 --- a/library/random.po +++ b/library/random.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-01-23 00:16+0000\n" "PO-Revision-Date: 2022-10-16 06:34+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -56,20 +56,21 @@ msgstr "" "(von Mises distribution)。" #: ../../library/random.rst:23 +#, fuzzy msgid "" "Almost all module functions depend on the basic function :func:`.random`, " -"which generates a random float uniformly in the semi-open range [0.0, 1.0). " -"Python uses the Mersenne Twister as the core generator. It produces 53-bit " -"precision floats and has a period of 2\\*\\*19937-1. The underlying " +"which generates a random float uniformly in the half-open range ``0.0 <= X < " +"1.0``. Python uses the Mersenne Twister as the core generator. It produces " +"53-bit precision floats and has a period of 2\\*\\*19937-1. The underlying " "implementation in C is both fast and threadsafe. The Mersenne Twister is " "one of the most extensively tested random number generators in existence. " "However, being completely deterministic, it is not suitable for all " "purposes, and is completely unsuitable for cryptographic purposes." msgstr "" "幾乎所有 module 函式都相依於基本函式 :func:`.random`,此函式在半開放範圍 " -"[0.0, 1.0) 內均勻地生成一個隨機 float(浮點數)。Python 使用 Mersenne " -"Twister(梅森旋轉演算法)作為核心的產生器,它產生 53 位元精度 float,其週期" -"為 2\\*\\*19937-1,透過 C 語言進行底層的實作既快速又支援執行緒安全 " +"[0.0, 1.0) 內均勻地生成一個隨機 float(浮點數)。Python 使用 Mersenne Twister" +"(梅森旋轉演算法)作為核心的產生器,它產生 53 位元精度 float,其週期為 " +"2\\*\\*19937-1,透過 C 語言進行底層的實作既快速又支援執行緒安全 " "(threadsafe)。Mersenne Twister 是現存最廣泛被驗證的隨機數產生器之一,但是基於" "完全確定性,它並不適合所有目的,並且完全不適合加密目的。" @@ -478,7 +479,9 @@ msgstr "" "實踐所示;這些方程式中的大多數都可以在任意統計文本中找到。" #: ../../library/random.rst:276 -msgid "Return the next random floating point number in the range [0.0, 1.0)." +#, fuzzy +msgid "" +"Return the next random floating point number in the range ``0.0 <= X < 1.0``" msgstr "回傳範圍 [0.0, 1.0) 中的下一個隨機浮點數。" #: ../../library/random.rst:281 From 3a584e9fe57c86c7b9c53a1ec753b3ff4cfed775 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 23 Jan 2023 22:47:44 +0800 Subject: [PATCH 011/130] fix(library/random): resolve fuzzy entries --- library/random.po | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/library/random.po b/library/random.po index dbe448fb02..86c00f1fd2 100644 --- a/library/random.po +++ b/library/random.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-01-23 00:16+0000\n" -"PO-Revision-Date: 2022-10-16 06:34+0800\n" +"PO-Revision-Date: 2023-01-23 22:47+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.1.1\n" +"X-Generator: Poedit 3.2.2\n" #: ../../library/random.rst:2 msgid ":mod:`random` --- Generate pseudo-random numbers" @@ -56,7 +56,6 @@ msgstr "" "(von Mises distribution)。" #: ../../library/random.rst:23 -#, fuzzy msgid "" "Almost all module functions depend on the basic function :func:`.random`, " "which generates a random float uniformly in the half-open range ``0.0 <= X < " @@ -68,11 +67,11 @@ msgid "" "purposes, and is completely unsuitable for cryptographic purposes." msgstr "" "幾乎所有 module 函式都相依於基本函式 :func:`.random`,此函式在半開放範圍 " -"[0.0, 1.0) 內均勻地生成一個隨機 float(浮點數)。Python 使用 Mersenne Twister" -"(梅森旋轉演算法)作為核心的產生器,它產生 53 位元精度 float,其週期為 " -"2\\*\\*19937-1,透過 C 語言進行底層的實作既快速又支援執行緒安全 " -"(threadsafe)。Mersenne Twister 是現存最廣泛被驗證的隨機數產生器之一,但是基於" -"完全確定性,它並不適合所有目的,並且完全不適合加密目的。" +"``0.0 <= X < 1.0`` 內均勻地生成一個隨機 float(浮點數)。Python 使用 " +"Mersenne Twister(梅森旋轉演算法)作為核心的產生器,它產生 53 位元精度 " +"float,其週期為 2\\*\\*19937-1,透過 C 語言進行底層的實作既快速又支援執行緒安" +"全 (threadsafe)。Mersenne Twister 是現存最廣泛被驗證的隨機數產生器之一,但是" +"基於完全確定性,它並不適合所有目的,並且完全不適合加密目的。" #: ../../library/random.rst:32 msgid "" @@ -479,10 +478,9 @@ msgstr "" "實踐所示;這些方程式中的大多數都可以在任意統計文本中找到。" #: ../../library/random.rst:276 -#, fuzzy msgid "" "Return the next random floating point number in the range ``0.0 <= X < 1.0``" -msgstr "回傳範圍 [0.0, 1.0) 中的下一個隨機浮點數。" +msgstr "回傳範圍 ``0.0 <= X < 1.0`` 中的下一個隨機浮點數" #: ../../library/random.rst:281 msgid "" From 0b63a3cd09c183e4a044b54d5dee3a49cbc0663c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Jan 2023 15:34:52 +0000 Subject: [PATCH 012/130] sync with cpython 4cf41693 --- library/asyncio.po | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/library/asyncio.po b/library/asyncio.po index ea5250c713..189accb450 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-01-23 15:33+0000\n" "PO-Revision-Date: 2021-11-23 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,15 +20,15 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.0\n" -#: ../../library/asyncio.rst:66 +#: ../../library/asyncio.rst:78 msgid "High-level APIs" msgstr "高階 API" -#: ../../library/asyncio.rst:78 +#: ../../library/asyncio.rst:90 msgid "Low-level APIs" msgstr "低階 API" -#: ../../library/asyncio.rst:89 +#: ../../library/asyncio.rst:101 msgid "Guides and Tutorials" msgstr "指南與教學" @@ -126,6 +126,10 @@ msgstr "" "透過 async/await 語法來\\ :ref:`橋接 `\\ 基於回呼 (callback-" "based) 的函式庫與程式碼。" +#: ../../library/asyncio.rst:59 +msgid "You can experiment with an ``asyncio`` concurrent context in the REPL:" +msgstr "" + #: ../../includes/wasm-notavail.rst:-1 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -137,10 +141,10 @@ msgid "" "more information." msgstr "" -#: ../../library/asyncio.rst:65 +#: ../../library/asyncio.rst:77 msgid "Reference" msgstr "參閱" -#: ../../library/asyncio.rst:98 +#: ../../library/asyncio.rst:110 msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." msgstr "asyncio 的原始碼可以在 :source:`Lib/asyncio/` 中找到。" From d02243f6e99ed6587d6ba14cdcd949ee31d85ecf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 25 Jan 2023 00:32:59 +0000 Subject: [PATCH 013/130] sync with cpython 5a8ed019 --- c-api/long.po | 83 ++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/c-api/long.po b/c-api/long.po index 6cc141e1d3..d9ea55afe4 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-01-25 00:31+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -118,47 +118,54 @@ msgid "" "are no digits, :exc:`ValueError` will be raised." msgstr "" -#: ../../c-api/long.rst:99 +#: ../../c-api/long.rst:96 +msgid "" +"Python methods :meth:`int.to_bytes` and :meth:`int.from_bytes` to convert a :" +"c:type:`PyLongObject` to/from an array of bytes in base ``256``. You can " +"call those from C using :c:func:`PyObject_CallMethod`." +msgstr "" + +#: ../../c-api/long.rst:103 msgid "" "Convert a sequence of Unicode digits in the string *u* to a Python integer " "value." msgstr "" -#: ../../c-api/long.rst:107 +#: ../../c-api/long.rst:111 msgid "" "Create a Python integer from the pointer *p*. The pointer value can be " "retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`." msgstr "" -#: ../../c-api/long.rst:118 ../../c-api/long.rst:136 +#: ../../c-api/long.rst:122 ../../c-api/long.rst:140 msgid "" "Return a C :c:expr:`long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`__index__` method " "(if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:122 +#: ../../c-api/long.rst:126 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "expr:`long`." msgstr "" -#: ../../c-api/long.rst:125 ../../c-api/long.rst:145 ../../c-api/long.rst:166 -#: ../../c-api/long.rst:186 ../../c-api/long.rst:209 +#: ../../c-api/long.rst:129 ../../c-api/long.rst:149 ../../c-api/long.rst:170 +#: ../../c-api/long.rst:190 ../../c-api/long.rst:213 msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:127 ../../c-api/long.rst:147 ../../c-api/long.rst:168 -#: ../../c-api/long.rst:190 ../../c-api/long.rst:274 ../../c-api/long.rst:294 +#: ../../c-api/long.rst:131 ../../c-api/long.rst:151 ../../c-api/long.rst:172 +#: ../../c-api/long.rst:194 ../../c-api/long.rst:278 ../../c-api/long.rst:298 msgid "Use :meth:`__index__` if available." msgstr "" -#: ../../c-api/long.rst:130 ../../c-api/long.rst:150 ../../c-api/long.rst:171 -#: ../../c-api/long.rst:193 ../../c-api/long.rst:277 ../../c-api/long.rst:297 +#: ../../c-api/long.rst:134 ../../c-api/long.rst:154 ../../c-api/long.rst:175 +#: ../../c-api/long.rst:197 ../../c-api/long.rst:281 ../../c-api/long.rst:301 msgid "This function will no longer use :meth:`__int__`." msgstr "" -#: ../../c-api/long.rst:140 +#: ../../c-api/long.rst:144 msgid "" "If the value of *obj* is greater than :const:`LONG_MAX` or less than :const:" "`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " @@ -166,20 +173,20 @@ msgid "" "occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:159 ../../c-api/long.rst:177 +#: ../../c-api/long.rst:163 ../../c-api/long.rst:181 msgid "" "Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`__index__` method " "(if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:163 +#: ../../c-api/long.rst:167 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "expr:`long long`." msgstr "" -#: ../../c-api/long.rst:181 +#: ../../c-api/long.rst:185 msgid "" "If the value of *obj* is greater than :const:`LLONG_MAX` or less than :const:" "`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " @@ -187,133 +194,133 @@ msgid "" "occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:203 +#: ../../c-api/long.rst:207 msgid "" "Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must " "be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:206 +#: ../../c-api/long.rst:210 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`Py_ssize_t`." msgstr "" -#: ../../c-api/long.rst:218 +#: ../../c-api/long.rst:222 msgid "" "Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* " "must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:221 +#: ../../c-api/long.rst:225 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "expr:`unsigned long`." msgstr "" -#: ../../c-api/long.rst:224 +#: ../../c-api/long.rst:228 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:234 +#: ../../c-api/long.rst:238 msgid "" "Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:237 +#: ../../c-api/long.rst:241 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`size_t`." msgstr "" -#: ../../c-api/long.rst:240 +#: ../../c-api/long.rst:244 msgid "" "Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:249 +#: ../../c-api/long.rst:253 msgid "" "Return a C :c:expr:`unsigned long long` representation of *pylong*. " "*pylong* must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:252 +#: ../../c-api/long.rst:256 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :" "c:expr:`unsigned long long`." msgstr "" -#: ../../c-api/long.rst:255 +#: ../../c-api/long.rst:259 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:258 +#: ../../c-api/long.rst:262 msgid "" "A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." msgstr "" -#: ../../c-api/long.rst:264 +#: ../../c-api/long.rst:268 msgid "" "Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is not " "an instance of :c:type:`PyLongObject`, first call its :meth:`__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:268 +#: ../../c-api/long.rst:272 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long`, return " "the reduction of that value modulo ``ULONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:271 +#: ../../c-api/long.rst:275 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:283 +#: ../../c-api/long.rst:287 msgid "" "Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* " "is not an instance of :c:type:`PyLongObject`, first call its :meth:" "`__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:288 +#: ../../c-api/long.rst:292 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long long`, " "return the reduction of that value modulo ``ULLONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:291 +#: ../../c-api/long.rst:295 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " "to disambiguate." msgstr "" -#: ../../c-api/long.rst:303 +#: ../../c-api/long.rst:307 msgid "" "Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:306 +#: ../../c-api/long.rst:310 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "expr:`double`." msgstr "" -#: ../../c-api/long.rst:309 +#: ../../c-api/long.rst:313 msgid "" "Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:314 +#: ../../c-api/long.rst:318 msgid "" "Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If *pylong* " "cannot be converted, an :exc:`OverflowError` will be raised. This is only " @@ -321,7 +328,7 @@ msgid "" "c:func:`PyLong_FromVoidPtr`." msgstr "" -#: ../../c-api/long.rst:319 +#: ../../c-api/long.rst:323 msgid "" "Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" From f8d254f21225f0f7125157dc387366a5c0dd81c1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 28 Jan 2023 00:34:21 +0000 Subject: [PATCH 014/130] sync with cpython 88a1e6db --- library/logging.config.po | 115 ++++++++++++++++++++++++++------------ 1 file changed, 78 insertions(+), 37 deletions(-) diff --git a/library/logging.config.po b/library/logging.config.po index 06e5211737..ebf183ceee 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-01-28 00:32+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -664,19 +664,27 @@ msgstr "" #: ../../library/logging.config.rst:528 msgid "" +"The values for keys such as ``bar``, ``spam`` and ``answer`` in the above " +"example should not be configuration dictionaries or references such as " +"``cfg://foo`` or ``ext://bar``, because they will not be processed by the " +"configuration machinery, but passed to the callable as-is." +msgstr "" + +#: ../../library/logging.config.rst:533 +msgid "" "The key ``'()'`` has been used as the special key because it is not a valid " "keyword parameter name, and so will not clash with the names of the keyword " "arguments used in the call. The ``'()'`` also serves as a mnemonic that the " "corresponding value is a callable." msgstr "" -#: ../../library/logging.config.rst:533 +#: ../../library/logging.config.rst:538 msgid "" "The ``filters`` member of ``handlers`` and ``loggers`` can take filter " "instances in addition to ids." msgstr "" -#: ../../library/logging.config.rst:537 +#: ../../library/logging.config.rst:542 msgid "" "You can also specify a special key ``'.'`` whose value is a dictionary is a " "mapping of attribute names to values. If found, the specified attributes " @@ -684,17 +692,50 @@ msgid "" "following configuration::" msgstr "" -#: ../../library/logging.config.rst:553 +#: ../../library/logging.config.rst:558 msgid "" "the returned formatter will have attribute ``foo`` set to ``'bar'`` and " "attribute ``baz`` set to ``'bozz'``." msgstr "" -#: ../../library/logging.config.rst:560 +#: ../../library/logging.config.rst:561 +msgid "" +"The values for attributes such as ``foo`` and ``baz`` in the above example " +"should not be configuration dictionaries or references such as ``cfg://foo`` " +"or ``ext://bar``, because they will not be processed by the configuration " +"machinery, but set as attribute values as-is." +msgstr "" + +#: ../../library/logging.config.rst:570 +msgid "Handler configuration order" +msgstr "" + +#: ../../library/logging.config.rst:572 +msgid "" +"Handlers are configured in alphabetical order of their keys, and a " +"configured handler replaces the configuration dictionary in (a working copy " +"of) the ``handlers`` dictionary in the schema. If you use a construct such " +"as ``cfg://handlers.foo``, then initially ``handlers['foo']`` points to the " +"configuration dictionary for the handler named ``foo``, and later (once that " +"handler has been configured) it points to the configured handler instance. " +"Thus, ``cfg://handlers.foo`` could resolve to either a dictionary or a " +"handler instance. In general, it is wise to name handlers in a way such that " +"dependent handlers are configured _after_ any handlers they depend on; that " +"allows something like ``cfg://handlers.foo`` to be used in configuring a " +"handler that depends on handler ``foo``. If that dependent handler were " +"named ``bar``, problems would result, because the configuration of ``bar`` " +"would be attempted before that of ``foo``, and ``foo`` would not yet have " +"been configured. However, if the dependent handler were named ``foobar``, it " +"would be configured after ``foo``, with the result that ``cfg://handlers." +"foo`` would resolve to configured handler ``foo``, and not its configuration " +"dictionary." +msgstr "" + +#: ../../library/logging.config.rst:593 msgid "Access to external objects" msgstr "" -#: ../../library/logging.config.rst:562 +#: ../../library/logging.config.rst:595 msgid "" "There are times where a configuration needs to refer to objects external to " "the configuration, for example ``sys.stderr``. If the configuration dict is " @@ -709,7 +750,7 @@ msgid "" "import mechanisms." msgstr "" -#: ../../library/logging.config.rst:575 +#: ../../library/logging.config.rst:608 msgid "" "The handling of such prefixes is done in a way analogous to protocol " "handling: there is a generic mechanism to look for prefixes which match the " @@ -719,11 +760,11 @@ msgid "" "prefix is not recognised, then the string value will be left as-is." msgstr "" -#: ../../library/logging.config.rst:587 +#: ../../library/logging.config.rst:620 msgid "Access to internal objects" msgstr "" -#: ../../library/logging.config.rst:589 +#: ../../library/logging.config.rst:622 msgid "" "As well as external objects, there is sometimes also a need to refer to " "objects in the configuration. This will be done implicitly by the " @@ -734,7 +775,7 @@ msgid "" "and resolve to the appropriate destination object." msgstr "" -#: ../../library/logging.config.rst:597 +#: ../../library/logging.config.rst:630 msgid "" "However, a more generic mechanism is needed for user-defined objects which " "are not known to the :mod:`logging` module. For example, consider :class:" @@ -748,7 +789,7 @@ msgid "" "resolution system allows the user to specify:" msgstr "" -#: ../../library/logging.config.rst:619 +#: ../../library/logging.config.rst:652 msgid "" "The literal string ``'cfg://handlers.file'`` will be resolved in an " "analogous way to strings with the ``ext://`` prefix, but looking in the " @@ -757,7 +798,7 @@ msgid "" "format``. Thus, given the following snippet:" msgstr "" -#: ../../library/logging.config.rst:637 +#: ../../library/logging.config.rst:670 msgid "" "in the configuration, the string ``'cfg://handlers'`` would resolve to the " "dict with key ``handlers``, the string ``'cfg://handlers.email`` would " @@ -773,7 +814,7 @@ msgid "" "to the string value if needed." msgstr "" -#: ../../library/logging.config.rst:651 +#: ../../library/logging.config.rst:684 msgid "" "Given a string ``cfg://handlers.myhandler.mykey.123``, this will resolve to " "``config_dict['handlers']['myhandler']['mykey']['123']``. If the string is " @@ -783,11 +824,11 @@ msgid "" "['mykey']['123']`` if that fails." msgstr "" -#: ../../library/logging.config.rst:663 +#: ../../library/logging.config.rst:696 msgid "Import resolution and custom importers" msgstr "" -#: ../../library/logging.config.rst:665 +#: ../../library/logging.config.rst:698 msgid "" "Import resolution, by default, uses the builtin :func:`__import__` function " "to do its importing. You may want to replace this with your own importing " @@ -799,17 +840,17 @@ msgid "" "instance level, you need to wrap it with :func:`staticmethod`. For example::" msgstr "" -#: ../../library/logging.config.rst:680 +#: ../../library/logging.config.rst:713 msgid "" "You don't need to wrap with :func:`staticmethod` if you're setting the " "import callable on a configurator *instance*." msgstr "" -#: ../../library/logging.config.rst:687 +#: ../../library/logging.config.rst:720 msgid "Configuration file format" msgstr "" -#: ../../library/logging.config.rst:689 +#: ../../library/logging.config.rst:722 msgid "" "The configuration file format understood by :func:`fileConfig` is based on :" "mod:`configparser` functionality. The file must contain sections called " @@ -826,7 +867,7 @@ msgid "" "specified in a section called ``[logger_root]``." msgstr "" -#: ../../library/logging.config.rst:704 +#: ../../library/logging.config.rst:737 msgid "" "The :func:`fileConfig` API is older than the :func:`dictConfig` API and does " "not provide functionality to cover certain aspects of logging. For example, " @@ -839,17 +880,17 @@ msgid "" "when it's convenient to do so." msgstr "" -#: ../../library/logging.config.rst:714 +#: ../../library/logging.config.rst:747 msgid "Examples of these sections in the file are given below." msgstr "" -#: ../../library/logging.config.rst:727 +#: ../../library/logging.config.rst:760 msgid "" "The root logger must specify a level and a list of handlers. An example of a " "root logger section is given below." msgstr "" -#: ../../library/logging.config.rst:736 +#: ../../library/logging.config.rst:769 msgid "" "The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` " "or ``NOTSET``. For the root logger only, ``NOTSET`` means that all messages " @@ -857,7 +898,7 @@ msgid "" "of the ``logging`` package's namespace." msgstr "" -#: ../../library/logging.config.rst:741 +#: ../../library/logging.config.rst:774 msgid "" "The ``handlers`` entry is a comma-separated list of handler names, which " "must appear in the ``[handlers]`` section. These names must appear in the " @@ -865,13 +906,13 @@ msgid "" "file." msgstr "" -#: ../../library/logging.config.rst:746 +#: ../../library/logging.config.rst:779 msgid "" "For loggers other than the root logger, some additional information is " "required. This is illustrated by the following example." msgstr "" -#: ../../library/logging.config.rst:757 +#: ../../library/logging.config.rst:790 msgid "" "The ``level`` and ``handlers`` entries are interpreted as for the root " "logger, except that if a non-root logger's level is specified as ``NOTSET``, " @@ -884,20 +925,20 @@ msgid "" "application to get the logger." msgstr "" -#: ../../library/logging.config.rst:766 +#: ../../library/logging.config.rst:799 msgid "" "Sections which specify handler configuration are exemplified by the " "following." msgstr "" -#: ../../library/logging.config.rst:776 +#: ../../library/logging.config.rst:809 msgid "" "The ``class`` entry indicates the handler's class (as determined by :func:" "`eval` in the ``logging`` package's namespace). The ``level`` is interpreted " "as for loggers, and ``NOTSET`` is taken to mean 'log everything'." msgstr "" -#: ../../library/logging.config.rst:780 +#: ../../library/logging.config.rst:813 msgid "" "The ``formatter`` entry indicates the key name of the formatter for this " "handler. If blank, a default formatter (``logging._defaultFormatter``) is " @@ -905,7 +946,7 @@ msgid "" "and have a corresponding section in the configuration file." msgstr "" -#: ../../library/logging.config.rst:785 +#: ../../library/logging.config.rst:818 msgid "" "The ``args`` entry, when :ref:`evaluated ` in the context of the " "``logging`` package's namespace, is the list of arguments to the constructor " @@ -914,7 +955,7 @@ msgid "" "provided, it defaults to ``()``." msgstr "" -#: ../../library/logging.config.rst:791 +#: ../../library/logging.config.rst:824 msgid "" "The optional ``kwargs`` entry, when :ref:`evaluated ` in the " "context of the ``logging`` package's namespace, is the keyword argument dict " @@ -922,19 +963,19 @@ msgid "" "``{}``." msgstr "" -#: ../../library/logging.config.rst:848 +#: ../../library/logging.config.rst:881 msgid "" "Sections which specify formatter configuration are typified by the following." msgstr "" -#: ../../library/logging.config.rst:859 +#: ../../library/logging.config.rst:892 msgid "" "The arguments for the formatter configuration are the same as the keys in " "the dictionary schema :ref:`formatters section `." msgstr "" -#: ../../library/logging.config.rst:865 +#: ../../library/logging.config.rst:898 msgid "" "Due to the use of :func:`eval` as described above, there are potential " "security risks which result from using the :func:`listen` to send and " @@ -943,18 +984,18 @@ msgid "" "`listen` documentation for more information." msgstr "" -#: ../../library/logging.config.rst:874 +#: ../../library/logging.config.rst:907 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.config.rst:874 +#: ../../library/logging.config.rst:907 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.config.rst:876 +#: ../../library/logging.config.rst:909 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../library/logging.config.rst:877 +#: ../../library/logging.config.rst:910 msgid "Useful handlers included with the logging module." msgstr "" From b2c4cb5c3640b14fe4f25dfbed15c64bbef16216 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 30 Jan 2023 00:30:17 +0000 Subject: [PATCH 015/130] sync with cpython 34679913 --- using/windows.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/using/windows.po b/using/windows.po index e46e2c99fe..b9293164d3 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-17 00:16+0000\n" +"POT-Creation-Date: 2023-01-30 00:28+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1292,7 +1292,7 @@ msgid "" "Re-executing the command should now print the latest Python 3.x information. " "As with the above command-line examples, you can specify a more explicit " "version qualifier. Assuming you have Python 3.7 installed, try changing the " -"first line to ``#! python3.7`` and you should find the |version| version " +"first line to ``#! python3.7`` and you should find the 3.7 version " "information printed." msgstr "" From e8753b8569c2ca96a3d202f4c6df44c49774bd02 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 31 Jan 2023 00:35:56 +0000 Subject: [PATCH 016/130] sync with cpython faf8068d --- library/pathlib.po | 190 +++++++++++++++++++++++---------------------- 1 file changed, 98 insertions(+), 92 deletions(-) diff --git a/library/pathlib.po b/library/pathlib.po index 388563f8a7..7c4b0c2c4a 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-21 00:16+0000\n" +"POT-Creation-Date: 2023-01-31 00:34+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -591,7 +591,7 @@ msgid "" "arguments ``self``, ``pattern``." msgstr "" -#: ../../library/pathlib.rst:851 ../../library/pathlib.rst:1144 +#: ../../library/pathlib.rst:851 ../../library/pathlib.rst:1146 msgid "" "Return only directories if *pattern* ends with a pathname components " "separator (:data:`~os.sep` or :data:`~os.altsep`)." @@ -773,43 +773,49 @@ msgid "" "either a string or another path object::" msgstr "" -#: ../../library/pathlib.rst:1070 ../../library/pathlib.rst:1084 +#: ../../library/pathlib.rst:1070 ../../library/pathlib.rst:1086 msgid "" "The target path may be absolute or relative. Relative paths are interpreted " "relative to the current working directory, *not* the directory of the Path " "object." msgstr "" -#: ../../library/pathlib.rst:1074 ../../library/pathlib.rst:1088 +#: ../../library/pathlib.rst:1074 +msgid "" +"It is implemented in terms of :func:`os.rename` and gives the same " +"guarantees." +msgstr "" + +#: ../../library/pathlib.rst:1076 ../../library/pathlib.rst:1090 msgid "Added return value, return the new Path instance." msgstr "" -#: ../../library/pathlib.rst:1080 +#: ../../library/pathlib.rst:1082 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. If *target* points to an existing file or " "empty directory, it will be unconditionally replaced." msgstr "" -#: ../../library/pathlib.rst:1094 +#: ../../library/pathlib.rst:1096 msgid "" "Make the path absolute, without normalization or resolving symlinks. Returns " "a new path object::" msgstr "" -#: ../../library/pathlib.rst:1106 +#: ../../library/pathlib.rst:1108 msgid "" "Make the path absolute, resolving any symlinks. A new path object is " "returned::" msgstr "" -#: ../../library/pathlib.rst:1115 +#: ../../library/pathlib.rst:1117 msgid "" "\"``..``\" components are also eliminated (this is the only method to do " "so)::" msgstr "" -#: ../../library/pathlib.rst:1121 +#: ../../library/pathlib.rst:1123 msgid "" "If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError` " "is raised. If *strict* is ``False``, the path is resolved as far as " @@ -818,11 +824,11 @@ msgid "" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:1127 +#: ../../library/pathlib.rst:1129 msgid "The *strict* argument (pre-3.6 behavior is strict)." msgstr "" -#: ../../library/pathlib.rst:1132 +#: ../../library/pathlib.rst:1134 msgid "" "This is like calling :func:`Path.glob` with \"``**/``\" added in front of " "the given relative *pattern*::" @@ -834,49 +840,49 @@ msgid "" "arguments ``self``, ``pattern``." msgstr "" -#: ../../library/pathlib.rst:1150 +#: ../../library/pathlib.rst:1152 msgid "Remove this directory. The directory must be empty." msgstr "" -#: ../../library/pathlib.rst:1155 +#: ../../library/pathlib.rst:1157 msgid "" "Return whether this path points to the same file as *other_path*, which can " "be either a Path object, or a string. The semantics are similar to :func:" "`os.path.samefile` and :func:`os.path.samestat`." msgstr "" -#: ../../library/pathlib.rst:1159 +#: ../../library/pathlib.rst:1161 msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." msgstr "" -#: ../../library/pathlib.rst:1176 +#: ../../library/pathlib.rst:1178 msgid "" "Make this path a symbolic link to *target*. Under Windows, " "*target_is_directory* must be true (default ``False``) if the link's target " "is a directory. Under POSIX, *target_is_directory*'s value is ignored." msgstr "" -#: ../../library/pathlib.rst:1192 +#: ../../library/pathlib.rst:1194 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." msgstr "" -#: ../../library/pathlib.rst:1197 +#: ../../library/pathlib.rst:1199 msgid "Make this path a hard link to the same file as *target*." msgstr "" -#: ../../library/pathlib.rst:1200 +#: ../../library/pathlib.rst:1202 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." msgstr "" -#: ../../library/pathlib.rst:1207 +#: ../../library/pathlib.rst:1209 msgid "Make *target* a hard link to this path." msgstr "" -#: ../../library/pathlib.rst:1211 +#: ../../library/pathlib.rst:1213 msgid "" "This function does not make this path a hard link to *target*, despite the " "implication of the function and argument names. The argument order (target, " @@ -884,14 +890,14 @@ msgid "" "hardlink_to`, but matches that of :func:`os.link`." msgstr "" -#: ../../library/pathlib.rst:1220 +#: ../../library/pathlib.rst:1222 msgid "" "This method is deprecated in favor of :meth:`Path.hardlink_to`, as the " "argument order of :meth:`Path.link_to` does not match that of :meth:`Path." "symlink_to`." msgstr "" -#: ../../library/pathlib.rst:1227 +#: ../../library/pathlib.rst:1229 msgid "" "Create a file at this given path. If *mode* is given, it is combined with " "the process' ``umask`` value to determine the file mode and access flags. " @@ -900,65 +906,65 @@ msgid "" "`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:1236 +#: ../../library/pathlib.rst:1238 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" -#: ../../library/pathlib.rst:1239 +#: ../../library/pathlib.rst:1241 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." msgstr "" -#: ../../library/pathlib.rst:1242 +#: ../../library/pathlib.rst:1244 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." msgstr "" -#: ../../library/pathlib.rst:1245 +#: ../../library/pathlib.rst:1247 msgid "The *missing_ok* parameter was added." msgstr "新增 *missing_ok* 參數。" -#: ../../library/pathlib.rst:1251 +#: ../../library/pathlib.rst:1253 msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1260 +#: ../../library/pathlib.rst:1262 msgid "An existing file of the same name is overwritten." msgstr "" -#: ../../library/pathlib.rst:1267 +#: ../../library/pathlib.rst:1269 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1276 +#: ../../library/pathlib.rst:1278 msgid "" "An existing file of the same name is overwritten. The optional parameters " "have the same meaning as in :func:`open`." msgstr "" -#: ../../library/pathlib.rst:1281 +#: ../../library/pathlib.rst:1283 msgid "The *newline* parameter was added." msgstr "新增 *newline* 參數。" -#: ../../library/pathlib.rst:1285 +#: ../../library/pathlib.rst:1287 msgid "Correspondence to tools in the :mod:`os` module" msgstr "" -#: ../../library/pathlib.rst:1287 +#: ../../library/pathlib.rst:1289 msgid "" "Below is a table mapping various :mod:`os` functions to their corresponding :" "class:`PurePath`/:class:`Path` equivalent." msgstr "" -#: ../../library/pathlib.rst:1292 +#: ../../library/pathlib.rst:1294 msgid "" "Not all pairs of functions/methods below are equivalent. Some of them, " "despite having some overlapping use-cases, have different semantics. They " @@ -966,237 +972,237 @@ msgid "" "relpath` and :meth:`PurePath.relative_to`." msgstr "" -#: ../../library/pathlib.rst:1298 +#: ../../library/pathlib.rst:1300 msgid ":mod:`os` and :mod:`os.path`" msgstr ":mod:`os` 和 :mod:`os.path`" -#: ../../library/pathlib.rst:1298 +#: ../../library/pathlib.rst:1300 msgid ":mod:`pathlib`" msgstr ":mod:`pathlib`" -#: ../../library/pathlib.rst:1300 +#: ../../library/pathlib.rst:1302 msgid ":func:`os.path.abspath`" msgstr ":func:`os.path.abspath`" -#: ../../library/pathlib.rst:1300 +#: ../../library/pathlib.rst:1302 msgid ":meth:`Path.absolute` [#]_" msgstr ":meth:`Path.absolute` [#]_" -#: ../../library/pathlib.rst:1301 +#: ../../library/pathlib.rst:1303 msgid ":func:`os.path.realpath`" msgstr ":func:`os.path.realpath`" -#: ../../library/pathlib.rst:1301 +#: ../../library/pathlib.rst:1303 msgid ":meth:`Path.resolve`" msgstr ":meth:`Path.resolve`" -#: ../../library/pathlib.rst:1302 +#: ../../library/pathlib.rst:1304 msgid ":func:`os.chmod`" msgstr ":func:`os.chmod`" -#: ../../library/pathlib.rst:1302 +#: ../../library/pathlib.rst:1304 msgid ":meth:`Path.chmod`" msgstr ":meth:`Path.chmod`" -#: ../../library/pathlib.rst:1303 +#: ../../library/pathlib.rst:1305 msgid ":func:`os.mkdir`" msgstr ":func:`os.mkdir`" -#: ../../library/pathlib.rst:1303 ../../library/pathlib.rst:1304 +#: ../../library/pathlib.rst:1305 ../../library/pathlib.rst:1306 msgid ":meth:`Path.mkdir`" msgstr ":meth:`Path.mkdir`" -#: ../../library/pathlib.rst:1304 +#: ../../library/pathlib.rst:1306 msgid ":func:`os.makedirs`" msgstr ":func:`os.makedirs`" -#: ../../library/pathlib.rst:1305 +#: ../../library/pathlib.rst:1307 msgid ":func:`os.rename`" msgstr ":func:`os.rename`" -#: ../../library/pathlib.rst:1305 +#: ../../library/pathlib.rst:1307 msgid ":meth:`Path.rename`" msgstr ":meth:`Path.rename`" -#: ../../library/pathlib.rst:1306 +#: ../../library/pathlib.rst:1308 msgid ":func:`os.replace`" msgstr ":func:`os.replace`" -#: ../../library/pathlib.rst:1306 +#: ../../library/pathlib.rst:1308 msgid ":meth:`Path.replace`" msgstr ":meth:`Path.replace`" -#: ../../library/pathlib.rst:1307 +#: ../../library/pathlib.rst:1309 msgid ":func:`os.rmdir`" msgstr ":func:`os.rmdir`" -#: ../../library/pathlib.rst:1307 +#: ../../library/pathlib.rst:1309 msgid ":meth:`Path.rmdir`" msgstr ":meth:`Path.rmdir`" -#: ../../library/pathlib.rst:1308 +#: ../../library/pathlib.rst:1310 msgid ":func:`os.remove`, :func:`os.unlink`" msgstr ":func:`os.remove`, :func:`os.unlink`" -#: ../../library/pathlib.rst:1308 +#: ../../library/pathlib.rst:1310 msgid ":meth:`Path.unlink`" msgstr ":meth:`Path.unlink`" -#: ../../library/pathlib.rst:1309 +#: ../../library/pathlib.rst:1311 msgid ":func:`os.getcwd`" msgstr ":func:`os.getcwd`" -#: ../../library/pathlib.rst:1309 +#: ../../library/pathlib.rst:1311 msgid ":func:`Path.cwd`" msgstr ":func:`Path.cwd`" -#: ../../library/pathlib.rst:1310 +#: ../../library/pathlib.rst:1312 msgid ":func:`os.path.exists`" msgstr ":func:`os.path.exists`" -#: ../../library/pathlib.rst:1310 +#: ../../library/pathlib.rst:1312 msgid ":meth:`Path.exists`" msgstr ":meth:`Path.exists`" -#: ../../library/pathlib.rst:1311 +#: ../../library/pathlib.rst:1313 msgid ":func:`os.path.expanduser`" msgstr ":func:`os.path.expanduser`" -#: ../../library/pathlib.rst:1311 +#: ../../library/pathlib.rst:1313 msgid ":meth:`Path.expanduser` and :meth:`Path.home`" msgstr ":meth:`Path.expanduser` 和 :meth:`Path.home`" -#: ../../library/pathlib.rst:1313 +#: ../../library/pathlib.rst:1315 msgid ":func:`os.listdir`" msgstr ":func:`os.listdir`" -#: ../../library/pathlib.rst:1313 +#: ../../library/pathlib.rst:1315 msgid ":meth:`Path.iterdir`" msgstr ":meth:`Path.iterdir`" -#: ../../library/pathlib.rst:1314 +#: ../../library/pathlib.rst:1316 msgid ":func:`os.path.isdir`" msgstr ":func:`os.path.isdir`" -#: ../../library/pathlib.rst:1314 +#: ../../library/pathlib.rst:1316 msgid ":meth:`Path.is_dir`" msgstr ":meth:`Path.is_dir`" -#: ../../library/pathlib.rst:1315 +#: ../../library/pathlib.rst:1317 msgid ":func:`os.path.isfile`" msgstr ":func:`os.path.isfile`" -#: ../../library/pathlib.rst:1315 +#: ../../library/pathlib.rst:1317 msgid ":meth:`Path.is_file`" msgstr ":meth:`Path.is_file`" -#: ../../library/pathlib.rst:1316 +#: ../../library/pathlib.rst:1318 msgid ":func:`os.path.islink`" msgstr ":func:`os.path.islink`" -#: ../../library/pathlib.rst:1316 +#: ../../library/pathlib.rst:1318 msgid ":meth:`Path.is_symlink`" msgstr ":meth:`Path.is_symlink`" -#: ../../library/pathlib.rst:1317 +#: ../../library/pathlib.rst:1319 msgid ":func:`os.link`" msgstr ":func:`os.link`" -#: ../../library/pathlib.rst:1317 +#: ../../library/pathlib.rst:1319 msgid ":meth:`Path.hardlink_to`" msgstr ":meth:`Path.hardlink_to`" -#: ../../library/pathlib.rst:1318 +#: ../../library/pathlib.rst:1320 msgid ":func:`os.symlink`" msgstr ":func:`os.symlink`" -#: ../../library/pathlib.rst:1318 +#: ../../library/pathlib.rst:1320 msgid ":meth:`Path.symlink_to`" msgstr ":meth:`Path.symlink_to`" -#: ../../library/pathlib.rst:1319 +#: ../../library/pathlib.rst:1321 msgid ":func:`os.readlink`" msgstr ":func:`os.readlink`" -#: ../../library/pathlib.rst:1319 +#: ../../library/pathlib.rst:1321 msgid ":meth:`Path.readlink`" msgstr ":meth:`Path.readlink`" -#: ../../library/pathlib.rst:1320 +#: ../../library/pathlib.rst:1322 msgid ":func:`os.path.relpath`" msgstr ":func:`os.path.relpath`" -#: ../../library/pathlib.rst:1320 +#: ../../library/pathlib.rst:1322 msgid ":meth:`PurePath.relative_to` [#]_" msgstr ":meth:`PurePath.relative_to` [#]_" -#: ../../library/pathlib.rst:1321 +#: ../../library/pathlib.rst:1323 msgid ":func:`os.stat`" msgstr ":func:`os.stat`" -#: ../../library/pathlib.rst:1321 +#: ../../library/pathlib.rst:1323 msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" msgstr ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" -#: ../../library/pathlib.rst:1324 +#: ../../library/pathlib.rst:1326 msgid ":func:`os.path.isabs`" msgstr ":func:`os.path.isabs`" -#: ../../library/pathlib.rst:1324 +#: ../../library/pathlib.rst:1326 msgid ":meth:`PurePath.is_absolute`" msgstr ":meth:`PurePath.is_absolute`" -#: ../../library/pathlib.rst:1325 +#: ../../library/pathlib.rst:1327 msgid ":func:`os.path.join`" msgstr ":func:`os.path.join`" -#: ../../library/pathlib.rst:1325 +#: ../../library/pathlib.rst:1327 msgid ":func:`PurePath.joinpath`" msgstr ":func:`PurePath.joinpath`" -#: ../../library/pathlib.rst:1326 +#: ../../library/pathlib.rst:1328 msgid ":func:`os.path.basename`" msgstr ":func:`os.path.basename`" -#: ../../library/pathlib.rst:1326 +#: ../../library/pathlib.rst:1328 msgid ":attr:`PurePath.name`" msgstr ":attr:`PurePath.name`" -#: ../../library/pathlib.rst:1327 +#: ../../library/pathlib.rst:1329 msgid ":func:`os.path.dirname`" msgstr ":func:`os.path.dirname`" -#: ../../library/pathlib.rst:1327 +#: ../../library/pathlib.rst:1329 msgid ":attr:`PurePath.parent`" msgstr ":attr:`PurePath.parent`" -#: ../../library/pathlib.rst:1328 +#: ../../library/pathlib.rst:1330 msgid ":func:`os.path.samefile`" msgstr ":func:`os.path.samefile`" -#: ../../library/pathlib.rst:1328 +#: ../../library/pathlib.rst:1330 msgid ":meth:`Path.samefile`" msgstr ":meth:`Path.samefile`" -#: ../../library/pathlib.rst:1329 +#: ../../library/pathlib.rst:1331 msgid ":func:`os.path.splitext`" msgstr ":func:`os.path.splitext`" -#: ../../library/pathlib.rst:1329 +#: ../../library/pathlib.rst:1331 msgid ":attr:`PurePath.stem` and :attr:`PurePath.suffix`" msgstr ":attr:`PurePath.stem` 和 :attr:`PurePath.suffix`" -#: ../../library/pathlib.rst:1334 +#: ../../library/pathlib.rst:1336 msgid "Footnotes" msgstr "註解" -#: ../../library/pathlib.rst:1335 +#: ../../library/pathlib.rst:1337 msgid "" ":func:`os.path.abspath` normalizes the resulting path, which may change its " "meaning in the presence of symlinks, while :meth:`Path.absolute` does not." msgstr "" -#: ../../library/pathlib.rst:1336 +#: ../../library/pathlib.rst:1338 msgid "" ":meth:`PurePath.relative_to` requires ``self`` to be the subpath of the " "argument, but :func:`os.path.relpath` does not." From 56fc87508de8b735541ce7a4bde3d459d97fc63a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 1 Feb 2023 00:39:01 +0000 Subject: [PATCH 017/130] sync with cpython 5e498072 --- faq/general.po | 19 ++++++++++--------- library/os.path.po | 12 ++++++------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/faq/general.po b/faq/general.po index c87261f00d..27c8d7a7b7 100644 --- a/faq/general.po +++ b/faq/general.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-01 00:37+0000\n" "PO-Revision-Date: 2022-10-16 06:51+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -506,9 +506,10 @@ msgid "It's probably best to cite your favorite book about Python." msgstr "也許最好是引用你最喜歡的關於 Python 的書。" #: ../../faq/general.rst:251 +#, fuzzy msgid "" -"The very first article about Python was written in 1991 and is now quite " -"outdated." +"The `very first article `_ about Python was " +"written in 1991 and is now quite outdated." msgstr "最早討論 Python 的文章是在 1991 年寫的,但現在來看已經過時了。" #: ../../faq/general.rst:254 @@ -675,10 +676,10 @@ msgid "" "administration software in Python. Companies that use Python internally " "include Google, Yahoo, and Lucasfilm Ltd." msgstr "" -"備受矚目的 Python 專案包括 `Mailman 郵件討論群管理員 `_" -"\\ 和 `Zope 應用程式伺服器 `_。有一些 Linux 發行版,最" -"著名的是 `Red Hat `_,已經用 Python 編寫了部分或全部" -"的安裝程式及系統管理軟體。內部使用 Python 的公司包括 Google、Yahoo 和 " +"備受矚目的 Python 專案包括 `Mailman 郵件討論群管理員 `_\\ 和 `Zope 應用程式伺服器 `_。有一些 Linux 發行" +"版,最著名的是 `Red Hat `_,已經用 Python 編寫了部分" +"或全部的安裝程式及系統管理軟體。內部使用 Python 的公司包括 Google、Yahoo 和 " "Lucasfilm Ltd。" #: ../../faq/general.rst:346 @@ -805,8 +806,8 @@ msgid "" "can't remember the methods for a list, they can do something like this::" msgstr "" "Python 的互動式直譯器使學生能夠在程式設計時測試語言的功能。他們可以開著一個運" -"行直譯器的視窗,同時在另一個視窗中輸入他們的程式原始碼。如果他們不記得 " -"list(串列)的 method(方法),他們可以像這樣做:\n" +"行直譯器的視窗,同時在另一個視窗中輸入他們的程式原始碼。如果他們不記得 list" +"(串列)的 method(方法),他們可以像這樣做:\n" "\n" "::" diff --git a/library/os.path.po b/library/os.path.po index cc57a77576..851efcdb4e 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-09 00:17+0000\n" +"POT-Creation-Date: 2023-02-01 00:37+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -302,11 +302,11 @@ msgstr "" msgid "" "Join one or more path segments intelligently. The return value is the " "concatenation of *path* and all members of *\\*paths*, with exactly one " -"directory separator following each non-empty part except the last. That is, " -"if the last part is empty, the result will end in a separator. If a segment " -"is an absolute path (which on Windows requires both a drive and a root), " -"then all previous segments are ignored and joining continues from the " -"absolute path segment." +"directory separator following each non-empty part, except the last. That is, " +"the result will only end in a separator if the last part is either empty or " +"ends in a separator. If a segment is an absolute path (which on Windows " +"requires both a drive and a root), then all previous segments are ignored " +"and joining continues from the absolute path segment." msgstr "" #: ../../library/os.path.rst:308 From 1ce354ef93cbf310d6f012af84d009f1a9d80b76 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Feb 2023 00:35:45 +0000 Subject: [PATCH 018/130] sync with cpython c2c970fc --- library/array.po | 85 ++++--- library/dis.po | 317 ++++++++++++----------- library/sqlite3.po | 616 +++++++++++++++++++++++---------------------- using/windows.po | 312 ++++++++++++----------- 4 files changed, 679 insertions(+), 651 deletions(-) diff --git a/library/array.po b/library/array.po index 180e47351f..e6eb3cadde 100644 --- a/library/array.po +++ b/library/array.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-02 00:33+0000\n" "PO-Revision-Date: 2021-11-23 18:40+0800\n" "Last-Translator: Benson Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -229,10 +229,19 @@ msgstr "" "實際的大小可以透過 :attr:`itemsize` 屬性存取。" #: ../../library/array.rst:65 -msgid "The module defines the following type:" +#, fuzzy +msgid "The module defines the following item:" msgstr "這個模組定義了下方的型別:" #: ../../library/array.rst:70 +msgid "A string with all available type codes." +msgstr "一個包含所有可用的 type codes 的字串。" + +#: ../../library/array.rst:73 +msgid "The module defines the following type:" +msgstr "這個模組定義了下方的型別:" + +#: ../../library/array.rst:78 msgid "" "A new array whose items are restricted by *typecode*, and initialized from " "the optional *initializer* value, which must be a list, a :term:`bytes-like " @@ -242,7 +251,7 @@ msgstr "" "化,\\ *initializer* 必須是一個 list、\\ :term:`bytes-like object`\\ (類位元" "組串物件)或包含適當型別變數的可疊代物件 (iterable)。" -#: ../../library/array.rst:75 +#: ../../library/array.rst:83 msgid "" "If given a list or string, the initializer is passed to the new array's :" "meth:`fromlist`, :meth:`frombytes`, or :meth:`fromunicode` method (see " @@ -261,11 +270,7 @@ msgstr "" "引發\\ :ref:`稽核事件 (auditing event) ` ``array.__new__`` 並帶入引" "數 ``typecode``\\ 、\\ ``initializer``\\。" -#: ../../library/array.rst:84 -msgid "A string with all available type codes." -msgstr "一個包含所有可用的 type codes 的字串。" - -#: ../../library/array.rst:86 +#: ../../library/array.rst:91 msgid "" "Array objects support the ordinary sequence operations of indexing, slicing, " "concatenation, and multiplication. When using slice assignment, the " @@ -280,23 +285,23 @@ msgstr "" "實作了緩衝區介面,可以在任何支援 :term:`bytes-like objects ` 的地方使用。" -#: ../../library/array.rst:92 +#: ../../library/array.rst:97 msgid "The following data items and methods are also supported:" msgstr "提供下方的資料物件與方法:" -#: ../../library/array.rst:96 +#: ../../library/array.rst:101 msgid "The typecode character used to create the array." msgstr "typecode 字元被用在建立陣列時。" -#: ../../library/array.rst:101 +#: ../../library/array.rst:106 msgid "The length in bytes of one array item in the internal representation." msgstr "陣列當中的一個元素在內部需要的位元組長度。" -#: ../../library/array.rst:106 +#: ../../library/array.rst:111 msgid "Append a new item with value *x* to the end of the array." msgstr "新增一個元素 *x* 到陣列的最尾端。" -#: ../../library/array.rst:111 +#: ../../library/array.rst:116 msgid "" "Return a tuple ``(address, length)`` giving the current memory address and " "the length in elements of the buffer used to hold array's contents. The " @@ -313,7 +318,7 @@ msgstr "" "用,例如 :c:func:`ioctl` 指令。只要陣列存在且沒有使用任何更改長度的操作時,回" "傳的數值就有效。" -#: ../../library/array.rst:121 +#: ../../library/array.rst:126 msgid "" "When using array objects from code written in C or C++ (the only way to " "effectively make use of this information), it makes more sense to use the " @@ -325,7 +330,7 @@ msgstr "" "適當的做法是使用陣列物件支援的緩衝區介面。這個方法維護了向後兼容性,並應該在" "新的程式碼中避免。關於緩衝區介面的文件在\\ :ref:`bufferobjects`\\ 。" -#: ../../library/array.rst:130 +#: ../../library/array.rst:135 msgid "" "\"Byteswap\" all items of the array. This is only supported for values " "which are 1, 2, 4, or 8 bytes in size; for other types of values, :exc:" @@ -336,11 +341,11 @@ msgstr "" "列,其他型別的值會導致 :exc:`RuntimeError`\\ 。這在從機器讀取位元順序不同的檔" "案時很有用。" -#: ../../library/array.rst:138 +#: ../../library/array.rst:143 msgid "Return the number of occurrences of *x* in the array." msgstr "回傳 *x* 在陣列中出現了幾次。" -#: ../../library/array.rst:143 +#: ../../library/array.rst:148 msgid "" "Append items from *iterable* to the end of the array. If *iterable* is " "another array, it must have *exactly* the same type code; if not, :exc:" @@ -352,7 +357,7 @@ msgstr "" "是一個陣列,它必須可以被疊代 (iterable) 且其中的元素必須是可以被加入陣列中的" "正確型別。" -#: ../../library/array.rst:151 +#: ../../library/array.rst:156 msgid "" "Appends items from the string, interpreting the string as an array of " "machine values (as if it had been read from a file using the :meth:" @@ -361,11 +366,11 @@ msgstr "" "從字串中新增元素。讀取時會將字串當作一個機器數值組成的陣列(就像從檔案中使" "用 :meth:`fromfile` 方法讀出的資料)。" -#: ../../library/array.rst:154 +#: ../../library/array.rst:159 msgid ":meth:`fromstring` is renamed to :meth:`frombytes` for clarity." msgstr "將 :meth:`fromstring` 更名為 :meth:`frombytes`\\ ,使其更加清晰易懂。" -#: ../../library/array.rst:160 +#: ../../library/array.rst:165 msgid "" "Read *n* items (as machine values) from the :term:`file object` *f* and " "append them to the end of the array. If less than *n* items are available, :" @@ -376,7 +381,7 @@ msgstr "" "入陣列的最尾端。如果只有少於 *n* 個有效的元素會導致 :exc:`EOFError`\\ ,但有" "效的元素仍然會被加入陣列中。" -#: ../../library/array.rst:168 +#: ../../library/array.rst:173 msgid "" "Append items from the list. This is equivalent to ``for x in list: a." "append(x)`` except that if there is a type error, the array is unchanged." @@ -384,7 +389,7 @@ msgstr "" "從 list 中新增元素。這等價於 ``for x in list: a.append(x)``\\ ,除了有型別錯" "誤產生時,陣列會保持原狀不會被更改。" -#: ../../library/array.rst:174 +#: ../../library/array.rst:179 msgid "" "Extends this array with data from the given unicode string. The array must " "be a type ``'u'`` array; otherwise a :exc:`ValueError` is raised. Use " @@ -395,7 +400,7 @@ msgstr "" "導致 :exc:`ValueError` 錯誤。使用 ``array.frombytes(unicodestring." "encode(enc))`` 來新增 Unicode 資料到一個其他型別的陣列。" -#: ../../library/array.rst:182 +#: ../../library/array.rst:187 msgid "" "Return the smallest *i* such that *i* is the index of the first occurrence " "of *x* in the array. The optional arguments *start* and *stop* can be " @@ -406,17 +411,17 @@ msgstr "" "數 *start* 及 *stop* 則可以被用來在指定的陣列空間中搜尋 *x*\\ 。如果 *x* 不存" "在將導致 :exc:`ValueError`\\ 。" -#: ../../library/array.rst:187 +#: ../../library/array.rst:192 msgid "Added optional *start* and *stop* parameters." msgstr "新增選擇性的參數 *start* 及 *stop*\\ 。" -#: ../../library/array.rst:192 +#: ../../library/array.rst:197 msgid "" "Insert a new item with value *x* in the array before position *i*. Negative " "values are treated as being relative to the end of the array." msgstr "在位置 *i* 之前插入一個元素 *x*\\ 。負數的索引值會從陣列尾端開始數。" -#: ../../library/array.rst:198 +#: ../../library/array.rst:203 msgid "" "Removes the item with the index *i* from the array and returns it. The " "optional argument defaults to ``-1``, so that by default the last item is " @@ -425,15 +430,15 @@ msgstr "" "移除並回傳陣列索引值 *i* 的元素。選擇性的引數 *i* 預設為 ``-1``\\ ,所以預設" "會刪除並回傳最後一個元素。" -#: ../../library/array.rst:205 +#: ../../library/array.rst:210 msgid "Remove the first occurrence of *x* from the array." msgstr "從陣列中刪除第一個出現的 *x*\\ 。" -#: ../../library/array.rst:210 +#: ../../library/array.rst:215 msgid "Reverse the order of the items in the array." msgstr "反轉陣列中元素的順序。" -#: ../../library/array.rst:215 +#: ../../library/array.rst:220 msgid "" "Convert the array to an array of machine values and return the bytes " "representation (the same sequence of bytes that would be written to a file " @@ -442,19 +447,19 @@ msgstr "" "將陣列轉為另一個機器數值組成的陣列並回傳它的位元組表示(跟用 :meth:`tofile` " "方法寫入檔案時的位元序列相同)。" -#: ../../library/array.rst:219 +#: ../../library/array.rst:224 msgid ":meth:`tostring` is renamed to :meth:`tobytes` for clarity." msgstr "為了明確性,過去的 :meth:`tostring` 已更名為 :meth:`tobytes`\\ 。" -#: ../../library/array.rst:225 +#: ../../library/array.rst:230 msgid "Write all items (as machine values) to the :term:`file object` *f*." msgstr "將所有元素(作為機器數值)寫入 :term:`file object` *f*\\ 。" -#: ../../library/array.rst:230 +#: ../../library/array.rst:235 msgid "Convert the array to an ordinary list with the same items." msgstr "不更改元素,將陣列轉為一般的 list。" -#: ../../library/array.rst:235 +#: ../../library/array.rst:240 msgid "" "Convert the array to a unicode string. The array must be a type ``'u'`` " "array; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes()." @@ -464,7 +469,7 @@ msgstr "" "`ValueError` 錯誤。使用 ``array.tobytes().decode(enc)`` 將其他型別的陣列轉為" "字串。" -#: ../../library/array.rst:240 +#: ../../library/array.rst:245 msgid "" "When an array object is printed or converted to a string, it is represented " "as ``array(typecode, initializer)``. The *initializer* is omitted if the " @@ -482,19 +487,19 @@ msgstr "" "\n" "::" -#: ../../library/array.rst:257 +#: ../../library/array.rst:262 msgid "Module :mod:`struct`" msgstr ":mod:`struct` 模組" -#: ../../library/array.rst:257 +#: ../../library/array.rst:262 msgid "Packing and unpacking of heterogeneous binary data." msgstr "將包含不同資料類型的二進位資料包裝與解開包裝。" -#: ../../library/array.rst:261 +#: ../../library/array.rst:266 msgid "Module :mod:`xdrlib`" msgstr ":mod:`xdrlib` 模組" -#: ../../library/array.rst:260 +#: ../../library/array.rst:265 msgid "" "Packing and unpacking of External Data Representation (XDR) data as used in " "some remote procedure call systems." @@ -502,10 +507,10 @@ msgstr "" "將 External Data Representation (XDR) 的資料包裝與解開包裝,這用在一些遠端操" "作的系統 (remote procedure call systems)。" -#: ../../library/array.rst:263 +#: ../../library/array.rst:268 msgid "`NumPy `_" msgstr "`NumPy `_" -#: ../../library/array.rst:264 +#: ../../library/array.rst:269 msgid "The NumPy package defines another array type." msgstr "NumPy 套件定義了另一個陣列型別" diff --git a/library/dis.po b/library/dis.po index 8c777742e8..f7174b1207 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-02 00:33+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -601,56 +601,55 @@ msgstr "" #: ../../library/dis.rst:565 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " -"awaiting a next item. If TOS is :exc:`StopAsyncIteration` pop 3 values from " -"the stack and restore the exception state using the second of them. " -"Otherwise re-raise the exception using the value from the stack. An " -"exception handler block is removed from the block stack." +"awaiting a next item. The stack contains the async iterable in TOS1 and the " +"raised exception in TOS. Both are popped. If the exception is not :exc:" +"`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:573 ../../library/dis.rst:651 -#: ../../library/dis.rst:662 +#: ../../library/dis.rst:572 ../../library/dis.rst:650 +#: ../../library/dis.rst:661 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:578 +#: ../../library/dis.rst:577 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from the object on top of the " "stack. Pushes ``__aexit__`` and result of ``__aenter__()`` to the stack." msgstr "" -#: ../../library/dis.rst:585 +#: ../../library/dis.rst:584 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:589 +#: ../../library/dis.rst:588 msgid "" "Implements the expression statement for the interactive mode. TOS is " "removed from the stack and printed. In non-interactive mode, an expression " "statement is terminated with :opcode:`POP_TOP`." msgstr "" -#: ../../library/dis.rst:596 +#: ../../library/dis.rst:595 msgid "" "Calls ``set.add(TOS1[-i], TOS)``. Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:601 +#: ../../library/dis.rst:600 msgid "" "Calls ``list.append(TOS1[-i], TOS)``. Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:606 +#: ../../library/dis.rst:605 msgid "" "Calls ``dict.__setitem__(TOS1[-i], TOS1, TOS)``. Used to implement dict " "comprehensions." msgstr "" -#: ../../library/dis.rst:610 +#: ../../library/dis.rst:609 msgid "Map value is TOS and map key is TOS1. Before, those were reversed." msgstr "" -#: ../../library/dis.rst:613 +#: ../../library/dis.rst:612 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -658,15 +657,15 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:621 +#: ../../library/dis.rst:620 msgid "Returns with TOS to the caller of the function." msgstr "" -#: ../../library/dis.rst:626 +#: ../../library/dis.rst:625 msgid "Pops TOS and yields it from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:632 +#: ../../library/dis.rst:631 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -674,45 +673,45 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:642 +#: ../../library/dis.rst:641 msgid "" "Loads all symbols not starting with ``'_'`` directly from the module TOS to " "the local namespace. The module is popped after loading all names. This " "opcode implements ``from module import *``." msgstr "" -#: ../../library/dis.rst:649 +#: ../../library/dis.rst:648 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:656 +#: ../../library/dis.rst:655 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "pops an additional value from the stack which is used to set ``f_lasti`` of " "the current frame." msgstr "" -#: ../../library/dis.rst:667 +#: ../../library/dis.rst:666 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: ../../library/dis.rst:675 +#: ../../library/dis.rst:674 msgid "" "Performs exception matching for ``except``. Tests whether the TOS1 is an " "exception matching TOS. Pops TOS and pushes the boolean result of the test." msgstr "" -#: ../../library/dis.rst:682 +#: ../../library/dis.rst:681 msgid "" "Performs exception matching for ``except*``. Applies ``split(TOS)`` on the " "exception group representing TOS1." msgstr "" -#: ../../library/dis.rst:685 +#: ../../library/dis.rst:684 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -720,7 +719,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:694 +#: ../../library/dis.rst:693 msgid "" "Combines the raised and reraised exceptions list from TOS, into an exception " "group to propagate from a try-except* block. Uses the original exception " @@ -729,7 +728,7 @@ msgid "" "there isn't one." msgstr "" -#: ../../library/dis.rst:704 +#: ../../library/dis.rst:703 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -737,25 +736,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:711 +#: ../../library/dis.rst:710 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:718 +#: ../../library/dis.rst:717 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:726 +#: ../../library/dis.rst:725 msgid "" "Pushes :func:`builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:732 +#: ../../library/dis.rst:731 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -764,11 +763,11 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: ../../library/dis.rst:743 +#: ../../library/dis.rst:742 msgid "Push ``len(TOS)`` onto the stack." msgstr "" -#: ../../library/dis.rst:750 +#: ../../library/dis.rst:749 msgid "" "If TOS is an instance of :class:`collections.abc.Mapping` (or, more " "technically: if it has the :const:`Py_TPFLAGS_MAPPING` flag set in its :c:" @@ -776,7 +775,7 @@ msgid "" "push ``False``." msgstr "" -#: ../../library/dis.rst:760 +#: ../../library/dis.rst:759 msgid "" "If TOS is an instance of :class:`collections.abc.Sequence` and is *not* an " "instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, more " @@ -785,39 +784,39 @@ msgid "" "push ``False``." msgstr "" -#: ../../library/dis.rst:770 +#: ../../library/dis.rst:769 msgid "" "TOS is a tuple of mapping keys, and TOS1 is the match subject. If TOS1 " "contains all of the keys in TOS, push a :class:`tuple` containing the " "corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:776 ../../library/dis.rst:1321 +#: ../../library/dis.rst:775 ../../library/dis.rst:1320 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:783 +#: ../../library/dis.rst:782 msgid "" "Implements ``name = TOS``. *namei* is the index of *name* in the attribute :" "attr:`co_names` of the code object. The compiler tries to use :opcode:" "`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible." msgstr "" -#: ../../library/dis.rst:790 +#: ../../library/dis.rst:789 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`co_names` " "attribute of the code object." msgstr "" -#: ../../library/dis.rst:796 +#: ../../library/dis.rst:795 msgid "" "Unpacks TOS into *count* individual values, which are put onto the stack " "right-to-left." msgstr "" -#: ../../library/dis.rst:802 +#: ../../library/dis.rst:801 msgid "" "Implements assignment with a starred target: Unpacks an iterable in TOS into " "individual values, where the total number of values can be smaller than the " @@ -825,119 +824,119 @@ msgid "" "leftover items." msgstr "" -#: ../../library/dis.rst:807 +#: ../../library/dis.rst:806 msgid "" "The low byte of *counts* is the number of values before the list value, the " "high byte of *counts* the number of values after it. The resulting values " "are put onto the stack right-to-left." msgstr "" -#: ../../library/dis.rst:814 +#: ../../library/dis.rst:813 msgid "" "Implements ``TOS.name = TOS1``, where *namei* is the index of name in :attr:" "`co_names`." msgstr "" -#: ../../library/dis.rst:820 +#: ../../library/dis.rst:819 msgid "" "Implements ``del TOS.name``, using *namei* as index into :attr:`co_names`." msgstr "" -#: ../../library/dis.rst:825 +#: ../../library/dis.rst:824 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:830 +#: ../../library/dis.rst:829 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:835 +#: ../../library/dis.rst:834 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:840 +#: ../../library/dis.rst:839 msgid "Pushes the value associated with ``co_names[namei]`` onto the stack." msgstr "" -#: ../../library/dis.rst:845 +#: ../../library/dis.rst:844 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack." msgstr "" -#: ../../library/dis.rst:851 +#: ../../library/dis.rst:850 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:856 +#: ../../library/dis.rst:855 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:861 +#: ../../library/dis.rst:860 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., TOS3: TOS2, TOS1: TOS}``." msgstr "" -#: ../../library/dis.rst:865 +#: ../../library/dis.rst:864 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:872 +#: ../../library/dis.rst:871 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``TOS1``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:881 +#: ../../library/dis.rst:880 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:889 +#: ../../library/dis.rst:888 msgid "" "Pops a list from the stack and pushes a tuple containing the same values." msgstr "" -#: ../../library/dis.rst:896 +#: ../../library/dis.rst:895 msgid "Calls ``list.extend(TOS1[-i], TOS)``. Used to build lists." msgstr "" -#: ../../library/dis.rst:903 +#: ../../library/dis.rst:902 msgid "Calls ``set.update(TOS1[-i], TOS)``. Used to build sets." msgstr "" -#: ../../library/dis.rst:910 +#: ../../library/dis.rst:909 msgid "Calls ``dict.update(TOS1[-i], TOS)``. Used to build dicts." msgstr "" -#: ../../library/dis.rst:917 +#: ../../library/dis.rst:916 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:924 +#: ../../library/dis.rst:923 msgid "Replaces TOS with ``getattr(TOS, co_names[namei])``." msgstr "" -#: ../../library/dis.rst:929 +#: ../../library/dis.rst:928 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:935 +#: ../../library/dis.rst:934 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:942 +#: ../../library/dis.rst:941 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:949 +#: ../../library/dis.rst:948 msgid "" "Imports the module ``co_names[namei]``. TOS and TOS1 are popped and provide " "the *fromlist* and *level* arguments of :func:`__import__`. The module " @@ -946,86 +945,86 @@ msgid "" "modifies the namespace." msgstr "" -#: ../../library/dis.rst:958 +#: ../../library/dis.rst:957 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in TOS. The " "resulting object is pushed onto the stack, to be subsequently stored by a :" "opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:965 +#: ../../library/dis.rst:964 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:970 +#: ../../library/dis.rst:969 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:977 +#: ../../library/dis.rst:976 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:984 +#: ../../library/dis.rst:983 msgid "" "If TOS is true, increments the bytecode counter by *delta*. TOS is popped." msgstr "" -#: ../../library/dis.rst:991 +#: ../../library/dis.rst:990 msgid "" "If TOS is true, decrements the bytecode counter by *delta*. TOS is popped." msgstr "" -#: ../../library/dis.rst:998 +#: ../../library/dis.rst:997 msgid "" "If TOS is false, increments the bytecode counter by *delta*. TOS is popped." msgstr "" -#: ../../library/dis.rst:1005 +#: ../../library/dis.rst:1004 msgid "" "If TOS is false, decrements the bytecode counter by *delta*. TOS is popped." msgstr "" -#: ../../library/dis.rst:1012 +#: ../../library/dis.rst:1011 msgid "" "If TOS is not ``None``, increments the bytecode counter by *delta*. TOS is " "popped." msgstr "" -#: ../../library/dis.rst:1019 +#: ../../library/dis.rst:1018 msgid "" "If TOS is not ``None``, decrements the bytecode counter by *delta*. TOS is " "popped." msgstr "" -#: ../../library/dis.rst:1026 +#: ../../library/dis.rst:1025 msgid "" "If TOS is ``None``, increments the bytecode counter by *delta*. TOS is " "popped." msgstr "" -#: ../../library/dis.rst:1033 +#: ../../library/dis.rst:1032 msgid "" "If TOS is ``None``, decrements the bytecode counter by *delta*. TOS is " "popped." msgstr "" -#: ../../library/dis.rst:1040 +#: ../../library/dis.rst:1039 msgid "" "If TOS is true, increments the bytecode counter by *delta* and leaves TOS on " "the stack. Otherwise (TOS is false), TOS is popped." msgstr "" -#: ../../library/dis.rst:1045 ../../library/dis.rst:1055 +#: ../../library/dis.rst:1044 ../../library/dis.rst:1054 msgid "The oparg is now a relative delta rather than an absolute target." msgstr "" -#: ../../library/dis.rst:1050 +#: ../../library/dis.rst:1049 msgid "" "If TOS is false, increments the bytecode counter by *delta* and leaves TOS " "on the stack. Otherwise (TOS is true), TOS is popped." msgstr "" -#: ../../library/dis.rst:1061 +#: ../../library/dis.rst:1060 msgid "" "TOS is an :term:`iterator`. Call its :meth:`~iterator.__next__` method. If " "this yields a new value, push it on the stack (leaving the iterator below " @@ -1033,153 +1032,153 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1069 +#: ../../library/dis.rst:1068 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1071 +#: ../../library/dis.rst:1070 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1077 +#: ../../library/dis.rst:1076 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1082 +#: ../../library/dis.rst:1081 msgid "Stores TOS into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1087 +#: ../../library/dis.rst:1086 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1092 +#: ../../library/dis.rst:1091 msgid "" "Creates a new cell in slot ``i``. If that slot is empty then that value is " "stored into the new cell." msgstr "" -#: ../../library/dis.rst:1100 +#: ../../library/dis.rst:1099 msgid "" -"Pushes a reference to the cell contained in slot ``i`` of the \"fast locals" -"\" storage. The name of the variable is ``co_fastlocalnames[i]``." +"Pushes a reference to the cell contained in slot ``i`` of the \"fast " +"locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1103 +#: ../../library/dis.rst:1102 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1106 ../../library/dis.rst:1115 -#: ../../library/dis.rst:1127 ../../library/dis.rst:1136 -#: ../../library/dis.rst:1147 +#: ../../library/dis.rst:1105 ../../library/dis.rst:1114 +#: ../../library/dis.rst:1126 ../../library/dis.rst:1135 +#: ../../library/dis.rst:1146 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1112 +#: ../../library/dis.rst:1111 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1121 +#: ../../library/dis.rst:1120 msgid "" "Much like :opcode:`LOAD_DEREF` but first checks the locals dictionary before " "consulting the cell. This is used for loading free variables in class " "bodies." msgstr "" -#: ../../library/dis.rst:1133 +#: ../../library/dis.rst:1132 msgid "" "Stores TOS into the cell contained in slot ``i`` of the \"fast locals\" " "storage." msgstr "" -#: ../../library/dis.rst:1142 +#: ../../library/dis.rst:1141 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1153 +#: ../../library/dis.rst:1152 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1162 +#: ../../library/dis.rst:1161 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1165 +#: ../../library/dis.rst:1164 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1166 +#: ../../library/dis.rst:1165 msgid "1: ``raise TOS`` (raise exception instance or type at ``TOS``)" msgstr "" -#: ../../library/dis.rst:1167 +#: ../../library/dis.rst:1166 msgid "" "2: ``raise TOS1 from TOS`` (raise exception instance or type at ``TOS1`` " "with ``__cause__`` set to ``TOS``)" msgstr "" -#: ../../library/dis.rst:1173 +#: ../../library/dis.rst:1172 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1178 +#: ../../library/dis.rst:1177 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1179 ../../library/dis.rst:1185 +#: ../../library/dis.rst:1178 ../../library/dis.rst:1184 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1180 +#: ../../library/dis.rst:1179 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1181 ../../library/dis.rst:1188 +#: ../../library/dis.rst:1180 ../../library/dis.rst:1187 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1183 +#: ../../library/dis.rst:1182 msgid "or:" msgstr "" -#: ../../library/dis.rst:1186 +#: ../../library/dis.rst:1185 msgid "``self``" msgstr "" -#: ../../library/dis.rst:1187 +#: ../../library/dis.rst:1186 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1190 +#: ../../library/dis.rst:1189 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1193 +#: ../../library/dis.rst:1192 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1202 +#: ../../library/dis.rst:1201 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1191,7 +1190,7 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1217 +#: ../../library/dis.rst:1216 msgid "" "Loads a method named ``co_names[namei]`` from the TOS object. TOS is popped. " "This bytecode distinguishes two cases: if TOS has a method with the correct " @@ -1201,70 +1200,70 @@ msgid "" "are pushed." msgstr "" -#: ../../library/dis.rst:1229 +#: ../../library/dis.rst:1228 msgid "" "Prefixes :opcode:`CALL`. Logically this is a no op. It exists to enable " "effective specialization of calls. ``argc`` is the number of arguments as " "described in :opcode:`CALL`." msgstr "" -#: ../../library/dis.rst:1238 +#: ../../library/dis.rst:1237 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1247 +#: ../../library/dis.rst:1246 msgid "" "Prefixes :opcode:`PRECALL`. Stores a reference to ``co_consts[consti]`` into " "an internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must " "be a tuple of strings." msgstr "" -#: ../../library/dis.rst:1256 +#: ../../library/dis.rst:1255 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1259 +#: ../../library/dis.rst:1258 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1261 +#: ../../library/dis.rst:1260 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1262 +#: ../../library/dis.rst:1261 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1263 +#: ../../library/dis.rst:1262 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1264 +#: ../../library/dis.rst:1263 msgid "the code associated with the function (at TOS1)" msgstr "" -#: ../../library/dis.rst:1265 +#: ../../library/dis.rst:1264 msgid "the :term:`qualified name` of the function (at TOS)" msgstr "" -#: ../../library/dis.rst:1267 +#: ../../library/dis.rst:1266 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1274 +#: ../../library/dis.rst:1273 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "``slice(TOS1, TOS)`` is pushed; if it is 3, ``slice(TOS2, TOS1, TOS)`` is " "pushed. See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1281 +#: ../../library/dis.rst:1280 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1272,142 +1271,142 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1289 +#: ../../library/dis.rst:1288 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1293 +#: ../../library/dis.rst:1292 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1294 +#: ../../library/dis.rst:1293 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1296 +#: ../../library/dis.rst:1295 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1298 +#: ../../library/dis.rst:1297 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1300 +#: ../../library/dis.rst:1299 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1303 +#: ../../library/dis.rst:1302 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1311 +#: ../../library/dis.rst:1310 msgid "" "TOS is a tuple of keyword attribute names, TOS1 is the class being matched " "against, and TOS2 is the match subject. *count* is the number of positional " "sub-patterns." msgstr "" -#: ../../library/dis.rst:1315 +#: ../../library/dis.rst:1314 msgid "" "Pop TOS, TOS1, and TOS2. If TOS2 is an instance of TOS1 and has the " "positional and keyword attributes required by *count* and TOS, push a tuple " "of extracted attributes. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1328 +#: ../../library/dis.rst:1327 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1330 +#: ../../library/dis.rst:1329 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1332 +#: ../../library/dis.rst:1331 msgid "``0`` The start of a function" msgstr "" -#: ../../library/dis.rst:1333 +#: ../../library/dis.rst:1332 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1334 +#: ../../library/dis.rst:1333 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1335 +#: ../../library/dis.rst:1334 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1342 +#: ../../library/dis.rst:1341 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1350 +#: ../../library/dis.rst:1349 msgid "" "Sends ``None`` to the sub-generator of this generator. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1358 +#: ../../library/dis.rst:1357 msgid "" "Wraps the value on top of the stack in an ``async_generator_wrapped_value``. " "Used to yield in async generators." msgstr "" -#: ../../library/dis.rst:1366 +#: ../../library/dis.rst:1365 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes which don't use their argument and those that do (``< " "HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1370 +#: ../../library/dis.rst:1369 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1378 +#: ../../library/dis.rst:1377 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1380 +#: ../../library/dis.rst:1379 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1385 +#: ../../library/dis.rst:1384 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1390 +#: ../../library/dis.rst:1389 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1395 +#: ../../library/dis.rst:1394 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1400 +#: ../../library/dis.rst:1399 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1405 +#: ../../library/dis.rst:1404 msgid "" "Sequence of bytecodes that access a free variable (note that 'free' in this " "context refers to names in the current scope that are referenced by inner " @@ -1415,22 +1414,22 @@ msgid "" "does *not* include references to global or builtin scopes)." msgstr "" -#: ../../library/dis.rst:1413 +#: ../../library/dis.rst:1412 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1418 +#: ../../library/dis.rst:1417 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1423 +#: ../../library/dis.rst:1422 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1428 +#: ../../library/dis.rst:1427 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1433 +#: ../../library/dis.rst:1432 msgid "Sequence of bytecodes of Boolean operations." msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 33d08f519e..645c2f6c00 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-19 00:17+0000\n" +"POT-Creation-Date: 2023-02-02 00:33+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-" @@ -236,7 +236,7 @@ msgstr ":ref:`sqlite3-adapters`" msgid ":ref:`sqlite3-converters`" msgstr ":ref:`sqlite3-converters`" -#: ../../library/sqlite3.rst:241 ../../library/sqlite3.rst:554 +#: ../../library/sqlite3.rst:241 ../../library/sqlite3.rst:557 msgid ":ref:`sqlite3-connection-context-manager`" msgstr ":ref:`sqlite3-connection-context-manager`" @@ -303,24 +303,26 @@ msgstr "" #: ../../library/sqlite3.rst:301 msgid "" -"If ``True`` (default), only the creating thread may use the connection. If " -"``False``, the connection may be shared across multiple threads; if so, " -"write operations should be serialized by the user to avoid data corruption." +"If ``True`` (default), :exc:`ProgrammingError` will be raised if the " +"database connection is used by a thread other than the one that created it. " +"If ``False``, the connection may be accessed in multiple threads; write " +"operations may need to be serialized by the user to avoid data corruption. " +"See :attr:`threadsafety` for more information." msgstr "" -#: ../../library/sqlite3.rst:307 +#: ../../library/sqlite3.rst:310 msgid "" "A custom subclass of :class:`Connection` to create the connection with, if " "not the default :class:`Connection` class." msgstr "" -#: ../../library/sqlite3.rst:311 +#: ../../library/sqlite3.rst:314 msgid "" "The number of statements that :mod:`!sqlite3` should internally cache for " "this connection, to avoid parsing overhead. By default, 128 statements." msgstr "" -#: ../../library/sqlite3.rst:316 +#: ../../library/sqlite3.rst:319 msgid "" "If set to ``True``, *database* is interpreted as a :abbr:`URI (Uniform " "Resource Identifier)` with a file path and an optional query string. The " @@ -333,32 +335,32 @@ msgstr "" msgid "Return type" msgstr "" -#: ../../library/sqlite3.rst:64 +#: ../../library/sqlite3.rst:67 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -#: ../../library/sqlite3.rst:65 +#: ../../library/sqlite3.rst:68 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." msgstr "" -#: ../../library/sqlite3.rst:330 +#: ../../library/sqlite3.rst:333 msgid "The *uri* parameter." msgstr "*uri* 參數。" -#: ../../library/sqlite3.rst:333 +#: ../../library/sqlite3.rst:336 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" -#: ../../library/sqlite3.rst:336 +#: ../../library/sqlite3.rst:339 msgid "The ``sqlite3.connect/handle`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:341 +#: ../../library/sqlite3.rst:344 msgid "" "Return ``True`` if the string *statement* appears to contain one or more " "complete SQL statements. No syntactic verification or parsing of any kind is " @@ -366,18 +368,18 @@ msgid "" "and the statement is terminated by a semicolon." msgstr "" -#: ../../library/sqlite3.rst:347 +#: ../../library/sqlite3.rst:350 msgid "For example:" msgstr "範例:" -#: ../../library/sqlite3.rst:356 +#: ../../library/sqlite3.rst:359 msgid "" "This function may be useful during command-line input to determine if the " "entered text seems to form a complete SQL statement, or if additional input " "is needed before calling :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:362 +#: ../../library/sqlite3.rst:365 msgid "" "Enable or disable callback tracebacks. By default you will not get any " "tracebacks in user-defined functions, aggregates, converters, authorizer " @@ -386,13 +388,13 @@ msgid "" "on :data:`sys.stderr`. Use ``False`` to disable the feature again." msgstr "" -#: ../../library/sqlite3.rst:369 +#: ../../library/sqlite3.rst:372 msgid "" "Register an :func:`unraisable hook handler ` for an " "improved debug experience:" msgstr "" -#: ../../library/sqlite3.rst:394 +#: ../../library/sqlite3.rst:397 msgid "" "Register an *adapter* callable to adapt the Python type *type* into an " "SQLite type. The adapter is called with a Python object of type *type* as " @@ -400,7 +402,7 @@ msgid "" "natively understands `." msgstr "" -#: ../../library/sqlite3.rst:402 +#: ../../library/sqlite3.rst:405 msgid "" "Register the *converter* callable to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " @@ -410,17 +412,17 @@ msgid "" "type detection works." msgstr "" -#: ../../library/sqlite3.rst:410 +#: ../../library/sqlite3.rst:413 msgid "" "Note: *typename* and the name of the type in your query are matched case-" "insensitively." msgstr "" -#: ../../library/sqlite3.rst:417 +#: ../../library/sqlite3.rst:420 msgid "Module constants" msgstr "" -#: ../../library/sqlite3.rst:421 +#: ../../library/sqlite3.rst:424 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function by using the type name, parsed from the query " @@ -428,13 +430,13 @@ msgid "" "in square brackets (``[]``)." msgstr "" -#: ../../library/sqlite3.rst:431 +#: ../../library/sqlite3.rst:434 msgid "" "This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:436 +#: ../../library/sqlite3.rst:439 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function using the declared types for each column. The " @@ -443,61 +445,61 @@ msgid "" "the converter dictionary key. For example:" msgstr "" -#: ../../library/sqlite3.rst:452 +#: ../../library/sqlite3.rst:455 msgid "" "This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:459 +#: ../../library/sqlite3.rst:462 msgid "" "Flags that should be returned by the *authorizer_callback* callable passed " "to :meth:`Connection.set_authorizer`, to indicate whether:" msgstr "" -#: ../../library/sqlite3.rst:462 +#: ../../library/sqlite3.rst:465 msgid "Access is allowed (:const:`!SQLITE_OK`)," msgstr "" -#: ../../library/sqlite3.rst:463 +#: ../../library/sqlite3.rst:466 msgid "" "The SQL statement should be aborted with an error (:const:`!SQLITE_DENY`)" msgstr "" -#: ../../library/sqlite3.rst:464 +#: ../../library/sqlite3.rst:467 msgid "" "The column should be treated as a ``NULL`` value (:const:`!SQLITE_IGNORE`)" msgstr "" -#: ../../library/sqlite3.rst:468 +#: ../../library/sqlite3.rst:471 msgid "" "String constant stating the supported DB-API level. Required by the DB-API. " "Hard-coded to ``\"2.0\"``." msgstr "" -#: ../../library/sqlite3.rst:473 +#: ../../library/sqlite3.rst:476 msgid "" "String constant stating the type of parameter marker formatting expected by " "the :mod:`!sqlite3` module. Required by the DB-API. Hard-coded to " "``\"qmark\"``." msgstr "" -#: ../../library/sqlite3.rst:479 +#: ../../library/sqlite3.rst:482 msgid "The ``named`` DB-API parameter style is also supported." msgstr "" -#: ../../library/sqlite3.rst:483 +#: ../../library/sqlite3.rst:486 msgid "" "Version number of the runtime SQLite library as a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:487 +#: ../../library/sqlite3.rst:490 msgid "" "Version number of the runtime SQLite library as a :class:`tuple` of :class:" "`integers `." msgstr "" -#: ../../library/sqlite3.rst:492 +#: ../../library/sqlite3.rst:495 msgid "" "Integer constant required by the DB-API 2.0, stating the level of thread " "safety the :mod:`!sqlite3` module supports. This attribute is set based on " @@ -505,154 +507,154 @@ msgid "" "underlying SQLite library is compiled with. The SQLite threading modes are:" msgstr "" -#: ../../library/sqlite3.rst:497 +#: ../../library/sqlite3.rst:500 msgid "" "**Single-thread**: In this mode, all mutexes are disabled and SQLite is " "unsafe to use in more than a single thread at once." msgstr "" -#: ../../library/sqlite3.rst:499 +#: ../../library/sqlite3.rst:502 msgid "" "**Multi-thread**: In this mode, SQLite can be safely used by multiple " "threads provided that no single database connection is used simultaneously " "in two or more threads." msgstr "" -#: ../../library/sqlite3.rst:502 +#: ../../library/sqlite3.rst:505 msgid "" "**Serialized**: In serialized mode, SQLite can be safely used by multiple " "threads with no restriction." msgstr "" -#: ../../library/sqlite3.rst:505 +#: ../../library/sqlite3.rst:508 msgid "" "The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels " "are as follows:" msgstr "" -#: ../../library/sqlite3.rst:509 +#: ../../library/sqlite3.rst:512 msgid "SQLite threading mode" msgstr "" -#: ../../library/sqlite3.rst:509 +#: ../../library/sqlite3.rst:512 msgid "`threadsafety`_" msgstr "`threadsafety`_" -#: ../../library/sqlite3.rst:509 +#: ../../library/sqlite3.rst:512 msgid "`SQLITE_THREADSAFE`_" msgstr "`SQLITE_THREADSAFE`_" -#: ../../library/sqlite3.rst:509 +#: ../../library/sqlite3.rst:512 msgid "DB-API 2.0 meaning" msgstr "" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:515 msgid "single-thread" msgstr "" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:515 msgid "0" msgstr "0" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:515 msgid "Threads may not share the module" msgstr "" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:518 msgid "multi-thread" msgstr "" -#: ../../library/sqlite3.rst:515 ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:518 ../../library/sqlite3.rst:521 msgid "1" msgstr "1" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:518 msgid "2" msgstr "2" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:518 msgid "Threads may share the module, but not connections" msgstr "" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:521 msgid "serialized" msgstr "" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:521 msgid "3" msgstr "3" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:521 msgid "Threads may share the module, connections and cursors" msgstr "" -#: ../../library/sqlite3.rst:525 +#: ../../library/sqlite3.rst:528 msgid "Set *threadsafety* dynamically instead of hard-coding it to ``1``." msgstr "" -#: ../../library/sqlite3.rst:530 +#: ../../library/sqlite3.rst:533 msgid "" "Version number of this module as a :class:`string `. This is not the " "version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:535 +#: ../../library/sqlite3.rst:538 msgid "" "Version number of this module as a :class:`tuple` of :class:`integers " "`. This is not the version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:542 +#: ../../library/sqlite3.rst:545 msgid "Connection objects" msgstr "" -#: ../../library/sqlite3.rst:546 +#: ../../library/sqlite3.rst:549 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`." msgstr "" -#: ../../library/sqlite3.rst:553 +#: ../../library/sqlite3.rst:556 msgid ":ref:`sqlite3-connection-shortcuts`" msgstr ":ref:`sqlite3-connection-shortcuts`" -#: ../../library/sqlite3.rst:556 +#: ../../library/sqlite3.rst:559 msgid "An SQLite database connection has the following attributes and methods:" msgstr "" -#: ../../library/sqlite3.rst:560 +#: ../../library/sqlite3.rst:563 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " "single optional parameter *factory*. If supplied, this must be a callable " "returning an instance of :class:`Cursor` or its subclasses." msgstr "" -#: ../../library/sqlite3.rst:567 +#: ../../library/sqlite3.rst:570 msgid "" "Open a :class:`Blob` handle to an existing :abbr:`BLOB (Binary Large " "OBject)`." msgstr "" -#: ../../library/sqlite3.rst:570 +#: ../../library/sqlite3.rst:573 msgid "The name of the table where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:573 +#: ../../library/sqlite3.rst:576 msgid "The name of the column where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:576 +#: ../../library/sqlite3.rst:579 msgid "The name of the row where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:579 +#: ../../library/sqlite3.rst:582 msgid "" "Set to ``True`` if the blob should be opened without write permissions. " "Defaults to ``False``." msgstr "" -#: ../../library/sqlite3.rst:584 +#: ../../library/sqlite3.rst:587 msgid "" "The name of the database where the blob is located. Defaults to ``\"main\"``." msgstr "" @@ -661,111 +663,111 @@ msgstr "" msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:588 +#: ../../library/sqlite3.rst:591 msgid "When trying to open a blob in a ``WITHOUT ROWID`` table." msgstr "" -#: ../../library/sqlite3.rst:595 +#: ../../library/sqlite3.rst:598 msgid "" "The blob size cannot be changed using the :class:`Blob` class. Use the SQL " "function ``zeroblob`` to create a blob with a fixed size." msgstr "" -#: ../../library/sqlite3.rst:602 +#: ../../library/sqlite3.rst:605 msgid "" "Commit any pending transaction to the database. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:607 +#: ../../library/sqlite3.rst:610 msgid "" "Roll back to the start of any pending transaction. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:612 +#: ../../library/sqlite3.rst:615 msgid "" "Close the database connection. Any pending transaction is not committed " "implicitly; make sure to :meth:`commit` before closing to avoid losing " "pending changes." msgstr "" -#: ../../library/sqlite3.rst:619 +#: ../../library/sqlite3.rst:622 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it " "with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:625 +#: ../../library/sqlite3.rst:628 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on " "it with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:631 +#: ../../library/sqlite3.rst:634 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` " "on it with the given *sql_script*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:637 +#: ../../library/sqlite3.rst:640 msgid "Create or remove a user-defined SQL function." msgstr "" -#: ../../library/sqlite3.rst:639 +#: ../../library/sqlite3.rst:642 msgid "The name of the SQL function." msgstr "" -#: ../../library/sqlite3.rst:642 +#: ../../library/sqlite3.rst:645 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:646 +#: ../../library/sqlite3.rst:649 msgid "" "A callable that is called when the SQL function is invoked. The callable " "must return :ref:`a type natively supported by SQLite `. Set " "to ``None`` to remove an existing SQL function." msgstr "" -#: ../../library/sqlite3.rst:653 +#: ../../library/sqlite3.rst:656 msgid "" "If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional " "optimizations." msgstr "" -#: ../../library/sqlite3.rst:658 +#: ../../library/sqlite3.rst:661 msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" -#: ../../library/sqlite3.rst:661 +#: ../../library/sqlite3.rst:664 msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:664 ../../library/sqlite3.rst:702 -#: ../../library/sqlite3.rst:765 ../../library/sqlite3.rst:1016 -#: ../../library/sqlite3.rst:1253 ../../library/sqlite3.rst:1359 -#: ../../library/sqlite3.rst:1380 +#: ../../library/sqlite3.rst:667 ../../library/sqlite3.rst:705 +#: ../../library/sqlite3.rst:768 ../../library/sqlite3.rst:1019 +#: ../../library/sqlite3.rst:1256 ../../library/sqlite3.rst:1362 +#: ../../library/sqlite3.rst:1383 msgid "Example:" msgstr "範例:" -#: ../../library/sqlite3.rst:680 +#: ../../library/sqlite3.rst:683 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:682 +#: ../../library/sqlite3.rst:685 msgid "The name of the SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:685 +#: ../../library/sqlite3.rst:688 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:689 +#: ../../library/sqlite3.rst:692 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " @@ -774,45 +776,45 @@ msgid "" "*n_arg*. Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:690 +#: ../../library/sqlite3.rst:693 msgid "A class must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:692 +#: ../../library/sqlite3.rst:695 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:693 ../../library/sqlite3.rst:749 +#: ../../library/sqlite3.rst:696 ../../library/sqlite3.rst:752 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:696 +#: ../../library/sqlite3.rst:699 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:699 +#: ../../library/sqlite3.rst:702 msgid "Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:734 +#: ../../library/sqlite3.rst:737 msgid "Create or remove a user-defined aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:736 +#: ../../library/sqlite3.rst:739 msgid "The name of the SQL aggregate window function to create or remove." msgstr "" -#: ../../library/sqlite3.rst:739 +#: ../../library/sqlite3.rst:742 msgid "" "The number of arguments the SQL aggregate window function can accept. If " "``-1``, it may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:743 +#: ../../library/sqlite3.rst:746 msgid "" "A class that must implement the following methods: * ``step()``: Add a row " "to the current window. * ``value()``: Return the current value of the " @@ -824,78 +826,78 @@ msgid "" "function." msgstr "" -#: ../../library/sqlite3.rst:744 +#: ../../library/sqlite3.rst:747 msgid "A class that must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:746 +#: ../../library/sqlite3.rst:749 msgid "``step()``: Add a row to the current window." msgstr "" -#: ../../library/sqlite3.rst:747 +#: ../../library/sqlite3.rst:750 msgid "``value()``: Return the current value of the aggregate." msgstr "" -#: ../../library/sqlite3.rst:748 +#: ../../library/sqlite3.rst:751 msgid "``inverse()``: Remove a row from the current window." msgstr "" -#: ../../library/sqlite3.rst:752 +#: ../../library/sqlite3.rst:755 msgid "" "The number of arguments that the ``step()`` and ``value()`` methods must " "accept is controlled by *num_params*." msgstr "" -#: ../../library/sqlite3.rst:755 +#: ../../library/sqlite3.rst:758 msgid "Set to ``None`` to remove an existing SQL aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:757 +#: ../../library/sqlite3.rst:760 msgid "" "If used with a version of SQLite older than 3.25.0, which does not support " "aggregate window functions." msgstr "" -#: ../../library/sqlite3.rst:820 +#: ../../library/sqlite3.rst:823 msgid "" "Create a collation named *name* using the collating function *callable*. " "*callable* is passed two :class:`string ` arguments, and it should " "return an :class:`integer `:" msgstr "" -#: ../../library/sqlite3.rst:824 +#: ../../library/sqlite3.rst:827 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:825 +#: ../../library/sqlite3.rst:828 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:826 +#: ../../library/sqlite3.rst:829 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:828 +#: ../../library/sqlite3.rst:831 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:856 +#: ../../library/sqlite3.rst:859 msgid "Remove a collation function by setting *callable* to ``None``." msgstr "" -#: ../../library/sqlite3.rst:858 +#: ../../library/sqlite3.rst:861 msgid "" "The collation name can contain any Unicode character. Earlier, only ASCII " "characters were allowed." msgstr "" -#: ../../library/sqlite3.rst:865 +#: ../../library/sqlite3.rst:868 msgid "" "Call this method from a different thread to abort any queries that might be " "executing on the connection. Aborted queries will raise an exception." msgstr "" -#: ../../library/sqlite3.rst:872 +#: ../../library/sqlite3.rst:875 msgid "" "Register callable *authorizer_callback* to be invoked for each attempt to " "access a column of a table in the database. The callback should return one " @@ -904,7 +906,7 @@ msgid "" "library." msgstr "" -#: ../../library/sqlite3.rst:878 +#: ../../library/sqlite3.rst:881 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or ``None`` " @@ -914,7 +916,7 @@ msgid "" "attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" -#: ../../library/sqlite3.rst:885 +#: ../../library/sqlite3.rst:888 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -922,15 +924,15 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:889 +#: ../../library/sqlite3.rst:892 msgid "Passing ``None`` as *authorizer_callback* will disable the authorizer." msgstr "" -#: ../../library/sqlite3.rst:891 +#: ../../library/sqlite3.rst:894 msgid "Added support for disabling the authorizer using ``None``." msgstr "" -#: ../../library/sqlite3.rst:897 +#: ../../library/sqlite3.rst:900 msgid "" "Register callable *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -938,26 +940,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:902 +#: ../../library/sqlite3.rst:905 msgid "" "If you want to clear any previously installed progress handler, call the " "method with ``None`` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:905 +#: ../../library/sqlite3.rst:908 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise an :exc:`OperationalError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:912 +#: ../../library/sqlite3.rst:915 msgid "" "Register callable *trace_callback* to be invoked for each SQL statement that " "is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:915 +#: ../../library/sqlite3.rst:918 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 " @@ -967,18 +969,18 @@ msgid "" "execution of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:923 +#: ../../library/sqlite3.rst:926 msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:926 +#: ../../library/sqlite3.rst:929 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: ../../library/sqlite3.rst:936 +#: ../../library/sqlite3.rst:939 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite " @@ -987,7 +989,7 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:945 +#: ../../library/sqlite3.rst:948 msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " @@ -1002,11 +1004,11 @@ msgid "" "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:956 +#: ../../library/sqlite3.rst:959 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:999 +#: ../../library/sqlite3.rst:1002 msgid "" "Load an SQLite extension from a shared library located at *path*. Enable " "extension loading with :meth:`enable_load_extension` before calling this " @@ -1019,38 +1021,38 @@ msgid "" "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:1007 +#: ../../library/sqlite3.rst:1010 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:1012 +#: ../../library/sqlite3.rst:1015 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." msgstr "" -#: ../../library/sqlite3.rst:1030 +#: ../../library/sqlite3.rst:1033 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1032 +#: ../../library/sqlite3.rst:1035 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:1035 +#: ../../library/sqlite3.rst:1038 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:1038 +#: ../../library/sqlite3.rst:1041 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:1044 +#: ../../library/sqlite3.rst:1047 msgid "" "If set to a callable, it is invoked with three integer arguments for every " "backup iteration: the *status* of the last iteration, the *remaining* number " @@ -1058,46 +1060,46 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1053 +#: ../../library/sqlite3.rst:1056 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1060 +#: ../../library/sqlite3.rst:1063 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:1064 +#: ../../library/sqlite3.rst:1067 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1083 +#: ../../library/sqlite3.rst:1086 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1095 +#: ../../library/sqlite3.rst:1098 msgid "Get a connection runtime limit." msgstr "" -#: ../../library/sqlite3.rst:1097 +#: ../../library/sqlite3.rst:1100 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: ../../library/sqlite3.rst:1102 ../../library/sqlite3.rst:1139 +#: ../../library/sqlite3.rst:1105 ../../library/sqlite3.rst:1142 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:1105 +#: ../../library/sqlite3.rst:1108 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: ../../library/sqlite3.rst:1125 +#: ../../library/sqlite3.rst:1128 msgid "" "Set a connection runtime limit. Attempts to increase a limit above its hard " "upper bound are silently truncated to the hard upper bound. Regardless of " @@ -1105,22 +1107,22 @@ msgid "" "returned." msgstr "" -#: ../../library/sqlite3.rst:1130 +#: ../../library/sqlite3.rst:1133 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: ../../library/sqlite3.rst:1133 +#: ../../library/sqlite3.rst:1136 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: ../../library/sqlite3.rst:1142 +#: ../../library/sqlite3.rst:1145 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: ../../library/sqlite3.rst:1159 +#: ../../library/sqlite3.rst:1162 msgid "" "Serialize a database into a :class:`bytes` object. For an ordinary on-disk " "database file, the serialization is just a copy of the disk file. For an in-" @@ -1129,17 +1131,17 @@ msgid "" "backed up to disk." msgstr "" -#: ../../library/sqlite3.rst:1165 +#: ../../library/sqlite3.rst:1168 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1173 +#: ../../library/sqlite3.rst:1176 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: ../../library/sqlite3.rst:1181 +#: ../../library/sqlite3.rst:1184 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1147,47 +1149,47 @@ msgid "" "serialization contained in *data*." msgstr "" -#: ../../library/sqlite3.rst:1187 +#: ../../library/sqlite3.rst:1190 msgid "A serialized database." msgstr "" -#: ../../library/sqlite3.rst:1190 +#: ../../library/sqlite3.rst:1193 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1194 +#: ../../library/sqlite3.rst:1197 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: ../../library/sqlite3.rst:1198 +#: ../../library/sqlite3.rst:1201 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1201 +#: ../../library/sqlite3.rst:1204 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: ../../library/sqlite3.rst:1206 +#: ../../library/sqlite3.rst:1209 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: ../../library/sqlite3.rst:1213 +#: ../../library/sqlite3.rst:1216 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:1216 +#: ../../library/sqlite3.rst:1219 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: ../../library/sqlite3.rst:1223 +#: ../../library/sqlite3.rst:1226 msgid "" "This attribute controls the :ref:`transaction handling ` performed by :mod:`!sqlite3`. If set to ``None``, " @@ -1197,13 +1199,13 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:1231 +#: ../../library/sqlite3.rst:1234 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:1236 +#: ../../library/sqlite3.rst:1239 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " "from this connection. Assigning to this attribute does not affect the :attr:" @@ -1212,12 +1214,12 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1243 ../../library/sqlite3.rst:1504 -#: ../../library/sqlite3.rst:1527 +#: ../../library/sqlite3.rst:1246 ../../library/sqlite3.rst:1507 +#: ../../library/sqlite3.rst:1530 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "" -#: ../../library/sqlite3.rst:1247 +#: ../../library/sqlite3.rst:1250 msgid "" "A callable that accepts a :class:`bytes` parameter and returns a text " "representation of it. The callable is invoked for SQLite values with the " @@ -1225,17 +1227,17 @@ msgid "" "you want to return ``bytes`` instead, set *text_factory* to ``bytes``." msgstr "" -#: ../../library/sqlite3.rst:1287 +#: ../../library/sqlite3.rst:1290 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:1294 +#: ../../library/sqlite3.rst:1297 msgid "Cursor objects" msgstr "" -#: ../../library/sqlite3.rst:1296 +#: ../../library/sqlite3.rst:1299 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 " @@ -1243,25 +1245,25 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1303 +#: ../../library/sqlite3.rst:1306 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:" msgstr "" -#: ../../library/sqlite3.rst:1328 +#: ../../library/sqlite3.rst:1331 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:1335 +#: ../../library/sqlite3.rst:1338 msgid "" "Execute SQL statement *sql*. Bind values to the statement using :ref:" "`placeholders ` that map to the :term:`sequence` or :" "class:`dict` *parameters*." msgstr "" -#: ../../library/sqlite3.rst:1340 +#: ../../library/sqlite3.rst:1343 msgid "" ":meth:`execute` will only execute a single SQL statement. If you try to " "execute more than one statement with it, it will raise a :exc:" @@ -1269,7 +1271,7 @@ msgid "" "multiple SQL statements with one call." msgstr "" -#: ../../library/sqlite3.rst:1345 +#: ../../library/sqlite3.rst:1348 msgid "" "If :attr:`~Connection.isolation_level` is not ``None``, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " @@ -1277,7 +1279,7 @@ msgid "" "*sql*." msgstr "" -#: ../../library/sqlite3.rst:1353 +#: ../../library/sqlite3.rst:1356 msgid "" "Execute :ref:`parameterized ` SQL statement *sql* " "against all parameter sequences or mappings found in the sequence " @@ -1286,7 +1288,7 @@ msgid "" "handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1372 +#: ../../library/sqlite3.rst:1375 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " "transaction, an implicit ``COMMIT`` statement is executed first. No other " @@ -1294,24 +1296,24 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1378 +#: ../../library/sqlite3.rst:1381 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1396 +#: ../../library/sqlite3.rst:1399 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1404 +#: ../../library/sqlite3.rst:1407 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1407 +#: ../../library/sqlite3.rst:1410 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1319,7 +1321,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1413 +#: ../../library/sqlite3.rst:1416 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1327,36 +1329,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1420 +#: ../../library/sqlite3.rst:1423 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1427 +#: ../../library/sqlite3.rst:1430 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1429 +#: ../../library/sqlite3.rst:1432 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." msgstr "" -#: ../../library/sqlite3.rst:1434 ../../library/sqlite3.rst:1438 +#: ../../library/sqlite3.rst:1437 ../../library/sqlite3.rst:1441 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1442 +#: ../../library/sqlite3.rst:1445 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." msgstr "" -#: ../../library/sqlite3.rst:1447 +#: ../../library/sqlite3.rst:1450 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1364,18 +1366,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1461 +#: ../../library/sqlite3.rst:1464 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1465 +#: ../../library/sqlite3.rst:1468 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1469 +#: ../../library/sqlite3.rst:1472 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1385,15 +1387,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1477 +#: ../../library/sqlite3.rst:1480 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1479 +#: ../../library/sqlite3.rst:1482 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1484 +#: ../../library/sqlite3.rst:1487 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1402,7 +1404,7 @@ msgid "" "methods." msgstr "" -#: ../../library/sqlite3.rst:1492 +#: ../../library/sqlite3.rst:1495 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1411,18 +1413,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1499 +#: ../../library/sqlite3.rst:1502 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." msgstr "" -#: ../../library/sqlite3.rst:1515 +#: ../../library/sqlite3.rst:1518 msgid "Row objects" msgstr "" -#: ../../library/sqlite3.rst:1519 +#: ../../library/sqlite3.rst:1522 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1430,28 +1432,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1524 +#: ../../library/sqlite3.rst:1527 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1531 +#: ../../library/sqlite3.rst:1534 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`." msgstr "" -#: ../../library/sqlite3.rst:1535 +#: ../../library/sqlite3.rst:1538 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:1542 +#: ../../library/sqlite3.rst:1545 msgid "Blob objects" msgstr "" -#: ../../library/sqlite3.rst:1548 +#: ../../library/sqlite3.rst:1551 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:" @@ -1459,24 +1461,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1553 +#: ../../library/sqlite3.rst:1556 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1583 +#: ../../library/sqlite3.rst:1586 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1585 +#: ../../library/sqlite3.rst:1588 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." msgstr "" -#: ../../library/sqlite3.rst:1591 +#: ../../library/sqlite3.rst:1594 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)` " @@ -1484,18 +1486,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1599 +#: ../../library/sqlite3.rst:1602 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`." msgstr "" -#: ../../library/sqlite3.rst:1605 +#: ../../library/sqlite3.rst:1608 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1609 +#: ../../library/sqlite3.rst:1612 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :data:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1503,26 +1505,26 @@ msgid "" "position) and :data:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1617 +#: ../../library/sqlite3.rst:1620 msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:1621 +#: ../../library/sqlite3.rst:1624 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1629 +#: ../../library/sqlite3.rst:1632 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1631 +#: ../../library/sqlite3.rst:1634 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1635 +#: ../../library/sqlite3.rst:1638 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1530,39 +1532,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1642 +#: ../../library/sqlite3.rst:1645 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1646 +#: ../../library/sqlite3.rst:1649 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1651 +#: ../../library/sqlite3.rst:1654 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1658 +#: ../../library/sqlite3.rst:1661 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1665 +#: ../../library/sqlite3.rst:1668 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1672 +#: ../../library/sqlite3.rst:1675 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1570,14 +1572,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1679 +#: ../../library/sqlite3.rst:1682 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1685 +#: ../../library/sqlite3.rst:1688 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1585,20 +1587,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1693 +#: ../../library/sqlite3.rst:1696 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1698 +#: ../../library/sqlite3.rst:1701 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1705 +#: ../../library/sqlite3.rst:1708 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 " @@ -1606,7 +1608,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1712 +#: ../../library/sqlite3.rst:1715 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1615,78 +1617,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1722 +#: ../../library/sqlite3.rst:1725 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1724 +#: ../../library/sqlite3.rst:1727 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1727 +#: ../../library/sqlite3.rst:1730 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1730 ../../library/sqlite3.rst:1747 +#: ../../library/sqlite3.rst:1733 ../../library/sqlite3.rst:1750 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1730 ../../library/sqlite3.rst:1747 +#: ../../library/sqlite3.rst:1733 ../../library/sqlite3.rst:1750 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1732 ../../library/sqlite3.rst:1749 +#: ../../library/sqlite3.rst:1735 ../../library/sqlite3.rst:1752 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1732 ../../library/sqlite3.rst:1749 +#: ../../library/sqlite3.rst:1735 ../../library/sqlite3.rst:1752 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1734 ../../library/sqlite3.rst:1751 +#: ../../library/sqlite3.rst:1737 ../../library/sqlite3.rst:1754 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1734 ../../library/sqlite3.rst:1751 +#: ../../library/sqlite3.rst:1737 ../../library/sqlite3.rst:1754 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1736 ../../library/sqlite3.rst:1753 +#: ../../library/sqlite3.rst:1739 ../../library/sqlite3.rst:1756 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1736 ../../library/sqlite3.rst:1753 +#: ../../library/sqlite3.rst:1739 ../../library/sqlite3.rst:1756 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1738 +#: ../../library/sqlite3.rst:1741 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1738 ../../library/sqlite3.rst:1755 +#: ../../library/sqlite3.rst:1741 ../../library/sqlite3.rst:1758 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1740 ../../library/sqlite3.rst:1758 +#: ../../library/sqlite3.rst:1743 ../../library/sqlite3.rst:1761 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1740 ../../library/sqlite3.rst:1758 +#: ../../library/sqlite3.rst:1743 ../../library/sqlite3.rst:1761 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1744 +#: ../../library/sqlite3.rst:1747 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1755 +#: ../../library/sqlite3.rst:1758 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1761 +#: ../../library/sqlite3.rst:1764 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1695,42 +1697,42 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1771 +#: ../../library/sqlite3.rst:1774 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1773 +#: ../../library/sqlite3.rst:1776 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1776 +#: ../../library/sqlite3.rst:1779 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1780 +#: ../../library/sqlite3.rst:1783 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1784 +#: ../../library/sqlite3.rst:1787 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1788 +#: ../../library/sqlite3.rst:1791 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1794 +#: ../../library/sqlite3.rst:1797 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1738,15 +1740,15 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1803 +#: ../../library/sqlite3.rst:1806 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:1808 +#: ../../library/sqlite3.rst:1811 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:1810 +#: ../../library/sqlite3.rst:1813 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1754,7 +1756,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:1823 +#: ../../library/sqlite3.rst:1826 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1762,7 +1764,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:1828 +#: ../../library/sqlite3.rst:1831 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -1773,24 +1775,24 @@ msgid "" "are ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1865 +#: ../../library/sqlite3.rst:1868 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:1872 +#: ../../library/sqlite3.rst:1875 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1874 +#: ../../library/sqlite3.rst:1877 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1878 +#: ../../library/sqlite3.rst:1881 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1800,11 +1802,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1890 +#: ../../library/sqlite3.rst:1893 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1892 +#: ../../library/sqlite3.rst:1895 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1814,84 +1816,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1923 +#: ../../library/sqlite3.rst:1926 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1925 +#: ../../library/sqlite3.rst:1928 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1955 +#: ../../library/sqlite3.rst:1958 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1957 +#: ../../library/sqlite3.rst:1960 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1962 +#: ../../library/sqlite3.rst:1965 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1965 +#: ../../library/sqlite3.rst:1968 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1970 +#: ../../library/sqlite3.rst:1973 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1979 +#: ../../library/sqlite3.rst:1982 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1983 +#: ../../library/sqlite3.rst:1986 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1984 +#: ../../library/sqlite3.rst:1987 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1985 +#: ../../library/sqlite3.rst:1988 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1989 +#: ../../library/sqlite3.rst:1992 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2040 +#: ../../library/sqlite3.rst:2043 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2042 +#: ../../library/sqlite3.rst:2045 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2104 +#: ../../library/sqlite3.rst:2107 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2106 +#: ../../library/sqlite3.rst:2109 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1903,11 +1905,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2147 +#: ../../library/sqlite3.rst:2150 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2149 +#: ../../library/sqlite3.rst:2152 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1917,58 +1919,58 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2158 +#: ../../library/sqlite3.rst:2161 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2163 +#: ../../library/sqlite3.rst:2166 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2196 +#: ../../library/sqlite3.rst:2199 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2198 +#: ../../library/sqlite3.rst:2201 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2200 +#: ../../library/sqlite3.rst:2203 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2209 +#: ../../library/sqlite3.rst:2212 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2219 +#: ../../library/sqlite3.rst:2222 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2233 +#: ../../library/sqlite3.rst:2236 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2242 +#: ../../library/sqlite3.rst:2245 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2244 +#: ../../library/sqlite3.rst:2247 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`." msgstr "" -#: ../../library/sqlite3.rst:2249 +#: ../../library/sqlite3.rst:2252 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -1976,7 +1978,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2254 +#: ../../library/sqlite3.rst:2257 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -1984,51 +1986,51 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2264 +#: ../../library/sqlite3.rst:2267 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2279 +#: ../../library/sqlite3.rst:2282 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2288 +#: ../../library/sqlite3.rst:2291 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2298 +#: ../../library/sqlite3.rst:2301 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2309 +#: ../../library/sqlite3.rst:2312 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2324 +#: ../../library/sqlite3.rst:2327 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`." msgstr "" -#: ../../library/sqlite3.rst:2332 +#: ../../library/sqlite3.rst:2335 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2337 +#: ../../library/sqlite3.rst:2340 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2339 +#: ../../library/sqlite3.rst:2342 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2342 +#: ../../library/sqlite3.rst:2345 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2042,7 +2044,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2355 +#: ../../library/sqlite3.rst:2358 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2052,14 +2054,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2363 +#: ../../library/sqlite3.rst:2366 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2367 +#: ../../library/sqlite3.rst:2370 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." diff --git a/using/windows.po b/using/windows.po index b9293164d3..3dcfeee787 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-30 00:28+0000\n" +"POT-Creation-Date: 2023-02-02 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -245,11 +245,11 @@ msgid "" "list of available options is shown below." msgstr "" -#: ../../using/windows.rst:140 ../../using/windows.rst:1044 +#: ../../using/windows.rst:140 ../../using/windows.rst:1069 msgid "Name" msgstr "" -#: ../../using/windows.rst:140 ../../using/windows.rst:1044 +#: ../../using/windows.rst:140 ../../using/windows.rst:1069 msgid "Description" msgstr "描述" @@ -1228,36 +1228,58 @@ msgid "" msgstr "" #: ../../using/windows.rst:733 -msgid "You should find the latest version of Python 3.x starts." -msgstr "" - -#: ../../using/windows.rst:735 msgid "" "If you see the following error, you do not have the launcher installed::" msgstr "" -#: ../../using/windows.rst:740 -msgid "" -"Per-user installations of Python do not add the launcher to :envvar:`PATH` " -"unless the option was selected on installation." -msgstr "" - -#: ../../using/windows.rst:743 +#: ../../using/windows.rst:738 msgid "The command::" msgstr "" "指令:\n" "\n" "::" -#: ../../using/windows.rst:747 +#: ../../using/windows.rst:742 msgid "displays the currently installed version(s) of Python." msgstr "" +#: ../../using/windows.rst:744 +msgid "" +"The ``-x.y`` argument is the short form of the ``-V:Company/Tag`` argument, " +"which allows selecting a specific Python runtime, including those that may " +"have come from somewhere other than python.org. Any runtime registered by " +"following :pep:`514` will be discoverable. The ``--list`` command lists all " +"available runtimes using the ``-V:`` format." +msgstr "" + #: ../../using/windows.rst:750 +msgid "" +"When using the ``-V:`` argument, specifying the Company will limit selection " +"to runtimes from that provider, while specifying only the Tag will select " +"from all providers. Note that omitting the slash implies a tag::" +msgstr "" + +#: ../../using/windows.rst:763 +msgid "" +"The short form of the argument (``-3``) only ever selects from core Python " +"releases, and not other distributions. However, the longer form (``-V:3``) " +"will select from any." +msgstr "" + +#: ../../using/windows.rst:767 +msgid "" +"The Company is matched on the full string, case-insenitive. The Tag is " +"matched oneither the full string, or a prefix, provided the next character " +"is a dot or a hyphen. This allows ``-V:3.1`` to match ``3.1-32``, but not " +"``3.10``. Tags are sorted using numerical ordering (``3.10`` is newer than " +"``3.1``), but are compared using text (``-V:3.01`` does not match ``3.1``)." +msgstr "" + +#: ../../using/windows.rst:775 msgid "Virtual environments" msgstr "虛擬環境(Virtual environment)" -#: ../../using/windows.rst:754 +#: ../../using/windows.rst:779 msgid "" "If the launcher is run with no explicit Python version specification, and a " "virtual environment (created with the standard library :mod:`venv` module or " @@ -1267,27 +1289,27 @@ msgid "" "specify the global Python version." msgstr "" -#: ../../using/windows.rst:762 +#: ../../using/windows.rst:787 msgid "From a script" msgstr "" -#: ../../using/windows.rst:764 +#: ../../using/windows.rst:789 msgid "" "Let's create a test Python script - create a file called ``hello.py`` with " "the following contents" msgstr "" -#: ../../using/windows.rst:773 +#: ../../using/windows.rst:798 msgid "From the directory in which hello.py lives, execute the command::" msgstr "" -#: ../../using/windows.rst:777 +#: ../../using/windows.rst:802 msgid "" "You should notice the version number of your latest Python 2.x installation " "is printed. Now try changing the first line to be:" msgstr "" -#: ../../using/windows.rst:784 +#: ../../using/windows.rst:809 msgid "" "Re-executing the command should now print the latest Python 3.x information. " "As with the above command-line examples, you can specify a more explicit " @@ -1296,7 +1318,7 @@ msgid "" "information printed." msgstr "" -#: ../../using/windows.rst:790 +#: ../../using/windows.rst:815 msgid "" "Note that unlike interactive use, a bare \"python\" will use the latest " "version of Python 2.x that you have installed. This is for backward " @@ -1304,11 +1326,11 @@ msgid "" "typically refers to Python 2." msgstr "" -#: ../../using/windows.rst:796 +#: ../../using/windows.rst:821 msgid "From file associations" msgstr "從檔案關聯" -#: ../../using/windows.rst:798 +#: ../../using/windows.rst:823 msgid "" "The launcher should have been associated with Python files (i.e. ``.py``, ``." "pyw``, ``.pyc`` files) when it was installed. This means that when you " @@ -1317,17 +1339,17 @@ msgid "" "have the script specify the version which should be used." msgstr "" -#: ../../using/windows.rst:804 +#: ../../using/windows.rst:829 msgid "" "The key benefit of this is that a single launcher can support multiple " "Python versions at the same time depending on the contents of the first line." msgstr "" -#: ../../using/windows.rst:808 +#: ../../using/windows.rst:833 msgid "Shebang Lines" msgstr "" -#: ../../using/windows.rst:810 +#: ../../using/windows.rst:835 msgid "" "If the first line of a script file starts with ``#!``, it is known as a " "\"shebang\" line. Linux and other Unix like operating systems have native " @@ -1337,34 +1359,34 @@ msgid "" "demonstrate their use." msgstr "" -#: ../../using/windows.rst:817 +#: ../../using/windows.rst:842 msgid "" "To allow shebang lines in Python scripts to be portable between Unix and " "Windows, this launcher supports a number of 'virtual' commands to specify " "which interpreter to use. The supported virtual commands are:" msgstr "" -#: ../../using/windows.rst:821 +#: ../../using/windows.rst:846 msgid "``/usr/bin/env``" msgstr "``/usr/bin/env``" -#: ../../using/windows.rst:822 +#: ../../using/windows.rst:847 msgid "``/usr/bin/python``" msgstr "``/usr/bin/python``" -#: ../../using/windows.rst:823 +#: ../../using/windows.rst:848 msgid "``/usr/local/bin/python``" msgstr "``/usr/local/bin/python``" -#: ../../using/windows.rst:824 +#: ../../using/windows.rst:849 msgid "``python``" msgstr "``python``" -#: ../../using/windows.rst:826 +#: ../../using/windows.rst:851 msgid "For example, if the first line of your script starts with" msgstr "" -#: ../../using/windows.rst:832 +#: ../../using/windows.rst:857 msgid "" "The default Python will be located and used. As many Python scripts written " "to work on Unix will already have this line, you should find these scripts " @@ -1373,7 +1395,7 @@ msgid "" "of the shebang lines starting with ``/usr``." msgstr "" -#: ../../using/windows.rst:838 +#: ../../using/windows.rst:863 msgid "" "Any of the above virtual commands can be suffixed with an explicit version " "(either just the major version, or the major and minor version). Furthermore " @@ -1382,21 +1404,21 @@ msgid "" "python 3.7." msgstr "" -#: ../../using/windows.rst:846 +#: ../../using/windows.rst:871 msgid "" "Beginning with python launcher 3.7 it is possible to request 64-bit version " "by the \"-64\" suffix. Furthermore it is possible to specify a major and " "architecture without minor (i.e. ``/usr/bin/python3-64``)." msgstr "" -#: ../../using/windows.rst:852 +#: ../../using/windows.rst:877 msgid "" "The \"-64\" suffix is deprecated, and now implies \"any architecture that is " "not provably i386/32-bit\". To request a specific environment, use the new " "``-V:`` argument with the complete tag." msgstr "" -#: ../../using/windows.rst:856 +#: ../../using/windows.rst:881 msgid "" "The ``/usr/bin/env`` form of shebang line has one further special property. " "Before looking for installed Python interpreters, this form will search the " @@ -1410,7 +1432,7 @@ msgid "" "of :envvar:`PATH`." msgstr "" -#: ../../using/windows.rst:867 +#: ../../using/windows.rst:892 msgid "" "Shebang lines that do not match any of these patterns are looked up in the " "``[commands]`` section of the launcher's :ref:`.INI file `. " @@ -1421,7 +1443,7 @@ msgid "" "part of the filename)." msgstr "" -#: ../../using/windows.rst:880 +#: ../../using/windows.rst:905 msgid "" "Any commands not found in the .INI file are treated as **Windows** " "executable paths that are absolute or relative to the directory containing " @@ -1432,29 +1454,29 @@ msgid "" "will be appended." msgstr "" -#: ../../using/windows.rst:889 +#: ../../using/windows.rst:914 msgid "Arguments in shebang lines" msgstr "" -#: ../../using/windows.rst:891 +#: ../../using/windows.rst:916 msgid "" "The shebang lines can also specify additional options to be passed to the " "Python interpreter. For example, if you have a shebang line:" msgstr "" -#: ../../using/windows.rst:898 +#: ../../using/windows.rst:923 msgid "Then Python will be started with the ``-v`` option" msgstr "" -#: ../../using/windows.rst:901 +#: ../../using/windows.rst:926 msgid "Customization" msgstr "" -#: ../../using/windows.rst:906 +#: ../../using/windows.rst:931 msgid "Customization via INI files" msgstr "" -#: ../../using/windows.rst:908 +#: ../../using/windows.rst:933 msgid "" "Two .ini files will be searched by the launcher - ``py.ini`` in the current " "user's application data directory (``%LOCALAPPDATA%`` or ``$env:" @@ -1463,7 +1485,7 @@ msgid "" "e. py.exe) and for the 'windows' version (i.e. pyw.exe)." msgstr "" -#: ../../using/windows.rst:914 +#: ../../using/windows.rst:939 msgid "" "Customization specified in the \"application directory\" will have " "precedence over the one next to the executable, so a user, who may not have " @@ -1471,11 +1493,11 @@ msgid "" "that global .ini file." msgstr "" -#: ../../using/windows.rst:919 +#: ../../using/windows.rst:944 msgid "Customizing default Python versions" msgstr "" -#: ../../using/windows.rst:921 +#: ../../using/windows.rst:946 msgid "" "In some cases, a version qualifier can be included in a command to dictate " "which version of Python will be used by the command. A version qualifier " @@ -1485,13 +1507,13 @@ msgid "" "\"-32\" or \"-64\"." msgstr "" -#: ../../using/windows.rst:927 +#: ../../using/windows.rst:952 msgid "" "For example, a shebang line of ``#!python`` has no version qualifier, while " "``#!python3`` has a version qualifier which specifies only a major version." msgstr "" -#: ../../using/windows.rst:930 +#: ../../using/windows.rst:955 msgid "" "If no version qualifiers are found in a command, the environment variable :" "envvar:`PY_PYTHON` can be set to specify the default version qualifier. If " @@ -1501,7 +1523,7 @@ msgid "" "launcher included with Python 3.7 or newer.)" msgstr "" -#: ../../using/windows.rst:937 +#: ../../using/windows.rst:962 msgid "" "If no minor version qualifiers are found, the environment variable " "``PY_PYTHON{major}`` (where ``{major}`` is the current major version " @@ -1512,7 +1534,7 @@ msgid "" "version in that family." msgstr "" -#: ../../using/windows.rst:945 +#: ../../using/windows.rst:970 msgid "" "On 64-bit Windows with both 32-bit and 64-bit implementations of the same " "(major.minor) Python version installed, the 64-bit version will always be " @@ -1526,30 +1548,30 @@ msgid "" "suffix can be used on a version specifier to change this behaviour." msgstr "" -#: ../../using/windows.rst:956 +#: ../../using/windows.rst:981 msgid "Examples:" msgstr "範例:" -#: ../../using/windows.rst:958 +#: ../../using/windows.rst:983 msgid "" "If no relevant options are set, the commands ``python`` and ``python2`` will " "use the latest Python 2.x version installed and the command ``python3`` will " "use the latest Python 3.x installed." msgstr "" -#: ../../using/windows.rst:962 +#: ../../using/windows.rst:987 msgid "" "The command ``python3.7`` will not consult any options at all as the " "versions are fully specified." msgstr "" -#: ../../using/windows.rst:965 +#: ../../using/windows.rst:990 msgid "" "If ``PY_PYTHON=3``, the commands ``python`` and ``python3`` will both use " "the latest installed Python 3 version." msgstr "" -#: ../../using/windows.rst:968 +#: ../../using/windows.rst:993 msgid "" "If ``PY_PYTHON=3.7-32``, the command ``python`` will use the 32-bit " "implementation of 3.7 whereas the command ``python3`` will use the latest " @@ -1557,13 +1579,13 @@ msgid "" "specified.)" msgstr "" -#: ../../using/windows.rst:973 +#: ../../using/windows.rst:998 msgid "" "If ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7``, the commands ``python`` and " "``python3`` will both use specifically 3.7" msgstr "" -#: ../../using/windows.rst:976 +#: ../../using/windows.rst:1001 msgid "" "In addition to environment variables, the same settings can be configured in " "the .INI file used by the launcher. The section in the INI file is called " @@ -1573,25 +1595,25 @@ msgid "" "will override things specified in the INI file." msgstr "" -#: ../../using/windows.rst:983 +#: ../../using/windows.rst:1008 msgid "For example:" msgstr "" -#: ../../using/windows.rst:985 +#: ../../using/windows.rst:1010 msgid "Setting ``PY_PYTHON=3.7`` is equivalent to the INI file containing:" msgstr "" -#: ../../using/windows.rst:992 +#: ../../using/windows.rst:1017 msgid "" "Setting ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7`` is equivalent to the INI file " "containing:" msgstr "" -#: ../../using/windows.rst:1002 +#: ../../using/windows.rst:1027 msgid "Diagnostics" msgstr "" -#: ../../using/windows.rst:1004 +#: ../../using/windows.rst:1029 msgid "" "If an environment variable :envvar:`PYLAUNCHER_DEBUG` is set (to any value), " "the launcher will print diagnostic information to stderr (i.e. to the " @@ -1601,11 +1623,11 @@ msgid "" "the target Python. It is primarily intended for testing and debugging." msgstr "" -#: ../../using/windows.rst:1012 +#: ../../using/windows.rst:1037 msgid "Dry Run" msgstr "" -#: ../../using/windows.rst:1014 +#: ../../using/windows.rst:1039 msgid "" "If an environment variable :envvar:`PYLAUNCHER_DRYRUN` is set (to any " "value), the launcher will output the command it would have run, but will not " @@ -1615,11 +1637,11 @@ msgid "" "correctly in the console." msgstr "" -#: ../../using/windows.rst:1022 +#: ../../using/windows.rst:1047 msgid "Install on demand" msgstr "安裝隨選" -#: ../../using/windows.rst:1024 +#: ../../using/windows.rst:1049 msgid "" "If an environment variable :envvar:`PYLAUNCHER_ALLOW_INSTALL` is set (to any " "value), and the requested Python version is not installed but is available " @@ -1628,7 +1650,7 @@ msgid "" "again." msgstr "" -#: ../../using/windows.rst:1029 +#: ../../using/windows.rst:1054 msgid "" "An additional :envvar:`PYLAUNCHER_ALWAYS_INSTALL` variable causes the " "launcher to always try to install Python, even if it is detected. This is " @@ -1636,137 +1658,137 @@ msgid "" "`PYLAUNCHER_DRYRUN`)." msgstr "" -#: ../../using/windows.rst:1034 +#: ../../using/windows.rst:1059 msgid "Return codes" msgstr "" -#: ../../using/windows.rst:1036 +#: ../../using/windows.rst:1061 msgid "" "The following exit codes may be returned by the Python launcher. " "Unfortunately, there is no way to distinguish these from the exit code of " "Python itself." msgstr "" -#: ../../using/windows.rst:1039 +#: ../../using/windows.rst:1064 msgid "" "The names of codes are as used in the sources, and are only for reference. " "There is no way to access or resolve them apart from reading this page. " "Entries are listed in alphabetical order of names." msgstr "" -#: ../../using/windows.rst:1044 +#: ../../using/windows.rst:1069 msgid "Value" msgstr "" -#: ../../using/windows.rst:1046 +#: ../../using/windows.rst:1071 msgid "RC_BAD_VENV_CFG" msgstr "RC_BAD_VENV_CFG" -#: ../../using/windows.rst:1046 +#: ../../using/windows.rst:1071 msgid "107" msgstr "107" -#: ../../using/windows.rst:1046 +#: ../../using/windows.rst:1071 msgid "A :file:`pyvenv.cfg` was found but is corrupt." msgstr "" -#: ../../using/windows.rst:1048 +#: ../../using/windows.rst:1073 msgid "RC_CREATE_PROCESS" msgstr "RC_CREATE_PROCESS" -#: ../../using/windows.rst:1048 +#: ../../using/windows.rst:1073 msgid "101" msgstr "101" -#: ../../using/windows.rst:1048 +#: ../../using/windows.rst:1073 msgid "Failed to launch Python." msgstr "" -#: ../../using/windows.rst:1050 +#: ../../using/windows.rst:1075 msgid "RC_INSTALLING" msgstr "RC_INSTALLING" -#: ../../using/windows.rst:1050 +#: ../../using/windows.rst:1075 msgid "111" msgstr "111" -#: ../../using/windows.rst:1050 +#: ../../using/windows.rst:1075 msgid "" "An install was started, but the command will need to be re-run after it " "completes." msgstr "" -#: ../../using/windows.rst:1053 +#: ../../using/windows.rst:1078 msgid "RC_INTERNAL_ERROR" msgstr "RC_INTERNAL_ERROR" -#: ../../using/windows.rst:1053 +#: ../../using/windows.rst:1078 msgid "109" msgstr "109" -#: ../../using/windows.rst:1053 +#: ../../using/windows.rst:1078 msgid "Unexpected error. Please report a bug." msgstr "" -#: ../../using/windows.rst:1055 +#: ../../using/windows.rst:1080 msgid "RC_NO_COMMANDLINE" msgstr "RC_NO_COMMANDLINE" -#: ../../using/windows.rst:1055 +#: ../../using/windows.rst:1080 msgid "108" msgstr "108" -#: ../../using/windows.rst:1055 +#: ../../using/windows.rst:1080 msgid "Unable to obtain command line from the operating system." msgstr "" -#: ../../using/windows.rst:1058 +#: ../../using/windows.rst:1083 msgid "RC_NO_PYTHON" msgstr "RC_NO_PYTHON" -#: ../../using/windows.rst:1058 +#: ../../using/windows.rst:1083 msgid "103" msgstr "103" -#: ../../using/windows.rst:1058 +#: ../../using/windows.rst:1083 msgid "Unable to locate the requested version." msgstr "" -#: ../../using/windows.rst:1060 +#: ../../using/windows.rst:1085 msgid "RC_NO_VENV_CFG" msgstr "RC_NO_VENV_CFG" -#: ../../using/windows.rst:1060 +#: ../../using/windows.rst:1085 msgid "106" msgstr "106" -#: ../../using/windows.rst:1060 +#: ../../using/windows.rst:1085 msgid "A :file:`pyvenv.cfg` was required but not found." msgstr "" -#: ../../using/windows.rst:1068 +#: ../../using/windows.rst:1093 msgid "Finding modules" msgstr "" -#: ../../using/windows.rst:1070 +#: ../../using/windows.rst:1095 msgid "" "These notes supplement the description at :ref:`sys-path-init` with detailed " "Windows notes." msgstr "" -#: ../../using/windows.rst:1073 +#: ../../using/windows.rst:1098 msgid "" "When no ``._pth`` file is found, this is how :data:`sys.path` is populated " "on Windows:" msgstr "" -#: ../../using/windows.rst:1076 +#: ../../using/windows.rst:1101 msgid "" "An empty entry is added at the start, which corresponds to the current " "directory." msgstr "" -#: ../../using/windows.rst:1079 +#: ../../using/windows.rst:1104 msgid "" "If the environment variable :envvar:`PYTHONPATH` exists, as described in :" "ref:`using-on-envvars`, its entries are added next. Note that on Windows, " @@ -1774,7 +1796,7 @@ msgid "" "from the colon used in drive identifiers (``C:\\`` etc.)." msgstr "" -#: ../../using/windows.rst:1084 +#: ../../using/windows.rst:1109 msgid "" "Additional \"application paths\" can be added in the registry as subkeys of :" "samp:`\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\{version}\\\\PythonPath` under " @@ -1784,7 +1806,7 @@ msgid "" "installers only use HKLM, so HKCU is typically empty.)" msgstr "" -#: ../../using/windows.rst:1091 +#: ../../using/windows.rst:1116 msgid "" "If the environment variable :envvar:`PYTHONHOME` is set, it is assumed as " "\"Python Home\". Otherwise, the path of the main Python executable is used " @@ -1795,31 +1817,31 @@ msgid "" "PythonPath stored in the registry." msgstr "" -#: ../../using/windows.rst:1099 +#: ../../using/windows.rst:1124 msgid "" "If the Python Home cannot be located, no :envvar:`PYTHONPATH` is specified " "in the environment, and no registry entries can be found, a default path " "with relative entries is used (e.g. ``.\\Lib;.\\plat-win``, etc)." msgstr "" -#: ../../using/windows.rst:1103 +#: ../../using/windows.rst:1128 msgid "" "If a ``pyvenv.cfg`` file is found alongside the main executable or in the " "directory one level above the executable, the following variations apply:" msgstr "" -#: ../../using/windows.rst:1106 +#: ../../using/windows.rst:1131 msgid "" "If ``home`` is an absolute path and :envvar:`PYTHONHOME` is not set, this " "path is used instead of the path to the main executable when deducing the " "home location." msgstr "" -#: ../../using/windows.rst:1110 +#: ../../using/windows.rst:1135 msgid "The end result of all this is:" msgstr "最終這所有的結果為:" -#: ../../using/windows.rst:1112 +#: ../../using/windows.rst:1137 msgid "" "When running :file:`python.exe`, or any other .exe in the main Python " "directory (either an installed version, or directly from the PCbuild " @@ -1827,7 +1849,7 @@ msgid "" "ignored. Other \"application paths\" in the registry are always read." msgstr "" -#: ../../using/windows.rst:1117 +#: ../../using/windows.rst:1142 msgid "" "When Python is hosted in another .exe (different directory, embedded via " "COM, etc), the \"Python Home\" will not be deduced, so the core path from " @@ -1835,20 +1857,20 @@ msgid "" "always read." msgstr "" -#: ../../using/windows.rst:1121 +#: ../../using/windows.rst:1146 msgid "" "If Python can't find its home and there are no registry value (frozen .exe, " "some very strange installation setup) you get a path with some default, but " "relative, paths." msgstr "" -#: ../../using/windows.rst:1125 +#: ../../using/windows.rst:1150 msgid "" "For those who want to bundle Python into their application or distribution, " "the following advice will prevent conflicts with other installations:" msgstr "" -#: ../../using/windows.rst:1128 +#: ../../using/windows.rst:1153 msgid "" "Include a ``._pth`` file alongside your executable containing the " "directories to include. This will ignore paths listed in the registry and " @@ -1856,20 +1878,20 @@ msgid "" "listed." msgstr "" -#: ../../using/windows.rst:1133 +#: ../../using/windows.rst:1158 msgid "" "If you are loading :file:`python3.dll` or :file:`python37.dll` in your own " "executable, explicitly call :c:func:`Py_SetPath` or (at least) :c:func:" "`Py_SetProgramName` before :c:func:`Py_Initialize`." msgstr "" -#: ../../using/windows.rst:1137 +#: ../../using/windows.rst:1162 msgid "" "Clear and/or overwrite :envvar:`PYTHONPATH` and set :envvar:`PYTHONHOME` " "before launching :file:`python.exe` from your application." msgstr "" -#: ../../using/windows.rst:1140 +#: ../../using/windows.rst:1165 msgid "" "If you cannot use the previous suggestions (for example, you are a " "distribution that allows people to run :file:`python.exe` directly), ensure " @@ -1878,7 +1900,7 @@ msgid "" "correctly named ZIP file will be detected instead.)" msgstr "" -#: ../../using/windows.rst:1146 +#: ../../using/windows.rst:1171 msgid "" "These will ensure that the files in a system-wide installation will not take " "precedence over the copy of the standard library bundled with your " @@ -1888,19 +1910,19 @@ msgid "" "packages." msgstr "" -#: ../../using/windows.rst:1155 +#: ../../using/windows.rst:1180 msgid "" "Adds ``._pth`` file support and removes ``applocal`` option from ``pyvenv." "cfg``." msgstr "" -#: ../../using/windows.rst:1157 +#: ../../using/windows.rst:1182 msgid "" "Adds ``pythonXX.zip`` as a potential landmark when directly adjacent to the " "executable." msgstr "" -#: ../../using/windows.rst:1163 +#: ../../using/windows.rst:1188 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " @@ -1908,88 +1930,88 @@ msgid "" "explicitly added to :attr:`sys.meta_path` in the future." msgstr "" -#: ../../using/windows.rst:1169 +#: ../../using/windows.rst:1194 msgid "Additional modules" msgstr "" -#: ../../using/windows.rst:1171 +#: ../../using/windows.rst:1196 msgid "" "Even though Python aims to be portable among all platforms, there are " "features that are unique to Windows. A couple of modules, both in the " "standard library and external, and snippets exist to use these features." msgstr "" -#: ../../using/windows.rst:1175 +#: ../../using/windows.rst:1200 msgid "" "The Windows-specific standard modules are documented in :ref:`mswin-specific-" "services`." msgstr "" -#: ../../using/windows.rst:1179 +#: ../../using/windows.rst:1204 msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1181 +#: ../../using/windows.rst:1206 msgid "" "The `PyWin32 `_ module by Mark Hammond is " "a collection of modules for advanced Windows-specific support. This " "includes utilities for:" msgstr "" -#: ../../using/windows.rst:1185 +#: ../../using/windows.rst:1210 msgid "" "`Component Object Model `_ (COM)" msgstr "" -#: ../../using/windows.rst:1188 +#: ../../using/windows.rst:1213 msgid "Win32 API calls" msgstr "Win32 API 呼叫" -#: ../../using/windows.rst:1189 +#: ../../using/windows.rst:1214 msgid "Registry" msgstr "登錄檔(Registry)" -#: ../../using/windows.rst:1190 +#: ../../using/windows.rst:1215 msgid "Event log" msgstr "事件日誌(Event log)" -#: ../../using/windows.rst:1191 +#: ../../using/windows.rst:1216 msgid "" "`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" -#: ../../using/windows.rst:1195 +#: ../../using/windows.rst:1220 msgid "" "`PythonWin `_ is a sample MFC application shipped with PyWin32. " "It is an embeddable IDE with a built-in debugger." msgstr "" -#: ../../using/windows.rst:1202 +#: ../../using/windows.rst:1227 msgid "" "`Win32 How Do I...? `_" msgstr "" "`Win32 How Do I...? `_" -#: ../../using/windows.rst:1202 +#: ../../using/windows.rst:1227 msgid "by Tim Golden" msgstr "由 Tim Golden 所著" -#: ../../using/windows.rst:1204 +#: ../../using/windows.rst:1229 msgid "`Python and COM `_" msgstr "`Python and COM `_" -#: ../../using/windows.rst:1205 +#: ../../using/windows.rst:1230 msgid "by David and Paul Boddie" msgstr "由 David 與 Paul Boddie 所著" -#: ../../using/windows.rst:1209 +#: ../../using/windows.rst:1234 msgid "cx_Freeze" msgstr "cx_Freeze" -#: ../../using/windows.rst:1211 +#: ../../using/windows.rst:1236 msgid "" "`cx_Freeze `_ is a :mod:" "`distutils` extension (see :ref:`extending-distutils`) which wraps Python " @@ -1998,11 +2020,11 @@ msgid "" "users to install Python." msgstr "" -#: ../../using/windows.rst:1219 +#: ../../using/windows.rst:1244 msgid "Compiling Python on Windows" msgstr "編譯 Python 在 Windows" -#: ../../using/windows.rst:1221 +#: ../../using/windows.rst:1246 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -2010,48 +2032,48 @@ msgid "" "devguide.python.org/setup/#get-the-source-code>`_." msgstr "" -#: ../../using/windows.rst:1226 +#: ../../using/windows.rst:1251 msgid "" "The source tree contains a build solution and project files for Microsoft " "Visual Studio, which is the compiler used to build the official Python " "releases. These files are in the :file:`PCbuild` directory." msgstr "" -#: ../../using/windows.rst:1230 +#: ../../using/windows.rst:1255 msgid "" "Check :file:`PCbuild/readme.txt` for general information on the build " "process." msgstr "" -#: ../../using/windows.rst:1232 +#: ../../using/windows.rst:1257 msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" -#: ../../using/windows.rst:1236 +#: ../../using/windows.rst:1261 msgid "Other Platforms" msgstr "其他平台" -#: ../../using/windows.rst:1238 +#: ../../using/windows.rst:1263 msgid "" "With ongoing development of Python, some platforms that used to be supported " "earlier are no longer supported (due to the lack of users or developers). " "Check :pep:`11` for details on all unsupported platforms." msgstr "" -#: ../../using/windows.rst:1242 +#: ../../using/windows.rst:1267 msgid "" "`Windows CE `_ is `no longer supported " "`__ since Python 3 (if it " "ever was)." msgstr "" -#: ../../using/windows.rst:1245 +#: ../../using/windows.rst:1270 msgid "" "The `Cygwin `_ installer offers to install the `Python " "interpreter `__ as well" msgstr "" -#: ../../using/windows.rst:1249 +#: ../../using/windows.rst:1274 msgid "" "See `Python for Windows `_ for " "detailed information about platforms with pre-compiled installers." From ddba9de0fef5d916163ac33afd1928b792f94bd5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 3 Feb 2023 00:36:08 +0000 Subject: [PATCH 019/130] sync with cpython bfac5d98 --- library/array.po | 99 +++++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/library/array.po b/library/array.po index e6eb3cadde..21b51d4890 100644 --- a/library/array.po +++ b/library/array.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-02 00:33+0000\n" +"POT-Creation-Date: 2023-02-03 00:34+0000\n" "PO-Revision-Date: 2021-11-23 18:40+0800\n" "Last-Translator: Benson Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -220,10 +220,11 @@ msgstr "" "即為 ``wchar_t`` 的別名。" #: ../../library/array.rst:61 +#, fuzzy msgid "" "The actual representation of values is determined by the machine " "architecture (strictly speaking, by the C implementation). The actual size " -"can be accessed through the :attr:`itemsize` attribute." +"can be accessed through the :attr:`array.itemsize` attribute." msgstr "" "實際上數值的表示方法是被機器的架構所決定(更精準地說,被 C 的實作方法決定)。" "實際的大小可以透過 :attr:`itemsize` 屬性存取。" @@ -262,15 +263,7 @@ msgstr "" "meth:`frombytes` 或 :meth:`fromunicode` 方法(參照下方)將元素新增到其中。其" "他情況時, 一個 iterable initializer 將被傳入 :meth:`extend` 方法之中。" -#: ../../library/array.rst:11 -msgid "" -"Raises an :ref:`auditing event ` ``array.__new__`` with arguments " -"``typecode``, ``initializer``." -msgstr "" -"引發\\ :ref:`稽核事件 (auditing event) ` ``array.__new__`` 並帶入引" -"數 ``typecode``\\ 、\\ ``initializer``\\。" - -#: ../../library/array.rst:91 +#: ../../library/array.rst:88 msgid "" "Array objects support the ordinary sequence operations of indexing, slicing, " "concatenation, and multiplication. When using slice assignment, the " @@ -285,30 +278,35 @@ msgstr "" "實作了緩衝區介面,可以在任何支援 :term:`bytes-like objects ` 的地方使用。" -#: ../../library/array.rst:97 -msgid "The following data items and methods are also supported:" -msgstr "提供下方的資料物件與方法:" +#: ../../library/array.rst:17 +msgid "" +"Raises an :ref:`auditing event ` ``array.__new__`` with arguments " +"``typecode``, ``initializer``." +msgstr "" +"引發\\ :ref:`稽核事件 (auditing event) ` ``array.__new__`` 並帶入引" +"數 ``typecode``\\ 、\\ ``initializer``\\。" -#: ../../library/array.rst:101 +#: ../../library/array.rst:99 msgid "The typecode character used to create the array." msgstr "typecode 字元被用在建立陣列時。" -#: ../../library/array.rst:106 +#: ../../library/array.rst:104 msgid "The length in bytes of one array item in the internal representation." msgstr "陣列當中的一個元素在內部需要的位元組長度。" -#: ../../library/array.rst:111 +#: ../../library/array.rst:109 msgid "Append a new item with value *x* to the end of the array." msgstr "新增一個元素 *x* 到陣列的最尾端。" -#: ../../library/array.rst:116 +#: ../../library/array.rst:114 +#, fuzzy msgid "" "Return a tuple ``(address, length)`` giving the current memory address and " "the length in elements of the buffer used to hold array's contents. The " "size of the memory buffer in bytes can be computed as ``array.buffer_info()" "[1] * array.itemsize``. This is occasionally useful when working with low-" "level (and inherently unsafe) I/O interfaces that require memory addresses, " -"such as certain :c:func:`ioctl` operations. The returned numbers are valid " +"such as certain :c:func:`!ioctl` operations. The returned numbers are valid " "as long as the array exists and no length-changing operations are applied to " "it." msgstr "" @@ -318,7 +316,7 @@ msgstr "" "用,例如 :c:func:`ioctl` 指令。只要陣列存在且沒有使用任何更改長度的操作時,回" "傳的數值就有效。" -#: ../../library/array.rst:126 +#: ../../library/array.rst:124 msgid "" "When using array objects from code written in C or C++ (the only way to " "effectively make use of this information), it makes more sense to use the " @@ -330,7 +328,7 @@ msgstr "" "適當的做法是使用陣列物件支援的緩衝區介面。這個方法維護了向後兼容性,並應該在" "新的程式碼中避免。關於緩衝區介面的文件在\\ :ref:`bufferobjects`\\ 。" -#: ../../library/array.rst:135 +#: ../../library/array.rst:133 msgid "" "\"Byteswap\" all items of the array. This is only supported for values " "which are 1, 2, 4, or 8 bytes in size; for other types of values, :exc:" @@ -341,11 +339,11 @@ msgstr "" "列,其他型別的值會導致 :exc:`RuntimeError`\\ 。這在從機器讀取位元順序不同的檔" "案時很有用。" -#: ../../library/array.rst:143 +#: ../../library/array.rst:141 msgid "Return the number of occurrences of *x* in the array." msgstr "回傳 *x* 在陣列中出現了幾次。" -#: ../../library/array.rst:148 +#: ../../library/array.rst:146 msgid "" "Append items from *iterable* to the end of the array. If *iterable* is " "another array, it must have *exactly* the same type code; if not, :exc:" @@ -357,7 +355,7 @@ msgstr "" "是一個陣列,它必須可以被疊代 (iterable) 且其中的元素必須是可以被加入陣列中的" "正確型別。" -#: ../../library/array.rst:156 +#: ../../library/array.rst:154 msgid "" "Appends items from the string, interpreting the string as an array of " "machine values (as if it had been read from a file using the :meth:" @@ -366,11 +364,12 @@ msgstr "" "從字串中新增元素。讀取時會將字串當作一個機器數值組成的陣列(就像從檔案中使" "用 :meth:`fromfile` 方法讀出的資料)。" -#: ../../library/array.rst:159 -msgid ":meth:`fromstring` is renamed to :meth:`frombytes` for clarity." +#: ../../library/array.rst:157 +#, fuzzy +msgid ":meth:`!fromstring` is renamed to :meth:`frombytes` for clarity." msgstr "將 :meth:`fromstring` 更名為 :meth:`frombytes`\\ ,使其更加清晰易懂。" -#: ../../library/array.rst:165 +#: ../../library/array.rst:163 msgid "" "Read *n* items (as machine values) from the :term:`file object` *f* and " "append them to the end of the array. If less than *n* items are available, :" @@ -381,7 +380,7 @@ msgstr "" "入陣列的最尾端。如果只有少於 *n* 個有效的元素會導致 :exc:`EOFError`\\ ,但有" "效的元素仍然會被加入陣列中。" -#: ../../library/array.rst:173 +#: ../../library/array.rst:171 msgid "" "Append items from the list. This is equivalent to ``for x in list: a." "append(x)`` except that if there is a type error, the array is unchanged." @@ -389,7 +388,7 @@ msgstr "" "從 list 中新增元素。這等價於 ``for x in list: a.append(x)``\\ ,除了有型別錯" "誤產生時,陣列會保持原狀不會被更改。" -#: ../../library/array.rst:179 +#: ../../library/array.rst:177 msgid "" "Extends this array with data from the given unicode string. The array must " "be a type ``'u'`` array; otherwise a :exc:`ValueError` is raised. Use " @@ -400,7 +399,7 @@ msgstr "" "導致 :exc:`ValueError` 錯誤。使用 ``array.frombytes(unicodestring." "encode(enc))`` 來新增 Unicode 資料到一個其他型別的陣列。" -#: ../../library/array.rst:187 +#: ../../library/array.rst:185 msgid "" "Return the smallest *i* such that *i* is the index of the first occurrence " "of *x* in the array. The optional arguments *start* and *stop* can be " @@ -411,17 +410,17 @@ msgstr "" "數 *start* 及 *stop* 則可以被用來在指定的陣列空間中搜尋 *x*\\ 。如果 *x* 不存" "在將導致 :exc:`ValueError`\\ 。" -#: ../../library/array.rst:192 +#: ../../library/array.rst:190 msgid "Added optional *start* and *stop* parameters." msgstr "新增選擇性的參數 *start* 及 *stop*\\ 。" -#: ../../library/array.rst:197 +#: ../../library/array.rst:196 msgid "" "Insert a new item with value *x* in the array before position *i*. Negative " "values are treated as being relative to the end of the array." msgstr "在位置 *i* 之前插入一個元素 *x*\\ 。負數的索引值會從陣列尾端開始數。" -#: ../../library/array.rst:203 +#: ../../library/array.rst:202 msgid "" "Removes the item with the index *i* from the array and returns it. The " "optional argument defaults to ``-1``, so that by default the last item is " @@ -430,15 +429,15 @@ msgstr "" "移除並回傳陣列索引值 *i* 的元素。選擇性的引數 *i* 預設為 ``-1``\\ ,所以預設" "會刪除並回傳最後一個元素。" -#: ../../library/array.rst:210 +#: ../../library/array.rst:209 msgid "Remove the first occurrence of *x* from the array." msgstr "從陣列中刪除第一個出現的 *x*\\ 。" -#: ../../library/array.rst:215 +#: ../../library/array.rst:214 msgid "Reverse the order of the items in the array." msgstr "反轉陣列中元素的順序。" -#: ../../library/array.rst:220 +#: ../../library/array.rst:219 msgid "" "Convert the array to an array of machine values and return the bytes " "representation (the same sequence of bytes that would be written to a file " @@ -447,19 +446,20 @@ msgstr "" "將陣列轉為另一個機器數值組成的陣列並回傳它的位元組表示(跟用 :meth:`tofile` " "方法寫入檔案時的位元序列相同)。" -#: ../../library/array.rst:224 -msgid ":meth:`tostring` is renamed to :meth:`tobytes` for clarity." +#: ../../library/array.rst:223 +#, fuzzy +msgid ":meth:`!tostring` is renamed to :meth:`tobytes` for clarity." msgstr "為了明確性,過去的 :meth:`tostring` 已更名為 :meth:`tobytes`\\ 。" -#: ../../library/array.rst:230 +#: ../../library/array.rst:229 msgid "Write all items (as machine values) to the :term:`file object` *f*." msgstr "將所有元素(作為機器數值)寫入 :term:`file object` *f*\\ 。" -#: ../../library/array.rst:235 +#: ../../library/array.rst:234 msgid "Convert the array to an ordinary list with the same items." msgstr "不更改元素,將陣列轉為一般的 list。" -#: ../../library/array.rst:240 +#: ../../library/array.rst:239 msgid "" "Convert the array to a unicode string. The array must be a type ``'u'`` " "array; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes()." @@ -469,7 +469,7 @@ msgstr "" "`ValueError` 錯誤。使用 ``array.tobytes().decode(enc)`` 將其他型別的陣列轉為" "字串。" -#: ../../library/array.rst:245 +#: ../../library/array.rst:244 msgid "" "When an array object is printed or converted to a string, it is represented " "as ``array(typecode, initializer)``. The *initializer* is omitted if the " @@ -487,19 +487,19 @@ msgstr "" "\n" "::" -#: ../../library/array.rst:262 +#: ../../library/array.rst:261 msgid "Module :mod:`struct`" msgstr ":mod:`struct` 模組" -#: ../../library/array.rst:262 +#: ../../library/array.rst:261 msgid "Packing and unpacking of heterogeneous binary data." msgstr "將包含不同資料類型的二進位資料包裝與解開包裝。" -#: ../../library/array.rst:266 +#: ../../library/array.rst:265 msgid "Module :mod:`xdrlib`" msgstr ":mod:`xdrlib` 模組" -#: ../../library/array.rst:265 +#: ../../library/array.rst:264 msgid "" "Packing and unpacking of External Data Representation (XDR) data as used in " "some remote procedure call systems." @@ -507,10 +507,13 @@ msgstr "" "將 External Data Representation (XDR) 的資料包裝與解開包裝,這用在一些遠端操" "作的系統 (remote procedure call systems)。" -#: ../../library/array.rst:268 +#: ../../library/array.rst:267 msgid "`NumPy `_" msgstr "`NumPy `_" -#: ../../library/array.rst:269 +#: ../../library/array.rst:268 msgid "The NumPy package defines another array type." msgstr "NumPy 套件定義了另一個陣列型別" + +#~ msgid "The following data items and methods are also supported:" +#~ msgstr "提供下方的資料物件與方法:" From 580738e385febfb7affcf3280b2db7a884bf7594 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 4 Feb 2023 00:32:37 +0000 Subject: [PATCH 020/130] sync with cpython 898de13f --- library/asyncio-stream.po | 69 +++++++++++++++++++++------------------ tutorial/venv.po | 7 ++-- 2 files changed, 41 insertions(+), 35 deletions(-) diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 80bf333e5a..2264b7af6b 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-15 00:16+0000\n" +"POT-Creation-Date: 2023-02-04 00:30+0000\n" "PO-Revision-Date: 2022-10-31 16:28+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -350,13 +350,16 @@ msgid "The method closes the stream and the underlying socket." msgstr "此方法會關閉串流以及底層的 socket。" #: ../../library/asyncio-stream.rst:298 -msgid "The method should be used along with the ``wait_closed()`` method::" +#, fuzzy +msgid "" +"The method should be used, though not mandatory, along with the " +"``wait_closed()`` method::" msgstr "" "此方法應與 ``wait_closed()`` 方法一起使用:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:305 +#: ../../library/asyncio-stream.rst:306 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." @@ -364,29 +367,29 @@ msgstr "" "如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 " "``False``。" -#: ../../library/asyncio-stream.rst:310 +#: ../../library/asyncio-stream.rst:311 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。" -#: ../../library/asyncio-stream.rst:315 +#: ../../library/asyncio-stream.rst:316 msgid "Return the underlying asyncio transport." msgstr "回傳底層的 asyncio 傳輸。" -#: ../../library/asyncio-stream.rst:319 +#: ../../library/asyncio-stream.rst:320 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。" -#: ../../library/asyncio-stream.rst:324 +#: ../../library/asyncio-stream.rst:325 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "" "等待直到可以繼續寫入到串流。範例:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:330 +#: ../../library/asyncio-stream.rst:331 msgid "" "This is a flow control method that interacts with the underlying IO write " "buffer. When the size of the buffer reaches the high watermark, *drain()* " @@ -398,62 +401,64 @@ msgstr "" "(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low " "watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。" -#: ../../library/asyncio-stream.rst:340 +#: ../../library/asyncio-stream.rst:341 msgid "Upgrade an existing stream-based connection to TLS." msgstr "" -#: ../../library/asyncio-stream.rst:342 +#: ../../library/asyncio-stream.rst:343 msgid "Parameters:" msgstr "" -#: ../../library/asyncio-stream.rst:344 +#: ../../library/asyncio-stream.rst:345 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-stream.rst:346 +#: ../../library/asyncio-stream.rst:347 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-stream.rst:349 +#: ../../library/asyncio-stream.rst:350 msgid "" "*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake " "to complete before aborting the connection. ``60.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-stream.rst:357 +#: ../../library/asyncio-stream.rst:358 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:364 +#: ../../library/asyncio-stream.rst:365 msgid "Wait until the stream is closed." msgstr "等待直到串流被關閉。" -#: ../../library/asyncio-stream.rst:366 +#: ../../library/asyncio-stream.rst:367 +#, fuzzy msgid "" "Should be called after :meth:`close` to wait until the underlying connection " -"is closed." +"is closed, ensuring that all data has been flushed before e.g. exiting the " +"program." msgstr "應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉。" -#: ../../library/asyncio-stream.rst:373 +#: ../../library/asyncio-stream.rst:375 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-stream.rst:378 +#: ../../library/asyncio-stream.rst:380 msgid "TCP echo client using streams" msgstr "使用串流的 TCP echo 客戶端" -#: ../../library/asyncio-stream.rst:380 +#: ../../library/asyncio-stream.rst:382 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "" "使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:403 +#: ../../library/asyncio-stream.rst:406 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" @@ -462,18 +467,18 @@ msgstr "" "使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 " "`\\ 範例。" -#: ../../library/asyncio-stream.rst:410 +#: ../../library/asyncio-stream.rst:413 msgid "TCP echo server using streams" msgstr "使用串流的 TCP echo 伺服器" -#: ../../library/asyncio-stream.rst:412 +#: ../../library/asyncio-stream.rst:415 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "" "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:445 +#: ../../library/asyncio-stream.rst:449 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." @@ -482,11 +487,11 @@ msgstr "" "使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 " "` 範例。" -#: ../../library/asyncio-stream.rst:450 +#: ../../library/asyncio-stream.rst:454 msgid "Get HTTP headers" msgstr "獲取 HTTP 標頭" -#: ../../library/asyncio-stream.rst:452 +#: ../../library/asyncio-stream.rst:456 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "" @@ -494,25 +499,25 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:490 +#: ../../library/asyncio-stream.rst:495 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:494 +#: ../../library/asyncio-stream.rst:499 msgid "or with HTTPS::" msgstr "" "或使用 HTTPS:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:502 +#: ../../library/asyncio-stream.rst:507 msgid "Register an open socket to wait for data using streams" msgstr "註冊一個使用串流來等待資料的開放 socket" -#: ../../library/asyncio-stream.rst:504 +#: ../../library/asyncio-stream.rst:509 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" @@ -521,7 +526,7 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:538 +#: ../../library/asyncio-stream.rst:544 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " @@ -531,7 +536,7 @@ msgstr "" "`\\ 範例中,有使用了低階協定以及 :meth:" "`loop.create_connection` 方法。" -#: ../../library/asyncio-stream.rst:542 +#: ../../library/asyncio-stream.rst:548 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." diff --git a/tutorial/venv.po b/tutorial/venv.po index 1fcd3b296f..bfe17fb5f3 100644 --- a/tutorial/venv.po +++ b/tutorial/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-04 00:30+0000\n" "PO-Revision-Date: 2022-10-16 05:35+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -176,10 +176,11 @@ msgid "Managing Packages with pip" msgstr "用 pip 管理套件" #: ../../tutorial/venv.rst:100 +#, fuzzy msgid "" "You can install, upgrade, and remove packages using a program called :" -"program:`pip`. By default ``pip`` will install packages from the Python " -"Package Index, . You can browse the Python Package Index " +"program:`pip`. By default ``pip`` will install packages from the `Python " +"Package Index `_. You can browse the Python Package Index " "by going to it in your web browser." msgstr "" "你可以使用一個叫做 :program:`pip` 的程式來安裝、升級和移除套件。``pip`` 預設" From c0189ff0794561f47ceffbac1460f508b4e1e8cc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Feb 2023 00:37:43 +0000 Subject: [PATCH 021/130] sync with cpython 7cbcfbe2 --- c-api/code.po | 12 +-- library/faulthandler.po | 77 ++++++++++----- library/pdb.po | 212 ++++++++++++++++++++++------------------ library/traceback.po | 168 +++++++++++++++++-------------- 4 files changed, 265 insertions(+), 204 deletions(-) diff --git a/c-api/code.po b/c-api/code.po index 73f6f8308f..29fa006aae 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-05 00:35+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -105,28 +105,28 @@ msgstr "" msgid "Returns ``1`` if the function succeeds and 0 otherwise." msgstr "" -#: ../../c-api/code.rst:82 +#: ../../c-api/code.rst:84 msgid "" "Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong " "reference to a :c:type:`PyBytesObject` representing the bytecode in a code " "object. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:87 +#: ../../c-api/code.rst:89 msgid "" "This ``PyBytesObject`` may be created on-demand by the interpreter and does " "not necessarily represent the bytecode actually executed by CPython. The " "primary use case for this function is debuggers and profilers." msgstr "" -#: ../../c-api/code.rst:95 +#: ../../c-api/code.rst:97 msgid "" "Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " "variables. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:104 +#: ../../c-api/code.rst:106 msgid "" "Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " @@ -134,7 +134,7 @@ msgid "" "returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:113 +#: ../../c-api/code.rst:115 msgid "" "Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the free " diff --git a/library/faulthandler.po b/library/faulthandler.po index d0d28790e7..971e29783e 100644 --- a/library/faulthandler.po +++ b/library/faulthandler.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-02-05 00:35+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-" @@ -92,26 +92,49 @@ msgid "" "enable` at Python startup." msgstr "" -#: ../../library/faulthandler.rst:48 -msgid "Dumping the traceback" +#: ../../library/faulthandler.rst:49 +msgid "Module :mod:`pdb`" +msgstr "" + +#: ../../library/faulthandler.rst:49 +msgid "Interactive source code debugger for Python programs." +msgstr "" + +#: ../../library/faulthandler.rst:51 +msgid "Module :mod:`traceback`" msgstr "" #: ../../library/faulthandler.rst:52 msgid "" +"Standard interface to extract, format and print stack traces of Python " +"programs." +msgstr "" + +#: ../../library/faulthandler.rst:55 +msgid "Dumping the traceback" +msgstr "" + +#: ../../library/faulthandler.rst:59 +msgid "" "Dump the tracebacks of all threads into *file*. If *all_threads* is " "``False``, dump only the current thread." msgstr "" -#: ../../library/faulthandler.rst:55 ../../library/faulthandler.rst:73 -#: ../../library/faulthandler.rst:115 ../../library/faulthandler.rst:137 +#: ../../library/faulthandler.rst:62 +msgid "" +":func:`traceback.print_tb`, which can be used to print a traceback object." +msgstr "" + +#: ../../library/faulthandler.rst:64 ../../library/faulthandler.rst:82 +#: ../../library/faulthandler.rst:124 ../../library/faulthandler.rst:146 msgid "Added support for passing file descriptor to this function." msgstr "" -#: ../../library/faulthandler.rst:60 +#: ../../library/faulthandler.rst:69 msgid "Fault handler state" msgstr "" -#: ../../library/faulthandler.rst:64 +#: ../../library/faulthandler.rst:73 msgid "" "Enable the fault handler: install handlers for the :const:`SIGSEGV`, :const:" "`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and :const:`SIGILL` signals to " @@ -119,37 +142,37 @@ msgid "" "for every running thread. Otherwise, dump only the current thread." msgstr "" -#: ../../library/faulthandler.rst:70 +#: ../../library/faulthandler.rst:79 msgid "" "The *file* must be kept open until the fault handler is disabled: see :ref:" "`issue with file descriptors `." msgstr "" -#: ../../library/faulthandler.rst:76 +#: ../../library/faulthandler.rst:85 msgid "On Windows, a handler for Windows exception is also installed." msgstr "" -#: ../../library/faulthandler.rst:79 +#: ../../library/faulthandler.rst:88 msgid "" "The dump now mentions if a garbage collector collection is running if " "*all_threads* is true." msgstr "" -#: ../../library/faulthandler.rst:85 +#: ../../library/faulthandler.rst:94 msgid "" "Disable the fault handler: uninstall the signal handlers installed by :func:" "`enable`." msgstr "" -#: ../../library/faulthandler.rst:90 +#: ../../library/faulthandler.rst:99 msgid "Check if the fault handler is enabled." msgstr "" -#: ../../library/faulthandler.rst:94 +#: ../../library/faulthandler.rst:103 msgid "Dumping the tracebacks after a timeout" msgstr "" -#: ../../library/faulthandler.rst:98 +#: ../../library/faulthandler.rst:107 msgid "" "Dump the tracebacks of all threads, after a timeout of *timeout* seconds, or " "every *timeout* seconds if *repeat* is ``True``. If *exit* is ``True``, " @@ -160,58 +183,58 @@ msgid "" "a sub-second resolution." msgstr "" -#: ../../library/faulthandler.rst:106 +#: ../../library/faulthandler.rst:115 msgid "" "The *file* must be kept open until the traceback is dumped or :func:" "`cancel_dump_traceback_later` is called: see :ref:`issue with file " "descriptors `." msgstr "" -#: ../../library/faulthandler.rst:110 +#: ../../library/faulthandler.rst:119 msgid "This function is implemented using a watchdog thread." msgstr "" -#: ../../library/faulthandler.rst:112 +#: ../../library/faulthandler.rst:121 msgid "This function is now always available." msgstr "" -#: ../../library/faulthandler.rst:120 +#: ../../library/faulthandler.rst:129 msgid "Cancel the last call to :func:`dump_traceback_later`." msgstr "" -#: ../../library/faulthandler.rst:124 +#: ../../library/faulthandler.rst:133 msgid "Dumping the traceback on a user signal" msgstr "" -#: ../../library/faulthandler.rst:128 +#: ../../library/faulthandler.rst:137 msgid "" "Register a user signal: install a handler for the *signum* signal to dump " "the traceback of all threads, or of the current thread if *all_threads* is " "``False``, into *file*. Call the previous handler if chain is ``True``." msgstr "" -#: ../../library/faulthandler.rst:132 +#: ../../library/faulthandler.rst:141 msgid "" "The *file* must be kept open until the signal is unregistered by :func:" "`unregister`: see :ref:`issue with file descriptors `." msgstr "" -#: ../../library/faulthandler.rst:135 ../../library/faulthandler.rst:146 +#: ../../library/faulthandler.rst:144 ../../library/faulthandler.rst:155 msgid "Not available on Windows." msgstr "" -#: ../../library/faulthandler.rst:142 +#: ../../library/faulthandler.rst:151 msgid "" "Unregister a user signal: uninstall the handler of the *signum* signal " "installed by :func:`register`. Return ``True`` if the signal was registered, " "``False`` otherwise." msgstr "" -#: ../../library/faulthandler.rst:152 +#: ../../library/faulthandler.rst:161 msgid "Issue with file descriptors" msgstr "" -#: ../../library/faulthandler.rst:154 +#: ../../library/faulthandler.rst:163 msgid "" ":func:`enable`, :func:`dump_traceback_later` and :func:`register` keep the " "file descriptor of their *file* argument. If the file is closed and its file " @@ -220,11 +243,11 @@ msgid "" "Call these functions again each time that the file is replaced." msgstr "" -#: ../../library/faulthandler.rst:162 +#: ../../library/faulthandler.rst:171 msgid "Example" msgstr "範例" -#: ../../library/faulthandler.rst:164 +#: ../../library/faulthandler.rst:173 msgid "" "Example of a segmentation fault on Linux with and without enabling the fault " "handler:" diff --git a/library/pdb.po b/library/pdb.po index e33c673406..f9e17244d3 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-05 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,26 +43,46 @@ msgid "" "source. The extension interface uses the modules :mod:`bdb` and :mod:`cmd`." msgstr "" -#: ../../library/pdb.rst:30 +#: ../../library/pdb.rst:34 +msgid "Module :mod:`faulthandler`" +msgstr "" + +#: ../../library/pdb.rst:33 +msgid "" +"Used to dump Python tracebacks explicitly, on a fault, after a timeout, or " +"on a user signal." +msgstr "" + +#: ../../library/pdb.rst:36 +msgid "Module :mod:`traceback`" +msgstr "" + +#: ../../library/pdb.rst:37 +msgid "" +"Standard interface to extract, format and print stack traces of Python " +"programs." +msgstr "" + +#: ../../library/pdb.rst:39 msgid "" "The debugger's prompt is ``(Pdb)``. Typical usage to run a program under " "control of the debugger is::" msgstr "" -#: ../../library/pdb.rst:44 +#: ../../library/pdb.rst:53 msgid "" "Tab-completion via the :mod:`readline` module is available for commands and " "command arguments, e.g. the current global and local names are offered as " "arguments of the ``p`` command." msgstr "" -#: ../../library/pdb.rst:49 +#: ../../library/pdb.rst:58 msgid "" ":file:`pdb.py` can also be invoked as a script to debug other scripts. For " "example::" msgstr "" -#: ../../library/pdb.rst:54 +#: ../../library/pdb.rst:63 msgid "" "When invoked as a script, pdb will automatically enter post-mortem debugging " "if the program being debugged exits abnormally. After post-mortem debugging " @@ -71,47 +91,47 @@ msgid "" "cases is more useful than quitting the debugger upon program's exit." msgstr "" -#: ../../library/pdb.rst:60 +#: ../../library/pdb.rst:69 msgid "" ":file:`pdb.py` now accepts a ``-c`` option that executes commands as if " "given in a :file:`.pdbrc` file, see :ref:`debugger-commands`." msgstr "" -#: ../../library/pdb.rst:64 +#: ../../library/pdb.rst:73 msgid "" ":file:`pdb.py` now accepts a ``-m`` option that execute modules similar to " "the way ``python3 -m`` does. As with a script, the debugger will pause " "execution just before the first line of the module." msgstr "" -#: ../../library/pdb.rst:70 +#: ../../library/pdb.rst:79 msgid "The typical usage to break into the debugger is to insert::" msgstr "" -#: ../../library/pdb.rst:74 +#: ../../library/pdb.rst:83 msgid "" "at the location you want to break into the debugger, and then run the " "program. You can then step through the code following this statement, and " "continue running without the debugger using the :pdbcmd:`continue` command." msgstr "" -#: ../../library/pdb.rst:78 +#: ../../library/pdb.rst:87 msgid "" "The built-in :func:`breakpoint()`, when called with defaults, can be used " "instead of ``import pdb; pdb.set_trace()``." msgstr "" -#: ../../library/pdb.rst:82 +#: ../../library/pdb.rst:91 msgid "The typical usage to inspect a crashed program is::" msgstr "" -#: ../../library/pdb.rst:100 +#: ../../library/pdb.rst:109 msgid "" "The module defines the following functions; each enters the debugger in a " "slightly different way:" msgstr "" -#: ../../library/pdb.rst:105 +#: ../../library/pdb.rst:114 msgid "" "Execute the *statement* (given as a string or a code object) under debugger " "control. The debugger prompt appears before any code is executed; you can " @@ -123,14 +143,14 @@ msgid "" "`exec` or :func:`eval` functions.)" msgstr "" -#: ../../library/pdb.rst:117 +#: ../../library/pdb.rst:126 msgid "" "Evaluate the *expression* (given as a string or a code object) under " "debugger control. When :func:`runeval` returns, it returns the value of the " "expression. Otherwise this function is similar to :func:`run`." msgstr "" -#: ../../library/pdb.rst:124 +#: ../../library/pdb.rst:133 msgid "" "Call the *function* (a function or method object, not a string) with the " "given arguments. When :func:`runcall` returns, it returns whatever the " @@ -138,7 +158,7 @@ msgid "" "is entered." msgstr "" -#: ../../library/pdb.rst:132 +#: ../../library/pdb.rst:141 msgid "" "Enter the debugger at the calling stack frame. This is useful to hard-code " "a breakpoint at a given point in a program, even if the code is not " @@ -146,11 +166,11 @@ msgid "" "is printed to the console just before debugging begins." msgstr "" -#: ../../library/pdb.rst:137 +#: ../../library/pdb.rst:146 msgid "The keyword-only argument *header*." msgstr "" -#: ../../library/pdb.rst:143 +#: ../../library/pdb.rst:152 msgid "" "Enter post-mortem debugging of the given *traceback* object. If no " "*traceback* is given, it uses the one of the exception that is currently " @@ -158,37 +178,37 @@ msgid "" "used)." msgstr "" -#: ../../library/pdb.rst:151 +#: ../../library/pdb.rst:160 msgid "" "Enter post-mortem debugging of the traceback found in :data:`sys." "last_traceback`." msgstr "" -#: ../../library/pdb.rst:155 +#: ../../library/pdb.rst:164 msgid "" "The ``run*`` functions and :func:`set_trace` are aliases for instantiating " "the :class:`Pdb` class and calling the method of the same name. If you want " "to access further features, you have to do this yourself:" msgstr "" -#: ../../library/pdb.rst:162 +#: ../../library/pdb.rst:171 msgid ":class:`Pdb` is the debugger class." msgstr "" -#: ../../library/pdb.rst:164 +#: ../../library/pdb.rst:173 msgid "" "The *completekey*, *stdin* and *stdout* arguments are passed to the " "underlying :class:`cmd.Cmd` class; see the description there." msgstr "" -#: ../../library/pdb.rst:167 +#: ../../library/pdb.rst:176 msgid "" "The *skip* argument, if given, must be an iterable of glob-style module name " "patterns. The debugger will not step into frames that originate in a module " "that matches one of these patterns. [1]_" msgstr "" -#: ../../library/pdb.rst:171 +#: ../../library/pdb.rst:180 msgid "" "By default, Pdb sets a handler for the SIGINT signal (which is sent when the " "user presses :kbd:`Ctrl-C` on the console) when you give a ``continue`` " @@ -197,13 +217,13 @@ msgid "" "to true." msgstr "" -#: ../../library/pdb.rst:176 +#: ../../library/pdb.rst:185 msgid "" "The *readrc* argument defaults to true and controls whether Pdb will load ." "pdbrc files from the filesystem." msgstr "" -#: ../../library/pdb.rst:179 +#: ../../library/pdb.rst:188 msgid "Example call to enable tracing with *skip*::" msgstr "" @@ -212,28 +232,28 @@ msgid "" "Raises an :ref:`auditing event ` ``pdb.Pdb`` with no arguments." msgstr "" -#: ../../library/pdb.rst:185 +#: ../../library/pdb.rst:194 msgid "The *skip* argument." msgstr "" -#: ../../library/pdb.rst:188 +#: ../../library/pdb.rst:197 msgid "" "The *nosigint* argument. Previously, a SIGINT handler was never set by Pdb." msgstr "" -#: ../../library/pdb.rst:192 +#: ../../library/pdb.rst:201 msgid "The *readrc* argument." msgstr "" -#: ../../library/pdb.rst:200 +#: ../../library/pdb.rst:209 msgid "See the documentation for the functions explained above." msgstr "" -#: ../../library/pdb.rst:206 +#: ../../library/pdb.rst:215 msgid "Debugger Commands" msgstr "" -#: ../../library/pdb.rst:208 +#: ../../library/pdb.rst:217 msgid "" "The commands recognized by the debugger are listed below. Most commands can " "be abbreviated to one or two letters as indicated; e.g. ``h(elp)`` means " @@ -245,13 +265,13 @@ msgid "" "are separated by a vertical bar (``|``)." msgstr "" -#: ../../library/pdb.rst:217 +#: ../../library/pdb.rst:226 msgid "" "Entering a blank line repeats the last command entered. Exception: if the " "last command was a :pdbcmd:`list` command, the next 11 lines are listed." msgstr "" -#: ../../library/pdb.rst:220 +#: ../../library/pdb.rst:229 msgid "" "Commands that the debugger doesn't recognize are assumed to be Python " "statements and are executed in the context of the program being debugged. " @@ -262,14 +282,14 @@ msgid "" "is not changed." msgstr "" -#: ../../library/pdb.rst:228 +#: ../../library/pdb.rst:237 msgid "" "The debugger supports :ref:`aliases `. Aliases can have " "parameters which allows one a certain level of adaptability to the context " "under examination." msgstr "" -#: ../../library/pdb.rst:232 +#: ../../library/pdb.rst:241 msgid "" "Multiple commands may be entered on a single line, separated by ``;;``. (A " "single ``;`` is not used as it is the separator for multiple commands in a " @@ -280,7 +300,7 @@ msgid "" "\"\";\"``." msgstr "" -#: ../../library/pdb.rst:243 +#: ../../library/pdb.rst:252 msgid "" "If a file :file:`.pdbrc` exists in the user's home directory or in the " "current directory, it is read with ``'utf-8'`` encoding and executed as if " @@ -289,20 +309,20 @@ msgid "" "and aliases defined there can be overridden by the local file." msgstr "" -#: ../../library/pdb.rst:249 +#: ../../library/pdb.rst:258 msgid "" ":file:`.pdbrc` is now read with ``'utf-8'`` encoding. Previously, it was " "read with the system locale encoding." msgstr "" -#: ../../library/pdb.rst:253 +#: ../../library/pdb.rst:262 msgid "" ":file:`.pdbrc` can now contain commands that continue debugging, such as :" "pdbcmd:`continue` or :pdbcmd:`next`. Previously, these commands had no " "effect." msgstr "" -#: ../../library/pdb.rst:261 +#: ../../library/pdb.rst:270 msgid "" "Without argument, print the list of available commands. With a *command* as " "argument, print help about that command. ``help pdb`` displays the full " @@ -311,25 +331,25 @@ msgid "" "the ``!`` command." msgstr "" -#: ../../library/pdb.rst:269 +#: ../../library/pdb.rst:278 msgid "" "Print a stack trace, with the most recent frame at the bottom. An arrow " "indicates the current frame, which determines the context of most commands." msgstr "" -#: ../../library/pdb.rst:274 +#: ../../library/pdb.rst:283 msgid "" "Move the current frame *count* (default one) levels down in the stack trace " "(to a newer frame)." msgstr "" -#: ../../library/pdb.rst:279 +#: ../../library/pdb.rst:288 msgid "" "Move the current frame *count* (default one) levels up in the stack trace " "(to an older frame)." msgstr "" -#: ../../library/pdb.rst:284 +#: ../../library/pdb.rst:293 msgid "" "With a *lineno* argument, set a break there in the current file. With a " "*function* argument, set a break at the first executable statement within " @@ -340,33 +360,33 @@ msgid "" "refer." msgstr "" -#: ../../library/pdb.rst:291 +#: ../../library/pdb.rst:300 msgid "" "If a second argument is present, it is an expression which must evaluate to " "true before the breakpoint is honored." msgstr "" -#: ../../library/pdb.rst:294 +#: ../../library/pdb.rst:303 msgid "" "Without argument, list all breaks, including for each breakpoint, the number " "of times that breakpoint has been hit, the current ignore count, and the " "associated condition if any." msgstr "" -#: ../../library/pdb.rst:300 +#: ../../library/pdb.rst:309 msgid "" "Temporary breakpoint, which is removed automatically when it is first hit. " "The arguments are the same as for :pdbcmd:`break`." msgstr "" -#: ../../library/pdb.rst:305 +#: ../../library/pdb.rst:314 msgid "" "With a *filename:lineno* argument, clear all the breakpoints at this line. " "With a space separated list of breakpoint numbers, clear those breakpoints. " "Without argument, clear all breaks (but first ask confirmation)." msgstr "" -#: ../../library/pdb.rst:311 +#: ../../library/pdb.rst:320 msgid "" "Disable the breakpoints given as a space separated list of breakpoint " "numbers. Disabling a breakpoint means it cannot cause the program to stop " @@ -374,11 +394,11 @@ msgid "" "breakpoints and can be (re-)enabled." msgstr "" -#: ../../library/pdb.rst:318 +#: ../../library/pdb.rst:327 msgid "Enable the breakpoints specified." msgstr "" -#: ../../library/pdb.rst:322 +#: ../../library/pdb.rst:331 msgid "" "Set the ignore count for the given breakpoint number. If count is omitted, " "the ignore count is set to 0. A breakpoint becomes active when the ignore " @@ -387,39 +407,39 @@ msgid "" "condition evaluates to true." msgstr "" -#: ../../library/pdb.rst:330 +#: ../../library/pdb.rst:339 msgid "" "Set a new *condition* for the breakpoint, an expression which must evaluate " "to true before the breakpoint is honored. If *condition* is absent, any " "existing condition is removed; i.e., the breakpoint is made unconditional." msgstr "" -#: ../../library/pdb.rst:336 +#: ../../library/pdb.rst:345 msgid "" "Specify a list of commands for breakpoint number *bpnumber*. The commands " "themselves appear on the following lines. Type a line containing just " "``end`` to terminate the commands. An example::" msgstr "" -#: ../../library/pdb.rst:345 +#: ../../library/pdb.rst:354 msgid "" "To remove all commands from a breakpoint, type ``commands`` and follow it " "immediately with ``end``; that is, give no commands." msgstr "" -#: ../../library/pdb.rst:348 +#: ../../library/pdb.rst:357 msgid "" "With no *bpnumber* argument, ``commands`` refers to the last breakpoint set." msgstr "" -#: ../../library/pdb.rst:350 +#: ../../library/pdb.rst:359 msgid "" "You can use breakpoint commands to start your program up again. Simply use " "the :pdbcmd:`continue` command, or :pdbcmd:`step`, or any other command that " "resumes execution." msgstr "" -#: ../../library/pdb.rst:354 +#: ../../library/pdb.rst:363 msgid "" "Specifying any command resuming execution (currently :pdbcmd:`continue`, :" "pdbcmd:`step`, :pdbcmd:`next`, :pdbcmd:`return`, :pdbcmd:`jump`, :pdbcmd:" @@ -430,7 +450,7 @@ msgid "" "ambiguities about which list to execute." msgstr "" -#: ../../library/pdb.rst:363 +#: ../../library/pdb.rst:372 msgid "" "If you use the 'silent' command in the command list, the usual message about " "stopping at a breakpoint is not printed. This may be desirable for " @@ -439,13 +459,13 @@ msgid "" "was reached." msgstr "" -#: ../../library/pdb.rst:370 +#: ../../library/pdb.rst:379 msgid "" "Execute the current line, stop at the first possible occasion (either in a " "function that is called or on the next line in the current function)." msgstr "" -#: ../../library/pdb.rst:375 +#: ../../library/pdb.rst:384 msgid "" "Continue execution until the next line in the current function is reached or " "it returns. (The difference between :pdbcmd:`next` and :pdbcmd:`step` is " @@ -454,46 +474,46 @@ msgid "" "line in the current function.)" msgstr "" -#: ../../library/pdb.rst:383 +#: ../../library/pdb.rst:392 msgid "" "Without argument, continue execution until the line with a number greater " "than the current one is reached." msgstr "" -#: ../../library/pdb.rst:386 +#: ../../library/pdb.rst:395 msgid "" "With a line number, continue execution until a line with a number greater or " "equal to that is reached. In both cases, also stop when the current frame " "returns." msgstr "" -#: ../../library/pdb.rst:390 +#: ../../library/pdb.rst:399 msgid "Allow giving an explicit line number." msgstr "" -#: ../../library/pdb.rst:395 +#: ../../library/pdb.rst:404 msgid "Continue execution until the current function returns." msgstr "" -#: ../../library/pdb.rst:399 +#: ../../library/pdb.rst:408 msgid "Continue execution, only stop when a breakpoint is encountered." msgstr "" -#: ../../library/pdb.rst:403 +#: ../../library/pdb.rst:412 msgid "" "Set the next line that will be executed. Only available in the bottom-most " "frame. This lets you jump back and execute code again, or jump forward to " "skip code that you don't want to run." msgstr "" -#: ../../library/pdb.rst:407 +#: ../../library/pdb.rst:416 msgid "" "It should be noted that not all jumps are allowed -- for instance it is not " "possible to jump into the middle of a :keyword:`for` loop or out of a :" "keyword:`finally` clause." msgstr "" -#: ../../library/pdb.rst:413 +#: ../../library/pdb.rst:422 msgid "" "List source code for the current file. Without arguments, list 11 lines " "around the current line or continue the previous listing. With ``.`` as " @@ -502,7 +522,7 @@ msgid "" "second argument is less than the first, it is interpreted as a count." msgstr "" -#: ../../library/pdb.rst:419 +#: ../../library/pdb.rst:428 msgid "" "The current line in the current frame is indicated by ``->``. If an " "exception is being debugged, the line where the exception was originally " @@ -510,77 +530,77 @@ msgid "" "line." msgstr "" -#: ../../library/pdb.rst:424 +#: ../../library/pdb.rst:433 msgid "The ``>>`` marker." msgstr "" -#: ../../library/pdb.rst:429 +#: ../../library/pdb.rst:438 msgid "" "List all source code for the current function or frame. Interesting lines " "are marked as for :pdbcmd:`list`." msgstr "" -#: ../../library/pdb.rst:436 +#: ../../library/pdb.rst:445 msgid "Print the argument list of the current function." msgstr "" -#: ../../library/pdb.rst:440 +#: ../../library/pdb.rst:449 msgid "Evaluate the *expression* in the current context and print its value." msgstr "" -#: ../../library/pdb.rst:444 +#: ../../library/pdb.rst:453 msgid "" "``print()`` can also be used, but is not a debugger command --- this " "executes the Python :func:`print` function." msgstr "" -#: ../../library/pdb.rst:450 +#: ../../library/pdb.rst:459 msgid "" "Like the :pdbcmd:`p` command, except the value of the expression is pretty-" "printed using the :mod:`pprint` module." msgstr "" -#: ../../library/pdb.rst:455 +#: ../../library/pdb.rst:464 msgid "Print the type of the *expression*." msgstr "" -#: ../../library/pdb.rst:459 +#: ../../library/pdb.rst:468 msgid "Try to get source code for the given object and display it." msgstr "" -#: ../../library/pdb.rst:465 +#: ../../library/pdb.rst:474 msgid "" "Display the value of the expression if it changed, each time execution stops " "in the current frame." msgstr "" -#: ../../library/pdb.rst:468 +#: ../../library/pdb.rst:477 msgid "Without expression, list all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:474 +#: ../../library/pdb.rst:483 msgid "" "Do not display the expression any more in the current frame. Without " "expression, clear all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:481 +#: ../../library/pdb.rst:490 msgid "" "Start an interactive interpreter (using the :mod:`code` module) whose global " "namespace contains all the (global and local) names found in the current " "scope." msgstr "" -#: ../../library/pdb.rst:491 +#: ../../library/pdb.rst:500 msgid "" "Create an alias called *name* that executes *command*. The command must " -"*not* be enclosed in quotes. Replaceable parameters can be indicated by ``" -"%1``, ``%2``, and so on, while ``%*`` is replaced by all the parameters. If " -"no command is given, the current alias for *name* is shown. If no arguments " -"are given, all aliases are listed." +"*not* be enclosed in quotes. Replaceable parameters can be indicated by " +"``%1``, ``%2``, and so on, while ``%*`` is replaced by all the parameters. " +"If no command is given, the current alias for *name* is shown. If no " +"arguments are given, all aliases are listed." msgstr "" -#: ../../library/pdb.rst:497 +#: ../../library/pdb.rst:506 msgid "" "Aliases may be nested and can contain anything that can be legally typed at " "the pdb prompt. Note that internal pdb commands *can* be overridden by " @@ -589,17 +609,17 @@ msgid "" "other words in the line are left alone." msgstr "" -#: ../../library/pdb.rst:503 +#: ../../library/pdb.rst:512 msgid "" "As an example, here are two useful aliases (especially when placed in the :" "file:`.pdbrc` file)::" msgstr "" -#: ../../library/pdb.rst:513 +#: ../../library/pdb.rst:522 msgid "Delete the specified alias." msgstr "" -#: ../../library/pdb.rst:517 +#: ../../library/pdb.rst:526 msgid "" "Execute the (one-line) *statement* in the context of the current stack " "frame. The exclamation point can be omitted unless the first word of the " @@ -608,7 +628,7 @@ msgid "" "line, e.g.::" msgstr "" -#: ../../library/pdb.rst:529 +#: ../../library/pdb.rst:538 msgid "" "Restart the debugged Python program. If an argument is supplied, it is " "split with :mod:`shlex` and the result is used as the new :data:`sys.argv`. " @@ -616,25 +636,25 @@ msgid "" "`restart` is an alias for :pdbcmd:`run`." msgstr "" -#: ../../library/pdb.rst:536 +#: ../../library/pdb.rst:545 msgid "Quit from the debugger. The program being executed is aborted." msgstr "" -#: ../../library/pdb.rst:540 +#: ../../library/pdb.rst:549 msgid "" "Enter a recursive debugger that steps through the code argument (which is an " "arbitrary expression or statement to be executed in the current environment)." msgstr "" -#: ../../library/pdb.rst:546 +#: ../../library/pdb.rst:555 msgid "Print the return value for the last return of a function." msgstr "" -#: ../../library/pdb.rst:549 +#: ../../library/pdb.rst:558 msgid "Footnotes" msgstr "註解" -#: ../../library/pdb.rst:550 +#: ../../library/pdb.rst:559 msgid "" "Whether a frame is considered to originate in a certain module is determined " "by the ``__name__`` in the frame globals." diff --git a/library/traceback.po b/library/traceback.po index f6b7fad4fa..95d2b61ad9 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-05 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,11 +42,29 @@ msgid "" "from :func:`sys.exc_info`." msgstr "" -#: ../../library/traceback.rst:23 -msgid "The module defines the following functions:" +#: ../../library/traceback.rst:26 +msgid "Module :mod:`faulthandler`" +msgstr "" + +#: ../../library/traceback.rst:26 +msgid "" +"Used to dump Python tracebacks explicitly, on a fault, after a timeout, or " +"on a user signal." msgstr "" #: ../../library/traceback.rst:28 +msgid "Module :mod:`pdb`" +msgstr "" + +#: ../../library/traceback.rst:29 +msgid "Interactive source code debugger for Python programs." +msgstr "" + +#: ../../library/traceback.rst:31 +msgid "The module defines the following functions:" +msgstr "" + +#: ../../library/traceback.rst:35 msgid "" "Print up to *limit* stack trace entries from traceback object *tb* (starting " "from the caller's frame) if *limit* is positive. Otherwise, print the last " @@ -56,41 +74,41 @@ msgid "" "the output." msgstr "" -#: ../../library/traceback.rst:35 ../../library/traceback.rst:98 +#: ../../library/traceback.rst:42 ../../library/traceback.rst:105 msgid "Added negative *limit* support." msgstr "" -#: ../../library/traceback.rst:42 +#: ../../library/traceback.rst:49 msgid "" "Print exception information and stack trace entries from traceback object " "*tb* to *file*. This differs from :func:`print_tb` in the following ways:" msgstr "" -#: ../../library/traceback.rst:46 +#: ../../library/traceback.rst:53 msgid "" "if *tb* is not ``None``, it prints a header ``Traceback (most recent call " "last):``" msgstr "" -#: ../../library/traceback.rst:49 +#: ../../library/traceback.rst:56 msgid "it prints the exception type and *value* after the stack trace" msgstr "" -#: ../../library/traceback.rst:53 +#: ../../library/traceback.rst:60 msgid "" "if *type(value)* is :exc:`SyntaxError` and *value* has the appropriate " "format, it prints the line where the syntax error occurred with a caret " "indicating the approximate position of the error." msgstr "" -#: ../../library/traceback.rst:57 +#: ../../library/traceback.rst:64 msgid "" "Since Python 3.10, instead of passing *value* and *tb*, an exception object " "can be passed as the first argument. If *value* and *tb* are provided, the " "first argument is ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:61 +#: ../../library/traceback.rst:68 msgid "" "The optional *limit* argument has the same meaning as for :func:`print_tb`. " "If *chain* is true (the default), then chained exceptions (the :attr:" @@ -99,29 +117,29 @@ msgid "" "exception." msgstr "" -#: ../../library/traceback.rst:67 ../../library/traceback.rst:160 +#: ../../library/traceback.rst:74 ../../library/traceback.rst:167 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" -#: ../../library/traceback.rst:70 ../../library/traceback.rst:147 +#: ../../library/traceback.rst:77 ../../library/traceback.rst:154 msgid "" "The *etype* parameter has been renamed to *exc* and is now positional-only." msgstr "" -#: ../../library/traceback.rst:77 +#: ../../library/traceback.rst:84 msgid "" "This is a shorthand for ``print_exception(*sys.exc_info(), limit, file, " "chain)``." msgstr "" -#: ../../library/traceback.rst:83 +#: ../../library/traceback.rst:90 msgid "" "This is a shorthand for ``print_exception(sys.last_type, sys.last_value, sys." "last_traceback, limit, file, chain)``. In general it will work only after " "an exception has reached an interactive prompt (see :data:`sys.last_type`)." msgstr "" -#: ../../library/traceback.rst:91 +#: ../../library/traceback.rst:98 msgid "" "Print up to *limit* stack trace entries (starting from the invocation point) " "if *limit* is positive. Otherwise, print the last ``abs(limit)`` entries. " @@ -130,11 +148,11 @@ msgid "" "optional *file* argument has the same meaning as for :func:`print_tb`." msgstr "" -#: ../../library/traceback.rst:104 +#: ../../library/traceback.rst:111 msgid "" -"Return a :class:`StackSummary` object representing a list of \"pre-processed" -"\" stack trace entries extracted from the traceback object *tb*. It is " -"useful for alternate formatting of stack traces. The optional *limit* " +"Return a :class:`StackSummary` object representing a list of \"pre-" +"processed\" stack trace entries extracted from the traceback object *tb*. " +"It is useful for alternate formatting of stack traces. The optional *limit* " "argument has the same meaning as for :func:`print_tb`. A \"pre-processed\" " "stack trace entry is a :class:`FrameSummary` object containing attributes :" "attr:`~FrameSummary.filename`, :attr:`~FrameSummary.lineno`, :attr:" @@ -144,14 +162,14 @@ msgid "" "stripped; if the source is not available it is ``None``." msgstr "" -#: ../../library/traceback.rst:118 +#: ../../library/traceback.rst:125 msgid "" "Extract the raw traceback from the current stack frame. The return value " "has the same format as for :func:`extract_tb`. The optional *f* and *limit* " "arguments have the same meaning as for :func:`print_stack`." msgstr "" -#: ../../library/traceback.rst:125 +#: ../../library/traceback.rst:132 msgid "" "Given a list of tuples or :class:`FrameSummary` objects as returned by :func:" "`extract_tb` or :func:`extract_stack`, return a list of strings ready for " @@ -161,7 +179,7 @@ msgid "" "text line is not ``None``." msgstr "" -#: ../../library/traceback.rst:135 +#: ../../library/traceback.rst:142 msgid "" "Format the exception part of a traceback using an exception value such as " "given by ``sys.last_value``. The return value is a list of strings, each " @@ -172,14 +190,14 @@ msgid "" "the list." msgstr "" -#: ../../library/traceback.rst:143 +#: ../../library/traceback.rst:150 msgid "" "Since Python 3.10, instead of passing *value*, an exception object can be " "passed as the first argument. If *value* is provided, the first argument is " "ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:154 +#: ../../library/traceback.rst:161 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -188,66 +206,66 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: ../../library/traceback.rst:163 +#: ../../library/traceback.rst:170 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: ../../library/traceback.rst:170 +#: ../../library/traceback.rst:177 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: ../../library/traceback.rst:176 +#: ../../library/traceback.rst:183 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "" -#: ../../library/traceback.rst:181 +#: ../../library/traceback.rst:188 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "" -#: ../../library/traceback.rst:185 +#: ../../library/traceback.rst:192 msgid "" "Clears the local variables of all the stack frames in a traceback *tb* by " "calling the :meth:`clear` method of each frame object." msgstr "" -#: ../../library/traceback.rst:192 +#: ../../library/traceback.rst:199 msgid "" "Walk a stack following ``f.f_back`` from the given frame, yielding the frame " "and line number for each frame. If *f* is ``None``, the current stack is " "used. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:200 +#: ../../library/traceback.rst:207 msgid "" "Walk a traceback following ``tb_next`` yielding the frame and line number " "for each frame. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:205 +#: ../../library/traceback.rst:212 msgid "The module also defines the following classes:" msgstr "" -#: ../../library/traceback.rst:208 +#: ../../library/traceback.rst:215 msgid ":class:`TracebackException` Objects" msgstr ":class:`TracebackException` 物件" -#: ../../library/traceback.rst:212 +#: ../../library/traceback.rst:219 msgid "" ":class:`TracebackException` objects are created from actual exceptions to " "capture data for later printing in a lightweight fashion." msgstr "" -#: ../../library/traceback.rst:217 ../../library/traceback.rst:277 +#: ../../library/traceback.rst:224 ../../library/traceback.rst:284 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." msgstr "" -#: ../../library/traceback.rst:220 +#: ../../library/traceback.rst:227 msgid "" "If *compact* is true, only data that is required by :class:" "`TracebackException`'s ``format`` method is saved in the class attributes. " @@ -255,122 +273,122 @@ msgid "" "is ``None`` and ``__suppress_context__`` is false." msgstr "" -#: ../../library/traceback.rst:225 ../../library/traceback.rst:280 +#: ../../library/traceback.rst:232 ../../library/traceback.rst:287 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:229 +#: ../../library/traceback.rst:236 msgid "A :class:`TracebackException` of the original ``__cause__``." msgstr "" -#: ../../library/traceback.rst:233 +#: ../../library/traceback.rst:240 msgid "A :class:`TracebackException` of the original ``__context__``." msgstr "" -#: ../../library/traceback.rst:237 +#: ../../library/traceback.rst:244 msgid "The ``__suppress_context__`` value from the original exception." msgstr "" -#: ../../library/traceback.rst:241 +#: ../../library/traceback.rst:248 msgid "" "The ``__notes__`` value from the original exception, or ``None`` if the " "exception does not have any notes. If it is not ``None`` is it formatted in " "the traceback after the exception string." msgstr "" -#: ../../library/traceback.rst:249 +#: ../../library/traceback.rst:256 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:253 +#: ../../library/traceback.rst:260 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:257 +#: ../../library/traceback.rst:264 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:261 +#: ../../library/traceback.rst:268 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:265 +#: ../../library/traceback.rst:272 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:269 +#: ../../library/traceback.rst:276 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:273 +#: ../../library/traceback.rst:280 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:284 +#: ../../library/traceback.rst:291 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:291 +#: ../../library/traceback.rst:298 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:293 +#: ../../library/traceback.rst:300 msgid "" "If *chain* is not ``True``, ``__cause__`` and ``__context__`` will not be " "formatted." msgstr "" -#: ../../library/traceback.rst:296 +#: ../../library/traceback.rst:303 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: ../../library/traceback.rst:300 ../../library/traceback.rst:314 +#: ../../library/traceback.rst:307 ../../library/traceback.rst:321 msgid "" "The message indicating which exception occurred is always the last string in " "the output." msgstr "" -#: ../../library/traceback.rst:305 +#: ../../library/traceback.rst:312 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:307 +#: ../../library/traceback.rst:314 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:309 +#: ../../library/traceback.rst:316 msgid "" "Normally, the generator emits a single string; however, for :exc:" "`SyntaxError` exceptions, it emits several lines that (when printed) display " "detailed information about where the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:317 +#: ../../library/traceback.rst:324 msgid "Added the *compact* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/traceback.rst:322 +#: ../../library/traceback.rst:329 msgid ":class:`StackSummary` Objects" msgstr ":class:`StackSummary` 物件" -#: ../../library/traceback.rst:326 +#: ../../library/traceback.rst:333 msgid "" ":class:`StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:332 +#: ../../library/traceback.rst:339 msgid "" "Construct a :class:`StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: ../../library/traceback.rst:336 +#: ../../library/traceback.rst:343 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -380,14 +398,14 @@ msgid "" "class:`FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:346 +#: ../../library/traceback.rst:353 msgid "" "Construct a :class:`StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with filename, lineno, name, line as the elements." msgstr "" -#: ../../library/traceback.rst:352 +#: ../../library/traceback.rst:359 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single frame from the stack. Each string ends in a " @@ -395,18 +413,18 @@ msgid "" "with source text lines." msgstr "" -#: ../../library/traceback.rst:357 +#: ../../library/traceback.rst:364 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: ../../library/traceback.rst:361 +#: ../../library/traceback.rst:368 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:366 +#: ../../library/traceback.rst:373 msgid "" "Returns a string for printing one of the frames involved in the stack. This " "method is called for each :class:`FrameSummary` object to be printed by :" @@ -414,16 +432,16 @@ msgid "" "from the output." msgstr "" -#: ../../library/traceback.rst:375 +#: ../../library/traceback.rst:382 msgid ":class:`FrameSummary` Objects" msgstr ":class:`FrameSummary` 物件" -#: ../../library/traceback.rst:379 +#: ../../library/traceback.rst:386 msgid "" "A :class:`FrameSummary` object represents a single frame in a traceback." msgstr "" -#: ../../library/traceback.rst:383 +#: ../../library/traceback.rst:390 msgid "" "Represent a single frame in the traceback or stack that is being formatted " "or printed. It may optionally have a stringified version of the frames " @@ -436,11 +454,11 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:396 +#: ../../library/traceback.rst:403 msgid "Traceback Examples" msgstr "" -#: ../../library/traceback.rst:398 +#: ../../library/traceback.rst:405 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -448,22 +466,22 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:420 +#: ../../library/traceback.rst:427 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:455 +#: ../../library/traceback.rst:462 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:497 +#: ../../library/traceback.rst:504 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:523 +#: ../../library/traceback.rst:530 msgid "This last example demonstrates the final few formatting functions:" msgstr "" From 68cabcde9ec7b829ec05c121e3d44cf940c71a8d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 7 Feb 2023 00:36:29 +0000 Subject: [PATCH 022/130] sync with cpython c993ffa4 --- bugs.po | 54 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/bugs.po b/bugs.po index d5ce9aada4..306433153d 100644 --- a/bugs.po +++ b/bugs.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-04 00:16+0000\n" +"POT-Creation-Date: 2023-02-07 00:34+0000\n" "PO-Revision-Date: 2022-08-31 12:34+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -65,6 +65,12 @@ msgstr "" #: ../../bugs.rst:22 msgid "" +"You can also open a discussion item on our `Documentation Discourse forum " +"`_." +msgstr "" + +#: ../../bugs.rst:25 +msgid "" "If you're short on time, you can also email documentation bug reports to " "docs@python.org (behavioral bugs can be sent to python-list@python.org). " "'docs@' is a mailing list run by volunteers; your request will be noticed, " @@ -74,26 +80,26 @@ msgstr "" "(程式碼執行的錯誤可以寄到 python-list@python.org)。「docs@」是一個由志工們" "所運行的郵寄清單;您的請求會被注意到,但可能需要一些時間才會被處理。" -#: ../../bugs.rst:30 +#: ../../bugs.rst:33 msgid "`Documentation bugs`_" msgstr "`說明文件錯誤`_" -#: ../../bugs.rst:30 +#: ../../bugs.rst:33 msgid "" "A list of documentation bugs that have been submitted to the Python issue " "tracker." msgstr "一系列已被提交至 Python 問題追蹤系統的有關說明文件的錯誤。" -#: ../../bugs.rst:33 +#: ../../bugs.rst:36 msgid "`Issue Tracking `_" msgstr "`問題追蹤系統 `_" -#: ../../bugs.rst:33 +#: ../../bugs.rst:36 msgid "" "Overview of the process involved in reporting an improvement on the tracker." msgstr "在追蹤系統上回報改進建議的過程簡介。" -#: ../../bugs.rst:36 +#: ../../bugs.rst:39 msgid "" "`Helping with Documentation `_" @@ -101,19 +107,19 @@ msgstr "" "`貢獻說明文件 `_" -#: ../../bugs.rst:36 +#: ../../bugs.rst:39 msgid "" "Comprehensive guide for individuals that are interested in contributing to " "Python documentation." msgstr "給有意成為 Python 說明文件貢獻者的綜合指南。" -#: ../../bugs.rst:38 +#: ../../bugs.rst:41 msgid "" "`Documentation Translations `_" msgstr "`說明文件翻譯 `_" -#: ../../bugs.rst:39 +#: ../../bugs.rst:42 msgid "" "A list of GitHub pages for documentation translation and their primary " "contacts." @@ -121,11 +127,11 @@ msgstr "" "一份 GitHub 網頁的清單,裡面有各個說明文件翻譯團隊的連結,以及他們的主要聯絡" "人。" -#: ../../bugs.rst:45 +#: ../../bugs.rst:48 msgid "Using the Python issue tracker" msgstr "使用 Python 問題追蹤系統" -#: ../../bugs.rst:47 +#: ../../bugs.rst:50 msgid "" "Issue reports for Python itself should be submitted via the GitHub issues " "tracker (https://github.com/python/cpython/issues). The GitHub issues " @@ -136,7 +142,7 @@ msgstr "" "python/cpython/issues) 提交。這個 GitHub 問題追蹤系統提供了一個網頁表單,可以" "輸入並提交相關資訊給開發者。" -#: ../../bugs.rst:52 +#: ../../bugs.rst:55 msgid "" "The first step in filing a report is to determine whether the problem has " "already been reported. The advantage in doing so, aside from saving the " @@ -151,7 +157,7 @@ msgstr "" "本中修正了這個問題,也有可能需要更詳細的資訊(在這種情況下,如果可以,非常歡" "迎您提供資訊!)。要確認是否重複回報,請使用頁面頂端的搜尋框來搜尋追蹤系統。" -#: ../../bugs.rst:59 +#: ../../bugs.rst:62 msgid "" "If the problem you're reporting is not already in the list, log in to " "GitHub. If you don't already have a GitHub account, create a new account " @@ -161,7 +167,7 @@ msgstr "" "如果您想回報的問題還沒有在問題列表出現過,請登入 GitHub。如果您還沒有 GitHub " "帳戶,請點選「Sign up」連結來建立一個新的帳戶。您無法以匿名方式提交錯誤報告。" -#: ../../bugs.rst:64 +#: ../../bugs.rst:67 msgid "" "Being now logged in, you can submit an issue. Click on the \"New issue\" " "button in the top bar to report a new issue." @@ -169,18 +175,18 @@ msgstr "" "如果已經登入,那您就可以提交問題了。請點選列表頂端區域的「New issue」按鈕,來" "回報一個新的問題。" -#: ../../bugs.rst:67 +#: ../../bugs.rst:70 msgid "The submission form has two fields, \"Title\" and \"Comment\"." msgstr "提交的表單中有兩個欄位,「Title」及「Comment」。" -#: ../../bugs.rst:69 +#: ../../bugs.rst:72 msgid "" "For the \"Title\" field, enter a *very* short description of the problem; " "less than ten words is good." msgstr "" "在「Title」欄位,輸入對該問題\\ *非常*\\ 簡短的描述;最好少於十個單字。" -#: ../../bugs.rst:72 +#: ../../bugs.rst:75 msgid "" "In the \"Comment\" field, describe the problem in detail, including what you " "expected to happen and what did happen. Be sure to include whether any " @@ -191,7 +197,7 @@ msgstr "" "確定說明中包含了涉及到的任何擴充模組,以及您當時所使用的硬體和軟體平台(視情" "況而定,可以附上版本資訊)。" -#: ../../bugs.rst:77 +#: ../../bugs.rst:80 msgid "" "Each issue report will be reviewed by a developer who will determine what " "needs to be done to correct the problem. You will receive an update each " @@ -200,7 +206,7 @@ msgstr "" "每一份問題報告都會被一位開發人員查核,並由他決定要做出什麼變更來修正這個問" "題。每當該問題有修正動作時,您會收到更新回報。" -#: ../../bugs.rst:86 +#: ../../bugs.rst:89 msgid "" "`How to Report Bugs Effectively `_" @@ -208,7 +214,7 @@ msgstr "" "`如何有效地回報錯誤 `_" -#: ../../bugs.rst:85 +#: ../../bugs.rst:88 msgid "" "Article which goes into some detail about how to create a useful bug report. " "This describes what kind of information is useful and why it is useful." @@ -216,14 +222,14 @@ msgstr "" "這篇文章詳細說明如何建立一份有用的錯誤報告。它描述了什麼樣的資訊是有用的,以" "及這些資訊為什麼有用。" -#: ../../bugs.rst:89 +#: ../../bugs.rst:92 msgid "" "`Bug Writing Guidelines `_" msgstr "" "`錯誤撰寫指南 `_" -#: ../../bugs.rst:89 +#: ../../bugs.rst:92 msgid "" "Information about writing a good bug report. Some of this is specific to " "the Mozilla project, but describes general good practices." @@ -231,11 +237,11 @@ msgstr "" "撰寫一份優良錯誤報告的相關資訊。部分的文章內容是針對 Mozilla 專案,但它也描述" "了通用的好習慣。" -#: ../../bugs.rst:95 +#: ../../bugs.rst:98 msgid "Getting started contributing to Python yourself" msgstr "開始讓自己貢獻 Python" -#: ../../bugs.rst:97 +#: ../../bugs.rst:100 msgid "" "Beyond just reporting bugs that you find, you are also welcome to submit " "patches to fix them. You can find more information on how to get started " From 70ea4cf10bd4f4abb9016d0e8843398fbd60aa89 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Feb 2023 00:34:52 +0000 Subject: [PATCH 023/130] sync with cpython 4a9dff0e --- library/asyncio-task.po | 4 +- library/subprocess.po | 580 ++++++++++++++++++++-------------------- 2 files changed, 298 insertions(+), 286 deletions(-) diff --git a/library/asyncio-task.po b/library/asyncio-task.po index cc633d8410..ac78e90add 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-26 00:17+0000\n" +"POT-Creation-Date: 2023-02-09 00:33+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1078,7 +1078,7 @@ msgstr "" #: ../../library/asyncio-task.rst:1099 msgid "" "The *file* argument is an I/O stream to which the output is written; by " -"default output is written to :data:`sys.stderr`." +"default output is written to :data:`sys.stdout`." msgstr "" #: ../../library/asyncio-task.rst:1104 diff --git a/library/subprocess.po b/library/subprocess.po index fdd3f5536b..2285495607 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-25 00:16+0000\n" +"POT-Creation-Date: 2023-02-09 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -152,92 +152,102 @@ msgid "" "*universal_newlines*. Added the *capture_output* parameter." msgstr "" -#: ../../library/subprocess.rst:116 +#: ../../library/subprocess.rst:116 ../../library/subprocess.rst:501 +#: ../../library/subprocess.rst:1181 ../../library/subprocess.rst:1221 +#: ../../library/subprocess.rst:1284 +msgid "" +"Changed Windows shell search order for ``shell=True``. The current directory " +"and ``%PATH%`` are replaced with ``%COMSPEC%`` and ``%SystemRoot%" +"\\System32\\cmd.exe``. As a result, dropping a malicious program named ``cmd." +"exe`` into a current directory no longer works." +msgstr "" + +#: ../../library/subprocess.rst:124 msgid "" "The return value from :func:`run`, representing a process that has finished." msgstr "" -#: ../../library/subprocess.rst:120 +#: ../../library/subprocess.rst:128 msgid "" "The arguments used to launch the process. This may be a list or a string." msgstr "" -#: ../../library/subprocess.rst:124 +#: ../../library/subprocess.rst:132 msgid "" "Exit status of the child process. Typically, an exit status of 0 indicates " "that it ran successfully." msgstr "" -#: ../../library/subprocess.rst:127 ../../library/subprocess.rst:911 +#: ../../library/subprocess.rst:135 ../../library/subprocess.rst:928 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." msgstr "" -#: ../../library/subprocess.rst:132 +#: ../../library/subprocess.rst:140 msgid "" "Captured stdout from the child process. A bytes sequence, or a string if :" "func:`run` was called with an encoding, errors, or text=True. ``None`` if " "stdout was not captured." msgstr "" -#: ../../library/subprocess.rst:136 +#: ../../library/subprocess.rst:144 msgid "" "If you ran the process with ``stderr=subprocess.STDOUT``, stdout and stderr " "will be combined in this attribute, and :attr:`stderr` will be ``None``." msgstr "" -#: ../../library/subprocess.rst:142 +#: ../../library/subprocess.rst:150 msgid "" "Captured stderr from the child process. A bytes sequence, or a string if :" "func:`run` was called with an encoding, errors, or text=True. ``None`` if " "stderr was not captured." msgstr "" -#: ../../library/subprocess.rst:148 +#: ../../library/subprocess.rst:156 msgid "If :attr:`returncode` is non-zero, raise a :exc:`CalledProcessError`." msgstr "" -#: ../../library/subprocess.rst:154 +#: ../../library/subprocess.rst:162 msgid "" "Special value that can be used as the *stdin*, *stdout* or *stderr* argument " "to :class:`Popen` and indicates that the special file :data:`os.devnull` " "will be used." msgstr "" -#: ../../library/subprocess.rst:163 +#: ../../library/subprocess.rst:171 msgid "" "Special value that can be used as the *stdin*, *stdout* or *stderr* argument " "to :class:`Popen` and indicates that a pipe to the standard stream should be " "opened. Most useful with :meth:`Popen.communicate`." msgstr "" -#: ../../library/subprocess.rst:170 +#: ../../library/subprocess.rst:178 msgid "" "Special value that can be used as the *stderr* argument to :class:`Popen` " "and indicates that standard error should go into the same handle as standard " "output." msgstr "" -#: ../../library/subprocess.rst:177 +#: ../../library/subprocess.rst:185 msgid "Base class for all other exceptions from this module." msgstr "" -#: ../../library/subprocess.rst:184 +#: ../../library/subprocess.rst:192 msgid "" "Subclass of :exc:`SubprocessError`, raised when a timeout expires while " "waiting for a child process." msgstr "" -#: ../../library/subprocess.rst:189 ../../library/subprocess.rst:233 +#: ../../library/subprocess.rst:197 ../../library/subprocess.rst:241 msgid "Command that was used to spawn the child process." msgstr "" -#: ../../library/subprocess.rst:193 +#: ../../library/subprocess.rst:201 msgid "Timeout in seconds." msgstr "" -#: ../../library/subprocess.rst:197 +#: ../../library/subprocess.rst:205 msgid "" "Output of the child process if it was captured by :func:`run` or :func:" "`check_output`. Otherwise, ``None``. This is always :class:`bytes` when " @@ -245,11 +255,11 @@ msgid "" "remain ``None`` instead of ``b''`` when no output was observed." msgstr "" -#: ../../library/subprocess.rst:205 ../../library/subprocess.rst:242 +#: ../../library/subprocess.rst:213 ../../library/subprocess.rst:250 msgid "Alias for output, for symmetry with :attr:`stderr`." msgstr "" -#: ../../library/subprocess.rst:209 +#: ../../library/subprocess.rst:217 msgid "" "Stderr output of the child process if it was captured by :func:`run`. " "Otherwise, ``None``. This is always :class:`bytes` when stderr output was " @@ -257,40 +267,40 @@ msgid "" "instead of ``b''`` when no stderr output was observed." msgstr "" -#: ../../library/subprocess.rst:216 ../../library/subprocess.rst:249 +#: ../../library/subprocess.rst:224 ../../library/subprocess.rst:257 msgid "*stdout* and *stderr* attributes added" msgstr "" -#: ../../library/subprocess.rst:221 +#: ../../library/subprocess.rst:229 msgid "" "Subclass of :exc:`SubprocessError`, raised when a process run by :func:" "`check_call`, :func:`check_output`, or :func:`run` (with ``check=True``) " "returns a non-zero exit status." msgstr "" -#: ../../library/subprocess.rst:228 +#: ../../library/subprocess.rst:236 msgid "" "Exit status of the child process. If the process exited due to a signal, " "this will be the negative signal number." msgstr "" -#: ../../library/subprocess.rst:237 +#: ../../library/subprocess.rst:245 msgid "" "Output of the child process if it was captured by :func:`run` or :func:" "`check_output`. Otherwise, ``None``." msgstr "" -#: ../../library/subprocess.rst:246 +#: ../../library/subprocess.rst:254 msgid "" "Stderr output of the child process if it was captured by :func:`run`. " "Otherwise, ``None``." msgstr "" -#: ../../library/subprocess.rst:256 +#: ../../library/subprocess.rst:264 msgid "Frequently Used Arguments" msgstr "" -#: ../../library/subprocess.rst:258 +#: ../../library/subprocess.rst:266 msgid "" "To support a wide variety of use cases, the :class:`Popen` constructor (and " "the convenience functions) accept a large number of optional arguments. For " @@ -298,7 +308,7 @@ msgid "" "default values. The arguments that are most commonly needed are:" msgstr "" -#: ../../library/subprocess.rst:263 +#: ../../library/subprocess.rst:271 msgid "" "*args* is required for all calls and should be a string, or a sequence of " "program arguments. Providing a sequence of arguments is generally preferred, " @@ -308,7 +318,7 @@ msgid "" "simply name the program to be executed without specifying any arguments." msgstr "" -#: ../../library/subprocess.rst:271 +#: ../../library/subprocess.rst:279 msgid "" "*stdin*, *stdout* and *stderr* specify the executed program's standard " "input, standard output and standard error file handles, respectively. Valid " @@ -323,7 +333,7 @@ msgid "" "handle as for *stdout*." msgstr "" -#: ../../library/subprocess.rst:286 +#: ../../library/subprocess.rst:294 msgid "" "If *encoding* or *errors* are specified, or *text* (also known as " "*universal_newlines*) is true, the file objects *stdin*, *stdout* and " @@ -331,7 +341,7 @@ msgid "" "specified in the call or the defaults for :class:`io.TextIOWrapper`." msgstr "" -#: ../../library/subprocess.rst:292 +#: ../../library/subprocess.rst:300 msgid "" "For *stdin*, line ending characters ``'\\n'`` in the input will be converted " "to the default line separator :data:`os.linesep`. For *stdout* and *stderr*, " @@ -340,28 +350,28 @@ msgid "" "when the *newline* argument to its constructor is ``None``." msgstr "" -#: ../../library/subprocess.rst:298 +#: ../../library/subprocess.rst:306 msgid "" "If text mode is not used, *stdin*, *stdout* and *stderr* will be opened as " "binary streams. No encoding or line ending conversion is performed." msgstr "" -#: ../../library/subprocess.rst:301 +#: ../../library/subprocess.rst:309 msgid "Added *encoding* and *errors* parameters." msgstr "新增 *encoding* 與 *errors* 參數。" -#: ../../library/subprocess.rst:304 +#: ../../library/subprocess.rst:312 msgid "Added the *text* parameter as an alias for *universal_newlines*." msgstr "" -#: ../../library/subprocess.rst:309 +#: ../../library/subprocess.rst:317 msgid "" "The newlines attribute of the file objects :attr:`Popen.stdin`, :attr:`Popen." "stdout` and :attr:`Popen.stderr` are not updated by the :meth:`Popen." "communicate` method." msgstr "" -#: ../../library/subprocess.rst:313 +#: ../../library/subprocess.rst:321 msgid "" "If *shell* is ``True``, the specified command will be executed through the " "shell. This can be useful if you are using Python primarily for the " @@ -374,7 +384,7 @@ msgid "" "expanduser`, and :mod:`shutil`)." msgstr "" -#: ../../library/subprocess.rst:323 +#: ../../library/subprocess.rst:331 msgid "" "When *universal_newlines* is ``True``, the class uses the encoding :func:" "`locale.getpreferredencoding(False) ` instead " @@ -382,22 +392,22 @@ msgid "" "class for more information on this change." msgstr "" -#: ../../library/subprocess.rst:331 ../../library/subprocess.rst:452 +#: ../../library/subprocess.rst:339 ../../library/subprocess.rst:460 msgid "" "Read the `Security Considerations`_ section before using ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:333 +#: ../../library/subprocess.rst:341 msgid "" "These options, along with all of the other options, are described in more " "detail in the :class:`Popen` constructor documentation." msgstr "" -#: ../../library/subprocess.rst:338 +#: ../../library/subprocess.rst:346 msgid "Popen Constructor" msgstr "" -#: ../../library/subprocess.rst:340 +#: ../../library/subprocess.rst:348 msgid "" "The underlying process creation and management in this module is handled by " "the :class:`Popen` class. It offers a lot of flexibility so that developers " @@ -405,7 +415,7 @@ msgid "" "functions." msgstr "" -#: ../../library/subprocess.rst:355 +#: ../../library/subprocess.rst:363 msgid "" "Execute a child program in a new process. On POSIX, the class uses :meth:" "`os.execvpe`-like behavior to execute the child program. On Windows, the " @@ -413,7 +423,7 @@ msgid "" "class:`Popen` are as follows." msgstr "" -#: ../../library/subprocess.rst:360 +#: ../../library/subprocess.rst:368 msgid "" "*args* should be a sequence of program arguments or else a single string or :" "term:`path-like object`. By default, the program to execute is the first " @@ -424,7 +434,7 @@ msgid "" "sequence." msgstr "" -#: ../../library/subprocess.rst:370 +#: ../../library/subprocess.rst:378 msgid "" "For maximum reliability, use a fully qualified path for the executable. To " "search for an unqualified name on :envvar:`PATH`, use :meth:`shutil.which`. " @@ -433,7 +443,7 @@ msgid "" "format to launch an installed module." msgstr "" -#: ../../library/subprocess.rst:376 +#: ../../library/subprocess.rst:384 msgid "" "Resolving the path of *executable* (or the first item of *args*) is platform " "dependent. For POSIX, see :meth:`os.execvpe`, and note that when resolving " @@ -447,27 +457,27 @@ msgid "" "variations." msgstr "" -#: ../../library/subprocess.rst:387 +#: ../../library/subprocess.rst:395 msgid "" "An example of passing some arguments to an external program as a sequence " "is::" msgstr "" -#: ../../library/subprocess.rst:392 +#: ../../library/subprocess.rst:400 msgid "" "On POSIX, if *args* is a string, the string is interpreted as the name or " "path of the program to execute. However, this can only be done if not " "passing arguments to the program." msgstr "" -#: ../../library/subprocess.rst:398 +#: ../../library/subprocess.rst:406 msgid "" "It may not be obvious how to break a shell command into a sequence of " "arguments, especially in complex cases. :meth:`shlex.split` can illustrate " "how to determine the correct tokenization for *args*::" msgstr "" -#: ../../library/subprocess.rst:410 +#: ../../library/subprocess.rst:418 msgid "" "Note in particular that options (such as *-input*) and arguments (such as " "*eggs.txt*) that are separated by whitespace in the shell go in separate " @@ -476,33 +486,33 @@ msgid "" "shown above) are single list elements." msgstr "" -#: ../../library/subprocess.rst:416 +#: ../../library/subprocess.rst:424 msgid "" "On Windows, if *args* is a sequence, it will be converted to a string in a " "manner described in :ref:`converting-argument-sequence`. This is because " "the underlying ``CreateProcess()`` operates on strings." msgstr "" -#: ../../library/subprocess.rst:420 +#: ../../library/subprocess.rst:428 msgid "" "*args* parameter accepts a :term:`path-like object` if *shell* is ``False`` " "and a sequence containing path-like objects on POSIX." msgstr "" -#: ../../library/subprocess.rst:424 +#: ../../library/subprocess.rst:432 msgid "" "*args* parameter accepts a :term:`path-like object` if *shell* is ``False`` " "and a sequence containing bytes and path-like objects on Windows." msgstr "" -#: ../../library/subprocess.rst:429 +#: ../../library/subprocess.rst:437 msgid "" "The *shell* argument (which defaults to ``False``) specifies whether to use " "the shell as the program to execute. If *shell* is ``True``, it is " "recommended to pass *args* as a string rather than as a sequence." msgstr "" -#: ../../library/subprocess.rst:433 +#: ../../library/subprocess.rst:441 msgid "" "On POSIX with ``shell=True``, the shell defaults to :file:`/bin/sh`. If " "*args* is a string, the string specifies the command to execute through the " @@ -514,7 +524,7 @@ msgid "" "class:`Popen` does the equivalent of::" msgstr "" -#: ../../library/subprocess.rst:444 +#: ../../library/subprocess.rst:452 msgid "" "On Windows with ``shell=True``, the :envvar:`COMSPEC` environment variable " "specifies the default shell. The only time you need to specify " @@ -523,35 +533,35 @@ msgid "" "``shell=True`` to run a batch file or console-based executable." msgstr "" -#: ../../library/subprocess.rst:454 +#: ../../library/subprocess.rst:462 msgid "" "*bufsize* will be supplied as the corresponding argument to the :func:`open` " "function when creating the stdin/stdout/stderr pipe file objects:" msgstr "" -#: ../../library/subprocess.rst:458 +#: ../../library/subprocess.rst:466 msgid "" ":const:`0` means unbuffered (read and write are one system call and can " "return short)" msgstr "" -#: ../../library/subprocess.rst:460 +#: ../../library/subprocess.rst:468 msgid "" -":const:`1` means line buffered (only usable if ``universal_newlines=True`` i." -"e., in a text mode)" +":const:`1` means line buffered (only usable if ``text=True`` or " +"``universal_newlines=True``)" msgstr "" -#: ../../library/subprocess.rst:462 +#: ../../library/subprocess.rst:470 msgid "any other positive value means use a buffer of approximately that size" msgstr "" -#: ../../library/subprocess.rst:464 +#: ../../library/subprocess.rst:472 msgid "" "negative bufsize (the default) means the system default of io." "DEFAULT_BUFFER_SIZE will be used." msgstr "" -#: ../../library/subprocess.rst:467 +#: ../../library/subprocess.rst:475 msgid "" "*bufsize* now defaults to -1 to enable buffering by default to match the " "behavior that most code expects. In versions prior to Python 3.2.4 and " @@ -560,7 +570,7 @@ msgid "" "of Python 2 as most code expected." msgstr "" -#: ../../library/subprocess.rst:474 +#: ../../library/subprocess.rst:482 msgid "" "The *executable* argument specifies a replacement program to execute. It " "is very seldom needed. When ``shell=False``, *executable* replaces the " @@ -573,17 +583,17 @@ msgid "" "default :file:`/bin/sh`." msgstr "" -#: ../../library/subprocess.rst:484 +#: ../../library/subprocess.rst:492 msgid "*executable* parameter accepts a :term:`path-like object` on POSIX." msgstr "" -#: ../../library/subprocess.rst:487 +#: ../../library/subprocess.rst:495 msgid "" "*executable* parameter accepts a bytes and :term:`path-like object` on " "Windows." msgstr "" -#: ../../library/subprocess.rst:491 +#: ../../library/subprocess.rst:507 msgid "" "*stdin*, *stdout* and *stderr* specify the executed program's standard " "input, standard output and standard error file handles, respectively. Valid " @@ -598,19 +608,19 @@ msgid "" "handle as for stdout." msgstr "" -#: ../../library/subprocess.rst:503 +#: ../../library/subprocess.rst:519 msgid "" "If *preexec_fn* is set to a callable object, this object will be called in " "the child process just before the child is executed. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:509 +#: ../../library/subprocess.rst:525 msgid "" "The *preexec_fn* parameter is NOT SAFE to use in the presence of threads in " "your application. The child process could deadlock before exec is called." msgstr "" -#: ../../library/subprocess.rst:515 +#: ../../library/subprocess.rst:531 msgid "" "If you need to modify the environment for the child use the *env* parameter " "rather than doing it in a *preexec_fn*. The *start_new_session* and " @@ -618,7 +628,7 @@ msgid "" "to call :func:`os.setsid` or :func:`os.setpgid` in the child." msgstr "" -#: ../../library/subprocess.rst:522 +#: ../../library/subprocess.rst:538 msgid "" "The *preexec_fn* parameter is no longer supported in subinterpreters. The " "use of the parameter in a subinterpreter raises :exc:`RuntimeError`. The new " @@ -626,7 +636,7 @@ msgid "" "and other embedded environments." msgstr "" -#: ../../library/subprocess.rst:527 +#: ../../library/subprocess.rst:543 msgid "" "If *close_fds* is true, all file descriptors except :const:`0`, :const:`1` " "and :const:`2` will be closed before the child process is executed. " @@ -634,38 +644,38 @@ msgid "" "flag as described in :ref:`fd_inheritance`." msgstr "" -#: ../../library/subprocess.rst:532 +#: ../../library/subprocess.rst:548 msgid "" "On Windows, if *close_fds* is true then no handles will be inherited by the " "child process unless explicitly passed in the ``handle_list`` element of :" "attr:`STARTUPINFO.lpAttributeList`, or by standard handle redirection." msgstr "" -#: ../../library/subprocess.rst:536 +#: ../../library/subprocess.rst:552 msgid "" "The default for *close_fds* was changed from :const:`False` to what is " "described above." msgstr "" -#: ../../library/subprocess.rst:540 +#: ../../library/subprocess.rst:556 msgid "" "On Windows the default for *close_fds* was changed from :const:`False` to :" "const:`True` when redirecting the standard handles. It's now possible to set " "*close_fds* to :const:`True` when redirecting the standard handles." msgstr "" -#: ../../library/subprocess.rst:545 +#: ../../library/subprocess.rst:561 msgid "" "*pass_fds* is an optional sequence of file descriptors to keep open between " "the parent and child. Providing any *pass_fds* forces *close_fds* to be :" "const:`True`. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:549 +#: ../../library/subprocess.rst:565 msgid "The *pass_fds* parameter was added." msgstr "新增 *pass_fds* 參數。" -#: ../../library/subprocess.rst:552 +#: ../../library/subprocess.rst:568 msgid "" "If *cwd* is not ``None``, the function changes the working directory to " "*cwd* before executing the child. *cwd* can be a string, bytes or :term:" @@ -674,57 +684,57 @@ msgid "" "executable path is a relative path." msgstr "" -#: ../../library/subprocess.rst:558 +#: ../../library/subprocess.rst:574 msgid "*cwd* parameter accepts a :term:`path-like object` on POSIX." msgstr "" -#: ../../library/subprocess.rst:561 +#: ../../library/subprocess.rst:577 msgid "*cwd* parameter accepts a :term:`path-like object` on Windows." msgstr "" -#: ../../library/subprocess.rst:564 +#: ../../library/subprocess.rst:580 msgid "*cwd* parameter accepts a bytes object on Windows." msgstr "" -#: ../../library/subprocess.rst:567 +#: ../../library/subprocess.rst:583 msgid "" "If *restore_signals* is true (the default) all signals that Python has set " "to SIG_IGN are restored to SIG_DFL in the child process before the exec. " "Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:572 +#: ../../library/subprocess.rst:588 msgid "*restore_signals* was added." msgstr "新增 *restore_signals*\\ 。" -#: ../../library/subprocess.rst:575 +#: ../../library/subprocess.rst:591 msgid "" "If *start_new_session* is true the ``setsid()`` system call will be made in " "the child process prior to the execution of the subprocess." msgstr "" -#: ../../library/subprocess.rst:578 ../../library/subprocess.rst:585 -#: ../../library/subprocess.rst:595 ../../library/subprocess.rst:604 -#: ../../library/subprocess.rst:613 ../../library/subprocess.rst:619 +#: ../../library/subprocess.rst:594 ../../library/subprocess.rst:601 +#: ../../library/subprocess.rst:611 ../../library/subprocess.rst:620 +#: ../../library/subprocess.rst:629 ../../library/subprocess.rst:635 msgid ":ref:`Availability `: POSIX" msgstr ":ref:`適用 `:POSIX" -#: ../../library/subprocess.rst:579 +#: ../../library/subprocess.rst:595 msgid "*start_new_session* was added." msgstr "新增 *start_new_session*\\ 。" -#: ../../library/subprocess.rst:582 +#: ../../library/subprocess.rst:598 msgid "" "If *process_group* is a non-negative integer, the ``setpgid(0, value)`` " "system call will be made in the child process prior to the execution of the " "subprocess." msgstr "" -#: ../../library/subprocess.rst:586 +#: ../../library/subprocess.rst:602 msgid "*process_group* was added." msgstr "新增 *process_group*\\ 。" -#: ../../library/subprocess.rst:589 +#: ../../library/subprocess.rst:605 msgid "" "If *group* is not ``None``, the setregid() system call will be made in the " "child process prior to the execution of the subprocess. If the provided " @@ -733,7 +743,7 @@ msgid "" "passed verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:598 +#: ../../library/subprocess.rst:614 msgid "" "If *extra_groups* is not ``None``, the setgroups() system call will be made " "in the child process prior to the execution of the subprocess. Strings " @@ -742,7 +752,7 @@ msgid "" "verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:607 +#: ../../library/subprocess.rst:623 msgid "" "If *user* is not ``None``, the setreuid() system call will be made in the " "child process prior to the execution of the subprocess. If the provided " @@ -751,13 +761,13 @@ msgid "" "passed verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:616 +#: ../../library/subprocess.rst:632 msgid "" "If *umask* is not negative, the umask() system call will be made in the " "child process prior to the execution of the subprocess." msgstr "" -#: ../../library/subprocess.rst:622 +#: ../../library/subprocess.rst:638 msgid "" "If *env* is not ``None``, it must be a mapping that defines the environment " "variables for the new process; these are used instead of the default " @@ -766,14 +776,14 @@ msgid "" "data:`os.environ` or :data:`os.environb`." msgstr "" -#: ../../library/subprocess.rst:630 +#: ../../library/subprocess.rst:646 msgid "" "If specified, *env* must provide any variables required for the program to " "execute. On Windows, in order to run a `side-by-side assembly`_ the " "specified *env* **must** include a valid :envvar:`SystemRoot`." msgstr "" -#: ../../library/subprocess.rst:636 +#: ../../library/subprocess.rst:652 msgid "" "If *encoding* or *errors* are specified, or *text* is true, the file objects " "*stdin*, *stdout* and *stderr* are opened in text mode with the specified " @@ -783,70 +793,70 @@ msgid "" "in binary mode." msgstr "" -#: ../../library/subprocess.rst:642 +#: ../../library/subprocess.rst:658 msgid "*encoding* and *errors* were added." msgstr "新增 *encoding* 與 *errors*\\ 。" -#: ../../library/subprocess.rst:645 ../../library/subprocess.rst:1246 +#: ../../library/subprocess.rst:661 ../../library/subprocess.rst:1279 msgid "*text* was added as a more readable alias for *universal_newlines*." msgstr "" -#: ../../library/subprocess.rst:648 +#: ../../library/subprocess.rst:664 msgid "" "If given, *startupinfo* will be a :class:`STARTUPINFO` object, which is " "passed to the underlying ``CreateProcess`` function. *creationflags*, if " "given, can be one or more of the following flags:" msgstr "" -#: ../../library/subprocess.rst:652 +#: ../../library/subprocess.rst:668 msgid ":data:`CREATE_NEW_CONSOLE`" msgstr ":data:`CREATE_NEW_CONSOLE`" -#: ../../library/subprocess.rst:653 +#: ../../library/subprocess.rst:669 msgid ":data:`CREATE_NEW_PROCESS_GROUP`" msgstr ":data:`CREATE_NEW_PROCESS_GROUP`" -#: ../../library/subprocess.rst:654 +#: ../../library/subprocess.rst:670 msgid ":data:`ABOVE_NORMAL_PRIORITY_CLASS`" msgstr ":data:`ABOVE_NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:655 +#: ../../library/subprocess.rst:671 msgid ":data:`BELOW_NORMAL_PRIORITY_CLASS`" msgstr ":data:`BELOW_NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:656 +#: ../../library/subprocess.rst:672 msgid ":data:`HIGH_PRIORITY_CLASS`" msgstr ":data:`HIGH_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:657 +#: ../../library/subprocess.rst:673 msgid ":data:`IDLE_PRIORITY_CLASS`" msgstr ":data:`IDLE_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:658 +#: ../../library/subprocess.rst:674 msgid ":data:`NORMAL_PRIORITY_CLASS`" msgstr ":data:`NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:659 +#: ../../library/subprocess.rst:675 msgid ":data:`REALTIME_PRIORITY_CLASS`" msgstr ":data:`REALTIME_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:660 +#: ../../library/subprocess.rst:676 msgid ":data:`CREATE_NO_WINDOW`" msgstr ":data:`CREATE_NO_WINDOW`" -#: ../../library/subprocess.rst:661 +#: ../../library/subprocess.rst:677 msgid ":data:`DETACHED_PROCESS`" msgstr ":data:`DETACHED_PROCESS`" -#: ../../library/subprocess.rst:662 +#: ../../library/subprocess.rst:678 msgid ":data:`CREATE_DEFAULT_ERROR_MODE`" msgstr ":data:`CREATE_DEFAULT_ERROR_MODE`" -#: ../../library/subprocess.rst:663 +#: ../../library/subprocess.rst:679 msgid ":data:`CREATE_BREAKAWAY_FROM_JOB`" msgstr ":data:`CREATE_BREAKAWAY_FROM_JOB`" -#: ../../library/subprocess.rst:665 +#: ../../library/subprocess.rst:681 msgid "" "*pipesize* can be used to change the size of the pipe when :data:`PIPE` is " "used for *stdin*, *stdout* or *stderr*. The size of the pipe is only changed " @@ -854,24 +864,24 @@ msgid "" "platforms will ignore this parameter." msgstr "" -#: ../../library/subprocess.rst:670 +#: ../../library/subprocess.rst:686 msgid "The ``pipesize`` parameter was added." msgstr "新增 ``pipesize`` 參數。" -#: ../../library/subprocess.rst:673 +#: ../../library/subprocess.rst:689 msgid "" "Popen objects are supported as context managers via the :keyword:`with` " "statement: on exit, standard file descriptors are closed, and the process is " "waited for. ::" msgstr "" -#: ../../library/subprocess.rst:326 +#: ../../library/subprocess.rst:334 msgid "" "Raises an :ref:`auditing event ` ``subprocess.Popen`` with " "arguments ``executable``, ``args``, ``cwd``, ``env``." msgstr "" -#: ../../library/subprocess.rst:682 +#: ../../library/subprocess.rst:698 msgid "" "Popen and the other functions in this module that use it raise an :ref:" "`auditing event ` ``subprocess.Popen`` with arguments " @@ -879,17 +889,17 @@ msgid "" "be a single string or a list of strings, depending on platform." msgstr "" -#: ../../library/subprocess.rst:687 +#: ../../library/subprocess.rst:703 msgid "Added context manager support." msgstr "" -#: ../../library/subprocess.rst:690 +#: ../../library/subprocess.rst:706 msgid "" "Popen destructor now emits a :exc:`ResourceWarning` warning if the child " "process is still running." msgstr "" -#: ../../library/subprocess.rst:694 +#: ../../library/subprocess.rst:710 msgid "" "Popen can use :func:`os.posix_spawn` in some cases for better performance. " "On Windows Subsystem for Linux and QEMU User Emulation, Popen constructor " @@ -898,17 +908,17 @@ msgid "" "returncode`." msgstr "" -#: ../../library/subprocess.rst:703 +#: ../../library/subprocess.rst:719 msgid "Exceptions" msgstr "例外" -#: ../../library/subprocess.rst:705 +#: ../../library/subprocess.rst:721 msgid "" "Exceptions raised in the child process, before the new program has started " "to execute, will be re-raised in the parent." msgstr "" -#: ../../library/subprocess.rst:708 +#: ../../library/subprocess.rst:724 msgid "" "The most common exception raised is :exc:`OSError`. This occurs, for " "example, when trying to execute a non-existent file. Applications should " @@ -919,39 +929,39 @@ msgid "" "subprocess." msgstr "" -#: ../../library/subprocess.rst:715 +#: ../../library/subprocess.rst:731 msgid "" "A :exc:`ValueError` will be raised if :class:`Popen` is called with invalid " "arguments." msgstr "" -#: ../../library/subprocess.rst:718 +#: ../../library/subprocess.rst:734 msgid "" ":func:`check_call` and :func:`check_output` will raise :exc:" "`CalledProcessError` if the called process returns a non-zero return code." msgstr "" -#: ../../library/subprocess.rst:722 +#: ../../library/subprocess.rst:738 msgid "" "All of the functions and methods that accept a *timeout* parameter, such as :" "func:`call` and :meth:`Popen.communicate` will raise :exc:`TimeoutExpired` " "if the timeout expires before the process exits." msgstr "" -#: ../../library/subprocess.rst:726 +#: ../../library/subprocess.rst:742 msgid "" "Exceptions defined in this module all inherit from :exc:`SubprocessError`." msgstr "" -#: ../../library/subprocess.rst:728 +#: ../../library/subprocess.rst:744 msgid "The :exc:`SubprocessError` base class was added." msgstr "" -#: ../../library/subprocess.rst:734 +#: ../../library/subprocess.rst:750 msgid "Security Considerations" msgstr "" -#: ../../library/subprocess.rst:736 +#: ../../library/subprocess.rst:752 msgid "" "Unlike some other popen functions, this implementation will never implicitly " "call a system shell. This means that all characters, including shell " @@ -964,34 +974,34 @@ msgid "" "escaping." msgstr "" -#: ../../library/subprocess.rst:748 +#: ../../library/subprocess.rst:764 msgid "Popen Objects" msgstr "" -#: ../../library/subprocess.rst:750 +#: ../../library/subprocess.rst:766 msgid "Instances of the :class:`Popen` class have the following methods:" msgstr "" -#: ../../library/subprocess.rst:755 +#: ../../library/subprocess.rst:771 msgid "" "Check if child process has terminated. Set and return :attr:`~Popen." "returncode` attribute. Otherwise, returns ``None``." msgstr "" -#: ../../library/subprocess.rst:761 +#: ../../library/subprocess.rst:777 msgid "" "Wait for child process to terminate. Set and return :attr:`~Popen." "returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:764 +#: ../../library/subprocess.rst:780 msgid "" "If the process does not terminate after *timeout* seconds, raise a :exc:" "`TimeoutExpired` exception. It is safe to catch this exception and retry " "the wait." msgstr "" -#: ../../library/subprocess.rst:770 +#: ../../library/subprocess.rst:786 msgid "" "This will deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and the " "child process generates enough output to a pipe such that it blocks waiting " @@ -999,20 +1009,20 @@ msgid "" "when using pipes to avoid that." msgstr "" -#: ../../library/subprocess.rst:777 +#: ../../library/subprocess.rst:793 msgid "" "The function is implemented using a busy loop (non-blocking call and short " "sleeps). Use the :mod:`asyncio` module for an asynchronous wait: see :class:" "`asyncio.create_subprocess_exec`." msgstr "" -#: ../../library/subprocess.rst:781 ../../library/subprocess.rst:822 -#: ../../library/subprocess.rst:1159 ../../library/subprocess.rst:1191 -#: ../../library/subprocess.rst:1237 +#: ../../library/subprocess.rst:797 ../../library/subprocess.rst:838 +#: ../../library/subprocess.rst:1176 ../../library/subprocess.rst:1216 +#: ../../library/subprocess.rst:1270 msgid "*timeout* was added." msgstr "新增 *timeout*\\ 。" -#: ../../library/subprocess.rst:786 +#: ../../library/subprocess.rst:802 msgid "" "Interact with process: Send data to stdin. Read data from stdout and " "stderr, until end-of-file is reached. Wait for process to terminate and set " @@ -1022,13 +1032,13 @@ msgid "" "must be a string. Otherwise, it must be bytes." msgstr "" -#: ../../library/subprocess.rst:793 +#: ../../library/subprocess.rst:809 msgid "" ":meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``. The data " "will be strings if streams were opened in text mode; otherwise, bytes." msgstr "" -#: ../../library/subprocess.rst:797 +#: ../../library/subprocess.rst:813 msgid "" "Note that if you want to send data to the process's stdin, you need to " "create the Popen object with ``stdin=PIPE``. Similarly, to get anything " @@ -1036,94 +1046,96 @@ msgid "" "and/or ``stderr=PIPE`` too." msgstr "" -#: ../../library/subprocess.rst:802 +#: ../../library/subprocess.rst:818 msgid "" "If the process does not terminate after *timeout* seconds, a :exc:" "`TimeoutExpired` exception will be raised. Catching this exception and " "retrying communication will not lose any output." msgstr "" -#: ../../library/subprocess.rst:806 +#: ../../library/subprocess.rst:822 msgid "" "The child process is not killed if the timeout expires, so in order to " "cleanup properly a well-behaved application should kill the child process " "and finish communication::" msgstr "" -#: ../../library/subprocess.rst:819 +#: ../../library/subprocess.rst:835 msgid "" "The data read is buffered in memory, so do not use this method if the data " "size is large or unlimited." msgstr "" -#: ../../library/subprocess.rst:828 +#: ../../library/subprocess.rst:844 msgid "Sends the signal *signal* to the child." msgstr "" -#: ../../library/subprocess.rst:830 +#: ../../library/subprocess.rst:846 msgid "Do nothing if the process completed." msgstr "" -#: ../../library/subprocess.rst:834 +#: ../../library/subprocess.rst:850 msgid "" "On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and " "CTRL_BREAK_EVENT can be sent to processes started with a *creationflags* " "parameter which includes ``CREATE_NEW_PROCESS_GROUP``." msgstr "" -#: ../../library/subprocess.rst:841 +#: ../../library/subprocess.rst:857 msgid "" "Stop the child. On POSIX OSs the method sends SIGTERM to the child. On " "Windows the Win32 API function :c:func:`TerminateProcess` is called to stop " "the child." msgstr "" -#: ../../library/subprocess.rst:848 +#: ../../library/subprocess.rst:864 msgid "" "Kills the child. On POSIX OSs the function sends SIGKILL to the child. On " "Windows :meth:`kill` is an alias for :meth:`terminate`." msgstr "" -#: ../../library/subprocess.rst:852 -msgid "The following attributes are also available:" +#: ../../library/subprocess.rst:868 +msgid "" +"The following attributes are also set by the class for you to access. " +"Reassigning them to new values is unsupported:" msgstr "" -#: ../../library/subprocess.rst:856 +#: ../../library/subprocess.rst:873 msgid "" "The *args* argument as it was passed to :class:`Popen` -- a sequence of " "program arguments or else a single string." msgstr "" -#: ../../library/subprocess.rst:863 +#: ../../library/subprocess.rst:880 msgid "" "If the *stdin* argument was :data:`PIPE`, this attribute is a writeable " "stream object as returned by :func:`open`. If the *encoding* or *errors* " -"arguments were specified or the *universal_newlines* argument was ``True``, " -"the stream is a text stream, otherwise it is a byte stream. If the *stdin* " -"argument was not :data:`PIPE`, this attribute is ``None``." +"arguments were specified or the *text* or *universal_newlines* argument was " +"``True``, the stream is a text stream, otherwise it is a byte stream. If the " +"*stdin* argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:872 +#: ../../library/subprocess.rst:889 msgid "" "If the *stdout* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " "output from the child process. If the *encoding* or *errors* arguments were " -"specified or the *universal_newlines* argument was ``True``, the stream is a " -"text stream, otherwise it is a byte stream. If the *stdout* argument was " -"not :data:`PIPE`, this attribute is ``None``." +"specified or the *text* or *universal_newlines* argument was ``True``, the " +"stream is a text stream, otherwise it is a byte stream. If the *stdout* " +"argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:882 +#: ../../library/subprocess.rst:899 msgid "" "If the *stderr* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " "error output from the child process. If the *encoding* or *errors* arguments " -"were specified or the *universal_newlines* argument was ``True``, the stream " -"is a text stream, otherwise it is a byte stream. If the *stderr* argument " -"was not :data:`PIPE`, this attribute is ``None``." +"were specified or the *text* or *universal_newlines* argument was ``True``, " +"the stream is a text stream, otherwise it is a byte stream. If the *stderr* " +"argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:891 +#: ../../library/subprocess.rst:908 msgid "" "Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write `, :attr:`.stdout.read ` or :attr:`.stderr.read `__ structure is used for :class:`Popen` " @@ -1166,38 +1178,38 @@ msgid "" "only arguments." msgstr "" -#: ../../library/subprocess.rst:929 +#: ../../library/subprocess.rst:946 msgid "Keyword-only argument support was added." msgstr "" -#: ../../library/subprocess.rst:934 +#: ../../library/subprocess.rst:951 msgid "" "A bit field that determines whether certain :class:`STARTUPINFO` attributes " "are used when the process creates a window. ::" msgstr "" -#: ../../library/subprocess.rst:942 +#: ../../library/subprocess.rst:959 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard input handle for the process. If :data:`STARTF_USESTDHANDLES` " "is not specified, the default for standard input is the keyboard buffer." msgstr "" -#: ../../library/subprocess.rst:949 +#: ../../library/subprocess.rst:966 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard output handle for the process. Otherwise, this attribute is " "ignored and the default for standard output is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:956 +#: ../../library/subprocess.rst:973 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard error handle for the process. Otherwise, this attribute is " "ignored and the default for standard error is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:962 +#: ../../library/subprocess.rst:979 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute " "can be any of the values that can be specified in the ``nCmdShow`` parameter " @@ -1206,34 +1218,34 @@ msgid "" "Otherwise, this attribute is ignored." msgstr "" -#: ../../library/subprocess.rst:969 +#: ../../library/subprocess.rst:986 msgid "" ":data:`SW_HIDE` is provided for this attribute. It is used when :class:" "`Popen` is called with ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:974 +#: ../../library/subprocess.rst:991 msgid "" "A dictionary of additional attributes for process creation as given in " "``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." msgstr "" -#: ../../library/subprocess.rst:978 +#: ../../library/subprocess.rst:995 msgid "Supported attributes:" msgstr "" -#: ../../library/subprocess.rst:996 +#: ../../library/subprocess.rst:1013 msgid "**handle_list**" msgstr "**handle_list**" -#: ../../library/subprocess.rst:981 +#: ../../library/subprocess.rst:998 msgid "" "Sequence of handles that will be inherited. *close_fds* must be true if non-" "empty." msgstr "" -#: ../../library/subprocess.rst:984 +#: ../../library/subprocess.rst:1001 msgid "" "The handles must be temporarily made inheritable by :func:`os." "set_handle_inheritable` when passed to the :class:`Popen` constructor, else :" @@ -1241,7 +1253,7 @@ msgid "" "``ERROR_INVALID_PARAMETER`` (87)." msgstr "" -#: ../../library/subprocess.rst:991 +#: ../../library/subprocess.rst:1008 msgid "" "In a multithreaded process, use caution to avoid leaking handles that are " "marked inheritable when combining this feature with concurrent calls to " @@ -1250,97 +1262,97 @@ msgid "" "temporarily creates inheritable handles." msgstr "" -#: ../../library/subprocess.rst:1001 +#: ../../library/subprocess.rst:1018 msgid "Windows Constants" msgstr "" -#: ../../library/subprocess.rst:1003 +#: ../../library/subprocess.rst:1020 msgid "The :mod:`subprocess` module exposes the following constants." msgstr "" -#: ../../library/subprocess.rst:1007 +#: ../../library/subprocess.rst:1024 msgid "" "The standard input device. Initially, this is the console input buffer, " "``CONIN$``." msgstr "" -#: ../../library/subprocess.rst:1012 +#: ../../library/subprocess.rst:1029 msgid "" "The standard output device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1017 +#: ../../library/subprocess.rst:1034 msgid "" "The standard error device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1022 +#: ../../library/subprocess.rst:1039 msgid "Hides the window. Another window will be activated." msgstr "" -#: ../../library/subprocess.rst:1026 +#: ../../library/subprocess.rst:1043 msgid "" "Specifies that the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO." "hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes contain additional " "information." msgstr "" -#: ../../library/subprocess.rst:1032 +#: ../../library/subprocess.rst:1049 msgid "" "Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains " "additional information." msgstr "" -#: ../../library/subprocess.rst:1037 +#: ../../library/subprocess.rst:1054 msgid "" "The new process has a new console, instead of inheriting its parent's " "console (the default)." msgstr "" -#: ../../library/subprocess.rst:1042 +#: ../../library/subprocess.rst:1059 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "group will be created. This flag is necessary for using :func:`os.kill` on " "the subprocess." msgstr "" -#: ../../library/subprocess.rst:1046 +#: ../../library/subprocess.rst:1063 msgid "This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified." msgstr "" -#: ../../library/subprocess.rst:1050 +#: ../../library/subprocess.rst:1067 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an above average priority." msgstr "" -#: ../../library/subprocess.rst:1057 +#: ../../library/subprocess.rst:1074 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a below average priority." msgstr "" -#: ../../library/subprocess.rst:1064 +#: ../../library/subprocess.rst:1081 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a high priority." msgstr "" -#: ../../library/subprocess.rst:1071 +#: ../../library/subprocess.rst:1088 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an idle (lowest) priority." msgstr "" -#: ../../library/subprocess.rst:1078 +#: ../../library/subprocess.rst:1095 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an normal priority. (default)" msgstr "" -#: ../../library/subprocess.rst:1085 +#: ../../library/subprocess.rst:1102 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have realtime priority. You should almost never use " @@ -1350,20 +1362,20 @@ msgid "" "perform brief tasks that should have limited interruptions." msgstr "" -#: ../../library/subprocess.rst:1096 +#: ../../library/subprocess.rst:1113 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not create a window." msgstr "" -#: ../../library/subprocess.rst:1103 +#: ../../library/subprocess.rst:1120 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not inherit its parent's console. This value cannot be used with " "CREATE_NEW_CONSOLE." msgstr "" -#: ../../library/subprocess.rst:1111 +#: ../../library/subprocess.rst:1128 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "does not inherit the error mode of the calling process. Instead, the new " @@ -1371,39 +1383,39 @@ msgid "" "multithreaded shell applications that run with hard errors disabled." msgstr "" -#: ../../library/subprocess.rst:1121 +#: ../../library/subprocess.rst:1138 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "is not associated with the job." msgstr "" -#: ../../library/subprocess.rst:1129 +#: ../../library/subprocess.rst:1146 msgid "Older high-level API" msgstr "" -#: ../../library/subprocess.rst:1131 +#: ../../library/subprocess.rst:1148 msgid "" "Prior to Python 3.5, these three functions comprised the high level API to " "subprocess. You can now use :func:`run` in many cases, but lots of existing " "code calls these functions." msgstr "" -#: ../../library/subprocess.rst:1138 +#: ../../library/subprocess.rst:1155 msgid "" "Run the command described by *args*. Wait for command to complete, then " "return the :attr:`~Popen.returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:1141 ../../library/subprocess.rst:1173 +#: ../../library/subprocess.rst:1158 ../../library/subprocess.rst:1198 msgid "" "Code needing to capture stdout or stderr should use :func:`run` instead::" msgstr "" -#: ../../library/subprocess.rst:1145 ../../library/subprocess.rst:1177 +#: ../../library/subprocess.rst:1162 ../../library/subprocess.rst:1202 msgid "To suppress stdout or stderr, supply a value of :data:`DEVNULL`." msgstr "" -#: ../../library/subprocess.rst:1147 ../../library/subprocess.rst:1179 +#: ../../library/subprocess.rst:1164 ../../library/subprocess.rst:1204 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is the same as that of the :class:`Popen` constructor - this " @@ -1411,14 +1423,14 @@ msgid "" "to that interface." msgstr "" -#: ../../library/subprocess.rst:1154 ../../library/subprocess.rst:1186 +#: ../../library/subprocess.rst:1171 ../../library/subprocess.rst:1211 msgid "" "Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. The child " "process will block if it generates enough output to a pipe to fill up the OS " "pipe buffer as the pipes are not being read from." msgstr "" -#: ../../library/subprocess.rst:1166 +#: ../../library/subprocess.rst:1191 msgid "" "Run command with arguments. Wait for command to complete. If the return " "code was zero then return, otherwise raise :exc:`CalledProcessError`. The :" @@ -1427,11 +1439,11 @@ msgid "" "to start the process it will propagate the exception that was raised." msgstr "" -#: ../../library/subprocess.rst:1200 +#: ../../library/subprocess.rst:1233 msgid "Run command with arguments and return its output." msgstr "" -#: ../../library/subprocess.rst:1202 +#: ../../library/subprocess.rst:1235 msgid "" "If the return code was non-zero it raises a :exc:`CalledProcessError`. The :" "exc:`CalledProcessError` object will have the return code in the :attr:" @@ -1439,11 +1451,11 @@ msgid "" "`~CalledProcessError.output` attribute." msgstr "" -#: ../../library/subprocess.rst:1207 +#: ../../library/subprocess.rst:1240 msgid "This is equivalent to::" msgstr "" -#: ../../library/subprocess.rst:1211 +#: ../../library/subprocess.rst:1244 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is largely the same as that of :func:`run` - most arguments are " @@ -1453,52 +1465,52 @@ msgid "" "using the parent's standard input file handle." msgstr "" -#: ../../library/subprocess.rst:1218 +#: ../../library/subprocess.rst:1251 msgid "" "By default, this function will return the data as encoded bytes. The actual " "encoding of the output data may depend on the command being invoked, so the " "decoding to text will often need to be handled at the application level." msgstr "" -#: ../../library/subprocess.rst:1222 +#: ../../library/subprocess.rst:1255 msgid "" "This behaviour may be overridden by setting *text*, *encoding*, *errors*, or " "*universal_newlines* to ``True`` as described in :ref:`frequently-used-" "arguments` and :func:`run`." msgstr "" -#: ../../library/subprocess.rst:1226 +#: ../../library/subprocess.rst:1259 msgid "" "To also capture standard error in the result, use ``stderr=subprocess." "STDOUT``::" msgstr "" -#: ../../library/subprocess.rst:1240 +#: ../../library/subprocess.rst:1273 msgid "Support for the *input* keyword argument was added." msgstr "新增 *input* 關鍵字引數的支援。" -#: ../../library/subprocess.rst:1243 +#: ../../library/subprocess.rst:1276 msgid "*encoding* and *errors* were added. See :func:`run` for details." msgstr "新增 *encoding* 與 *errors*\\ 。細節請見 :func:`run`\\ 。" -#: ../../library/subprocess.rst:1253 +#: ../../library/subprocess.rst:1294 msgid "Replacing Older Functions with the :mod:`subprocess` Module" msgstr "" -#: ../../library/subprocess.rst:1255 +#: ../../library/subprocess.rst:1296 msgid "" "In this section, \"a becomes b\" means that b can be used as a replacement " "for a." msgstr "" -#: ../../library/subprocess.rst:1259 +#: ../../library/subprocess.rst:1300 msgid "" "All \"a\" functions in this section fail (more or less) silently if the " "executed program cannot be found; the \"b\" replacements raise :exc:" "`OSError` instead." msgstr "" -#: ../../library/subprocess.rst:1263 +#: ../../library/subprocess.rst:1304 msgid "" "In addition, the replacements using :func:`check_output` will fail with a :" "exc:`CalledProcessError` if the requested operation produces a non-zero " @@ -1506,143 +1518,143 @@ msgid "" "output` attribute of the raised exception." msgstr "" -#: ../../library/subprocess.rst:1268 +#: ../../library/subprocess.rst:1309 msgid "" "In the following examples, we assume that the relevant functions have " "already been imported from the :mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1273 +#: ../../library/subprocess.rst:1314 msgid "Replacing :program:`/bin/sh` shell command substitution" msgstr "" -#: ../../library/subprocess.rst:1279 ../../library/subprocess.rst:1290 -#: ../../library/subprocess.rst:1307 +#: ../../library/subprocess.rst:1320 ../../library/subprocess.rst:1331 +#: ../../library/subprocess.rst:1348 msgid "becomes::" msgstr "" "變成:\n" "\n" "::" -#: ../../library/subprocess.rst:1284 +#: ../../library/subprocess.rst:1325 msgid "Replacing shell pipeline" msgstr "" -#: ../../library/subprocess.rst:1297 +#: ../../library/subprocess.rst:1338 msgid "" "The ``p1.stdout.close()`` call after starting the p2 is important in order " "for p1 to receive a SIGPIPE if p2 exits before p1." msgstr "" -#: ../../library/subprocess.rst:1300 +#: ../../library/subprocess.rst:1341 msgid "" "Alternatively, for trusted input, the shell's own pipeline support may still " "be used directly:" msgstr "" -#: ../../library/subprocess.rst:1313 +#: ../../library/subprocess.rst:1354 msgid "Replacing :func:`os.system`" msgstr "" -#: ../../library/subprocess.rst:1321 +#: ../../library/subprocess.rst:1362 msgid "Notes:" msgstr "註解:" -#: ../../library/subprocess.rst:1323 +#: ../../library/subprocess.rst:1364 msgid "Calling the program through the shell is usually not required." msgstr "" -#: ../../library/subprocess.rst:1324 +#: ../../library/subprocess.rst:1365 msgid "" "The :func:`call` return value is encoded differently to that of :func:`os." "system`." msgstr "" -#: ../../library/subprocess.rst:1327 +#: ../../library/subprocess.rst:1368 msgid "" "The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the " "command is running, but the caller must do this separately when using the :" "mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1331 +#: ../../library/subprocess.rst:1372 msgid "A more realistic example would look like this::" msgstr "" -#: ../../library/subprocess.rst:1344 +#: ../../library/subprocess.rst:1385 msgid "Replacing the :func:`os.spawn ` family" msgstr "" -#: ../../library/subprocess.rst:1346 +#: ../../library/subprocess.rst:1387 msgid "P_NOWAIT example::" msgstr "" "P_NOWAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1352 +#: ../../library/subprocess.rst:1393 msgid "P_WAIT example::" msgstr "" "P_WAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1358 +#: ../../library/subprocess.rst:1399 msgid "Vector example::" msgstr "" -#: ../../library/subprocess.rst:1364 +#: ../../library/subprocess.rst:1405 msgid "Environment example::" msgstr "" -#: ../../library/subprocess.rst:1373 +#: ../../library/subprocess.rst:1414 msgid "Replacing :func:`os.popen`, :func:`os.popen2`, :func:`os.popen3`" msgstr "" -#: ../../library/subprocess.rst:1403 +#: ../../library/subprocess.rst:1444 msgid "Return code handling translates as follows::" msgstr "" -#: ../../library/subprocess.rst:1419 +#: ../../library/subprocess.rst:1460 msgid "Replacing functions from the :mod:`popen2` module" msgstr "" -#: ../../library/subprocess.rst:1423 +#: ../../library/subprocess.rst:1464 msgid "" "If the cmd argument to popen2 functions is a string, the command is executed " "through /bin/sh. If it is a list, the command is directly executed." msgstr "" -#: ../../library/subprocess.rst:1442 +#: ../../library/subprocess.rst:1483 msgid "" ":class:`popen2.Popen3` and :class:`popen2.Popen4` basically work as :class:" "`subprocess.Popen`, except that:" msgstr "" -#: ../../library/subprocess.rst:1445 +#: ../../library/subprocess.rst:1486 msgid ":class:`Popen` raises an exception if the execution fails." msgstr "" -#: ../../library/subprocess.rst:1447 +#: ../../library/subprocess.rst:1488 msgid "The *capturestderr* argument is replaced with the *stderr* argument." msgstr "" -#: ../../library/subprocess.rst:1449 +#: ../../library/subprocess.rst:1490 msgid "``stdin=PIPE`` and ``stdout=PIPE`` must be specified." msgstr "" -#: ../../library/subprocess.rst:1451 +#: ../../library/subprocess.rst:1492 msgid "" "popen2 closes all file descriptors by default, but you have to specify " "``close_fds=True`` with :class:`Popen` to guarantee this behavior on all " "platforms or past Python versions." msgstr "" -#: ../../library/subprocess.rst:1457 +#: ../../library/subprocess.rst:1498 msgid "Legacy Shell Invocation Functions" msgstr "" -#: ../../library/subprocess.rst:1459 +#: ../../library/subprocess.rst:1500 msgid "" "This module also provides the following legacy functions from the 2.x " "``commands`` module. These operations implicitly invoke the system shell and " @@ -1650,11 +1662,11 @@ msgid "" "handling consistency are valid for these functions." msgstr "" -#: ../../library/subprocess.rst:1466 +#: ../../library/subprocess.rst:1507 msgid "Return ``(exitcode, output)`` of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1468 +#: ../../library/subprocess.rst:1509 msgid "" "Execute the string *cmd* in a shell with :meth:`Popen.check_output` and " "return a 2-tuple ``(exitcode, output)``. *encoding* and *errors* are used to " @@ -1662,85 +1674,85 @@ msgid "" "details." msgstr "" -#: ../../library/subprocess.rst:1473 +#: ../../library/subprocess.rst:1514 msgid "" "A trailing newline is stripped from the output. The exit code for the " "command can be interpreted as the return code of subprocess. Example::" msgstr "" -#: ../../library/subprocess.rst:1487 ../../library/subprocess.rst:1509 +#: ../../library/subprocess.rst:1528 ../../library/subprocess.rst:1550 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix 和 Windows。" -#: ../../library/subprocess.rst:1488 +#: ../../library/subprocess.rst:1529 msgid "Windows support was added." msgstr "" -#: ../../library/subprocess.rst:1491 +#: ../../library/subprocess.rst:1532 msgid "" "The function now returns (exitcode, output) instead of (status, output) as " "it did in Python 3.3.3 and earlier. exitcode has the same value as :attr:" "`~Popen.returncode`." msgstr "" -#: ../../library/subprocess.rst:1495 ../../library/subprocess.rst:1513 +#: ../../library/subprocess.rst:1536 ../../library/subprocess.rst:1554 msgid "Added *encoding* and *errors* arguments." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/subprocess.rst:1500 +#: ../../library/subprocess.rst:1541 msgid "Return output (stdout and stderr) of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1502 +#: ../../library/subprocess.rst:1543 msgid "" "Like :func:`getstatusoutput`, except the exit code is ignored and the return " "value is a string containing the command's output. Example::" msgstr "" -#: ../../library/subprocess.rst:1510 +#: ../../library/subprocess.rst:1551 msgid "Windows support added" msgstr "" -#: ../../library/subprocess.rst:1518 +#: ../../library/subprocess.rst:1559 msgid "Notes" msgstr "註解" -#: ../../library/subprocess.rst:1523 +#: ../../library/subprocess.rst:1564 msgid "Converting an argument sequence to a string on Windows" msgstr "" -#: ../../library/subprocess.rst:1525 +#: ../../library/subprocess.rst:1566 msgid "" "On Windows, an *args* sequence is converted to a string that can be parsed " "using the following rules (which correspond to the rules used by the MS C " "runtime):" msgstr "" -#: ../../library/subprocess.rst:1529 +#: ../../library/subprocess.rst:1570 msgid "" "Arguments are delimited by white space, which is either a space or a tab." msgstr "" -#: ../../library/subprocess.rst:1532 +#: ../../library/subprocess.rst:1573 msgid "" "A string surrounded by double quotation marks is interpreted as a single " "argument, regardless of white space contained within. A quoted string can " "be embedded in an argument." msgstr "" -#: ../../library/subprocess.rst:1537 +#: ../../library/subprocess.rst:1578 msgid "" "A double quotation mark preceded by a backslash is interpreted as a literal " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1540 +#: ../../library/subprocess.rst:1581 msgid "" "Backslashes are interpreted literally, unless they immediately precede a " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1543 +#: ../../library/subprocess.rst:1584 msgid "" "If backslashes immediately precede a double quotation mark, every pair of " "backslashes is interpreted as a literal backslash. If the number of " @@ -1748,33 +1760,33 @@ msgid "" "mark as described in rule 3." msgstr "" -#: ../../library/subprocess.rst:1552 +#: ../../library/subprocess.rst:1593 msgid ":mod:`shlex`" msgstr ":mod:`shlex`" -#: ../../library/subprocess.rst:1553 +#: ../../library/subprocess.rst:1594 msgid "Module which provides function to parse and escape command lines." msgstr "" -#: ../../library/subprocess.rst:1560 +#: ../../library/subprocess.rst:1601 msgid "Disabling use of ``vfork()`` or ``posix_spawn()``" msgstr "" -#: ../../library/subprocess.rst:1562 +#: ../../library/subprocess.rst:1603 msgid "" "On Linux, :mod:`subprocess` defaults to using the ``vfork()`` system call " "internally when it is safe to do so rather than ``fork()``. This greatly " "improves performance." msgstr "" -#: ../../library/subprocess.rst:1566 +#: ../../library/subprocess.rst:1607 msgid "" "If you ever encounter a presumed highly unusual situation where you need to " "prevent ``vfork()`` from being used by Python, you can set the :attr:" "`subprocess._USE_VFORK` attribute to a false value." msgstr "" -#: ../../library/subprocess.rst:1574 +#: ../../library/subprocess.rst:1615 msgid "" "Setting this has no impact on use of ``posix_spawn()`` which could use " "``vfork()`` internally within its libc implementation. There is a similar :" @@ -1782,7 +1794,7 @@ msgid "" "that." msgstr "" -#: ../../library/subprocess.rst:1583 +#: ../../library/subprocess.rst:1624 msgid "" "It is safe to set these to false on any Python version. They will have no " "effect on older versions when unsupported. Do not assume the attributes are " @@ -1790,17 +1802,17 @@ msgid "" "the corresponding function will be used, only that that it may be." msgstr "" -#: ../../library/subprocess.rst:1588 +#: ../../library/subprocess.rst:1629 msgid "" "Please file issues any time you have to use these private knobs with a way " "to reproduce the issue you were seeing. Link to that issue from a comment in " "your code." msgstr "" -#: ../../library/subprocess.rst:1592 +#: ../../library/subprocess.rst:1633 msgid "``_USE_POSIX_SPAWN``" msgstr "``_USE_POSIX_SPAWN``" -#: ../../library/subprocess.rst:1593 +#: ../../library/subprocess.rst:1634 msgid "``_USE_VFORK``" msgstr "``_USE_VFORK``" From ef35b9d469637e78a5b872cf7e7284a0f1665235 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 11 Feb 2023 00:29:52 +0000 Subject: [PATCH 024/130] sync with cpython 91fb7c36 --- library/importlib.po | 4 +- library/sqlite3.po | 326 +++++++++++++++++++++++-------------------- 2 files changed, 178 insertions(+), 152 deletions(-) diff --git a/library/importlib.po b/library/importlib.po index c1eb54be64..3ade64a5de 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-11 00:28+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1702,7 +1702,7 @@ msgstr "" #: ../../library/importlib.rst:1465 msgid "" -"A static method which returns a callable that creates a lazy loader. This is " +"A class method which returns a callable that creates a lazy loader. This is " "meant to be used in situations where the loader is passed by class instead " "of by instance. ::" msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 645c2f6c00..006977abe4 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-02 00:33+0000\n" +"POT-Creation-Date: 2023-02-11 00:28+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-" @@ -748,8 +748,8 @@ msgstr "新增 *deterministic* 參數。" #: ../../library/sqlite3.rst:667 ../../library/sqlite3.rst:705 #: ../../library/sqlite3.rst:768 ../../library/sqlite3.rst:1019 -#: ../../library/sqlite3.rst:1256 ../../library/sqlite3.rst:1362 -#: ../../library/sqlite3.rst:1383 +#: ../../library/sqlite3.rst:1256 ../../library/sqlite3.rst:1383 +#: ../../library/sqlite3.rst:1404 msgid "Example:" msgstr "範例:" @@ -1214,8 +1214,8 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1246 ../../library/sqlite3.rst:1507 -#: ../../library/sqlite3.rst:1530 +#: ../../library/sqlite3.rst:1246 ../../library/sqlite3.rst:1528 +#: ../../library/sqlite3.rst:1551 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "" @@ -1258,20 +1258,26 @@ msgstr "" #: ../../library/sqlite3.rst:1338 msgid "" -"Execute SQL statement *sql*. Bind values to the statement using :ref:" -"`placeholders ` that map to the :term:`sequence` or :" -"class:`dict` *parameters*." +"Execute SQL a single SQL statement, optionally binding Python values using :" +"ref:`placeholders `." +msgstr "" + +#: ../../library/sqlite3.rst:1342 +msgid "A single SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1343 +#: ../../library/sqlite3.rst:1345 msgid "" -":meth:`execute` will only execute a single SQL statement. If you try to " -"execute more than one statement with it, it will raise a :exc:" -"`ProgrammingError`. Use :meth:`executescript` if you want to execute " -"multiple SQL statements with one call." +"Python values to bind to placeholders in *sql*. A :class:`!dict` if named " +"placeholders are used. A :term:`!sequence` if unnamed placeholders are used. " +"See :ref:`sqlite3-placeholders`." +msgstr "" + +#: ../../library/sqlite3.rst:1352 +msgid "If *sql* contains more than one SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1348 +#: ../../library/sqlite3.rst:1355 msgid "" "If :attr:`~Connection.isolation_level` is not ``None``, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " @@ -1279,16 +1285,36 @@ msgid "" "*sql*." msgstr "" -#: ../../library/sqlite3.rst:1356 +#: ../../library/sqlite3.rst:1360 +msgid "Use :meth:`executescript` to execute multiple SQL statements." +msgstr "" + +#: ../../library/sqlite3.rst:1364 +msgid "" +"For every item in *parameters*, repeatedly execute the :ref:`parameterized " +"` SQL statement *sql*." +msgstr "" + +#: ../../library/sqlite3.rst:1368 +msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." +msgstr "" + +#: ../../library/sqlite3.rst:1370 +msgid "A single SQL :abbr:`DML (Data Manipulation Language)` statement." +msgstr "" + +#: ../../library/sqlite3.rst:1373 +msgid "" +"An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " +"See :ref:`sqlite3-placeholders`." +msgstr "" + +#: ../../library/sqlite3.rst:1379 msgid "" -"Execute :ref:`parameterized ` SQL statement *sql* " -"against all parameter sequences or mappings found in the sequence " -"*parameters*. It is also possible to use an :term:`iterator` yielding " -"parameters instead of a sequence. Uses the same implicit transaction " -"handling as :meth:`~Cursor.execute`." +"If *sql* contains more than one SQL statement, or is not a DML statment." msgstr "" -#: ../../library/sqlite3.rst:1375 +#: ../../library/sqlite3.rst:1396 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " "transaction, an implicit ``COMMIT`` statement is executed first. No other " @@ -1296,24 +1322,24 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1381 +#: ../../library/sqlite3.rst:1402 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1399 +#: ../../library/sqlite3.rst:1420 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1407 +#: ../../library/sqlite3.rst:1428 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1410 +#: ../../library/sqlite3.rst:1431 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1321,7 +1347,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1416 +#: ../../library/sqlite3.rst:1437 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1329,36 +1355,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1423 +#: ../../library/sqlite3.rst:1444 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1430 +#: ../../library/sqlite3.rst:1451 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1432 +#: ../../library/sqlite3.rst:1453 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." msgstr "" -#: ../../library/sqlite3.rst:1437 ../../library/sqlite3.rst:1441 +#: ../../library/sqlite3.rst:1458 ../../library/sqlite3.rst:1462 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1445 +#: ../../library/sqlite3.rst:1466 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." msgstr "" -#: ../../library/sqlite3.rst:1450 +#: ../../library/sqlite3.rst:1471 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1366,18 +1392,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1464 +#: ../../library/sqlite3.rst:1485 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1468 +#: ../../library/sqlite3.rst:1489 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1472 +#: ../../library/sqlite3.rst:1493 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1387,15 +1413,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1480 +#: ../../library/sqlite3.rst:1501 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1482 +#: ../../library/sqlite3.rst:1503 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1487 +#: ../../library/sqlite3.rst:1508 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1404,7 +1430,7 @@ msgid "" "methods." msgstr "" -#: ../../library/sqlite3.rst:1495 +#: ../../library/sqlite3.rst:1516 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1413,18 +1439,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1502 +#: ../../library/sqlite3.rst:1523 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." msgstr "" -#: ../../library/sqlite3.rst:1518 +#: ../../library/sqlite3.rst:1539 msgid "Row objects" msgstr "" -#: ../../library/sqlite3.rst:1522 +#: ../../library/sqlite3.rst:1543 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1432,28 +1458,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1527 +#: ../../library/sqlite3.rst:1548 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1534 +#: ../../library/sqlite3.rst:1555 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`." msgstr "" -#: ../../library/sqlite3.rst:1538 +#: ../../library/sqlite3.rst:1559 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:1545 +#: ../../library/sqlite3.rst:1566 msgid "Blob objects" msgstr "" -#: ../../library/sqlite3.rst:1551 +#: ../../library/sqlite3.rst:1572 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:" @@ -1461,24 +1487,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1556 +#: ../../library/sqlite3.rst:1577 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1586 +#: ../../library/sqlite3.rst:1607 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1588 +#: ../../library/sqlite3.rst:1609 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." msgstr "" -#: ../../library/sqlite3.rst:1594 +#: ../../library/sqlite3.rst:1615 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)` " @@ -1486,18 +1512,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1602 +#: ../../library/sqlite3.rst:1623 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`." msgstr "" -#: ../../library/sqlite3.rst:1608 +#: ../../library/sqlite3.rst:1629 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1612 +#: ../../library/sqlite3.rst:1633 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :data:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1505,26 +1531,26 @@ msgid "" "position) and :data:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1620 +#: ../../library/sqlite3.rst:1641 msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:1624 +#: ../../library/sqlite3.rst:1645 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1632 +#: ../../library/sqlite3.rst:1653 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1634 +#: ../../library/sqlite3.rst:1655 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1638 +#: ../../library/sqlite3.rst:1659 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1532,39 +1558,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1645 +#: ../../library/sqlite3.rst:1666 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1649 +#: ../../library/sqlite3.rst:1670 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1654 +#: ../../library/sqlite3.rst:1675 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1661 +#: ../../library/sqlite3.rst:1682 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1668 +#: ../../library/sqlite3.rst:1689 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1675 +#: ../../library/sqlite3.rst:1696 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1572,14 +1598,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1682 +#: ../../library/sqlite3.rst:1703 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1688 +#: ../../library/sqlite3.rst:1709 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1587,20 +1613,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1696 +#: ../../library/sqlite3.rst:1717 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1701 +#: ../../library/sqlite3.rst:1722 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1708 +#: ../../library/sqlite3.rst:1729 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 " @@ -1608,7 +1634,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1715 +#: ../../library/sqlite3.rst:1736 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1617,78 +1643,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1725 +#: ../../library/sqlite3.rst:1746 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1727 +#: ../../library/sqlite3.rst:1748 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1730 +#: ../../library/sqlite3.rst:1751 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1733 ../../library/sqlite3.rst:1750 +#: ../../library/sqlite3.rst:1754 ../../library/sqlite3.rst:1771 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1733 ../../library/sqlite3.rst:1750 +#: ../../library/sqlite3.rst:1754 ../../library/sqlite3.rst:1771 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1735 ../../library/sqlite3.rst:1752 +#: ../../library/sqlite3.rst:1756 ../../library/sqlite3.rst:1773 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1735 ../../library/sqlite3.rst:1752 +#: ../../library/sqlite3.rst:1756 ../../library/sqlite3.rst:1773 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1737 ../../library/sqlite3.rst:1754 +#: ../../library/sqlite3.rst:1758 ../../library/sqlite3.rst:1775 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1737 ../../library/sqlite3.rst:1754 +#: ../../library/sqlite3.rst:1758 ../../library/sqlite3.rst:1775 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1739 ../../library/sqlite3.rst:1756 +#: ../../library/sqlite3.rst:1760 ../../library/sqlite3.rst:1777 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1739 ../../library/sqlite3.rst:1756 +#: ../../library/sqlite3.rst:1760 ../../library/sqlite3.rst:1777 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1741 +#: ../../library/sqlite3.rst:1762 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1741 ../../library/sqlite3.rst:1758 +#: ../../library/sqlite3.rst:1762 ../../library/sqlite3.rst:1779 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1743 ../../library/sqlite3.rst:1761 +#: ../../library/sqlite3.rst:1764 ../../library/sqlite3.rst:1782 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1743 ../../library/sqlite3.rst:1761 +#: ../../library/sqlite3.rst:1764 ../../library/sqlite3.rst:1782 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1747 +#: ../../library/sqlite3.rst:1768 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1758 +#: ../../library/sqlite3.rst:1779 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1764 +#: ../../library/sqlite3.rst:1785 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1697,42 +1723,42 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1774 +#: ../../library/sqlite3.rst:1795 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1776 +#: ../../library/sqlite3.rst:1797 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1779 +#: ../../library/sqlite3.rst:1800 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1783 +#: ../../library/sqlite3.rst:1804 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1787 +#: ../../library/sqlite3.rst:1808 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1791 +#: ../../library/sqlite3.rst:1812 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1797 +#: ../../library/sqlite3.rst:1818 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1740,15 +1766,15 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1806 +#: ../../library/sqlite3.rst:1827 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:1811 +#: ../../library/sqlite3.rst:1832 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:1813 +#: ../../library/sqlite3.rst:1834 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1756,7 +1782,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:1826 +#: ../../library/sqlite3.rst:1847 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1764,7 +1790,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:1831 +#: ../../library/sqlite3.rst:1852 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -1775,24 +1801,24 @@ msgid "" "are ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1868 +#: ../../library/sqlite3.rst:1889 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:1875 +#: ../../library/sqlite3.rst:1896 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1877 +#: ../../library/sqlite3.rst:1898 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1881 +#: ../../library/sqlite3.rst:1902 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1802,11 +1828,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1893 +#: ../../library/sqlite3.rst:1914 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1895 +#: ../../library/sqlite3.rst:1916 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1816,84 +1842,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1926 +#: ../../library/sqlite3.rst:1947 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1928 +#: ../../library/sqlite3.rst:1949 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1958 +#: ../../library/sqlite3.rst:1979 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1960 +#: ../../library/sqlite3.rst:1981 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1965 +#: ../../library/sqlite3.rst:1986 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1968 +#: ../../library/sqlite3.rst:1989 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1973 +#: ../../library/sqlite3.rst:1994 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1982 +#: ../../library/sqlite3.rst:2003 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1986 +#: ../../library/sqlite3.rst:2007 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1987 +#: ../../library/sqlite3.rst:2008 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1988 +#: ../../library/sqlite3.rst:2009 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1992 +#: ../../library/sqlite3.rst:2013 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2043 +#: ../../library/sqlite3.rst:2064 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2045 +#: ../../library/sqlite3.rst:2066 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2107 +#: ../../library/sqlite3.rst:2128 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2109 +#: ../../library/sqlite3.rst:2130 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1905,11 +1931,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2150 +#: ../../library/sqlite3.rst:2171 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2152 +#: ../../library/sqlite3.rst:2173 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1919,58 +1945,58 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2161 +#: ../../library/sqlite3.rst:2182 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2166 +#: ../../library/sqlite3.rst:2187 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2199 +#: ../../library/sqlite3.rst:2220 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2201 +#: ../../library/sqlite3.rst:2222 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2203 +#: ../../library/sqlite3.rst:2224 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2212 +#: ../../library/sqlite3.rst:2233 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2222 +#: ../../library/sqlite3.rst:2243 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2236 +#: ../../library/sqlite3.rst:2257 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2245 +#: ../../library/sqlite3.rst:2266 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2247 +#: ../../library/sqlite3.rst:2268 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`." msgstr "" -#: ../../library/sqlite3.rst:2252 +#: ../../library/sqlite3.rst:2273 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -1978,7 +2004,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2257 +#: ../../library/sqlite3.rst:2278 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -1986,51 +2012,51 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2267 +#: ../../library/sqlite3.rst:2288 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2282 +#: ../../library/sqlite3.rst:2303 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2291 +#: ../../library/sqlite3.rst:2312 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2301 +#: ../../library/sqlite3.rst:2322 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2312 +#: ../../library/sqlite3.rst:2333 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2327 +#: ../../library/sqlite3.rst:2348 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`." msgstr "" -#: ../../library/sqlite3.rst:2335 +#: ../../library/sqlite3.rst:2356 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2340 +#: ../../library/sqlite3.rst:2361 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2342 +#: ../../library/sqlite3.rst:2363 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2345 +#: ../../library/sqlite3.rst:2366 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2044,7 +2070,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2358 +#: ../../library/sqlite3.rst:2379 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2054,14 +2080,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2366 +#: ../../library/sqlite3.rst:2387 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2370 +#: ../../library/sqlite3.rst:2391 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." From a5b97bfd96e578f78e5c6eae0cb2fd6e0406038d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 13 Feb 2023 00:37:01 +0000 Subject: [PATCH 025/130] sync with cpython 1b736838 --- c-api/exceptions.po | 12 ++-- includes/wasm-notavail.po | 4 +- library/_thread.po | 6 +- library/asynchat.po | 4 +- library/asyncio-eventloop.po | 8 +-- library/asyncio-stream.po | 10 +-- library/asyncio.po | 4 +- library/asyncore.po | 4 +- library/cgi.po | 4 +- library/codecs.po | 20 +++--- library/compileall.po | 4 +- library/concurrent.futures.po | 4 +- library/crypt.po | 14 ++-- library/ensurepip.po | 4 +- library/errno.po | 4 +- library/fcntl.po | 4 +- library/ftplib.po | 4 +- library/getpass.po | 12 ++-- library/grp.po | 4 +- library/http.client.po | 4 +- library/http.server.po | 4 +- library/imaplib.po | 4 +- library/mimetypes.po | 4 +- library/mmap.po | 4 +- library/multiprocessing.po | 4 +- library/nis.po | 4 +- library/nntplib.po | 4 +- library/os.path.po | 8 +-- library/os.po | 124 +++++++++++++++++----------------- library/pipes.po | 4 +- library/poplib.po | 4 +- library/pwd.po | 4 +- library/resource.po | 18 ++--- library/select.po | 6 +- library/selectors.po | 4 +- library/shutil.po | 14 ++-- library/signal.po | 18 +++-- library/smtpd.po | 8 +-- library/smtplib.po | 10 +-- library/socket.po | 78 +++++++++++---------- library/socketserver.po | 4 +- library/spwd.po | 4 +- library/ssl.po | 6 +- library/subprocess.po | 6 +- library/sys.po | 10 +-- library/syslog.po | 4 +- library/telnetlib.po | 4 +- library/threading.po | 10 +-- library/time.po | 38 +++++------ library/urllib.request.po | 16 ++--- library/venv.po | 22 +++--- library/webbrowser.po | 12 ++-- library/xmlrpc.client.po | 8 +-- library/xmlrpc.server.po | 4 +- library/zoneinfo.po | 4 +- using/cmdline.po | 22 +++--- 56 files changed, 325 insertions(+), 311 deletions(-) diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 5a9b93c345..123e125b37 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+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-" @@ -235,7 +235,7 @@ msgstr "" #: ../../c-api/exceptions.rst:200 ../../c-api/exceptions.rst:208 #: ../../c-api/exceptions.rst:217 ../../c-api/exceptions.rst:225 -#: ../../c-api/exceptions.rst:234 ../../c-api/exceptions.rst:243 +#: ../../c-api/exceptions.rst:233 ../../c-api/exceptions.rst:243 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -763,8 +763,8 @@ msgstr "" #: ../../c-api/exceptions.rst:735 msgid "" -"Get the *start* attribute of the given exception object and place it into *" -"\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " +"Get the *start* attribute of the given exception object and place it into " +"*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" @@ -776,8 +776,8 @@ msgstr "" #: ../../c-api/exceptions.rst:750 msgid "" -"Get the *end* attribute of the given exception object and place it into *" -"\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " +"Get the *end* attribute of the given exception object and place it into " +"*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" diff --git a/includes/wasm-notavail.po b/includes/wasm-notavail.po index 99bfe4fbb7..2c6c37275f 100644 --- a/includes/wasm-notavail.po +++ b/includes/wasm-notavail.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-10-16 07:40+0800\n" "Last-Translator: \n" "Language-Team: \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 3.1.1\n" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/_thread.po b/library/_thread.po index 7294764fc7..b29bceb633 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -140,7 +140,7 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/_thread.rst:122 +#: ../../library/_thread.rst:121 msgid "" ":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " "NetBSD, AIX." @@ -165,7 +165,7 @@ msgid "" "information)." msgstr "" -#: ../../library/_thread.rst:-1 +#: ../../library/_thread.rst:143 msgid ":ref:`Availability `: Windows, pthreads." msgstr ":ref:`適用 `:Windows, pthreads。" diff --git a/library/asynchat.po b/library/asynchat.po index 91a4fdc536..441b017721 100644 --- a/library/asynchat.po +++ b/library/asynchat.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-10-16 04:51+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -56,7 +56,7 @@ msgid "" "connection requests." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 7d51719a36..59392b48bf 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-11 00:15+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -849,8 +849,8 @@ msgid "" "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:630 -#: ../../library/asyncio-eventloop.rst:770 +#: ../../library/asyncio-eventloop.rst:629 +#: ../../library/asyncio-eventloop.rst:769 #: ../../library/asyncio-eventloop.rst:1195 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -2022,7 +2022,7 @@ msgstr ":ref:`適用 `:Unix、Windows。" msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1676 +#: ../../library/asyncio-eventloop.rst:1675 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 2264b7af6b..891df4854e 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-04 00:30+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-10-31 16:28+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -169,6 +169,10 @@ msgstr "與 :func:`open_connection` 相似,但是是操作 Unix sockets。" msgid "See also the documentation of :meth:`loop.create_unix_connection`." msgstr "另請參閱 :meth:`loop.create_unix_connection` 文件。" +#: ../../library/asyncio-stream.rst:151 ../../library/asyncio-stream.rst:181 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + #: ../../library/asyncio-stream.rst:153 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " @@ -189,10 +193,6 @@ msgstr "與 :func:`start_server` 相似,但會是操作 Unix sockets。" msgid "See also the documentation of :meth:`loop.create_unix_server`." msgstr "另請參閱 :meth:`loop.create_unix_server` 文件。" -#: ../../library/asyncio-stream.rst:182 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - #: ../../library/asyncio-stream.rst:183 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " diff --git a/library/asyncio.po b/library/asyncio.po index 189accb450..ae662c8775 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-23 15:33+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2021-11-23 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -130,7 +130,7 @@ msgstr "" msgid "You can experiment with an ``asyncio`` concurrent context in the REPL:" msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/asyncore.po b/library/asyncore.po index dcbd34afcc..281774bfce 100644 --- a/library/asyncore.po +++ b/library/asyncore.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-10-16 04:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -47,7 +47,7 @@ msgid "" "socket service clients and servers." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/cgi.po b/library/cgi.po index 146654af8f..d42d98d54c 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-05-22 02:01+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -62,7 +62,7 @@ msgid "" "of this variable is ``0``, meaning the request size is unlimited." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/codecs.po b/library/codecs.po index b88926545d..774ff7f0fe 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+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-" @@ -423,10 +423,10 @@ msgstr "``'surrogateescape'``" #: ../../library/codecs.rst:354 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 byte " -"when the ``'surrogateescape'`` error handler is used when encoding the data. " -"(See :pep:`383` for more.)" +"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 " +"byte when the ``'surrogateescape'`` error handler is used when encoding the " +"data. (See :pep:`383` for more.)" msgstr "" #: ../../library/codecs.rst:368 @@ -591,8 +591,8 @@ msgstr "" #: ../../library/codecs.rst:479 msgid "" "Malformed data is replaced by a backslashed escape sequence. On encoding, " -"use the hexadecimal form of Unicode code point with formats ``\\xhh`` ``" -"\\uxxxx`` ``\\Uxxxxxxxx``. On decoding, use the hexadecimal form of byte " +"use the hexadecimal form of Unicode code point with formats ``\\xhh`` " +"``\\uxxxx`` ``\\Uxxxxxxxx``. On decoding, use the hexadecimal form of byte " "value with format ``\\xhh``." msgstr "" @@ -1151,8 +1151,8 @@ msgstr "" #: ../../library/codecs.rst:923 msgid "" -"Strings are stored internally as sequences of code points in range ``U" -"+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " +"Strings are stored internally as sequences of code points in range " +"``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " "implementation.) Once a string object is used outside of CPU and memory, " "endianness and how these arrays are stored as bytes become an issue. As with " "other codecs, serialising a string into a sequence of bytes is known as " @@ -2654,7 +2654,7 @@ msgstr "" msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1535 +#: ../../library/codecs.rst:1534 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" diff --git a/library/compileall.po b/library/compileall.po index 7c40681b5e..9daefb3f3e 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-25 00:16+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,7 +35,7 @@ msgid "" "don't have write permission to the library directories." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index efca27d7e7..27ef62b246 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,7 +44,7 @@ msgid "" "by the abstract :class:`Executor` class." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/crypt.po b/library/crypt.po index bcea088d03..aba1d17f83 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,11 +50,11 @@ msgid "" "be available on this module." msgstr "" -#: ../../library/crypt.rst:40 +#: ../../library/crypt.rst:39 msgid ":ref:`Availability `: Unix, not VxWorks." msgstr ":ref:`適用 `:Unix,非 VxWorks。" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -142,11 +142,11 @@ msgstr "" #: ../../library/crypt.rst:109 msgid "" -"*salt* (either a random 2 or 16 character string, possibly prefixed with ``" -"$digit$`` to indicate the method) which will be used to perturb the " +"*salt* (either a random 2 or 16 character string, possibly prefixed with " +"``$digit$`` to indicate the method) which will be used to perturb the " "encryption algorithm. The characters in *salt* must be in the set ``[./a-zA-" -"Z0-9]``, with the exception of Modular Crypt Format which prefixes a ``$digit" -"$``." +"Z0-9]``, with the exception of Modular Crypt Format which prefixes a " +"``$digit$``." msgstr "" #: ../../library/crypt.rst:115 diff --git a/library/ensurepip.po b/library/ensurepip.po index 02191ec7f4..a0fe3fd7ea 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-26 00:17+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+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-" @@ -66,7 +66,7 @@ msgstr "" msgid "The original rationale and specification for this module." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/errno.po b/library/errno.po index fccb5e3bba..ea1e0cb643 100644 --- a/library/errno.po +++ b/library/errno.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -583,6 +583,6 @@ msgid "" "`PermissionError`." msgstr "" -#: ../../library/errno.rst:667 +#: ../../library/errno.rst:666 msgid ":ref:`Availability `: WASI, FreeBSD" msgstr ":ref:`適用 `:WASI, FreeBSD" diff --git a/library/fcntl.po b/library/fcntl.po index 5a3f9f78a7..4c112f7b7d 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,7 +30,7 @@ msgid "" "`ioctl(2)` Unix manual pages." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/ftplib.po b/library/ftplib.po index 09e81aa4b1..87e3fca402 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,7 +40,7 @@ msgstr "" msgid "The default encoding is UTF-8, following :rfc:`2640`." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/getpass.po b/library/getpass.po index 92fae955ba..3aa4334c47 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-02-11 12:04+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr ":mod:`getpass` --- 可攜式密碼輸入工具" msgid "**Source code:** :source:`Lib/getpass.py`" msgstr "**原始碼:**\\ :source:`Lib/getpass.py`" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -54,8 +54,8 @@ msgstr "" "提示使用者輸入一個密碼且不會有回音 (echo)。使用者會看到字串 *prompt* 作為提" "示,其預設值為 ``'Password: '``。在 Unix 上,如有必要的話會使用替換錯誤處理函" "式 (replace error handler) 寫入到類檔案物件 (file-like object) *stream*\\ " -"中。\\ *stream* 預設為主控終端機 (controlling terminal) (\\ :file:`/dev/tty`" -"\\ ),如果不可用則為 ``sys.stderr`` (此引數在 Windows 上會被忽略)。" +"中。\\ *stream* 預設為主控終端機 (controlling terminal) (\\ :file:`/dev/" +"tty`\\ ),如果不可用則為 ``sys.stderr`` (此引數在 Windows 上會被忽略)。" #: ../../library/getpass.rst:28 msgid "" @@ -64,8 +64,8 @@ msgid "" "`GetPassWarning`." msgstr "" "如果無回音輸入 (echo-free input) 無法使用則 getpass() 將回退為印出一條警告訊" -"息到 *stream*\\ ,並從 ``sys.stdin`` 讀取且同時發出 :exc:`GetPassWarning`" -"\\ 。" +"息到 *stream*\\ ,並從 ``sys.stdin`` 讀取且同時發出 :exc:" +"`GetPassWarning`\\ 。" #: ../../library/getpass.rst:33 msgid "" diff --git a/library/grp.po b/library/grp.po index 1a7cd5661f..b090b5ed7a 100644 --- a/library/grp.po +++ b/library/grp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgid "" "all Unix versions." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/http.client.po b/library/http.client.po index 190c7ef32c..ce8d78faab 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,7 +45,7 @@ msgid "" "(through the :mod:`ssl` module)." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/http.server.po b/library/http.server.po index d2bababb33..a3f615ef16 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-07 00:17+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,7 +36,7 @@ msgid "" "ref:`basic security checks `." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/imaplib.po b/library/imaplib.po index f01db88762..27c3cc24cd 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,7 +35,7 @@ msgid "" "that the ``STATUS`` command is not supported in IMAP4." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/mimetypes.po b/library/mimetypes.po index 81d8a06aa8..3e6b637c47 100644 --- a/library/mimetypes.po +++ b/library/mimetypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2016-11-19 00:32+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -312,6 +312,6 @@ msgstr "" msgid "Load MIME type information from the Windows registry." msgstr "" -#: ../../library/mimetypes.rst:270 +#: ../../library/mimetypes.rst:269 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" diff --git a/library/mmap.po b/library/mmap.po index 1e07afcbe8..b817322cab 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -22,7 +22,7 @@ msgstr "" msgid ":mod:`mmap` --- Memory-mapped file support" msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 097cdf7f2d..c2006c256e 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-28 00:17+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,7 +26,7 @@ msgstr "" msgid "**Source code:** :source:`Lib/multiprocessing/`" msgstr "**原始碼:**\\ :source:`Lib/multiprocessing/`" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/nis.po b/library/nis.po index 133bbe4cf6..696dd9583c 100644 --- a/library/nis.po +++ b/library/nis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2016-11-19 00:32+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,7 +41,7 @@ msgid "" "Unix." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/nntplib.po b/library/nntplib.po index d29bd31401..fdef783158 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,7 +38,7 @@ msgid "" "`3977` as well as the older :rfc:`977` and :rfc:`2980`." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/os.path.po b/library/os.path.po index 851efcdb4e..c692e51960 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-01 00:37+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -124,9 +124,9 @@ msgid "" "empty. Unlike :func:`commonprefix`, this returns a valid path." msgstr "" -#: ../../library/os.path.rst:89 ../../library/os.path.rst:389 -#: ../../library/os.path.rst:401 ../../library/os.path.rst:417 -#: ../../library/os.path.rst:433 +#: ../../library/os.path.rst:88 ../../library/os.path.rst:388 +#: ../../library/os.path.rst:400 ../../library/os.path.rst:416 +#: ../../library/os.path.rst:432 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" diff --git a/library/os.po b/library/os.po index d474aaf534..aae454e8b7 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-10 00:17+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -286,19 +286,19 @@ msgid "" msgstr "" #: ../../library/os.rst:181 ../../library/os.rst:353 ../../library/os.rst:362 -#: ../../library/os.rst:385 ../../library/os.rst:394 ../../library/os.rst:429 -#: ../../library/os.rst:437 ../../library/os.rst:476 ../../library/os.rst:487 -#: ../../library/os.rst:497 ../../library/os.rst:507 ../../library/os.rst:530 +#: ../../library/os.rst:384 ../../library/os.rst:393 ../../library/os.rst:429 +#: ../../library/os.rst:437 ../../library/os.rst:475 ../../library/os.rst:486 +#: ../../library/os.rst:496 ../../library/os.rst:506 ../../library/os.rst:529 #: ../../library/os.rst:563 ../../library/os.rst:570 ../../library/os.rst:577 -#: ../../library/os.rst:587 ../../library/os.rst:598 ../../library/os.rst:607 -#: ../../library/os.rst:625 ../../library/os.rst:633 ../../library/os.rst:641 -#: ../../library/os.rst:650 ../../library/os.rst:658 ../../library/os.rst:665 -#: ../../library/os.rst:672 ../../library/os.rst:681 ../../library/os.rst:1047 -#: ../../library/os.rst:1191 ../../library/os.rst:1217 -#: ../../library/os.rst:1454 ../../library/os.rst:1489 -#: ../../library/os.rst:1498 ../../library/os.rst:1862 -#: ../../library/os.rst:1951 ../../library/os.rst:1991 -#: ../../library/os.rst:2208 ../../library/os.rst:2230 +#: ../../library/os.rst:586 ../../library/os.rst:598 ../../library/os.rst:607 +#: ../../library/os.rst:624 ../../library/os.rst:633 ../../library/os.rst:640 +#: ../../library/os.rst:649 ../../library/os.rst:658 ../../library/os.rst:665 +#: ../../library/os.rst:672 ../../library/os.rst:681 ../../library/os.rst:1046 +#: ../../library/os.rst:1190 ../../library/os.rst:1216 +#: ../../library/os.rst:1453 ../../library/os.rst:1488 +#: ../../library/os.rst:1497 ../../library/os.rst:1861 +#: ../../library/os.rst:1950 ../../library/os.rst:1990 +#: ../../library/os.rst:2207 ../../library/os.rst:2229 #: ../../library/os.rst:3757 ../../library/os.rst:3764 #: ../../library/os.rst:3771 ../../library/os.rst:3778 #: ../../library/os.rst:3785 ../../library/os.rst:3792 @@ -310,13 +310,13 @@ msgstr "" #: ../../library/os.rst:3889 ../../library/os.rst:3906 #: ../../library/os.rst:3946 ../../library/os.rst:3953 #: ../../library/os.rst:3974 ../../library/os.rst:4101 -#: ../../library/os.rst:4151 ../../library/os.rst:4388 -#: ../../library/os.rst:4422 ../../library/os.rst:4479 -#: ../../library/os.rst:4493 ../../library/os.rst:4511 -#: ../../library/os.rst:4525 ../../library/os.rst:4537 -#: ../../library/os.rst:4549 ../../library/os.rst:4561 +#: ../../library/os.rst:4150 ../../library/os.rst:4387 +#: ../../library/os.rst:4421 ../../library/os.rst:4479 +#: ../../library/os.rst:4493 ../../library/os.rst:4510 +#: ../../library/os.rst:4525 ../../library/os.rst:4536 +#: ../../library/os.rst:4548 ../../library/os.rst:4561 #: ../../library/os.rst:4570 ../../library/os.rst:4580 -#: ../../library/os.rst:4594 ../../library/os.rst:4644 +#: ../../library/os.rst:4593 ../../library/os.rst:4644 #: ../../library/os.rst:4655 ../../library/os.rst:4667 #: ../../library/os.rst:4674 ../../library/os.rst:4683 #: ../../library/os.rst:4692 ../../library/os.rst:4701 @@ -469,12 +469,12 @@ msgid "" "like to use a different encoding." msgstr "" -#: ../../library/os.rst:-1 ../../library/os.rst:317 ../../library/os.rst:975 -#: ../../library/os.rst:987 ../../library/os.rst:1203 ../../library/os.rst:1637 -#: ../../library/os.rst:2035 ../../library/os.rst:2308 -#: ../../library/os.rst:3135 ../../library/os.rst:3749 -#: ../../library/os.rst:4238 ../../library/os.rst:4249 -#: ../../library/os.rst:4367 +#: ../../library/os.rst:317 ../../library/os.rst:975 ../../library/os.rst:986 +#: ../../library/os.rst:1202 ../../library/os.rst:1637 +#: ../../library/os.rst:2034 ../../library/os.rst:2307 +#: ../../library/os.rst:3097 ../../library/os.rst:3134 +#: ../../library/os.rst:3749 ../../library/os.rst:4238 +#: ../../library/os.rst:4249 ../../library/os.rst:4366 #, fuzzy msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -494,19 +494,21 @@ msgid "" "``True``." msgstr "" -#: ../../library/os.rst:-1 ../../library/os.rst:333 ../../library/os.rst:734 -#: ../../library/os.rst:920 ../../library/os.rst:942 ../../library/os.rst:963 -#: ../../library/os.rst:1024 ../../library/os.rst:1036 -#: ../../library/os.rst:1242 ../../library/os.rst:1257 -#: ../../library/os.rst:1270 ../../library/os.rst:1339 -#: ../../library/os.rst:1549 ../../library/os.rst:1575 -#: ../../library/os.rst:1611 ../../library/os.rst:1964 -#: ../../library/os.rst:2006 ../../library/os.rst:2019 -#: ../../library/os.rst:2274 ../../library/os.rst:2285 -#: ../../library/os.rst:2964 ../../library/os.rst:3121 -#: ../../library/os.rst:3354 ../../library/os.rst:4856 +#: ../../library/os.rst:332 ../../library/os.rst:371 ../../library/os.rst:517 +#: ../../library/os.rst:733 ../../library/os.rst:893 ../../library/os.rst:908 +#: ../../library/os.rst:919 ../../library/os.rst:942 ../../library/os.rst:963 +#: ../../library/os.rst:999 ../../library/os.rst:1023 ../../library/os.rst:1035 +#: ../../library/os.rst:1241 ../../library/os.rst:1256 +#: ../../library/os.rst:1269 ../../library/os.rst:1338 +#: ../../library/os.rst:1473 ../../library/os.rst:1548 +#: ../../library/os.rst:1575 ../../library/os.rst:1610 +#: ../../library/os.rst:1933 ../../library/os.rst:1964 +#: ../../library/os.rst:2005 ../../library/os.rst:2018 +#: ../../library/os.rst:2273 ../../library/os.rst:2285 +#: ../../library/os.rst:2963 ../../library/os.rst:3120 +#: ../../library/os.rst:3353 ../../library/os.rst:4856 #: ../../library/os.rst:4865 ../../library/os.rst:4886 -#: ../../library/os.rst:4896 ../../library/os.rst:4906 +#: ../../library/os.rst:4896 ../../library/os.rst:4905 #, fuzzy msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -579,10 +581,10 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:-1 ../../library/os.rst:421 ../../library/os.rst:458 -#: ../../library/os.rst:3715 ../../library/os.rst:3931 -#: ../../library/os.rst:4343 ../../library/os.rst:4460 -#: ../../library/os.rst:4629 +#: ../../library/os.rst:421 ../../library/os.rst:457 ../../library/os.rst:3714 +#: ../../library/os.rst:3930 ../../library/os.rst:4219 +#: ../../library/os.rst:4343 ../../library/os.rst:4459 +#: ../../library/os.rst:4628 #, fuzzy msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." @@ -947,7 +949,7 @@ msgid "" "amount requested." msgstr "" -#: ../../library/os.rst:838 +#: ../../library/os.rst:837 msgid ":ref:`Availability `: Linux >= 4.5 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 4.5 以上且具有 glibc 2.27 以上。" @@ -979,7 +981,7 @@ msgid "" "stderr), the new file descriptor is :ref:`inheritable `." msgstr "" -#: ../../library/os.rst:864 ../../library/os.rst:877 +#: ../../library/os.rst:863 ../../library/os.rst:876 msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" @@ -1335,7 +1337,7 @@ msgid "" "starting from *offset* and continuing for *len* bytes." msgstr "" -#: ../../library/os.rst:1227 +#: ../../library/os.rst:1226 msgid ":ref:`Availability `: Unix, not Emscripten." msgstr ":ref:`適用 `:Unix、非 Emscripten。" @@ -1407,7 +1409,7 @@ msgstr "" msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: ../../library/os.rst:-1 +#: ../../library/os.rst:1295 ../../library/os.rst:1365 #, fuzzy msgid "" ":ref:`Availability `: Linux >= 2.6.30, FreeBSD >= 6.0, OpenBSD " @@ -1434,7 +1436,7 @@ msgid "" "EAGAIN`." msgstr "" -#: ../../library/os.rst:1313 +#: ../../library/os.rst:1312 msgid ":ref:`Availability `: Linux >= 4.14." msgstr ":ref:`適用 `:Linux 4.14 以上。" @@ -1450,7 +1452,7 @@ msgid "" "using the :data:`O_DIRECT` flag." msgstr "" -#: ../../library/os.rst:1327 +#: ../../library/os.rst:1326 msgid ":ref:`Availability `: Linux >= 4.6." msgstr ":ref:`適用 `:Linux 4.6 以上。" @@ -1499,7 +1501,7 @@ msgid "" "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1378 ../../library/os.rst:1388 +#: ../../library/os.rst:1377 ../../library/os.rst:1387 msgid ":ref:`Availability `: Linux >= 4.7." msgstr ":ref:`適用 `:Linux 4.7 以上。" @@ -1519,7 +1521,7 @@ msgid "" "*offset* is updated." msgstr "" -#: ../../library/os.rst:1402 +#: ../../library/os.rst:1401 msgid ":ref:`Availability `: Linux >= 4.16." msgstr ":ref:`適用 `:Linux 4.16 以上。" @@ -1636,7 +1638,7 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1525 +#: ../../library/os.rst:1524 msgid ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" @@ -1786,8 +1788,8 @@ msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" #: ../../library/os.rst:1689 ../../library/os.rst:1695 -#: ../../library/os.rst:3647 ../../library/os.rst:4261 -#: ../../library/os.rst:4307 +#: ../../library/os.rst:3646 ../../library/os.rst:4261 +#: ../../library/os.rst:4306 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -3651,7 +3653,7 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3379 +#: ../../library/os.rst:3378 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" @@ -3659,7 +3661,7 @@ msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:-1 +#: ../../library/os.rst:3403 #, fuzzy msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" @@ -3717,7 +3719,7 @@ msgid "" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3458 +#: ../../library/os.rst:3457 msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" @@ -3727,8 +3729,8 @@ msgid "" "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3467 ../../library/os.rst:3476 -#: ../../library/os.rst:3484 ../../library/os.rst:3493 +#: ../../library/os.rst:3466 ../../library/os.rst:3475 +#: ../../library/os.rst:3483 ../../library/os.rst:3492 msgid ":ref:`Availability `: Linux >= 2.6.27" msgstr ":ref:`適用 `:Linux 2.6.27 以上" @@ -3753,7 +3755,7 @@ msgid "" "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3502 +#: ../../library/os.rst:3501 msgid ":ref:`Availability `: Linux >= 2.6.30" msgstr ":ref:`適用 `:Linux 2.6.30 以上" @@ -4261,7 +4263,7 @@ msgid "" "subprocesses." msgstr "" -#: ../../library/os.rst:4007 +#: ../../library/os.rst:4006 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" @@ -4412,7 +4414,7 @@ msgid "" "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:-1 +#: ../../library/os.rst:4117 #, fuzzy msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" @@ -5433,7 +5435,7 @@ msgid "" "pages/man2/getrandom.2.html>`_." msgstr "" -#: ../../library/os.rst:5029 +#: ../../library/os.rst:5028 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" diff --git a/library/pipes.po b/library/pipes.po index efce40fb9e..7a56d66779 100644 --- a/library/pipes.po +++ b/library/pipes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-05-22 02:11+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -47,7 +47,7 @@ msgid "" "compatible shell for :func:`os.system` and :func:`os.popen` is required." msgstr "" -#: ../../library/pipes.rst:27 +#: ../../library/pipes.rst:26 msgid ":ref:`Availability `: Unix, not VxWorks." msgstr ":ref:`適用 `:Unix,非 VxWorks。" diff --git a/library/poplib.po b/library/poplib.po index a04c8a513d..e2f1a19dec 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,7 +51,7 @@ msgid "" "IMAP4` class, as IMAP servers tend to be better implemented." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/pwd.po b/library/pwd.po index 8315de19bb..22f8ac986d 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgid "" "It is available on all Unix versions." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/resource.po b/library/resource.po index 259ce31fe9..efae249b7e 100644 --- a/library/resource.po +++ b/library/resource.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgid "" "resources utilized by a program." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -156,7 +156,7 @@ msgid "" "arguments ``pid``, ``resource``, ``limits``." msgstr "" -#: ../../library/resource.rst:105 +#: ../../library/resource.rst:104 msgid ":ref:`Availability `: Linux >= 2.6.36 with glibc >= 2.13." msgstr ":ref:`適用 `:Linux 2.6.36 以上且具有 glibc 2.13 以上。" @@ -240,7 +240,7 @@ msgstr "" msgid "The number of bytes that can be allocated for POSIX message queues." msgstr "" -#: ../../library/resource.rst:191 ../../library/resource.rst:228 +#: ../../library/resource.rst:190 ../../library/resource.rst:227 msgid ":ref:`Availability `: Linux >= 2.6.8." msgstr ":ref:`適用 `:Linux 2.6.8 以上。" @@ -248,7 +248,7 @@ msgstr ":ref:`適用 `:Linux 2.6.8 以上。" msgid "The ceiling for the process's nice level (calculated as 20 - rlim_cur)." msgstr "" -#: ../../library/resource.rst:200 ../../library/resource.rst:209 +#: ../../library/resource.rst:199 ../../library/resource.rst:208 msgid ":ref:`Availability `: Linux >= 2.6.12." msgstr ":ref:`適用 `:Linux 2.6.12 以上。" @@ -262,7 +262,7 @@ msgid "" "real-time scheduling without making a blocking syscall." msgstr "" -#: ../../library/resource.rst:219 +#: ../../library/resource.rst:218 msgid ":ref:`Availability `: Linux >= 2.6.25." msgstr ":ref:`適用 `:Linux 2.6.25 以上。" @@ -277,8 +277,8 @@ msgid "" "this user may hold at any time." msgstr "" -#: ../../library/resource.rst:238 ../../library/resource.rst:251 -#: ../../library/resource.rst:259 +#: ../../library/resource.rst:237 ../../library/resource.rst:250 +#: ../../library/resource.rst:258 msgid ":ref:`Availability `: FreeBSD." msgstr ":ref:`適用 `:FreeBSD。" @@ -299,7 +299,7 @@ msgstr "" msgid "The maximum number of kqueues this user id is allowed to create." msgstr "" -#: ../../library/resource.rst:267 +#: ../../library/resource.rst:266 msgid ":ref:`Availability `: FreeBSD >= 11." msgstr ":ref:`適用 `:FreeBSD 11 以上。" diff --git a/library/select.po b/library/select.po index 664f3b6ddd..c502cc8e09 100644 --- a/library/select.po +++ b/library/select.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,7 +41,7 @@ msgid "" "precise control over the OS-level primitives used." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -235,7 +235,7 @@ msgstr "" msgid "This value is guaranteed by POSIX to be at least 512." msgstr "" -#: ../../library/select.rst:178 +#: ../../library/select.rst:177 msgid ":ref:`Availability `: Unix" msgstr ":ref:`適用 `:Unix。" diff --git a/library/selectors.po b/library/selectors.po index 14c6cdaf7f..bfc92d08e9 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,7 +70,7 @@ msgstr ":mod:`select`" msgid "Low-level I/O multiplexing module." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/shutil.po b/library/shutil.po index 448f858a87..90b35cde0d 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+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-" @@ -521,7 +521,7 @@ msgid "" "``path``, ``user``, ``group``." msgstr "" -#: ../../library/shutil.rst:415 +#: ../../library/shutil.rst:414 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -654,9 +654,9 @@ msgstr "" #: ../../library/shutil.rst:544 msgid "" "*base_name* is the name of the file to create, including the path, minus any " -"format-specific extension. *format* is the archive format: one of \"zip" -"\" (if the :mod:`zlib` module is available), \"tar\", \"gztar\" (if the :mod:" -"`zlib` module is available), \"bztar\" (if the :mod:`bz2` module is " +"format-specific extension. *format* is the archive format: one of " +"\"zip\" (if the :mod:`zlib` module is available), \"tar\", \"gztar\" (if " +"the :mod:`zlib` module is available), \"bztar\" (if the :mod:`bz2` module is " "available), or \"xztar\" (if the :mod:`lzma` module is available)." msgstr "" @@ -804,8 +804,8 @@ msgstr "" #: ../../library/shutil.rst:636 msgid "" -"*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", \"bztar" -"\", or \"xztar\". Or any other format registered with :func:" +"*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " +"\"bztar\", or \"xztar\". Or any other format registered with :func:" "`register_unpack_format`. If not provided, :func:`unpack_archive` will use " "the archive file name extension and see if an unpacker was registered for " "that extension. In case none is found, a :exc:`ValueError` is raised." diff --git a/library/signal.po b/library/signal.po index e21b977b5a..2f4a7925aa 100644 --- a/library/signal.po +++ b/library/signal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-26 00:17+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+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-" @@ -152,13 +152,17 @@ msgid "" "`SIG_UNBLOCK` and :const:`SIG_SETMASK`." msgstr "" -#: ../../library/signal.rst:-1 ../../library/signal.rst:136 +#: ../../library/signal.rst:103 ../../library/signal.rst:136 #: ../../library/signal.rst:148 ../../library/signal.rst:154 #: ../../library/signal.rst:164 ../../library/signal.rst:178 #: ../../library/signal.rst:196 ../../library/signal.rst:204 #: ../../library/signal.rst:230 ../../library/signal.rst:236 -#: ../../library/signal.rst:242 ../../library/signal.rst:499 -#: ../../library/signal.rst:506 +#: ../../library/signal.rst:242 ../../library/signal.rst:349 +#: ../../library/signal.rst:388 ../../library/signal.rst:435 +#: ../../library/signal.rst:469 ../../library/signal.rst:499 +#: ../../library/signal.rst:506 ../../library/signal.rst:559 +#: ../../library/signal.rst:601 ../../library/signal.rst:616 +#: ../../library/signal.rst:642 ../../library/signal.rst:662 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -200,8 +204,8 @@ msgstr "" msgid "Interrupt from keyboard (CTRL + BREAK)." msgstr "" -#: ../../library/signal.rst:142 ../../library/signal.rst:261 -#: ../../library/signal.rst:271 +#: ../../library/signal.rst:142 ../../library/signal.rst:260 +#: ../../library/signal.rst:270 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -274,7 +278,7 @@ msgid "" "can only be raised in user space." msgstr "" -#: ../../library/signal.rst:-1 +#: ../../library/signal.rst:215 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" diff --git a/library/smtpd.po b/library/smtpd.po index d9b750f237..abd23f40eb 100644 --- a/library/smtpd.po +++ b/library/smtpd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-10-16 06:26+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,7 +61,7 @@ msgid "" "SMTPUTF8 extensions." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -287,8 +287,8 @@ msgstr "" #: ../../library/smtpd.rst:201 msgid "" "Holds a list of the line strings (decoded using UTF-8) received from the " -"client. The lines have their ``\"\\r\\n\"`` line ending translated to ``\"\\n" -"\"``." +"client. The lines have their ``\"\\r\\n\"`` line ending translated to " +"``\"\\n\"``." msgstr "" #: ../../library/smtpd.rst:207 diff --git a/library/smtplib.po b/library/smtplib.po index bc30846ae5..55d19a9c15 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+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-" @@ -34,7 +34,7 @@ msgid "" "Mail Transfer Protocol) and :rfc:`1869` (SMTP Service Extensions)." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -574,9 +574,9 @@ msgstr "" #: ../../library/smtplib.rst:459 msgid "" "*msg* may be a string containing characters in the ASCII range, or a byte " -"string. A string is encoded to bytes using the ascii codec, and lone ``" -"\\r`` and ``\\n`` characters are converted to ``\\r\\n`` characters. A byte " -"string is not modified." +"string. A string is encoded to bytes using the ascii codec, and lone " +"``\\r`` and ``\\n`` characters are converted to ``\\r\\n`` characters. A " +"byte string is not modified." msgstr "" #: ../../library/smtplib.rst:464 diff --git a/library/socket.po b/library/socket.po index ec0fa39d7d..1afcb98c28 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-02 00:15+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+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-" @@ -39,7 +39,7 @@ msgid "" "operating system socket APIs." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 #, fuzzy msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" @@ -287,6 +287,11 @@ msgstr "" msgid "*feat* and *mask* are unsigned 32bit integers." msgstr "" +#: ../../library/socket.rst:171 ../../library/socket.rst:519 +#: ../../library/socket.rst:1766 +msgid ":ref:`Availability `: Linux >= 2.6.38." +msgstr ":ref:`適用 `:Linux >= 2.6.38。" + #: ../../library/socket.rst:173 msgid "Some algorithm types require more recent Kernels." msgstr "" @@ -298,6 +303,10 @@ msgid "" "context ID or CID and port are integers." msgstr "" +#: ../../library/socket.rst:181 ../../library/socket.rst:592 +msgid ":ref:`Availability `: Linux >= 3.9" +msgstr ":ref:`適用 `:Linux 3.9 以上。" + #: ../../library/socket.rst:183 msgid "See :manpage:`vsock(7)`" msgstr "" @@ -358,6 +367,10 @@ msgid "" "address, whose interpretation depends on the device." msgstr "" +#: ../../library/socket.rst:207 ../../library/socket.rst:480 +msgid ":ref:`Availability `: Linux >= 2.2." +msgstr ":ref:`適用 `:Linux >= 2.2。" + #: ../../library/socket.rst:209 msgid "" ":const:`AF_QIPCRTR` is a Linux-only socket based interface for communicating " @@ -366,6 +379,10 @@ msgid "" "*port* are non-negative integers." msgstr "" +#: ../../library/socket.rst:214 ../../library/socket.rst:568 +msgid ":ref:`Availability `: Linux >= 4.7." +msgstr ":ref:`適用 `:Linux >= 4.7。" + #: ../../library/socket.rst:218 msgid "" ":const:`IPPROTO_UDPLITE` is a variant of UDP which allows you to specify " @@ -384,6 +401,11 @@ msgid "" "IPPROTO_UDPLITE)`` for IPv6." msgstr "" +#: ../../library/socket.rst:231 +#, fuzzy +msgid ":ref:`Availability `: Linux >= 2.6.20, FreeBSD >= 10.1" +msgstr ":ref:`適用 `:Linux 2.6.25 以上、NetBSD 8 以上。" + #: ../../library/socket.rst:235 msgid "" "If you use a hostname in the *host* portion of IPv4/v6 socket address, the " @@ -509,7 +531,7 @@ msgid "" "html>`_ for a more thorough explanation." msgstr "" -#: ../../library/socket.rst:354 +#: ../../library/socket.rst:353 msgid ":ref:`Availability `: Linux >= 2.6.27." msgstr ":ref:`適用 `:Linux >= 2.6.27。" @@ -564,7 +586,7 @@ msgid "" "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:411 +#: ../../library/socket.rst:410 msgid ":ref:`Availability `: Linux >= 2.6.25, NetBSD >= 8." msgstr ":ref:`適用 `:Linux 2.6.25 以上、NetBSD 8 以上。" @@ -579,7 +601,7 @@ msgid "" "documentation, are also defined in the socket module." msgstr "" -#: ../../library/socket.rst:425 ../../library/socket.rst:460 +#: ../../library/socket.rst:424 ../../library/socket.rst:459 msgid ":ref:`Availability `: Linux >= 2.6.25." msgstr ":ref:`適用 `:Linux >= 2.6.25。" @@ -599,7 +621,7 @@ msgstr "" msgid "This constant is documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:440 +#: ../../library/socket.rst:439 msgid ":ref:`Availability `: Linux >= 3.6." msgstr ":ref:`適用 `:Linux >= 3.6。" @@ -609,7 +631,7 @@ msgid "" "CAN filters are passed to user space." msgstr "" -#: ../../library/socket.rst:451 +#: ../../library/socket.rst:450 msgid ":ref:`Availability `: Linux >= 4.1." msgstr ":ref:`適用 `:Linux >= 4.1。" @@ -625,15 +647,11 @@ msgid "" "constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:469 +#: ../../library/socket.rst:468 msgid ":ref:`Availability `: Linux >= 5.4." msgstr ":ref:`適用 `:Linux >= 5.4。" -#: ../../library/socket.rst:480 -msgid ":ref:`Availability `: Linux >= 2.2." -msgstr ":ref:`適用 `:Linux >= 2.2。" - -#: ../../library/socket.rst:492 +#: ../../library/socket.rst:491 msgid ":ref:`Availability `: Linux >= 2.6.30." msgstr ":ref:`適用 `:Linux >= 2.6.30。" @@ -657,19 +675,15 @@ msgstr "" msgid "Constants for Linux Kernel cryptography." msgstr "" -#: ../../library/socket.rst:520 ../../library/socket.rst:1767 -msgid ":ref:`Availability `: Linux >= 2.6.38." -msgstr ":ref:`適用 `:Linux >= 2.6.38。" - #: ../../library/socket.rst:529 msgid "Constants for Linux host/guest communication." msgstr "" -#: ../../library/socket.rst:532 +#: ../../library/socket.rst:531 msgid ":ref:`Availability `: Linux >= 4.8." msgstr ":ref:`適用 `:Linux >= 4.8。" -#: ../../library/socket.rst:538 +#: ../../library/socket.rst:537 msgid ":ref:`Availability `: BSD, macOS." msgstr ":ref:`適用 `:BSD、macOS。" @@ -699,10 +713,6 @@ msgid "" "service providing remote processors." msgstr "" -#: ../../library/socket.rst:568 -msgid ":ref:`Availability `: Linux >= 4.7." -msgstr ":ref:`適用 `:Linux >= 4.7。" - #: ../../library/socket.rst:574 msgid "" "LOCAL_CREDS and LOCAL_CREDS_PERSISTENT can be used with SOCK_DGRAM, " @@ -722,10 +732,6 @@ msgid "" "`SO_REUSEPORT`." msgstr "" -#: ../../library/socket.rst:592 -msgid ":ref:`Availability `: Linux >= 3.9" -msgstr ":ref:`適用 `:Linux 3.9 以上。" - #: ../../library/socket.rst:595 msgid "Functions" msgstr "函式" @@ -938,7 +944,7 @@ msgid "" "method. The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:782 ../../library/socket.rst:1873 +#: ../../library/socket.rst:781 ../../library/socket.rst:1872 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -1060,7 +1066,7 @@ msgstr "" #: ../../library/socket.rst:960 ../../library/socket.rst:971 #: ../../library/socket.rst:1295 ../../library/socket.rst:1342 #: ../../library/socket.rst:1356 ../../library/socket.rst:1376 -#: ../../library/socket.rst:1423 ../../library/socket.rst:1469 +#: ../../library/socket.rst:1423 ../../library/socket.rst:1468 #: ../../library/socket.rst:1850 ../../library/socket.rst:1860 msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" @@ -1268,7 +1274,7 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:1061 ../../library/socket.rst:1081 +#: ../../library/socket.rst:1060 ../../library/socket.rst:1080 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -1304,7 +1310,7 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:-1 +#: ../../library/socket.rst:1106 ../../library/socket.rst:1129 #, fuzzy msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -1362,7 +1368,8 @@ msgid "" "argument ``name``." msgstr "" -#: ../../library/socket.rst:-1 ../../library/socket.rst:1159 +#: ../../library/socket.rst:1158 ../../library/socket.rst:1596 +#: ../../library/socket.rst:1640 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -1372,8 +1379,9 @@ msgid "" "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:-1 ../../library/socket.rst:1170 -#: ../../library/socket.rst:1197 ../../library/socket.rst:1214 +#: ../../library/socket.rst:1169 ../../library/socket.rst:1196 +#: ../../library/socket.rst:1213 ../../library/socket.rst:1230 +#: ../../library/socket.rst:1244 #, fuzzy msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." @@ -1920,7 +1928,7 @@ msgid "" "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:-1 +#: ../../library/socket.rst:1748 #, fuzzy msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" diff --git a/library/socketserver.po b/library/socketserver.po index 463f3a2ad4..513cfe06f3 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-30 00:19+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+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-" @@ -32,7 +32,7 @@ msgid "" "servers." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/spwd.po b/library/spwd.po index 9378266318..ef10152ba2 100644 --- a/library/spwd.po +++ b/library/spwd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-05-22 02:14+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,7 +37,7 @@ msgid "" "available on various Unix versions." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/ssl.po b/library/ssl.po index 8743fbaf13..6950a090a8 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-21 00:16+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+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-" @@ -51,7 +51,7 @@ msgid "" "are not necessarily appropriate for your application." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -554,7 +554,7 @@ msgstr "" "\n" "::" -#: ../../library/ssl.rst:500 ../../library/ssl.rst:515 +#: ../../library/ssl.rst:499 ../../library/ssl.rst:514 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:只有 Windows。" diff --git a/library/subprocess.po b/library/subprocess.po index 2285495607..54573719b5 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-09 00:33+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,7 +43,7 @@ msgstr "" msgid ":pep:`324` -- PEP proposing the subprocess module" msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -1680,7 +1680,7 @@ msgid "" "command can be interpreted as the return code of subprocess. Example::" msgstr "" -#: ../../library/subprocess.rst:1528 ../../library/subprocess.rst:1550 +#: ../../library/subprocess.rst:1527 ../../library/subprocess.rst:1549 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix 和 Windows。" diff --git a/library/sys.po b/library/sys.po index f6ee2572ac..badff1b291 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-13 00:17+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -346,8 +346,8 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:278 ../../library/sys.rst:874 -#: ../../library/sys.rst:1580 ../../library/sys.rst:1812 +#: ../../library/sys.rst:278 ../../library/sys.rst:873 +#: ../../library/sys.rst:1579 ../../library/sys.rst:1812 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -438,7 +438,7 @@ msgstr ":const:`shared_memory`" msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: ../../library/sys.rst:351 +#: ../../library/sys.rst:350 msgid ":ref:`Availability `: Emscripten." msgstr ":ref:`適用 `:Emscripten。" @@ -1023,7 +1023,7 @@ msgstr "" msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:668 +#: ../../library/sys.rst:667 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" diff --git a/library/syslog.po b/library/syslog.po index 3081f2dbf3..fcab4d18ba 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,7 +36,7 @@ msgid "" "handlers` module as :class:`SysLogHandler`." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/telnetlib.po b/library/telnetlib.po index 0ce0276564..a7fcd0d429 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-05-22 02:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -54,7 +54,7 @@ msgid "" "(Erase Character), EL (Erase Line), GA (Go Ahead), SB (Subnegotiation Begin)." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/threading.po b/library/threading.po index b9fc294cca..55d4c47359 100644 --- a/library/threading.po +++ b/library/threading.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -74,7 +74,7 @@ msgid "" "appropriate model if you want to run multiple I/O-bound tasks simultaneously." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -195,7 +195,7 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/threading.rst:131 +#: ../../library/threading.rst:130 msgid "" ":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " "NetBSD, AIX." @@ -257,7 +257,7 @@ msgid "" "information)." msgstr "" -#: ../../library/threading.rst:-1 +#: ../../library/threading.rst:208 msgid ":ref:`Availability `: Windows, pthreads." msgstr ":ref:`適用 `:Windows, pthreads。" @@ -582,7 +582,7 @@ msgid "" "terminated." msgstr "" -#: ../../library/threading.rst:448 +#: ../../library/threading.rst:447 msgid "" ":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " "NetBSD, AIX, DragonFlyBSD." diff --git a/library/time.po b/library/time.po index eec664ca75..a7c2a46d79 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -216,7 +216,7 @@ msgid "" "such as segmentation fault." msgstr "" -#: ../../library/time.rst:-1 +#: ../../library/time.rst:147 msgid ":ref:`Availability `: Unix" msgstr ":ref:`適用 `:Unix" @@ -232,11 +232,11 @@ msgid "" "to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*." msgstr "" -#: ../../library/time.rst:160 ../../library/time.rst:173 -#: ../../library/time.rst:182 ../../library/time.rst:195 -#: ../../library/time.rst:204 ../../library/time.rst:681 -#: ../../library/time.rst:798 ../../library/time.rst:817 -#: ../../library/time.rst:845 ../../library/time.rst:880 +#: ../../library/time.rst:159 ../../library/time.rst:172 +#: ../../library/time.rst:181 ../../library/time.rst:194 +#: ../../library/time.rst:203 ../../library/time.rst:680 +#: ../../library/time.rst:797 ../../library/time.rst:816 +#: ../../library/time.rst:844 ../../library/time.rst:879 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -786,8 +786,8 @@ msgstr "" msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " -"order; this is also not portable. The field width is normally 2 except for ``" -"%j`` where it is 3." +"order; this is also not portable. The field width is normally 2 except for " +"``%j`` where it is 3." msgstr "" #: ../../library/time.rst:531 @@ -1052,7 +1052,7 @@ msgid "" "`float` type." msgstr "" -#: ../../library/time.rst:-1 +#: ../../library/time.rst:656 msgid ":ref:`Availability `: Linux, Unix, Windows." msgstr ":ref:`適用 `:Linux、Unix、Windows。" @@ -1155,8 +1155,8 @@ msgstr ":samp:`M{m}.{n}.{d}`" #: ../../library/time.rst:720 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 *m*" -"\" which may occur in either the fourth or the fifth week). Week 1 is the " +"*n* <= 5, 1 <= *m* <= 12, where week 5 means \"the last *d* day in month " +"*m*\" which may occur in either the fourth or the fifth week). Week 1 is the " "first week in which the *d*'th day occurs. Day zero is a Sunday." msgstr "" @@ -1201,7 +1201,7 @@ msgid "" "similar." msgstr "" -#: ../../library/time.rst:777 +#: ../../library/time.rst:776 msgid ":ref:`Availability `: Linux >= 2.6.39." msgstr ":ref:`適用 `:Linux 2.6.39 以上。" @@ -1212,7 +1212,7 @@ msgid "" "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" -#: ../../library/time.rst:788 +#: ../../library/time.rst:787 msgid ":ref:`Availability `: Solaris." msgstr ":ref:`適用 `:Solaris。" @@ -1228,7 +1228,7 @@ msgid "" "based time that is not subject to NTP adjustments." msgstr "" -#: ../../library/time.rst:808 +#: ../../library/time.rst:807 msgid ":ref:`Availability `: Linux >= 2.6.28, macOS >= 10.12." msgstr ":ref:`適用 `:Linux 2.6.28 以上、macOS 10.12 以上。" @@ -1236,7 +1236,7 @@ msgstr ":ref:`適用 `:Linux 2.6.28 以上、macOS 10.12 以上 msgid "High-resolution per-process timer from the CPU." msgstr "" -#: ../../library/time.rst:826 +#: ../../library/time.rst:825 msgid ":ref:`Availability `: FreeBSD, NetBSD >= 7, OpenBSD." msgstr ":ref:`適用 `:FreeBSD、NetBSD 7 以上、OpenBSD。" @@ -1252,7 +1252,7 @@ msgid "" "the correct answer. PTP or NTP software can maintain a leap second table." msgstr "" -#: ../../library/time.rst:837 +#: ../../library/time.rst:836 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" @@ -1266,7 +1266,7 @@ msgid "" "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" -#: ../../library/time.rst:856 +#: ../../library/time.rst:855 msgid ":ref:`Availability `: FreeBSD, OpenBSD >= 5.5." msgstr ":ref:`適用 `:FreeBSD、OpenBSD 5.5 以上。" @@ -1277,7 +1277,7 @@ msgid "" "the system is asleep." msgstr "" -#: ../../library/time.rst:867 +#: ../../library/time.rst:866 msgid ":ref:`Availability `: macOS >= 10.12." msgstr ":ref:`適用 `:macOS 10.12 以上。" diff --git a/library/urllib.request.po b/library/urllib.request.po index fdfc0fa2a1..205c041793 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,7 +46,7 @@ msgstr "" "有關於更高階的 HTTP 用戶端介面,推薦使用 `Requests 套件 `_\\ 。" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -289,8 +289,8 @@ msgstr "" "例,或是它們的 subclasses:\\ :class:`ProxyHandler`\\ (如果代理服務設定被偵" "測到)、\\ :class:`UnknownHandler`\\ 、\\ :class:`HTTPHandler`\\ 、\\ :class:" "`HTTPDefaultErrorHandler`\\ 、\\ :class:`HTTPRedirectHandler`\\ 、\\ :class:" -"`FTPHandler`\\ 、\\ :class:`FileHandler`\\ 、\\ :class:`HTTPErrorProcessor`" -"\\ 。" +"`FTPHandler`\\ 、\\ :class:`FileHandler`\\ 、\\ :class:" +"`HTTPErrorProcessor`\\ 。" #: ../../library/urllib.request.rst:148 msgid "" @@ -415,8 +415,8 @@ msgid "" "browser to identify itself -- some HTTP servers only allow requests coming " "from common browsers as opposed to scripts. For example, Mozilla Firefox may " "identify itself as ``\"Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 " -"Firefox/2.0.0.11\"``, while :mod:`urllib`'s default user agent string is ``" -"\"Python-urllib/2.6\"`` (on Python 2.6). All header keys are sent in camel " +"Firefox/2.0.0.11\"``, while :mod:`urllib`'s default user agent string is " +"``\"Python-urllib/2.6\"`` (on Python 2.6). All header keys are sent in camel " "case." msgstr "" "*headers* 必須是一個 dictionary,並會被視為如同每對 key 和 value 作為引數來呼" @@ -929,8 +929,8 @@ msgid "" "Handle an error of the given protocol. This will call the registered error " "handlers for the given protocol with the given arguments (which are protocol " "specific). The HTTP protocol is a special case which uses the HTTP response " -"code to determine the specific error handler; refer to the :meth:`http_error_" -"\\` methods of the handler classes." +"code to determine the specific error handler; refer to the :meth:" +"`http_error_\\` methods of the handler classes." msgstr "" #: ../../library/urllib.request.rst:672 diff --git a/library/venv.po b/library/venv.po index 54a73aae0b..a5bc922f14 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,13 +28,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 "" #: ../../library/venv.rst:29 @@ -55,7 +55,7 @@ msgid "" "environments/#creating-a-virtual-environment>`__" msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -576,8 +576,8 @@ msgstr "" #: ../../library/venv.rst:315 msgid "" -"*path* is the path to a directory that should contain subdirectories \"common" -"\", \"posix\", \"nt\", each containing scripts destined for the bin " +"*path* is the path to a directory that should contain subdirectories " +"\"common\", \"posix\", \"nt\", each containing scripts destined for the bin " "directory in the environment. The contents of \"common\" and the directory " "corresponding to :data:`os.name` are copied after some text replacement of " "placeholders:" diff --git a/library/webbrowser.po b/library/webbrowser.po index 75c080afbe..61eb1a3727 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,10 +45,10 @@ msgstr "" msgid "" "If the environment variable :envvar:`BROWSER` exists, it is interpreted as " "the :data:`os.pathsep`-separated list of browsers to try ahead of the " -"platform defaults. When the value of a list part contains the string ``" -"%s``, then it is interpreted as a literal browser command line to be used " -"with the argument URL substituted for ``%s``; if the part does not contain ``" -"%s``, it is simply interpreted as the name of the browser to launch. [1]_" +"platform defaults. When the value of a list part contains the string " +"``%s``, then it is interpreted as a literal browser command line to be used " +"with the argument URL substituted for ``%s``; if the part does not contain " +"``%s``, it is simply interpreted as the name of the browser to launch. [1]_" msgstr "" #: ../../library/webbrowser.rst:30 @@ -69,7 +69,7 @@ msgid "" "are, naturally, mutually exclusive. Usage example::" msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index 376697484c..19622f37b8 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,7 +48,7 @@ msgid "" "certificate and hostname checks by default." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" @@ -343,8 +343,8 @@ msgstr "" msgid "" "Signatures themselves are restricted to the top level parameters expected by " "a method. For instance if a method expects one array of structs as a " -"parameter, and it returns a string, its signature is simply \"string, array" -"\". If it expects three integers and returns a string, its signature is " +"parameter, and it returns a string, its signature is simply \"string, " +"array\". If it expects three integers and returns a string, its signature is " "\"string, int, int, int\"." msgstr "" diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index 253a63f278..0e119350df 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,7 +41,7 @@ msgid "" "see :ref:`xml-vulnerabilities`." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 046b375b26..32e409536a 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-26 00:17+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+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-" @@ -54,7 +54,7 @@ msgid "" "zone data via PyPI." msgstr "" -#: ../../includes/wasm-notavail.rst:-1 +#: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr "" diff --git a/using/cmdline.po b/using/cmdline.po index 845166583c..49988ef389 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-13 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -112,8 +112,8 @@ msgstr "" #: ../../using/cmdline.rst:68 msgid "" -"If this option is given, the first element of :data:`sys.argv` will be ``\"-c" -"\"`` and the current directory will be added to the start of :data:`sys." +"If this option is given, the first element of :data:`sys.argv` will be ``\"-" +"c\"`` and the current directory will be added to the start of :data:`sys." "path` (allowing modules in that directory to be imported as top level " "modules)." msgstr "" @@ -714,12 +714,12 @@ msgstr "" #: ../../using/cmdline.rst:531 msgid "" "``-X frozen_modules`` determines whether or not frozen modules are ignored " -"by the import machinery. A value of \"on\" means they get imported and \"off" -"\" means they are ignored. The default is \"on\" if this is an installed " -"Python (the normal case). If it's under development (running from the " -"source tree) then the default is \"off\". Note that the \"importlib_bootstrap" -"\" and \"importlib_bootstrap_external\" frozen modules are always used, even " -"if this flag is set to \"off\"." +"by the import machinery. A value of \"on\" means they get imported and " +"\"off\" means they are ignored. The default is \"on\" if this is an " +"installed Python (the normal case). If it's under development (running from " +"the source tree) then the default is \"off\". Note that the " +"\"importlib_bootstrap\" and \"importlib_bootstrap_external\" frozen modules " +"are always used, even if this flag is set to \"off\"." msgstr "" #: ../../using/cmdline.rst:539 @@ -1157,7 +1157,7 @@ msgid "" "_enablelegacywindowsfsencoding()`." msgstr "" -#: ../../using/cmdline.rst:926 ../../using/cmdline.rst:940 +#: ../../using/cmdline.rst:925 ../../using/cmdline.rst:939 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -1248,7 +1248,7 @@ msgid "" "system interfaces." msgstr "" -#: ../../using/cmdline.rst:991 +#: ../../using/cmdline.rst:990 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" From a7b45b4aeedceb9b6b19089c379f499665e2d03c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 14 Feb 2023 00:35:22 +0000 Subject: [PATCH 026/130] sync with cpython fd155b91 --- library/unittest.mock.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index d201ca6205..fc27d366c3 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-14 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -357,7 +357,7 @@ msgid "The reset_mock method resets all the call attributes on a mock object:" msgstr "" #: ../../library/unittest.mock.rst:408 -msgid "Added two keyword only argument to the reset_mock function." +msgid "Added two keyword-only arguments to the reset_mock function." msgstr "" #: ../../library/unittest.mock.rst:411 @@ -371,7 +371,7 @@ msgid "" msgstr "" #: ../../library/unittest.mock.rst:419 -msgid "*return_value*, and :attr:`side_effect` are keyword only argument." +msgid "*return_value*, and :attr:`side_effect` are keyword-only arguments." msgstr "" #: ../../library/unittest.mock.rst:425 @@ -1658,8 +1658,8 @@ msgstr "" msgid "" "``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__``" msgstr "" -"``__prepare__``\\ 、\\ ``__instancecheck__``\\ 、\\ ``__subclasscheck__``" -"\\ 、\\ ``__del__``" +"``__prepare__``\\ 、\\ ``__instancecheck__``\\ 、\\ " +"``__subclasscheck__``\\ 、\\ ``__del__``" #: ../../library/unittest.mock.rst:2050 msgid "Magic Mock" @@ -1938,9 +1938,9 @@ msgstr "" #: ../../library/unittest.mock.rst:2248 msgid "" -"``call_list`` is particularly useful for making assertions on \"chained calls" -"\". A chained call is multiple calls on a single line of code. This results " -"in multiple entries in :attr:`~Mock.mock_calls` on a mock. Manually " +"``call_list`` is particularly useful for making assertions on \"chained " +"calls\". A chained call is multiple calls on a single line of code. This " +"results in multiple entries in :attr:`~Mock.mock_calls` on a mock. Manually " "constructing the sequence of calls can be tedious." msgstr "" From 7476c53a485e1285847d257ab151b2284fce9974 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 15 Feb 2023 00:34:38 +0000 Subject: [PATCH 027/130] sync with cpython 4aeae286 --- c-api/dict.po | 9 +++++---- c-api/object.po | 6 +++--- faq/programming.po | 8 ++++---- library/abc.po | 6 +++--- library/collections.abc.po | 14 +++++++------- library/collections.po | 27 +++++++++++++++------------ library/datetime.po | 6 +++--- library/fractions.po | 8 ++++---- library/functools.po | 4 ++-- library/graphlib.po | 8 +++++--- library/inspect.po | 6 +++--- library/operator.po | 7 ++++--- library/pathlib.po | 8 ++++---- library/stdtypes.po | 23 ++++++++++++----------- library/typing.po | 6 +++--- reference/datamodel.po | 8 ++++---- 16 files changed, 81 insertions(+), 73 deletions(-) diff --git a/c-api/dict.po b/c-api/dict.po index 3e236cf2e1..e77a7e603c 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -98,9 +98,10 @@ msgstr "" #: ../../c-api/dict.rst:83 msgid "" -"Remove the entry in dictionary *p* with key *key*. *key* must be hashable; " -"if it isn't, :exc:`TypeError` is raised. If *key* is not in the dictionary, :" -"exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on failure." +"Remove the entry in dictionary *p* with key *key*. *key* must be :term:" +"`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not in the " +"dictionary, :exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on " +"failure." msgstr "" #: ../../c-api/dict.rst:91 diff --git a/c-api/object.po b/c-api/object.po index 81fda35c64..bedeef6ab1 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -301,8 +301,8 @@ msgstr "" #: ../../c-api/object.rst:284 msgid "" -"Set a :exc:`TypeError` indicating that ``type(o)`` is not hashable and " -"return ``-1``. This function receives special treatment when stored in a " +"Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` " +"and return ``-1``. This function receives special treatment when stored in a " "``tp_hash`` slot, allowing a type to explicitly indicate to the interpreter " "that it is not hashable." msgstr "" diff --git a/faq/programming.po b/faq/programming.po index fdf773d83c..462aae78c9 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-29 00:16+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2115,9 +2115,9 @@ msgstr "" #: ../../faq/programming.rst:1982 msgid "" -"The *lru_cache* approach works with methods that have hashable arguments. " -"It creates a reference to the instance unless special efforts are made to " -"pass in weak references." +"The *lru_cache* approach works with methods that have :term:`hashable` " +"arguments. It creates a reference to the instance unless special efforts " +"are made to pass in weak references." msgstr "" #: ../../faq/programming.rst:1986 diff --git a/library/abc.po b/library/abc.po index 051401df67..94e03ef7d6 100644 --- a/library/abc.po +++ b/library/abc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+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-" @@ -39,8 +39,8 @@ msgid "" "The :mod:`collections` module has some concrete classes that derive from " "ABCs; these can, of course, be further derived. In addition, the :mod:" "`collections.abc` submodule has some ABCs that can be used to test whether a " -"class or instance provides a particular interface, for example, if it is " -"hashable or if it is a mapping." +"class or instance provides a particular interface, for example, if it is :" +"term:`hashable` or if it is a mapping." msgstr "" #: ../../library/abc.rst:27 diff --git a/library/collections.abc.po b/library/collections.abc.po index 05fccba50f..2f998cd74e 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,7 +34,7 @@ msgstr "**原始碼:**\\ :source:`Lib/_collections_abc.py`" msgid "" "This module provides :term:`abstract base classes ` " "that can be used to test whether a class provides a particular interface; " -"for example, whether it is hashable or whether it is a mapping." +"for example, whether it is :term:`hashable` or whether it is a mapping." msgstr "" #: ../../library/collections.abc.rst:27 @@ -275,8 +275,8 @@ msgstr ":class:`MutableSet`" #: ../../library/collections.abc.rst:151 msgid "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" msgstr "" -"``__contains__``\\ 、\\ ``__iter__``\\ 、\\ ``__len__``\\ 、\\ ``add``" -"\\ 、\\ ``discard``" +"``__contains__``\\ 、\\ ``__iter__``\\ 、\\ ``__len__``\\ 、\\ " +"``add``\\ 、\\ ``discard``" #: ../../library/collections.abc.rst:151 msgid "" @@ -620,9 +620,9 @@ msgstr "" msgid "" "The :class:`Set` mixin provides a :meth:`_hash` method to compute a hash " "value for the set; however, :meth:`__hash__` is not defined because not all " -"sets are hashable or immutable. To add set hashability using mixins, " -"inherit from both :meth:`Set` and :meth:`Hashable`, then define ``__hash__ = " -"Set._hash``." +"sets are :term:`hashable` or immutable. To add set hashability using " +"mixins, inherit from both :meth:`Set` and :meth:`Hashable`, then define " +"``__hash__ = Set._hash``." msgstr "" #: ../../library/collections.abc.rst:415 diff --git a/library/collections.po b/library/collections.po index 59474796b7..ca080fbdf8 100644 --- a/library/collections.po +++ b/library/collections.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-26 00:11+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2022-03-01 01:14+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,7 +70,8 @@ msgid ":class:`Counter`" msgstr ":class:`Counter`" #: ../../library/collections.rst:28 -msgid "dict subclass for counting hashable objects" +#, fuzzy +msgid "dict subclass for counting :term:`hashable` objects" msgstr "dict 的子類別,用來計算可雜湊 (hashable) 物件的數量" #: ../../library/collections.rst:29 @@ -225,9 +226,9 @@ msgid "" "reference to ``d.parents`` is equivalent to: ``ChainMap(*d.maps[1:])``." msgstr "" "回傳一個包含除了第一個以外所有其他對映的新 :class:`ChainMap` 的特性,可用於需" -"要跳過第一個對映的搜索。使用情境類似於在\\ :term:`巢狀作用域 `" -"\\ 當中使用 :keyword:`nonlocal` 關鍵字,也可與內建函式 :func:`super` 做類比。" -"引用 ``d.parents`` 等同於 ``ChainMap(*d.maps[1:])``。" +"要跳過第一個對映的搜索。使用情境類似於在\\ :term:`巢狀作用域 `\\ 當中使用 :keyword:`nonlocal` 關鍵字,也可與內建函式 :func:`super` " +"做類比。引用 ``d.parents`` 等同於 ``ChainMap(*d.maps[1:])``。" #: ../../library/collections.rst:102 msgid "" @@ -352,8 +353,9 @@ msgstr "" "::" #: ../../library/collections.rst:244 +#, fuzzy msgid "" -"A :class:`Counter` is a :class:`dict` subclass for counting hashable " +"A :class:`Counter` is a :class:`dict` subclass for counting :term:`hashable` " "objects. It is a collection where elements are stored as dictionary keys and " "their counts are stored as dictionary values. Counts are allowed to be any " "integer value including zero or negative counts. The :class:`Counter` class " @@ -839,10 +841,11 @@ msgid "" "popleft`; otherwise, it can be cycled back to the end with the :meth:`~deque." "rotate` method::" msgstr "" -"一個\\ `輪詢調度器 `_" -"\\ 可以透過在 :class:`deque` 中放入 iterator 來實現,值自當前 iterator 的位" -"置 0 取出,如果 iterator 已經消耗完畢就用 :meth:`~deque.popleft` 將其從佇列中" -"移除,否則利用 :meth:`~deque.rotate` 來將其移至佇列尾端:\n" +"一個\\ `輪詢調度器 `_\\ 可以透過在 :class:`deque` 中放入 iterator 來實現,值自" +"當前 iterator 的位置 0 取出,如果 iterator 已經消耗完畢就用 :meth:`~deque." +"popleft` 將其從佇列中移除,否則利用 :meth:`~deque.rotate` 來將其移至佇列尾" +"端:\n" "\n" "::" @@ -1474,8 +1477,8 @@ msgid "" "The items, keys, and values :term:`views ` of :class:" "`OrderedDict` now support reverse iteration using :func:`reversed`." msgstr "" -":class:`OrderedDict` 的項 (item)、鍵與值之\\ :term:`視圖 `" -"\\ 現在可透過 :func:`reversed` 來倒序疊代。" +":class:`OrderedDict` 的項 (item)、鍵與值之\\ :term:`視圖 `\\ 現在可透過 :func:`reversed` 來倒序疊代。" #: ../../library/collections.rst:1175 msgid "" diff --git a/library/datetime.po b/library/datetime.po index 69e69d90a8..f8b6e4c994 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-21 00:16+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,8 +210,8 @@ msgstr "" #: ../../library/datetime.rst:163 msgid "" -"Objects of these types are hashable, meaning that they can be used as " -"dictionary keys." +"Objects of these types are :term:`hashable`, meaning that they can be used " +"as dictionary keys." msgstr "" #: ../../library/datetime.rst:165 diff --git a/library/fractions.po b/library/fractions.po index ff4c819806..6232247683 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2016-01-31 07:18+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,9 +70,9 @@ msgstr "" msgid "" "The :class:`Fraction` class inherits from the abstract base class :class:" "`numbers.Rational`, and implements all of the methods and operations from " -"that class. :class:`Fraction` instances are hashable, and should be treated " -"as immutable. In addition, :class:`Fraction` has the following properties " -"and methods:" +"that class. :class:`Fraction` instances are :term:`hashable`, and should be " +"treated as immutable. In addition, :class:`Fraction` has the following " +"properties and methods:" msgstr "" #: ../../library/fractions.rst:84 diff --git a/library/functools.po b/library/functools.po index 55ab0a8326..97b29d7a90 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-25 00:16+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -161,7 +161,7 @@ msgstr "" #: ../../library/functools.rst:149 msgid "" "Since a dictionary is used to cache results, the positional and keyword " -"arguments to the function must be hashable." +"arguments to the function must be :term:`hashable`." msgstr "" #: ../../library/functools.rst:152 diff --git a/library/graphlib.po b/library/graphlib.po index 5d43dbe73d..b033adfa49 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+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-" @@ -27,7 +27,9 @@ msgid "**Source code:** :source:`Lib/graphlib.py`" msgstr "**原始碼:**\\ :source:`Lib/graphlib.py`" #: ../../library/graphlib.rst:20 -msgid "Provides functionality to topologically sort a graph of hashable nodes." +msgid "" +"Provides functionality to topologically sort a graph of :term:`hashable` " +"nodes." msgstr "" #: ../../library/graphlib.rst:22 @@ -94,7 +96,7 @@ msgstr "" #: ../../library/graphlib.rst:87 msgid "" "Add a new node and its predecessors to the graph. Both the *node* and all " -"elements in *predecessors* must be hashable." +"elements in *predecessors* must be :term:`hashable`." msgstr "" #: ../../library/graphlib.rst:90 diff --git a/library/inspect.po b/library/inspect.po index 97f5635339..df29ff1afb 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-26 00:17+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -955,7 +955,7 @@ msgid "" msgstr "" #: ../../library/inspect.rst:670 -msgid "Signature objects are picklable and hashable." +msgid "Signature objects are picklable and :term:`hashable`." msgstr "" #: ../../library/inspect.rst:675 @@ -1029,7 +1029,7 @@ msgid "" msgstr "" #: ../../library/inspect.rst:748 -msgid "Parameter objects are picklable and hashable." +msgid "Parameter objects are picklable and :term:`hashable`." msgstr "" #: ../../library/inspect.rst:753 diff --git a/library/operator.po b/library/operator.po index ced7c9af72..9e459c858b 100644 --- a/library/operator.po +++ b/library/operator.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2021-12-09 23:32+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -317,10 +317,11 @@ msgstr "" "r[3])``。" #: ../../library/operator.rst:329 +#, fuzzy msgid "" "The items can be any type accepted by the operand's :meth:`__getitem__` " -"method. Dictionaries accept any hashable value. Lists, tuples, and strings " -"accept an index or a slice:" +"method. Dictionaries accept any :term:`hashable` value. Lists, tuples, and " +"strings accept an index or a slice:" msgstr "" "傳入的條目可以為運算元的 :meth:`__getitem__` 所接受的任何型別。dictionary(字" "典)接受任意可雜湊 (hashable) 的值。list、tupple 和字串接受索引或切片:" diff --git a/library/pathlib.po b/library/pathlib.po index 7c4b0c2c4a..c5c5fe6197 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-31 00:34+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -193,9 +193,9 @@ msgstr "" #: ../../library/pathlib.rst:189 msgid "" -"Paths are immutable and hashable. Paths of a same flavour are comparable " -"and orderable. These properties respect the flavour's case-folding " -"semantics::" +"Paths are immutable and :term:`hashable`. Paths of a same flavour are " +"comparable and orderable. These properties respect the flavour's case-" +"folding semantics::" msgstr "" #: ../../library/pathlib.rst:202 diff --git a/library/stdtypes.po b/library/stdtypes.po index e7400aed72..e6be6b1993 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-25 00:16+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4089,15 +4089,15 @@ msgstr "" #: ../../library/stdtypes.rst:3768 msgid "" -"One-dimensional memoryviews of hashable (read-only) types with formats 'B', " -"'b' or 'c' are also hashable. The hash is defined as ``hash(m) == hash(m." -"tobytes())``::" +"One-dimensional memoryviews of :term:`hashable` (read-only) types with " +"formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) " +"== hash(m.tobytes())``::" msgstr "" #: ../../library/stdtypes.rst:3780 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " -"with formats 'B', 'b' or 'c' are now hashable." +"with formats 'B', 'b' or 'c' are now :term:`hashable`." msgstr "" #: ../../library/stdtypes.rst:3784 @@ -4952,12 +4952,13 @@ msgstr "" #: ../../library/stdtypes.rst:4702 msgid "" -"Keys views are set-like since their entries are unique and hashable. If all " -"values are hashable, so that ``(key, value)`` pairs are unique and hashable, " -"then the items view is also set-like. (Values views are not treated as set-" -"like since the entries are generally not unique.) For set-like views, all " -"of the operations defined for the abstract base class :class:`collections." -"abc.Set` are available (for example, ``==``, ``<``, or ``^``)." +"Keys views are set-like since their entries are unique and :term:" +"`hashable`. If all values are hashable, so that ``(key, value)`` pairs are " +"unique and hashable, then the items view is also set-like. (Values views " +"are not treated as set-like since the entries are generally not unique.) " +"For set-like views, all of the operations defined for the abstract base " +"class :class:`collections.abc.Set` are available (for example, ``==``, " +"``<``, or ``^``)." msgstr "" #: ../../library/stdtypes.rst:4709 diff --git a/library/typing.po b/library/typing.po index 0b97228852..4a51af16e6 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-08 00:17+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -487,8 +487,8 @@ msgstr "" msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " -"parameterizing generics is cached, and most types in the typing module are " -"hashable and comparable for equality." +"parameterizing generics is cached, and most types in the typing module are :" +"term:`hashable` and comparable for equality." msgstr "" #: ../../library/typing.rst:447 diff --git a/reference/datamodel.po b/reference/datamodel.po index 9c16bb34b6..b2b6a6c012 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-01 00:18+0000\n" +"POT-Creation-Date: 2023-02-15 00:32+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1812,9 +1812,9 @@ msgid "" "`__hash__`, its instances will not be usable as items in hashable " "collections. If a class defines mutable objects and implements an :meth:" "`__eq__` method, it should not implement :meth:`__hash__`, since the " -"implementation of hashable collections requires that a key's hash value is " -"immutable (if the object's hash value changes, it will be in the wrong hash " -"bucket)." +"implementation of :term:`hashable` collections requires that a key's hash " +"value is immutable (if the object's hash value changes, it will be in the " +"wrong hash bucket)." msgstr "" #: ../../reference/datamodel.rst:1532 From 46c92cf38c8f53c5efd6a0fced6352be3ffc0c47 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 17 Feb 2023 00:38:49 +0000 Subject: [PATCH 028/130] sync with cpython aedf3839 --- library/configparser.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/library/configparser.po b/library/configparser.po index 6db325f6f4..62f1a1de1b 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-17 00:37+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -167,7 +167,7 @@ msgid "" "Please note that default values have precedence over fallback values. For " "instance, in our example the ``'CompressionLevel'`` key was specified only " "in the ``'DEFAULT'`` section. If we try to get it from the section " -"``'topsecret.server.com'``, we will always get the default, even if we " +"``'topsecret.server.example'``, we will always get the default, even if we " "specify a fallback:" msgstr "" @@ -251,8 +251,8 @@ msgstr "" #: ../../library/configparser.rst:364 msgid "" -"With ``interpolation`` set to ``None``, the parser would simply return ``" -"%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/" +"With ``interpolation`` set to ``None``, the parser would simply return " +"``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/" "lumberjack`` as the value of ``my_dir``." msgstr "" @@ -532,8 +532,8 @@ msgstr "" #: ../../library/configparser.rst:669 msgid "" -"*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: ``" -"\"DEFAULT\"``)" +"*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: " +"``\"DEFAULT\"``)" msgstr "" #: ../../library/configparser.rst:672 @@ -542,8 +542,8 @@ msgid "" "sections or interpolation purposes is a powerful concept of this library, " "letting users create complex declarative configurations. This section is " "normally called ``\"DEFAULT\"`` but this can be customized to point to any " -"other valid section name. Some typical values include: ``\"general\"`` or ``" -"\"common\"``. The name provided is used for recognizing default sections " +"other valid section name. Some typical values include: ``\"general\"`` or " +"``\"common\"``. The name provided is used for recognizing default sections " "when reading from any source and is used when writing configuration back to " "a file. Its current value can be retrieved using the ``parser_instance." "default_section`` attribute and may be modified at runtime (i.e. to convert " From b87c78e0e58b29b03f0895f44af75f93ccfa1b35 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 18 Feb 2023 00:35:41 +0000 Subject: [PATCH 029/130] sync with cpython b7a49eb5 --- c-api/module.po | 16 ++++---- library/enum.po | 96 ++++++++++++++++++++++----------------------- library/plistlib.po | 8 ++-- 3 files changed, 59 insertions(+), 61 deletions(-) diff --git a/c-api/module.po b/c-api/module.po index 81ef073865..524f8c3178 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-02-18 00:33+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -444,17 +444,17 @@ msgstr "" #: ../../c-api/module.rst:391 msgid "" -"Create a new module object, given the definition in *module* and the " -"ModuleSpec *spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` " -"with *module_api_version* set to :const:`PYTHON_API_VERSION`." +"Create a new module object, given the definition in *def* and the ModuleSpec " +"*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with " +"*module_api_version* set to :const:`PYTHON_API_VERSION`." msgstr "" #: ../../c-api/module.rst:399 msgid "" -"Create a new module object, given the definition in *module* and the " -"ModuleSpec *spec*, assuming the API version *module_api_version*. If that " -"version does not match the version of the running interpreter, a :exc:" -"`RuntimeWarning` is emitted." +"Create a new module object, given the definition in *def* and the ModuleSpec " +"*spec*, assuming the API version *module_api_version*. If that version does " +"not match the version of the running interpreter, a :exc:`RuntimeWarning` is " +"emitted." msgstr "" #: ../../c-api/module.rst:406 diff --git a/library/enum.po b/library/enum.po index 15fbce62af..ccc1a64e14 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-21 00:16+0000\n" +"POT-Creation-Date: 2023-02-18 00:33+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-" @@ -746,109 +746,107 @@ msgid "" msgstr "" #: ../../library/enum.rst:695 -msgid "" -"Out-of-range values cause a :exc:`ValueError` to be raised. This is the " -"default for :class:`Flag`::" +msgid "Out-of-range values cause a :exc:`ValueError` to be raised::" msgstr "" -#: ../../library/enum.rst:712 +#: ../../library/enum.rst:711 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " -"value::" +"value. This is the default for :class:`Flag`::" msgstr "" -#: ../../library/enum.rst:725 +#: ../../library/enum.rst:724 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`. " "This is the default for :class:`IntFlag`::" msgstr "" -#: ../../library/enum.rst:738 +#: ../../library/enum.rst:737 msgid "" -"Out-of-range values are kept, and the *Flag* membership is kept. This is " -"used for some stdlib flags:" +"Out-of-range values are kept, and the *Flag* membership is kept. This is " +"used for some stdlib flags::" msgstr "" -#: ../../library/enum.rst:754 +#: ../../library/enum.rst:753 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../library/enum.rst:756 +#: ../../library/enum.rst:755 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:759 +#: ../../library/enum.rst:758 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " "appropriately. Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:765 +#: ../../library/enum.rst:764 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../library/enum.rst:767 +#: ../../library/enum.rst:766 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../library/enum.rst:768 +#: ../../library/enum.rst:767 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../library/enum.rst:770 +#: ../../library/enum.rst:769 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../library/enum.rst:772 +#: ../../library/enum.rst:771 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../library/enum.rst:775 +#: ../../library/enum.rst:774 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:777 +#: ../../library/enum.rst:776 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "" -#: ../../library/enum.rst:782 +#: ../../library/enum.rst:781 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../library/enum.rst:785 +#: ../../library/enum.rst:784 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../library/enum.rst:788 +#: ../../library/enum.rst:787 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:789 +#: ../../library/enum.rst:788 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:794 +#: ../../library/enum.rst:793 msgid "Utilities and Decorators" msgstr "" -#: ../../library/enum.rst:798 +#: ../../library/enum.rst:797 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -859,58 +857,58 @@ msgid "" "manually specified values." msgstr "" -#: ../../library/enum.rst:806 +#: ../../library/enum.rst:805 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: ../../library/enum.rst:808 +#: ../../library/enum.rst:807 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: ../../library/enum.rst:809 +#: ../../library/enum.rst:808 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" -#: ../../library/enum.rst:810 +#: ../../library/enum.rst:809 msgid "used to create the ``SECOND`` enum member;" msgstr "" -#: ../../library/enum.rst:811 +#: ../../library/enum.rst:810 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:816 +#: ../../library/enum.rst:815 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "" -#: ../../library/enum.rst:819 +#: ../../library/enum.rst:818 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:822 +#: ../../library/enum.rst:821 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:828 +#: ../../library/enum.rst:827 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:832 +#: ../../library/enum.rst:831 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -918,29 +916,29 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:841 +#: ../../library/enum.rst:840 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:859 +#: ../../library/enum.rst:858 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:867 +#: ../../library/enum.rst:866 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:873 +#: ../../library/enum.rst:872 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:879 +#: ../../library/enum.rst:878 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -948,41 +946,41 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:889 +#: ../../library/enum.rst:888 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:896 +#: ../../library/enum.rst:895 msgid "Notes" msgstr "" -#: ../../library/enum.rst:898 +#: ../../library/enum.rst:897 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:900 +#: ../../library/enum.rst:899 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:903 +#: ../../library/enum.rst:902 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:905 +#: ../../library/enum.rst:904 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:908 +#: ../../library/enum.rst:907 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:915 +#: ../../library/enum.rst:914 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" diff --git a/library/plistlib.po b/library/plistlib.po index fd4018673b..60b9dc638c 100644 --- a/library/plistlib.po +++ b/library/plistlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-29 00:11+0000\n" +"POT-Creation-Date: 2023-02-18 00:33+0000\n" "PO-Revision-Date: 2016-01-31 07:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,8 @@ msgstr "**原始碼:**\\ :source:`Lib/plistlib.py`" #: ../../library/plistlib.rst:19 msgid "" -"This module provides an interface for reading and writing the \"property list" -"\" files used by Apple, primarily on macOS and iOS. This module supports " +"This module provides an interface for reading and writing the \"property " +"list\" files used by Apple, primarily on macOS and iOS. This module supports " "both binary and XML plist files." msgstr "" @@ -221,6 +221,6 @@ msgstr "範例" msgid "Generating a plist::" msgstr "" -#: ../../library/plistlib.rst:180 +#: ../../library/plistlib.rst:182 msgid "Parsing a plist::" msgstr "" From 2ed5e5fb684b7934e6e7f9d26e7d5640bdf1408d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 19 Feb 2023 00:35:02 +0000 Subject: [PATCH 030/130] sync with cpython 5220c2df --- library/asyncio-eventloop.po | 772 ++++++++++++++++++----------------- 1 file changed, 392 insertions(+), 380 deletions(-) diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 59392b48bf..db2464eefe 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-02-19 00:33+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -256,15 +256,14 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:179 -#: ../../library/asyncio-eventloop.rst:199 msgid "" "Note that there is no need to call this function when :func:`asyncio.run` is " "used." msgstr "" #: ../../library/asyncio-eventloop.rst:182 -#: ../../library/asyncio-eventloop.rst:1212 -#: ../../library/asyncio-eventloop.rst:1600 +#: ../../library/asyncio-eventloop.rst:1216 +#: ../../library/asyncio-eventloop.rst:1604 msgid "Example::" msgstr "" "範例:\n" @@ -274,212 +273,225 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:194 msgid "" "Schedule the closure of the default executor and wait for it to join all of " -"the threads in the :class:`ThreadPoolExecutor`. After calling this method, " -"a :exc:`RuntimeError` will be raised if :meth:`loop.run_in_executor` is " -"called while using the default executor." +"the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once " +"this method has been called, using the default executor with :meth:`loop." +"run_in_executor` will raise a :exc:`RuntimeError`." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:202 +msgid "" +"Do not call this method when using :func:`asyncio.run`, as the latter " +"handles default executor shutdown automatically." msgstr "" -#: ../../library/asyncio-eventloop.rst:206 +#: ../../library/asyncio-eventloop.rst:209 msgid "Scheduling callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:210 +#: ../../library/asyncio-eventloop.rst:213 msgid "" "Schedule the *callback* :term:`callback` to be called with *args* arguments " "at the next iteration of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:213 +#: ../../library/asyncio-eventloop.rst:216 msgid "" -"Callbacks are called in the order in which they are registered. Each " -"callback will be called exactly once." +"Return an instance of :class:`asyncio.Handle`, which can be used later to " +"cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:216 -#: ../../library/asyncio-eventloop.rst:283 +#: ../../library/asyncio-eventloop.rst:219 msgid "" -"An optional keyword-only *context* argument allows specifying a custom :" -"class:`contextvars.Context` for the *callback* to run in. The current " -"context is used when no *context* is provided." +"Callbacks are called in the order in which they are registered. Each " +"callback will be called exactly once." msgstr "" -#: ../../library/asyncio-eventloop.rst:220 +#: ../../library/asyncio-eventloop.rst:222 msgid "" -"An instance of :class:`asyncio.Handle` is returned, which can be used later " -"to cancel the callback." +"The optional keyword-only *context* argument specifies a custom :class:" +"`contextvars.Context` for the *callback* to run in. Callbacks use the " +"current context when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:223 -msgid "This method is not thread-safe." +#: ../../library/asyncio-eventloop.rst:226 +msgid "Unlike :meth:`call_soon_threadsafe`, this method is not thread-safe." msgstr "" -#: ../../library/asyncio-eventloop.rst:227 +#: ../../library/asyncio-eventloop.rst:230 msgid "" -"A thread-safe variant of :meth:`call_soon`. Must be used to schedule " -"callbacks *from another thread*." +"A thread-safe variant of :meth:`call_soon`. When scheduling callbacks from " +"another thread, this function *must* be used, since :meth:`call_soon` is not " +"thread-safe." msgstr "" -#: ../../library/asyncio-eventloop.rst:230 +#: ../../library/asyncio-eventloop.rst:234 msgid "" "Raises :exc:`RuntimeError` if called on a loop that's been closed. This can " "happen on a secondary thread when the main application is shutting down." msgstr "" -#: ../../library/asyncio-eventloop.rst:234 +#: ../../library/asyncio-eventloop.rst:238 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-eventloop.rst:237 -#: ../../library/asyncio-eventloop.rst:287 -#: ../../library/asyncio-eventloop.rst:307 +#: ../../library/asyncio-eventloop.rst:241 +#: ../../library/asyncio-eventloop.rst:291 +#: ../../library/asyncio-eventloop.rst:311 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "" -#: ../../library/asyncio-eventloop.rst:245 +#: ../../library/asyncio-eventloop.rst:249 msgid "" "Most :mod:`asyncio` scheduling functions don't allow passing keyword " "arguments. To do that, use :func:`functools.partial`::" msgstr "" -#: ../../library/asyncio-eventloop.rst:252 +#: ../../library/asyncio-eventloop.rst:256 msgid "" "Using partial objects is usually more convenient than using lambdas, as " "asyncio can render partial objects better in debug and error messages." msgstr "" -#: ../../library/asyncio-eventloop.rst:260 +#: ../../library/asyncio-eventloop.rst:264 msgid "Scheduling delayed callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:262 +#: ../../library/asyncio-eventloop.rst:266 msgid "" "Event loop provides mechanisms to schedule callback functions to be called " "at some point in the future. Event loop uses monotonic clocks to track time." msgstr "" -#: ../../library/asyncio-eventloop.rst:269 +#: ../../library/asyncio-eventloop.rst:273 msgid "" "Schedule *callback* to be called after the given *delay* number of seconds " "(can be either an int or a float)." msgstr "" -#: ../../library/asyncio-eventloop.rst:272 -#: ../../library/asyncio-eventloop.rst:304 +#: ../../library/asyncio-eventloop.rst:276 +#: ../../library/asyncio-eventloop.rst:308 msgid "" "An instance of :class:`asyncio.TimerHandle` is returned which can be used to " "cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:275 +#: ../../library/asyncio-eventloop.rst:279 msgid "" "*callback* will be called exactly once. If two callbacks are scheduled for " "exactly the same time, the order in which they are called is undefined." msgstr "" -#: ../../library/asyncio-eventloop.rst:279 +#: ../../library/asyncio-eventloop.rst:283 msgid "" "The optional positional *args* will be passed to the callback when it is " "called. If you want the callback to be called with keyword arguments use :" "func:`functools.partial`." msgstr "" -#: ../../library/asyncio-eventloop.rst:291 +#: ../../library/asyncio-eventloop.rst:287 +msgid "" +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *callback* to run in. The current " +"context is used when no *context* is provided." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:295 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "*delay* could not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:298 +#: ../../library/asyncio-eventloop.rst:302 msgid "" "Schedule *callback* to be called at the given absolute timestamp *when* (an " "int or a float), using the same time reference as :meth:`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:302 +#: ../../library/asyncio-eventloop.rst:306 msgid "This method's behavior is the same as :meth:`call_later`." msgstr "" -#: ../../library/asyncio-eventloop.rst:311 +#: ../../library/asyncio-eventloop.rst:315 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "difference between *when* and the current time could not exceed one day. " "This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:318 +#: ../../library/asyncio-eventloop.rst:322 msgid "" "Return the current time, as a :class:`float` value, according to the event " "loop's internal monotonic clock." msgstr "" -#: ../../library/asyncio-eventloop.rst:322 +#: ../../library/asyncio-eventloop.rst:326 msgid "" "In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) " "should not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:328 +#: ../../library/asyncio-eventloop.rst:332 msgid "The :func:`asyncio.sleep` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:332 +#: ../../library/asyncio-eventloop.rst:336 msgid "Creating Futures and Tasks" msgstr "" -#: ../../library/asyncio-eventloop.rst:336 +#: ../../library/asyncio-eventloop.rst:340 msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:338 +#: ../../library/asyncio-eventloop.rst:342 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " "(with better performance or instrumentation)." msgstr "" -#: ../../library/asyncio-eventloop.rst:346 +#: ../../library/asyncio-eventloop.rst:350 msgid "" "Schedule the execution of :ref:`coroutine ` *coro*. Return a :" "class:`Task` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:349 +#: ../../library/asyncio-eventloop.rst:353 msgid "" "Third-party event loops can use their own subclass of :class:`Task` for " "interoperability. In this case, the result type is a subclass of :class:" "`Task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:353 +#: ../../library/asyncio-eventloop.rst:357 msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." msgstr "" -#: ../../library/asyncio-eventloop.rst:356 +#: ../../library/asyncio-eventloop.rst:360 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. The current context " "copy is created when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:360 +#: ../../library/asyncio-eventloop.rst:364 msgid "Added the *name* parameter." msgstr "加入 *name* 參數。" -#: ../../library/asyncio-eventloop.rst:363 +#: ../../library/asyncio-eventloop.rst:367 msgid "Added the *context* parameter." msgstr "加入 *context* 參數。" -#: ../../library/asyncio-eventloop.rst:368 +#: ../../library/asyncio-eventloop.rst:372 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:371 +#: ../../library/asyncio-eventloop.rst:375 msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro, " @@ -488,82 +500,82 @@ msgid "" "Future`-compatible object." msgstr "" -#: ../../library/asyncio-eventloop.rst:379 +#: ../../library/asyncio-eventloop.rst:383 msgid "Return a task factory or ``None`` if the default one is in use." msgstr "" -#: ../../library/asyncio-eventloop.rst:383 +#: ../../library/asyncio-eventloop.rst:387 msgid "Opening network connections" msgstr "" -#: ../../library/asyncio-eventloop.rst:393 +#: ../../library/asyncio-eventloop.rst:397 msgid "" "Open a streaming transport connection to a given address specified by *host* " "and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:396 +#: ../../library/asyncio-eventloop.rst:400 msgid "" "The socket family can be either :py:data:`~socket.AF_INET` or :py:data:" "`~socket.AF_INET6` depending on *host* (or the *family* argument, if " "provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:400 +#: ../../library/asyncio-eventloop.rst:404 msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:402 -#: ../../library/asyncio-eventloop.rst:1128 -#: ../../library/asyncio-eventloop.rst:1144 +#: ../../library/asyncio-eventloop.rst:406 +#: ../../library/asyncio-eventloop.rst:1132 +#: ../../library/asyncio-eventloop.rst:1148 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:405 +#: ../../library/asyncio-eventloop.rst:409 msgid "" "This method will try to establish the connection in the background. When " "successful, it returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:408 +#: ../../library/asyncio-eventloop.rst:412 msgid "The chronological synopsis of the underlying operation is as follows:" msgstr "" -#: ../../library/asyncio-eventloop.rst:410 +#: ../../library/asyncio-eventloop.rst:414 msgid "" "The connection is established and a :ref:`transport ` is " "created for it." msgstr "" -#: ../../library/asyncio-eventloop.rst:413 +#: ../../library/asyncio-eventloop.rst:417 msgid "" "*protocol_factory* is called without arguments and is expected to return a :" "ref:`protocol ` instance." msgstr "" -#: ../../library/asyncio-eventloop.rst:416 +#: ../../library/asyncio-eventloop.rst:420 msgid "" "The protocol instance is coupled with the transport by calling its :meth:" "`~BaseProtocol.connection_made` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:419 +#: ../../library/asyncio-eventloop.rst:423 msgid "A ``(transport, protocol)`` tuple is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:421 +#: ../../library/asyncio-eventloop.rst:425 msgid "" "The created transport is an implementation-dependent bidirectional stream." msgstr "" -#: ../../library/asyncio-eventloop.rst:424 -#: ../../library/asyncio-eventloop.rst:545 +#: ../../library/asyncio-eventloop.rst:428 +#: ../../library/asyncio-eventloop.rst:549 msgid "Other arguments:" msgstr "" -#: ../../library/asyncio-eventloop.rst:426 +#: ../../library/asyncio-eventloop.rst:430 msgid "" "*ssl*: if given and not false, a SSL/TLS transport is created (by default a " "plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " @@ -572,11 +584,11 @@ msgid "" "is used." msgstr "" -#: ../../library/asyncio-eventloop.rst:432 +#: ../../library/asyncio-eventloop.rst:436 msgid ":ref:`SSL/TLS security considerations `" msgstr "" -#: ../../library/asyncio-eventloop.rst:434 +#: ../../library/asyncio-eventloop.rst:438 msgid "" "*server_hostname* sets or overrides the hostname that the target server's " "certificate will be matched against. Should only be passed if *ssl* is not " @@ -587,7 +599,7 @@ msgid "" "potential man-in-the-middle attacks)." msgstr "" -#: ../../library/asyncio-eventloop.rst:442 +#: ../../library/asyncio-eventloop.rst:446 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " @@ -595,7 +607,7 @@ msgid "" "constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:447 +#: ../../library/asyncio-eventloop.rst:451 msgid "" "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " "connection. It should be a floating-point number representing the amount of " @@ -605,7 +617,7 @@ msgid "" "the RFC is ``0.25`` (250 milliseconds)." msgstr "" -#: ../../library/asyncio-eventloop.rst:455 +#: ../../library/asyncio-eventloop.rst:459 msgid "" "*interleave* controls address reordering when a host name resolves to " "multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " @@ -616,7 +628,7 @@ msgid "" "*happy_eyeballs_delay* is not specified, and ``1`` if it is." msgstr "" -#: ../../library/asyncio-eventloop.rst:464 +#: ../../library/asyncio-eventloop.rst:468 msgid "" "*sock*, if given, should be an existing, already connected :class:`socket." "socket` object to be used by the transport. If *sock* is given, none of " @@ -624,61 +636,61 @@ msgid "" "*interleave* and *local_addr* should be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:472 -#: ../../library/asyncio-eventloop.rst:576 -#: ../../library/asyncio-eventloop.rst:800 +#: ../../library/asyncio-eventloop.rst:476 +#: ../../library/asyncio-eventloop.rst:580 +#: ../../library/asyncio-eventloop.rst:804 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." "BaseTransport.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:476 +#: ../../library/asyncio-eventloop.rst:480 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using " "``getaddrinfo()``, similarly to *host* and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:480 -#: ../../library/asyncio-eventloop.rst:891 +#: ../../library/asyncio-eventloop.rst:484 +#: ../../library/asyncio-eventloop.rst:895 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:484 -#: ../../library/asyncio-eventloop.rst:717 -#: ../../library/asyncio-eventloop.rst:811 -#: ../../library/asyncio-eventloop.rst:895 +#: ../../library/asyncio-eventloop.rst:488 +#: ../../library/asyncio-eventloop.rst:721 +#: ../../library/asyncio-eventloop.rst:815 +#: ../../library/asyncio-eventloop.rst:899 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:490 -#: ../../library/asyncio-eventloop.rst:729 +#: ../../library/asyncio-eventloop.rst:494 +#: ../../library/asyncio-eventloop.rst:733 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:494 +#: ../../library/asyncio-eventloop.rst:498 msgid "" "The socket option :py:data:`~socket.TCP_NODELAY` is set by default for all " "TCP connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:499 -#: ../../library/asyncio-eventloop.rst:821 +#: ../../library/asyncio-eventloop.rst:503 +#: ../../library/asyncio-eventloop.rst:825 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:503 +#: ../../library/asyncio-eventloop.rst:507 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "加入 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-eventloop.rst:505 +#: ../../library/asyncio-eventloop.rst:509 msgid "" "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " "IPv4 path and protocol are working, but the server's IPv6 path and protocol " @@ -689,69 +701,69 @@ msgid "" "visible delay and provides an algorithm." msgstr "" -#: ../../library/asyncio-eventloop.rst:514 +#: ../../library/asyncio-eventloop.rst:518 msgid "For more information: https://tools.ietf.org/html/rfc6555" msgstr "更多資訊請見:\\ https://tools.ietf.org/html/rfc6555" -#: ../../library/asyncio-eventloop.rst:518 -#: ../../library/asyncio-eventloop.rst:637 -#: ../../library/asyncio-eventloop.rst:743 -#: ../../library/asyncio-eventloop.rst:778 -#: ../../library/asyncio-eventloop.rst:825 -#: ../../library/asyncio-eventloop.rst:903 +#: ../../library/asyncio-eventloop.rst:522 +#: ../../library/asyncio-eventloop.rst:641 +#: ../../library/asyncio-eventloop.rst:747 +#: ../../library/asyncio-eventloop.rst:782 +#: ../../library/asyncio-eventloop.rst:829 +#: ../../library/asyncio-eventloop.rst:907 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:522 +#: ../../library/asyncio-eventloop.rst:526 msgid "" "The :func:`open_connection` function is a high-level alternative API. It " "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " "used directly in async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:532 +#: ../../library/asyncio-eventloop.rst:536 msgid "Create a datagram connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:534 +#: ../../library/asyncio-eventloop.rst:538 msgid "" "The socket family can be either :py:data:`~socket.AF_INET`, :py:data:" "`~socket.AF_INET6`, or :py:data:`~socket.AF_UNIX`, depending on *host* (or " "the *family* argument, if provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:538 +#: ../../library/asyncio-eventloop.rst:542 msgid "The socket type will be :py:data:`~socket.SOCK_DGRAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:540 -#: ../../library/asyncio-eventloop.rst:660 -#: ../../library/asyncio-eventloop.rst:792 +#: ../../library/asyncio-eventloop.rst:544 +#: ../../library/asyncio-eventloop.rst:664 +#: ../../library/asyncio-eventloop.rst:796 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:543 -#: ../../library/asyncio-eventloop.rst:619 +#: ../../library/asyncio-eventloop.rst:547 +#: ../../library/asyncio-eventloop.rst:623 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:547 +#: ../../library/asyncio-eventloop.rst:551 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using :" "meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:551 +#: ../../library/asyncio-eventloop.rst:555 msgid "" "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " "connect the socket to a remote address. The *remote_host* and *remote_port* " "are looked up using :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:555 +#: ../../library/asyncio-eventloop.rst:559 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " @@ -759,7 +771,7 @@ msgid "" "module constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:560 +#: ../../library/asyncio-eventloop.rst:564 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " @@ -768,13 +780,13 @@ msgid "" "this capability is unsupported." msgstr "" -#: ../../library/asyncio-eventloop.rst:566 +#: ../../library/asyncio-eventloop.rst:570 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." msgstr "" -#: ../../library/asyncio-eventloop.rst:569 +#: ../../library/asyncio-eventloop.rst:573 msgid "" "*sock* can optionally be specified in order to use a preexisting, already " "connected, :class:`socket.socket` object to be used by the transport. If " @@ -782,33 +794,33 @@ msgid "" "`None`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:580 +#: ../../library/asyncio-eventloop.rst:584 msgid "" "See :ref:`UDP echo client protocol ` and :" "ref:`UDP echo server protocol ` examples." msgstr "" -#: ../../library/asyncio-eventloop.rst:583 +#: ../../library/asyncio-eventloop.rst:587 msgid "" "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, " "*allow_broadcast*, and *sock* parameters were added." msgstr "" -#: ../../library/asyncio-eventloop.rst:587 +#: ../../library/asyncio-eventloop.rst:591 msgid "" "The *reuse_address* parameter is no longer supported, as using :py:data:" "`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " "Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:592 +#: ../../library/asyncio-eventloop.rst:596 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " "randomly distributed among the sockets." msgstr "" -#: ../../library/asyncio-eventloop.rst:596 +#: ../../library/asyncio-eventloop.rst:600 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " "similar functionality. With *reuse_port*, :py:data:`~sockets.SO_REUSEPORT` " @@ -816,95 +828,95 @@ msgid "" "from assigning sockets to the same socket address." msgstr "" -#: ../../library/asyncio-eventloop.rst:602 +#: ../../library/asyncio-eventloop.rst:606 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:605 +#: ../../library/asyncio-eventloop.rst:609 msgid "" "The *reuse_address* parameter, disabled since Python 3.9.0, 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" -#: ../../library/asyncio-eventloop.rst:614 +#: ../../library/asyncio-eventloop.rst:618 msgid "Create a Unix connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:616 +#: ../../library/asyncio-eventloop.rst:620 msgid "" "The socket family will be :py:data:`~socket.AF_UNIX`; socket type will be :" "py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:621 +#: ../../library/asyncio-eventloop.rst:625 msgid "" "*path* is the name of a Unix domain socket and is required, unless a *sock* " "parameter is specified. Abstract Unix sockets, :class:`str`, :class:" "`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:626 +#: ../../library/asyncio-eventloop.rst:630 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:629 -#: ../../library/asyncio-eventloop.rst:769 -#: ../../library/asyncio-eventloop.rst:1195 +#: ../../library/asyncio-eventloop.rst:633 +#: ../../library/asyncio-eventloop.rst:773 +#: ../../library/asyncio-eventloop.rst:1199 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncio-eventloop.rst:631 +#: ../../library/asyncio-eventloop.rst:635 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:641 +#: ../../library/asyncio-eventloop.rst:645 msgid "Creating network servers" msgstr "" -#: ../../library/asyncio-eventloop.rst:653 +#: ../../library/asyncio-eventloop.rst:657 msgid "" "Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: ../../library/asyncio-eventloop.rst:656 +#: ../../library/asyncio-eventloop.rst:660 msgid "Returns a :class:`Server` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:658 +#: ../../library/asyncio-eventloop.rst:662 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:663 +#: ../../library/asyncio-eventloop.rst:667 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: ../../library/asyncio-eventloop.rst:666 +#: ../../library/asyncio-eventloop.rst:670 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: ../../library/asyncio-eventloop.rst:669 +#: ../../library/asyncio-eventloop.rst:673 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "" -#: ../../library/asyncio-eventloop.rst:672 +#: ../../library/asyncio-eventloop.rst:676 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -#: ../../library/asyncio-eventloop.rst:676 +#: ../../library/asyncio-eventloop.rst:680 msgid "" "The *port* parameter can be set to specify which port the server should " "listen on. If ``0`` or ``None`` (the default), a random unused port will be " @@ -912,63 +924,63 @@ msgid "" "different random port will be selected for each interface)." msgstr "" -#: ../../library/asyncio-eventloop.rst:681 +#: ../../library/asyncio-eventloop.rst:685 msgid "" "*family* can be set to either :data:`socket.AF_INET` or :data:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :data:`~socket.AF_UNSPEC`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:686 +#: ../../library/asyncio-eventloop.rst:690 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:688 +#: ../../library/asyncio-eventloop.rst:692 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:693 +#: ../../library/asyncio-eventloop.rst:697 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:697 +#: ../../library/asyncio-eventloop.rst:701 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: ../../library/asyncio-eventloop.rst:700 +#: ../../library/asyncio-eventloop.rst:704 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:703 +#: ../../library/asyncio-eventloop.rst:707 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " "will automatically be set to ``True`` on Unix." msgstr "" -#: ../../library/asyncio-eventloop.rst:708 +#: ../../library/asyncio-eventloop.rst:712 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:713 +#: ../../library/asyncio-eventloop.rst:717 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " "seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:721 +#: ../../library/asyncio-eventloop.rst:725 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -976,44 +988,44 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:733 +#: ../../library/asyncio-eventloop.rst:737 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: ../../library/asyncio-eventloop.rst:737 +#: ../../library/asyncio-eventloop.rst:741 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " "option :py:data:`~socket.TCP_NODELAY` is set by default for all TCP " "connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:747 +#: ../../library/asyncio-eventloop.rst:751 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:758 +#: ../../library/asyncio-eventloop.rst:762 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:data:`~socket." "AF_UNIX` socket family." msgstr "" -#: ../../library/asyncio-eventloop.rst:761 +#: ../../library/asyncio-eventloop.rst:765 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " "and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:766 +#: ../../library/asyncio-eventloop.rst:770 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:773 +#: ../../library/asyncio-eventloop.rst:777 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -1021,63 +1033,63 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。\\ *path* 參數現在可為" "一個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:785 +#: ../../library/asyncio-eventloop.rst:789 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:787 +#: ../../library/asyncio-eventloop.rst:791 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "" -#: ../../library/asyncio-eventloop.rst:790 -#: ../../library/asyncio-eventloop.rst:877 +#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:881 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:795 +#: ../../library/asyncio-eventloop.rst:799 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:804 +#: ../../library/asyncio-eventloop.rst:808 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:807 +#: ../../library/asyncio-eventloop.rst:811 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:815 +#: ../../library/asyncio-eventloop.rst:819 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:829 +#: ../../library/asyncio-eventloop.rst:833 msgid "Transferring files" msgstr "" -#: ../../library/asyncio-eventloop.rst:834 +#: ../../library/asyncio-eventloop.rst:838 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:837 +#: ../../library/asyncio-eventloop.rst:841 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: ../../library/asyncio-eventloop.rst:839 +#: ../../library/asyncio-eventloop.rst:843 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:841 -#: ../../library/asyncio-eventloop.rst:1083 +#: ../../library/asyncio-eventloop.rst:845 +#: ../../library/asyncio-eventloop.rst:1087 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1086,35 +1098,35 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:848 +#: ../../library/asyncio-eventloop.rst:852 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " "SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:852 +#: ../../library/asyncio-eventloop.rst:856 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:859 +#: ../../library/asyncio-eventloop.rst:863 msgid "TLS Upgrade" msgstr "" -#: ../../library/asyncio-eventloop.rst:866 +#: ../../library/asyncio-eventloop.rst:870 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: ../../library/asyncio-eventloop.rst:868 +#: ../../library/asyncio-eventloop.rst:872 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " "protocol and *protocol*-facing transport." msgstr "" -#: ../../library/asyncio-eventloop.rst:872 +#: ../../library/asyncio-eventloop.rst:876 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1122,74 +1134,74 @@ msgid "" "exchanges extra TLS session packets with *transport*." msgstr "" -#: ../../library/asyncio-eventloop.rst:879 +#: ../../library/asyncio-eventloop.rst:883 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:883 +#: ../../library/asyncio-eventloop.rst:887 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:885 +#: ../../library/asyncio-eventloop.rst:889 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:888 +#: ../../library/asyncio-eventloop.rst:892 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:908 +#: ../../library/asyncio-eventloop.rst:912 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:912 +#: ../../library/asyncio-eventloop.rst:916 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: ../../library/asyncio-eventloop.rst:918 +#: ../../library/asyncio-eventloop.rst:922 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." msgstr "" -#: ../../library/asyncio-eventloop.rst:923 +#: ../../library/asyncio-eventloop.rst:927 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:927 -#: ../../library/asyncio-eventloop.rst:1182 +#: ../../library/asyncio-eventloop.rst:931 +#: ../../library/asyncio-eventloop.rst:1186 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:932 +#: ../../library/asyncio-eventloop.rst:936 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." msgstr "" -#: ../../library/asyncio-eventloop.rst:935 +#: ../../library/asyncio-eventloop.rst:939 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:940 +#: ../../library/asyncio-eventloop.rst:944 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:942 +#: ../../library/asyncio-eventloop.rst:946 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1198,72 +1210,72 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:951 +#: ../../library/asyncio-eventloop.rst:955 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:954 +#: ../../library/asyncio-eventloop.rst:958 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:956 -#: ../../library/asyncio-eventloop.rst:970 -#: ../../library/asyncio-eventloop.rst:981 -#: ../../library/asyncio-eventloop.rst:993 -#: ../../library/asyncio-eventloop.rst:1008 -#: ../../library/asyncio-eventloop.rst:1023 -#: ../../library/asyncio-eventloop.rst:1033 -#: ../../library/asyncio-eventloop.rst:1059 -#: ../../library/asyncio-eventloop.rst:1097 +#: ../../library/asyncio-eventloop.rst:960 +#: ../../library/asyncio-eventloop.rst:974 +#: ../../library/asyncio-eventloop.rst:985 +#: ../../library/asyncio-eventloop.rst:997 +#: ../../library/asyncio-eventloop.rst:1012 +#: ../../library/asyncio-eventloop.rst:1027 +#: ../../library/asyncio-eventloop.rst:1037 +#: ../../library/asyncio-eventloop.rst:1063 +#: ../../library/asyncio-eventloop.rst:1101 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:958 +#: ../../library/asyncio-eventloop.rst:962 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:965 +#: ../../library/asyncio-eventloop.rst:969 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:968 +#: ../../library/asyncio-eventloop.rst:972 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:976 +#: ../../library/asyncio-eventloop.rst:980 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:979 +#: ../../library/asyncio-eventloop.rst:983 msgid "Return a tuple of (received data, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:987 +#: ../../library/asyncio-eventloop.rst:991 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:991 +#: ../../library/asyncio-eventloop.rst:995 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:999 +#: ../../library/asyncio-eventloop.rst:1003 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1002 +#: ../../library/asyncio-eventloop.rst:1006 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1272,34 +1284,34 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1010 -#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:1014 +#: ../../library/asyncio-eventloop.rst:1065 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1017 +#: ../../library/asyncio-eventloop.rst:1021 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1021 +#: ../../library/asyncio-eventloop.rst:1025 msgid "Return the number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1029 +#: ../../library/asyncio-eventloop.rst:1033 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1031 +#: ../../library/asyncio-eventloop.rst:1035 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1035 +#: ../../library/asyncio-eventloop.rst:1039 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1307,19 +1319,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1044 +#: ../../library/asyncio-eventloop.rst:1048 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1050 +#: ../../library/asyncio-eventloop.rst:1054 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1053 +#: ../../library/asyncio-eventloop.rst:1057 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1327,57 +1339,57 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1068 +#: ../../library/asyncio-eventloop.rst:1072 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:1073 +#: ../../library/asyncio-eventloop.rst:1077 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1076 +#: ../../library/asyncio-eventloop.rst:1080 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1078 +#: ../../library/asyncio-eventloop.rst:1082 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1081 +#: ../../library/asyncio-eventloop.rst:1085 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1090 +#: ../../library/asyncio-eventloop.rst:1094 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1094 +#: ../../library/asyncio-eventloop.rst:1098 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1103 +#: ../../library/asyncio-eventloop.rst:1107 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1108 +#: ../../library/asyncio-eventloop.rst:1112 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1112 +#: ../../library/asyncio-eventloop.rst:1116 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1114 +#: ../../library/asyncio-eventloop.rst:1118 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1385,67 +1397,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:1122 +#: ../../library/asyncio-eventloop.rst:1126 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:1126 +#: ../../library/asyncio-eventloop.rst:1130 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1131 +#: ../../library/asyncio-eventloop.rst:1135 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1133 +#: ../../library/asyncio-eventloop.rst:1137 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1137 -#: ../../library/asyncio-eventloop.rst:1153 +#: ../../library/asyncio-eventloop.rst:1141 +#: ../../library/asyncio-eventloop.rst:1157 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1142 +#: ../../library/asyncio-eventloop.rst:1146 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1147 +#: ../../library/asyncio-eventloop.rst:1151 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1149 +#: ../../library/asyncio-eventloop.rst:1153 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1158 +#: ../../library/asyncio-eventloop.rst:1162 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1163 +#: ../../library/asyncio-eventloop.rst:1167 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1168 +#: ../../library/asyncio-eventloop.rst:1172 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1172 +#: ../../library/asyncio-eventloop.rst:1176 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1174 +#: ../../library/asyncio-eventloop.rst:1178 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1453,46 +1465,46 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1179 +#: ../../library/asyncio-eventloop.rst:1183 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1185 +#: ../../library/asyncio-eventloop.rst:1189 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1190 +#: ../../library/asyncio-eventloop.rst:1194 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1192 +#: ../../library/asyncio-eventloop.rst:1196 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1199 +#: ../../library/asyncio-eventloop.rst:1203 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1203 +#: ../../library/asyncio-eventloop.rst:1207 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1207 +#: ../../library/asyncio-eventloop.rst:1211 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1209 +#: ../../library/asyncio-eventloop.rst:1213 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1254 +#: ../../library/asyncio-eventloop.rst:1258 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1500,17 +1512,17 @@ msgid "" "importing of main module `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1259 +#: ../../library/asyncio-eventloop.rst:1263 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1261 +#: ../../library/asyncio-eventloop.rst:1265 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1264 +#: ../../library/asyncio-eventloop.rst:1268 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1518,32 +1530,32 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1273 +#: ../../library/asyncio-eventloop.rst:1277 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1277 +#: ../../library/asyncio-eventloop.rst:1281 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1283 +#: ../../library/asyncio-eventloop.rst:1287 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1285 +#: ../../library/asyncio-eventloop.rst:1289 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1289 +#: ../../library/asyncio-eventloop.rst:1293 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1291 +#: ../../library/asyncio-eventloop.rst:1295 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1552,158 +1564,158 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1301 +#: ../../library/asyncio-eventloop.rst:1305 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1308 +#: ../../library/asyncio-eventloop.rst:1312 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1310 +#: ../../library/asyncio-eventloop.rst:1314 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1314 +#: ../../library/asyncio-eventloop.rst:1318 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1319 +#: ../../library/asyncio-eventloop.rst:1323 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1321 +#: ../../library/asyncio-eventloop.rst:1325 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1324 +#: ../../library/asyncio-eventloop.rst:1328 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1325 +#: ../../library/asyncio-eventloop.rst:1329 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1326 +#: ../../library/asyncio-eventloop.rst:1330 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1327 +#: ../../library/asyncio-eventloop.rst:1331 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1328 +#: ../../library/asyncio-eventloop.rst:1332 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1329 +#: ../../library/asyncio-eventloop.rst:1333 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1330 +#: ../../library/asyncio-eventloop.rst:1334 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1331 +#: ../../library/asyncio-eventloop.rst:1335 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1333 +#: ../../library/asyncio-eventloop.rst:1337 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1333 +#: ../../library/asyncio-eventloop.rst:1337 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1337 +#: ../../library/asyncio-eventloop.rst:1341 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1342 +#: ../../library/asyncio-eventloop.rst:1346 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1346 +#: ../../library/asyncio-eventloop.rst:1350 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1348 +#: ../../library/asyncio-eventloop.rst:1352 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1354 +#: ../../library/asyncio-eventloop.rst:1358 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1358 +#: ../../library/asyncio-eventloop.rst:1362 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1363 +#: ../../library/asyncio-eventloop.rst:1367 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1367 +#: ../../library/asyncio-eventloop.rst:1371 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1369 +#: ../../library/asyncio-eventloop.rst:1373 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1376 +#: ../../library/asyncio-eventloop.rst:1380 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1385 +#: ../../library/asyncio-eventloop.rst:1389 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1388 +#: ../../library/asyncio-eventloop.rst:1392 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1390 +#: ../../library/asyncio-eventloop.rst:1394 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1391 +#: ../../library/asyncio-eventloop.rst:1395 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1394 +#: ../../library/asyncio-eventloop.rst:1398 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1398 +#: ../../library/asyncio-eventloop.rst:1402 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1711,136 +1723,136 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1404 +#: ../../library/asyncio-eventloop.rst:1408 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1407 +#: ../../library/asyncio-eventloop.rst:1411 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1409 +#: ../../library/asyncio-eventloop.rst:1413 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1411 +#: ../../library/asyncio-eventloop.rst:1415 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard input stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1414 -#: ../../library/asyncio-eventloop.rst:1426 -#: ../../library/asyncio-eventloop.rst:1438 +#: ../../library/asyncio-eventloop.rst:1418 +#: ../../library/asyncio-eventloop.rst:1430 +#: ../../library/asyncio-eventloop.rst:1442 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1416 -#: ../../library/asyncio-eventloop.rst:1428 -#: ../../library/asyncio-eventloop.rst:1440 +#: ../../library/asyncio-eventloop.rst:1420 +#: ../../library/asyncio-eventloop.rst:1432 +#: ../../library/asyncio-eventloop.rst:1444 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1418 -#: ../../library/asyncio-eventloop.rst:1430 -#: ../../library/asyncio-eventloop.rst:1442 +#: ../../library/asyncio-eventloop.rst:1422 +#: ../../library/asyncio-eventloop.rst:1434 +#: ../../library/asyncio-eventloop.rst:1446 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1421 +#: ../../library/asyncio-eventloop.rst:1425 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1423 +#: ../../library/asyncio-eventloop.rst:1427 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard output stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1433 +#: ../../library/asyncio-eventloop.rst:1437 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1435 +#: ../../library/asyncio-eventloop.rst:1439 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard error stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1444 +#: ../../library/asyncio-eventloop.rst:1448 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1447 +#: ../../library/asyncio-eventloop.rst:1451 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1452 +#: ../../library/asyncio-eventloop.rst:1456 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1456 +#: ../../library/asyncio-eventloop.rst:1460 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1459 +#: ../../library/asyncio-eventloop.rst:1463 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1467 +#: ../../library/asyncio-eventloop.rst:1471 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1472 +#: ../../library/asyncio-eventloop.rst:1476 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1475 +#: ../../library/asyncio-eventloop.rst:1479 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1478 +#: ../../library/asyncio-eventloop.rst:1482 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1481 +#: ../../library/asyncio-eventloop.rst:1485 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1486 +#: ../../library/asyncio-eventloop.rst:1490 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1850,105 +1862,105 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1495 +#: ../../library/asyncio-eventloop.rst:1499 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1499 +#: ../../library/asyncio-eventloop.rst:1503 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1504 +#: ../../library/asyncio-eventloop.rst:1508 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1509 +#: ../../library/asyncio-eventloop.rst:1513 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1515 +#: ../../library/asyncio-eventloop.rst:1519 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1518 +#: ../../library/asyncio-eventloop.rst:1522 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1522 +#: ../../library/asyncio-eventloop.rst:1526 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1524 +#: ../../library/asyncio-eventloop.rst:1528 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1531 +#: ../../library/asyncio-eventloop.rst:1535 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1533 +#: ../../library/asyncio-eventloop.rst:1537 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1537 +#: ../../library/asyncio-eventloop.rst:1541 msgid "Do not instantiate the class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1541 +#: ../../library/asyncio-eventloop.rst:1545 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1554 +#: ../../library/asyncio-eventloop.rst:1558 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1559 +#: ../../library/asyncio-eventloop.rst:1563 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1562 +#: ../../library/asyncio-eventloop.rst:1566 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1565 +#: ../../library/asyncio-eventloop.rst:1569 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1570 +#: ../../library/asyncio-eventloop.rst:1574 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1576 +#: ../../library/asyncio-eventloop.rst:1580 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1578 +#: ../../library/asyncio-eventloop.rst:1582 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1581 +#: ../../library/asyncio-eventloop.rst:1585 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -1957,96 +1969,96 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1592 +#: ../../library/asyncio-eventloop.rst:1596 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1596 +#: ../../library/asyncio-eventloop.rst:1600 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1618 +#: ../../library/asyncio-eventloop.rst:1622 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1624 +#: ../../library/asyncio-eventloop.rst:1628 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1628 +#: ../../library/asyncio-eventloop.rst:1632 msgid "List of :class:`socket.socket` objects the server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1630 +#: ../../library/asyncio-eventloop.rst:1634 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1640 +#: ../../library/asyncio-eventloop.rst:1644 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1642 +#: ../../library/asyncio-eventloop.rst:1646 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1645 +#: ../../library/asyncio-eventloop.rst:1649 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1651 +#: ../../library/asyncio-eventloop.rst:1655 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1653 +#: ../../library/asyncio-eventloop.rst:1657 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1668 +#: ../../library/asyncio-eventloop.rst:1672 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1673 +#: ../../library/asyncio-eventloop.rst:1677 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1675 +#: ../../library/asyncio-eventloop.rst:1679 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1679 +#: ../../library/asyncio-eventloop.rst:1683 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1685 +#: ../../library/asyncio-eventloop.rst:1689 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1687 +#: ../../library/asyncio-eventloop.rst:1691 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1693 +#: ../../library/asyncio-eventloop.rst:1697 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1695 +#: ../../library/asyncio-eventloop.rst:1699 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2054,70 +2066,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1705 +#: ../../library/asyncio-eventloop.rst:1709 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1707 +#: ../../library/asyncio-eventloop.rst:1711 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1731 +#: ../../library/asyncio-eventloop.rst:1735 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1738 +#: ../../library/asyncio-eventloop.rst:1742 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1740 +#: ../../library/asyncio-eventloop.rst:1744 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1768 +#: ../../library/asyncio-eventloop.rst:1772 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1775 +#: ../../library/asyncio-eventloop.rst:1779 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1777 +#: ../../library/asyncio-eventloop.rst:1781 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1815 +#: ../../library/asyncio-eventloop.rst:1819 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1819 +#: ../../library/asyncio-eventloop.rst:1823 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1827 +#: ../../library/asyncio-eventloop.rst:1831 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1829 +#: ../../library/asyncio-eventloop.rst:1833 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1831 +#: ../../library/asyncio-eventloop.rst:1835 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" From c9c3d6ade9f30b54f067e48bef7d38cabf7b28c2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 22 Feb 2023 00:33:11 +0000 Subject: [PATCH 031/130] sync with cpython 3bfa608c --- library/queue.po | 15 +- library/stdtypes.po | 4 +- library/traceback.po | 160 +++++----- library/types.po | 6 +- library/wsgiref.po | 8 +- reference/compound_stmts.po | 572 +++++++++++++++++---------------- reference/datamodel.po | 616 ++++++++++++++++++------------------ 7 files changed, 691 insertions(+), 690 deletions(-) diff --git a/library/queue.po b/library/queue.po index c278b4c8b2..4bc739ef99 100644 --- a/library/queue.po +++ b/library/queue.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-03 00:22+0000\n" +"POT-Creation-Date: 2023-02-22 00:30+0000\n" "PO-Revision-Date: 2022-09-27 00:12+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -116,9 +116,10 @@ msgstr "" "於零,則佇列大小為無限。" #: ../../library/queue.rst:59 +#, fuzzy msgid "" "The lowest valued entries are retrieved first (the lowest valued entry is " -"the one returned by ``sorted(list(entries))[0]``). A typical pattern for " +"the one that would be returned by ``min(entries)``). A typical pattern for " "entries is a tuple in the form: ``(priority_number, data)``." msgstr "" "最低值的條目會最先被取出(最低值的條目是被 ``sorted(list(entries))[0]`` 回傳" @@ -211,11 +212,11 @@ msgid "" "is immediately available, else raise the :exc:`Full` exception (*timeout* is " "ignored in that case)." msgstr "" -"將 *item* 放入佇列中。如果可選的 args *block* 為 true、*timeout* 為 ``None``" -"\\ (預設值),則在必要時阻塞,直到自由槽 (free slot) 可用。如果 *timeout* 為" -"正數,則最多阻塞 *timeout* 秒,如果該時間內沒有可用的自由槽,則會引發 :exc:" -"`Full` 例外。否則(*block* 為 false),如果自由槽立即可用,則將項目放在佇列" -"中,否則引發 :exc:`Full` 例外(在這種情況下,*timeout* 將被忽略)。" +"將 *item* 放入佇列中。如果可選的 args *block* 為 true、*timeout* 為 " +"``None``\\ (預設值),則在必要時阻塞,直到自由槽 (free slot) 可用。如果 " +"*timeout* 為正數,則最多阻塞 *timeout* 秒,如果該時間內沒有可用的自由槽,則會" +"引發 :exc:`Full` 例外。否則(*block* 為 false),如果自由槽立即可用,則將項目" +"放在佇列中,否則引發 :exc:`Full` 例外(在這種情況下,*timeout* 將被忽略)。" #: ../../library/queue.rst:141 msgid "Equivalent to ``put(item, block=False)``." diff --git a/library/stdtypes.po b/library/stdtypes.po index e6be6b1993..0b8ee41f65 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:32+0000\n" +"POT-Creation-Date: 2023-02-22 00:30+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -145,7 +145,7 @@ msgid "``x or y``" msgstr "``x or y``" #: ../../library/stdtypes.rst:87 -msgid "if *x* is false, then *y*, else *x*" +msgid "if *x* is true, then *x*, else *y*" msgstr "" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 diff --git a/library/traceback.po b/library/traceback.po index 95d2b61ad9..cd842f0334 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-05 00:35+0000\n" +"POT-Creation-Date: 2023-02-22 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,34 +37,34 @@ msgstr "" #: ../../library/traceback.rst:19 msgid "" -"The module uses traceback objects --- this is the object type that is stored " -"in the :data:`sys.last_traceback` variable and returned as the third item " -"from :func:`sys.exc_info`." +"The module uses traceback objects --- these are objects of type :class:" +"`types.TracebackType`, which are assigned to the ``__traceback__`` field of :" +"class:`BaseException` instances." msgstr "" -#: ../../library/traceback.rst:26 +#: ../../library/traceback.rst:25 msgid "Module :mod:`faulthandler`" msgstr "" -#: ../../library/traceback.rst:26 +#: ../../library/traceback.rst:25 msgid "" "Used to dump Python tracebacks explicitly, on a fault, after a timeout, or " "on a user signal." msgstr "" -#: ../../library/traceback.rst:28 +#: ../../library/traceback.rst:27 msgid "Module :mod:`pdb`" msgstr "" -#: ../../library/traceback.rst:29 +#: ../../library/traceback.rst:28 msgid "Interactive source code debugger for Python programs." msgstr "" -#: ../../library/traceback.rst:31 +#: ../../library/traceback.rst:30 msgid "The module defines the following functions:" msgstr "" -#: ../../library/traceback.rst:35 +#: ../../library/traceback.rst:34 msgid "" "Print up to *limit* stack trace entries from traceback object *tb* (starting " "from the caller's frame) if *limit* is positive. Otherwise, print the last " @@ -74,41 +74,41 @@ msgid "" "the output." msgstr "" -#: ../../library/traceback.rst:42 ../../library/traceback.rst:105 +#: ../../library/traceback.rst:41 ../../library/traceback.rst:104 msgid "Added negative *limit* support." msgstr "" -#: ../../library/traceback.rst:49 +#: ../../library/traceback.rst:48 msgid "" "Print exception information and stack trace entries from traceback object " "*tb* to *file*. This differs from :func:`print_tb` in the following ways:" msgstr "" -#: ../../library/traceback.rst:53 +#: ../../library/traceback.rst:52 msgid "" "if *tb* is not ``None``, it prints a header ``Traceback (most recent call " "last):``" msgstr "" -#: ../../library/traceback.rst:56 +#: ../../library/traceback.rst:55 msgid "it prints the exception type and *value* after the stack trace" msgstr "" -#: ../../library/traceback.rst:60 +#: ../../library/traceback.rst:59 msgid "" "if *type(value)* is :exc:`SyntaxError` and *value* has the appropriate " "format, it prints the line where the syntax error occurred with a caret " "indicating the approximate position of the error." msgstr "" -#: ../../library/traceback.rst:64 +#: ../../library/traceback.rst:63 msgid "" "Since Python 3.10, instead of passing *value* and *tb*, an exception object " "can be passed as the first argument. If *value* and *tb* are provided, the " "first argument is ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:68 +#: ../../library/traceback.rst:67 msgid "" "The optional *limit* argument has the same meaning as for :func:`print_tb`. " "If *chain* is true (the default), then chained exceptions (the :attr:" @@ -117,29 +117,29 @@ msgid "" "exception." msgstr "" -#: ../../library/traceback.rst:74 ../../library/traceback.rst:167 +#: ../../library/traceback.rst:73 ../../library/traceback.rst:166 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" -#: ../../library/traceback.rst:77 ../../library/traceback.rst:154 +#: ../../library/traceback.rst:76 ../../library/traceback.rst:153 msgid "" "The *etype* parameter has been renamed to *exc* and is now positional-only." msgstr "" -#: ../../library/traceback.rst:84 +#: ../../library/traceback.rst:83 msgid "" -"This is a shorthand for ``print_exception(*sys.exc_info(), limit, file, " +"This is a shorthand for ``print_exception(sys.exception(), limit, file, " "chain)``." msgstr "" -#: ../../library/traceback.rst:90 +#: ../../library/traceback.rst:89 msgid "" "This is a shorthand for ``print_exception(sys.last_type, sys.last_value, sys." "last_traceback, limit, file, chain)``. In general it will work only after " "an exception has reached an interactive prompt (see :data:`sys.last_type`)." msgstr "" -#: ../../library/traceback.rst:98 +#: ../../library/traceback.rst:97 msgid "" "Print up to *limit* stack trace entries (starting from the invocation point) " "if *limit* is positive. Otherwise, print the last ``abs(limit)`` entries. " @@ -148,7 +148,7 @@ msgid "" "optional *file* argument has the same meaning as for :func:`print_tb`." msgstr "" -#: ../../library/traceback.rst:111 +#: ../../library/traceback.rst:110 msgid "" "Return a :class:`StackSummary` object representing a list of \"pre-" "processed\" stack trace entries extracted from the traceback object *tb*. " @@ -162,14 +162,14 @@ msgid "" "stripped; if the source is not available it is ``None``." msgstr "" -#: ../../library/traceback.rst:125 +#: ../../library/traceback.rst:124 msgid "" "Extract the raw traceback from the current stack frame. The return value " "has the same format as for :func:`extract_tb`. The optional *f* and *limit* " "arguments have the same meaning as for :func:`print_stack`." msgstr "" -#: ../../library/traceback.rst:132 +#: ../../library/traceback.rst:131 msgid "" "Given a list of tuples or :class:`FrameSummary` objects as returned by :func:" "`extract_tb` or :func:`extract_stack`, return a list of strings ready for " @@ -179,7 +179,7 @@ msgid "" "text line is not ``None``." msgstr "" -#: ../../library/traceback.rst:142 +#: ../../library/traceback.rst:141 msgid "" "Format the exception part of a traceback using an exception value such as " "given by ``sys.last_value``. The return value is a list of strings, each " @@ -190,14 +190,14 @@ msgid "" "the list." msgstr "" -#: ../../library/traceback.rst:150 +#: ../../library/traceback.rst:149 msgid "" "Since Python 3.10, instead of passing *value*, an exception object can be " "passed as the first argument. If *value* is provided, the first argument is " "ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:161 +#: ../../library/traceback.rst:160 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -206,66 +206,66 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: ../../library/traceback.rst:170 +#: ../../library/traceback.rst:169 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: ../../library/traceback.rst:177 +#: ../../library/traceback.rst:176 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: ../../library/traceback.rst:183 +#: ../../library/traceback.rst:182 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "" -#: ../../library/traceback.rst:188 +#: ../../library/traceback.rst:187 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "" -#: ../../library/traceback.rst:192 +#: ../../library/traceback.rst:191 msgid "" "Clears the local variables of all the stack frames in a traceback *tb* by " "calling the :meth:`clear` method of each frame object." msgstr "" -#: ../../library/traceback.rst:199 +#: ../../library/traceback.rst:198 msgid "" "Walk a stack following ``f.f_back`` from the given frame, yielding the frame " "and line number for each frame. If *f* is ``None``, the current stack is " "used. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:207 +#: ../../library/traceback.rst:206 msgid "" "Walk a traceback following ``tb_next`` yielding the frame and line number " "for each frame. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:212 +#: ../../library/traceback.rst:211 msgid "The module also defines the following classes:" msgstr "" -#: ../../library/traceback.rst:215 +#: ../../library/traceback.rst:214 msgid ":class:`TracebackException` Objects" msgstr ":class:`TracebackException` 物件" -#: ../../library/traceback.rst:219 +#: ../../library/traceback.rst:218 msgid "" ":class:`TracebackException` objects are created from actual exceptions to " "capture data for later printing in a lightweight fashion." msgstr "" -#: ../../library/traceback.rst:224 ../../library/traceback.rst:284 +#: ../../library/traceback.rst:223 ../../library/traceback.rst:283 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." msgstr "" -#: ../../library/traceback.rst:227 +#: ../../library/traceback.rst:226 msgid "" "If *compact* is true, only data that is required by :class:" "`TracebackException`'s ``format`` method is saved in the class attributes. " @@ -273,122 +273,122 @@ msgid "" "is ``None`` and ``__suppress_context__`` is false." msgstr "" -#: ../../library/traceback.rst:232 ../../library/traceback.rst:287 +#: ../../library/traceback.rst:231 ../../library/traceback.rst:286 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:236 +#: ../../library/traceback.rst:235 msgid "A :class:`TracebackException` of the original ``__cause__``." msgstr "" -#: ../../library/traceback.rst:240 +#: ../../library/traceback.rst:239 msgid "A :class:`TracebackException` of the original ``__context__``." msgstr "" -#: ../../library/traceback.rst:244 +#: ../../library/traceback.rst:243 msgid "The ``__suppress_context__`` value from the original exception." msgstr "" -#: ../../library/traceback.rst:248 +#: ../../library/traceback.rst:247 msgid "" "The ``__notes__`` value from the original exception, or ``None`` if the " "exception does not have any notes. If it is not ``None`` is it formatted in " "the traceback after the exception string." msgstr "" -#: ../../library/traceback.rst:256 +#: ../../library/traceback.rst:255 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:260 +#: ../../library/traceback.rst:259 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:264 +#: ../../library/traceback.rst:263 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:268 +#: ../../library/traceback.rst:267 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:272 +#: ../../library/traceback.rst:271 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:276 +#: ../../library/traceback.rst:275 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:280 +#: ../../library/traceback.rst:279 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:291 +#: ../../library/traceback.rst:290 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:298 +#: ../../library/traceback.rst:297 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:300 +#: ../../library/traceback.rst:299 msgid "" "If *chain* is not ``True``, ``__cause__`` and ``__context__`` will not be " "formatted." msgstr "" -#: ../../library/traceback.rst:303 +#: ../../library/traceback.rst:302 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: ../../library/traceback.rst:307 ../../library/traceback.rst:321 +#: ../../library/traceback.rst:306 ../../library/traceback.rst:320 msgid "" "The message indicating which exception occurred is always the last string in " "the output." msgstr "" -#: ../../library/traceback.rst:312 +#: ../../library/traceback.rst:311 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:314 +#: ../../library/traceback.rst:313 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:316 +#: ../../library/traceback.rst:315 msgid "" "Normally, the generator emits a single string; however, for :exc:" "`SyntaxError` exceptions, it emits several lines that (when printed) display " "detailed information about where the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:324 +#: ../../library/traceback.rst:323 msgid "Added the *compact* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/traceback.rst:329 +#: ../../library/traceback.rst:328 msgid ":class:`StackSummary` Objects" msgstr ":class:`StackSummary` 物件" -#: ../../library/traceback.rst:333 +#: ../../library/traceback.rst:332 msgid "" ":class:`StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:339 +#: ../../library/traceback.rst:338 msgid "" "Construct a :class:`StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: ../../library/traceback.rst:343 +#: ../../library/traceback.rst:342 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -398,14 +398,14 @@ msgid "" "class:`FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:353 +#: ../../library/traceback.rst:352 msgid "" "Construct a :class:`StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with filename, lineno, name, line as the elements." msgstr "" -#: ../../library/traceback.rst:359 +#: ../../library/traceback.rst:358 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single frame from the stack. Each string ends in a " @@ -413,18 +413,18 @@ msgid "" "with source text lines." msgstr "" -#: ../../library/traceback.rst:364 +#: ../../library/traceback.rst:363 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: ../../library/traceback.rst:368 +#: ../../library/traceback.rst:367 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:373 +#: ../../library/traceback.rst:372 msgid "" "Returns a string for printing one of the frames involved in the stack. This " "method is called for each :class:`FrameSummary` object to be printed by :" @@ -432,16 +432,16 @@ msgid "" "from the output." msgstr "" -#: ../../library/traceback.rst:382 +#: ../../library/traceback.rst:381 msgid ":class:`FrameSummary` Objects" msgstr ":class:`FrameSummary` 物件" -#: ../../library/traceback.rst:386 +#: ../../library/traceback.rst:385 msgid "" "A :class:`FrameSummary` object represents a single frame in a traceback." msgstr "" -#: ../../library/traceback.rst:390 +#: ../../library/traceback.rst:389 msgid "" "Represent a single frame in the traceback or stack that is being formatted " "or printed. It may optionally have a stringified version of the frames " @@ -454,11 +454,11 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:403 +#: ../../library/traceback.rst:402 msgid "Traceback Examples" msgstr "" -#: ../../library/traceback.rst:405 +#: ../../library/traceback.rst:404 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -466,22 +466,22 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:427 +#: ../../library/traceback.rst:426 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:462 +#: ../../library/traceback.rst:461 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:504 +#: ../../library/traceback.rst:503 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:530 +#: ../../library/traceback.rst:529 msgid "This last example demonstrates the final few formatting functions:" msgstr "" diff --git a/library/types.po b/library/types.po index 327e5d470d..5f04014c18 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-22 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -366,7 +366,9 @@ msgid "The type of :ref:`union type expressions`." msgstr "" #: ../../library/types.rst:323 -msgid "The type of traceback objects such as found in ``sys.exc_info()[2]``." +msgid "" +"The type of traceback objects such as found in ``sys.exception()." +"__traceback__``." msgstr "" #: ../../library/types.rst:325 diff --git a/library/wsgiref.po b/library/wsgiref.po index 649205a079..0443ad38a5 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-26 00:17+0000\n" +"POT-Creation-Date: 2023-02-22 00:30+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -740,9 +740,9 @@ msgstr "" #: ../../library/wsgiref.rst:677 msgid "" -"This method can access the current error information using ``sys." -"exc_info()``, and should pass that information to *start_response* when " -"calling it (as described in the \"Error Handling\" section of :pep:`3333`)." +"This method can access the current error using ``sys.exception()``, and " +"should pass that information to *start_response* when calling it (as " +"described in the \"Error Handling\" section of :pep:`3333`)." msgstr "" #: ../../library/wsgiref.rst:681 diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index d5c8d46ea6..b2165348b6 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-05 00:16+0000\n" +"POT-Creation-Date: 2023-02-22 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -263,20 +263,18 @@ msgstr "" #: ../../reference/compound_stmts.rst:303 msgid "" -"Before an :keyword:`!except` clause's suite is executed, details about the " -"exception are stored in the :mod:`sys` module and can be accessed via :func:" -"`sys.exc_info`. :func:`sys.exc_info` returns a 3-tuple consisting of the " -"exception class, the exception instance and a traceback object (see section :" -"ref:`types`) identifying the point in the program where the exception " -"occurred. The details about the exception accessed via :func:`sys.exc_info` " -"are restored to their previous values when leaving an exception handler::" +"Before an :keyword:`!except` clause's suite is executed, the exception is " +"stored in the :mod:`sys` module, where it can be accessed from within the " +"body of the :keyword:`!except` clause by calling :func:`sys.exception`. When " +"leaving an exception handler, the exception stored in the :mod:`sys` module " +"is reset to its previous value::" msgstr "" -#: ../../reference/compound_stmts.rst:337 +#: ../../reference/compound_stmts.rst:334 msgid ":keyword:`!except*` clause" msgstr "" -#: ../../reference/compound_stmts.rst:339 +#: ../../reference/compound_stmts.rst:336 msgid "" "The :keyword:`!except*` clause(s) are used for handling :exc:" "`ExceptionGroup`\\s. The exception type for matching is interpreted as in " @@ -289,21 +287,21 @@ msgid "" "that matches it. ::" msgstr "" -#: ../../reference/compound_stmts.rst:367 +#: ../../reference/compound_stmts.rst:364 msgid "" "Any remaining exceptions that were not handled by any :keyword:`!except*` " "clause are re-raised at the end, combined into an exception group along with " "all exceptions that were raised from within :keyword:`!except*` clauses." msgstr "" -#: ../../reference/compound_stmts.rst:371 +#: ../../reference/compound_stmts.rst:368 msgid "" "If the raised exception is not an exception group and its type matches one " "of the :keyword:`!except*` clauses, it is caught and wrapped by an exception " "group with an empty message string. ::" msgstr "" -#: ../../reference/compound_stmts.rst:382 +#: ../../reference/compound_stmts.rst:379 msgid "" "An :keyword:`!except*` clause must have a matching type, and this type " "cannot be a subclass of :exc:`BaseExceptionGroup`. It is not possible to " @@ -312,11 +310,11 @@ msgid "" "an :keyword:`!except*` clause." msgstr "" -#: ../../reference/compound_stmts.rst:399 +#: ../../reference/compound_stmts.rst:396 msgid ":keyword:`!else` clause" msgstr "" -#: ../../reference/compound_stmts.rst:401 +#: ../../reference/compound_stmts.rst:398 msgid "" "The optional :keyword:`!else` clause is executed if the control flow leaves " "the :keyword:`try` suite, no exception was raised, and no :keyword:" @@ -325,11 +323,11 @@ msgid "" "keyword:`except` clauses." msgstr "" -#: ../../reference/compound_stmts.rst:413 +#: ../../reference/compound_stmts.rst:410 msgid ":keyword:`!finally` clause" msgstr "" -#: ../../reference/compound_stmts.rst:415 +#: ../../reference/compound_stmts.rst:412 msgid "" "If :keyword:`!finally` is present, it specifies a 'cleanup' handler. The :" "keyword:`try` clause is executed, including any :keyword:`except` and :" @@ -343,13 +341,13 @@ msgid "" "exception is discarded::" msgstr "" -#: ../../reference/compound_stmts.rst:434 +#: ../../reference/compound_stmts.rst:431 msgid "" "The exception information is not available to the program during execution " "of the :keyword:`!finally` clause." msgstr "" -#: ../../reference/compound_stmts.rst:442 +#: ../../reference/compound_stmts.rst:439 msgid "" "When a :keyword:`return`, :keyword:`break` or :keyword:`continue` statement " "is executed in the :keyword:`try` suite of a :keyword:`!try`...\\ :keyword:`!" @@ -357,7 +355,7 @@ msgid "" "way out.'" msgstr "" -#: ../../reference/compound_stmts.rst:446 +#: ../../reference/compound_stmts.rst:443 msgid "" "The return value of a function is determined by the last :keyword:`return` " "statement executed. Since the :keyword:`!finally` clause always executes, " @@ -365,17 +363,17 @@ msgid "" "will always be the last one executed::" msgstr "" -#: ../../reference/compound_stmts.rst:460 +#: ../../reference/compound_stmts.rst:457 msgid "" "Prior to Python 3.8, a :keyword:`continue` statement was illegal in the :" "keyword:`!finally` clause due to a problem with the implementation." msgstr "" -#: ../../reference/compound_stmts.rst:469 +#: ../../reference/compound_stmts.rst:466 msgid "The :keyword:`!with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:478 +#: ../../reference/compound_stmts.rst:475 msgid "" "The :keyword:`with` statement is used to wrap the execution of a block with " "methods defined by a context manager (see section :ref:`context-managers`). " @@ -383,37 +381,37 @@ msgid "" "`finally` usage patterns to be encapsulated for convenient reuse." msgstr "" -#: ../../reference/compound_stmts.rst:488 +#: ../../reference/compound_stmts.rst:485 msgid "" "The execution of the :keyword:`with` statement with one \"item\" proceeds as " "follows:" msgstr "" -#: ../../reference/compound_stmts.rst:490 +#: ../../reference/compound_stmts.rst:487 msgid "" "The context expression (the expression given in the :token:`~python-grammar:" "with_item`) is evaluated to obtain a context manager." msgstr "" -#: ../../reference/compound_stmts.rst:493 +#: ../../reference/compound_stmts.rst:490 msgid "The context manager's :meth:`__enter__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:495 +#: ../../reference/compound_stmts.rst:492 msgid "The context manager's :meth:`__exit__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:497 +#: ../../reference/compound_stmts.rst:494 msgid "The context manager's :meth:`__enter__` method is invoked." msgstr "" -#: ../../reference/compound_stmts.rst:499 +#: ../../reference/compound_stmts.rst:496 msgid "" "If a target was included in the :keyword:`with` statement, the return value " "from :meth:`__enter__` is assigned to it." msgstr "" -#: ../../reference/compound_stmts.rst:504 +#: ../../reference/compound_stmts.rst:501 msgid "" "The :keyword:`with` statement guarantees that if the :meth:`__enter__` " "method returns without an error, then :meth:`__exit__` will always be " @@ -422,11 +420,11 @@ msgid "" "See step 7 below." msgstr "" -#: ../../reference/compound_stmts.rst:510 +#: ../../reference/compound_stmts.rst:507 msgid "The suite is executed." msgstr "" -#: ../../reference/compound_stmts.rst:512 +#: ../../reference/compound_stmts.rst:509 msgid "" "The context manager's :meth:`__exit__` method is invoked. If an exception " "caused the suite to be exited, its type, value, and traceback are passed as " @@ -434,7 +432,7 @@ msgid "" "supplied." msgstr "" -#: ../../reference/compound_stmts.rst:517 +#: ../../reference/compound_stmts.rst:514 msgid "" "If the suite was exited due to an exception, and the return value from the :" "meth:`__exit__` method was false, the exception is reraised. If the return " @@ -442,119 +440,119 @@ msgid "" "the statement following the :keyword:`with` statement." msgstr "" -#: ../../reference/compound_stmts.rst:522 +#: ../../reference/compound_stmts.rst:519 msgid "" "If the suite was exited for any reason other than an exception, the return " "value from :meth:`__exit__` is ignored, and execution proceeds at the normal " "location for the kind of exit that was taken." msgstr "" -#: ../../reference/compound_stmts.rst:526 -#: ../../reference/compound_stmts.rst:1517 -#: ../../reference/compound_stmts.rst:1558 +#: ../../reference/compound_stmts.rst:523 +#: ../../reference/compound_stmts.rst:1514 +#: ../../reference/compound_stmts.rst:1555 msgid "The following code::" msgstr "" -#: ../../reference/compound_stmts.rst:531 -#: ../../reference/compound_stmts.rst:556 -#: ../../reference/compound_stmts.rst:1563 +#: ../../reference/compound_stmts.rst:528 +#: ../../reference/compound_stmts.rst:553 +#: ../../reference/compound_stmts.rst:1560 msgid "is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:550 +#: ../../reference/compound_stmts.rst:547 msgid "" "With more than one item, the context managers are processed as if multiple :" "keyword:`with` statements were nested::" msgstr "" -#: ../../reference/compound_stmts.rst:562 +#: ../../reference/compound_stmts.rst:559 msgid "" "You can also write multi-item context managers in multiple lines if the " "items are surrounded by parentheses. For example::" msgstr "" -#: ../../reference/compound_stmts.rst:571 +#: ../../reference/compound_stmts.rst:568 msgid "Support for multiple context expressions." msgstr "" -#: ../../reference/compound_stmts.rst:574 +#: ../../reference/compound_stmts.rst:571 msgid "" "Support for using grouping parentheses to break the statement in multiple " "lines." msgstr "" -#: ../../reference/compound_stmts.rst:580 +#: ../../reference/compound_stmts.rst:577 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/compound_stmts.rst:580 +#: ../../reference/compound_stmts.rst:577 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/compound_stmts.rst:586 +#: ../../reference/compound_stmts.rst:583 msgid "The :keyword:`!match` statement" msgstr "" -#: ../../reference/compound_stmts.rst:600 +#: ../../reference/compound_stmts.rst:597 msgid "The match statement is used for pattern matching. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:609 +#: ../../reference/compound_stmts.rst:606 msgid "" "This section uses single quotes to denote :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:612 +#: ../../reference/compound_stmts.rst:609 msgid "" "Pattern matching takes a pattern as input (following ``case``) and a subject " "value (following ``match``). The pattern (which may contain subpatterns) is " "matched against the subject value. The outcomes are:" msgstr "" -#: ../../reference/compound_stmts.rst:616 +#: ../../reference/compound_stmts.rst:613 msgid "A match success or failure (also termed a pattern success or failure)." msgstr "" -#: ../../reference/compound_stmts.rst:618 +#: ../../reference/compound_stmts.rst:615 msgid "" "Possible binding of matched values to a name. The prerequisites for this " "are further discussed below." msgstr "" -#: ../../reference/compound_stmts.rst:621 +#: ../../reference/compound_stmts.rst:618 msgid "" "The ``match`` and ``case`` keywords are :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:625 -#: ../../reference/compound_stmts.rst:1180 +#: ../../reference/compound_stmts.rst:622 +#: ../../reference/compound_stmts.rst:1177 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../reference/compound_stmts.rst:626 -#: ../../reference/compound_stmts.rst:1181 +#: ../../reference/compound_stmts.rst:623 +#: ../../reference/compound_stmts.rst:1178 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" msgstr "" -#: ../../reference/compound_stmts.rst:630 +#: ../../reference/compound_stmts.rst:627 msgid "Overview" msgstr "" -#: ../../reference/compound_stmts.rst:632 +#: ../../reference/compound_stmts.rst:629 msgid "Here's an overview of the logical flow of a match statement:" msgstr "" -#: ../../reference/compound_stmts.rst:635 +#: ../../reference/compound_stmts.rst:632 msgid "" "The subject expression ``subject_expr`` is evaluated and a resulting subject " "value obtained. If the subject expression contains a comma, a tuple is " "constructed using :ref:`the standard rules `." msgstr "" -#: ../../reference/compound_stmts.rst:639 +#: ../../reference/compound_stmts.rst:636 msgid "" "Each pattern in a ``case_block`` is attempted to match with the subject " "value. The specific rules for success or failure are described below. The " @@ -564,7 +562,7 @@ msgid "" "outlive the executed block and can be used after the match statement**." msgstr "" -#: ../../reference/compound_stmts.rst:648 +#: ../../reference/compound_stmts.rst:645 msgid "" "During failed pattern matches, some subpatterns may succeed. Do not rely on " "bindings being made for a failed match. Conversely, do not rely on " @@ -573,87 +571,87 @@ msgid "" "made to allow different implementations to add optimizations." msgstr "" -#: ../../reference/compound_stmts.rst:655 +#: ../../reference/compound_stmts.rst:652 msgid "" "If the pattern succeeds, the corresponding guard (if present) is evaluated. " "In this case all name bindings are guaranteed to have happened." msgstr "" -#: ../../reference/compound_stmts.rst:658 +#: ../../reference/compound_stmts.rst:655 msgid "" "If the guard evaluates as true or is missing, the ``block`` inside " "``case_block`` is executed." msgstr "" -#: ../../reference/compound_stmts.rst:661 +#: ../../reference/compound_stmts.rst:658 msgid "Otherwise, the next ``case_block`` is attempted as described above." msgstr "" -#: ../../reference/compound_stmts.rst:663 +#: ../../reference/compound_stmts.rst:660 msgid "If there are no further case blocks, the match statement is completed." msgstr "" -#: ../../reference/compound_stmts.rst:667 +#: ../../reference/compound_stmts.rst:664 msgid "" "Users should generally never rely on a pattern being evaluated. Depending " "on implementation, the interpreter may cache values or use other " "optimizations which skip repeated evaluations." msgstr "" -#: ../../reference/compound_stmts.rst:671 +#: ../../reference/compound_stmts.rst:668 msgid "A sample match statement::" msgstr "" -#: ../../reference/compound_stmts.rst:687 +#: ../../reference/compound_stmts.rst:684 msgid "" "In this case, ``if flag`` is a guard. Read more about that in the next " "section." msgstr "" -#: ../../reference/compound_stmts.rst:690 +#: ../../reference/compound_stmts.rst:687 msgid "Guards" msgstr "" -#: ../../reference/compound_stmts.rst:697 +#: ../../reference/compound_stmts.rst:694 msgid "" "A ``guard`` (which is part of the ``case``) must succeed for code inside the " "``case`` block to execute. It takes the form: :keyword:`if` followed by an " "expression." msgstr "" -#: ../../reference/compound_stmts.rst:702 +#: ../../reference/compound_stmts.rst:699 msgid "The logical flow of a ``case`` block with a ``guard`` follows:" msgstr "" -#: ../../reference/compound_stmts.rst:704 +#: ../../reference/compound_stmts.rst:701 msgid "" "Check that the pattern in the ``case`` block succeeded. If the pattern " "failed, the ``guard`` is not evaluated and the next ``case`` block is " "checked." msgstr "" -#: ../../reference/compound_stmts.rst:708 +#: ../../reference/compound_stmts.rst:705 msgid "If the pattern succeeded, evaluate the ``guard``." msgstr "" -#: ../../reference/compound_stmts.rst:710 +#: ../../reference/compound_stmts.rst:707 msgid "" "If the ``guard`` condition evaluates as true, the case block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:713 +#: ../../reference/compound_stmts.rst:710 msgid "" "If the ``guard`` condition evaluates as false, the case block is not " "selected." msgstr "" -#: ../../reference/compound_stmts.rst:716 +#: ../../reference/compound_stmts.rst:713 msgid "" "If the ``guard`` raises an exception during evaluation, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:719 +#: ../../reference/compound_stmts.rst:716 msgid "" "Guards are allowed to have side effects as they are expressions. Guard " "evaluation must proceed from the first to the last case block, one at a " @@ -662,17 +660,17 @@ msgid "" "block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:729 +#: ../../reference/compound_stmts.rst:726 msgid "Irrefutable Case Blocks" msgstr "" -#: ../../reference/compound_stmts.rst:733 +#: ../../reference/compound_stmts.rst:730 msgid "" "An irrefutable case block is a match-all case block. A match statement may " "have at most one irrefutable case block, and it must be last." msgstr "" -#: ../../reference/compound_stmts.rst:736 +#: ../../reference/compound_stmts.rst:733 msgid "" "A case block is considered irrefutable if it has no guard and its pattern is " "irrefutable. A pattern is considered irrefutable if we can prove from its " @@ -680,47 +678,47 @@ msgid "" "irrefutable:" msgstr "" -#: ../../reference/compound_stmts.rst:741 +#: ../../reference/compound_stmts.rst:738 msgid ":ref:`as-patterns` whose left-hand side is irrefutable" msgstr "" -#: ../../reference/compound_stmts.rst:743 +#: ../../reference/compound_stmts.rst:740 msgid ":ref:`or-patterns` containing at least one irrefutable pattern" msgstr "" -#: ../../reference/compound_stmts.rst:745 +#: ../../reference/compound_stmts.rst:742 msgid ":ref:`capture-patterns`" msgstr ":ref:`capture-patterns`" -#: ../../reference/compound_stmts.rst:747 +#: ../../reference/compound_stmts.rst:744 msgid ":ref:`wildcard-patterns`" msgstr ":ref:`wildcard-patterns`" -#: ../../reference/compound_stmts.rst:749 +#: ../../reference/compound_stmts.rst:746 msgid "parenthesized irrefutable patterns" msgstr "" -#: ../../reference/compound_stmts.rst:753 +#: ../../reference/compound_stmts.rst:750 msgid "Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:760 +#: ../../reference/compound_stmts.rst:757 msgid "This section uses grammar notations beyond standard EBNF:" msgstr "" -#: ../../reference/compound_stmts.rst:762 +#: ../../reference/compound_stmts.rst:759 msgid "the notation ``SEP.RULE+`` is shorthand for ``RULE (SEP RULE)*``" msgstr "" -#: ../../reference/compound_stmts.rst:764 +#: ../../reference/compound_stmts.rst:761 msgid "the notation ``!RULE`` is shorthand for a negative lookahead assertion" msgstr "" -#: ../../reference/compound_stmts.rst:767 +#: ../../reference/compound_stmts.rst:764 msgid "The top-level syntax for ``patterns`` is:" msgstr "" -#: ../../reference/compound_stmts.rst:781 +#: ../../reference/compound_stmts.rst:778 msgid "" "The descriptions below will include a description \"in simple terms\" of " "what a pattern does for illustration purposes (credits to Raymond Hettinger " @@ -730,70 +728,70 @@ msgid "" "forms." msgstr "" -#: ../../reference/compound_stmts.rst:791 +#: ../../reference/compound_stmts.rst:788 msgid "OR Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:793 +#: ../../reference/compound_stmts.rst:790 msgid "" "An OR pattern is two or more patterns separated by vertical bars ``|``. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:799 +#: ../../reference/compound_stmts.rst:796 msgid "" "Only the final subpattern may be :ref:`irrefutable `, and " "each subpattern must bind the same set of names to avoid ambiguity." msgstr "" -#: ../../reference/compound_stmts.rst:802 +#: ../../reference/compound_stmts.rst:799 msgid "" "An OR pattern matches each of its subpatterns in turn to the subject value, " "until one succeeds. The OR pattern is then considered successful. " "Otherwise, if none of the subpatterns succeed, the OR pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:806 +#: ../../reference/compound_stmts.rst:803 msgid "" "In simple terms, ``P1 | P2 | ...`` will try to match ``P1``, if it fails it " "will try to match ``P2``, succeeding immediately if any succeeds, failing " "otherwise." msgstr "" -#: ../../reference/compound_stmts.rst:812 +#: ../../reference/compound_stmts.rst:809 msgid "AS Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:814 +#: ../../reference/compound_stmts.rst:811 msgid "" "An AS pattern matches an OR pattern on the left of the :keyword:`as` keyword " "against a subject. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:820 +#: ../../reference/compound_stmts.rst:817 msgid "" "If the OR pattern fails, the AS pattern fails. Otherwise, the AS pattern " "binds the subject to the name on the right of the as keyword and succeeds. " "``capture_pattern`` cannot be a a ``_``." msgstr "" -#: ../../reference/compound_stmts.rst:824 +#: ../../reference/compound_stmts.rst:821 msgid "" "In simple terms ``P as NAME`` will match with ``P``, and on success it will " "set ``NAME = ``." msgstr "" -#: ../../reference/compound_stmts.rst:831 +#: ../../reference/compound_stmts.rst:828 msgid "Literal Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:833 +#: ../../reference/compound_stmts.rst:830 msgid "" "A literal pattern corresponds to most :ref:`literals ` in Python. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:846 +#: ../../reference/compound_stmts.rst:843 msgid "" "The rule ``strings`` and the token ``NUMBER`` are defined in the :doc:" "`standard Python grammar <./grammar>`. Triple-quoted strings are " @@ -801,42 +799,42 @@ msgid "" "are not supported." msgstr "" -#: ../../reference/compound_stmts.rst:851 +#: ../../reference/compound_stmts.rst:848 msgid "" "The forms ``signed_number '+' NUMBER`` and ``signed_number '-' NUMBER`` are " "for expressing :ref:`complex numbers `; they require a real " "number on the left and an imaginary number on the right. E.g. ``3 + 4j``." msgstr "" -#: ../../reference/compound_stmts.rst:855 +#: ../../reference/compound_stmts.rst:852 msgid "" "In simple terms, ``LITERAL`` will succeed only if `` == LITERAL``. " "For the singletons ``None``, ``True`` and ``False``, the :keyword:`is` " "operator is used." msgstr "" -#: ../../reference/compound_stmts.rst:861 +#: ../../reference/compound_stmts.rst:858 msgid "Capture Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:863 +#: ../../reference/compound_stmts.rst:860 msgid "A capture pattern binds the subject value to a name. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:869 +#: ../../reference/compound_stmts.rst:866 msgid "" "A single underscore ``_`` is not a capture pattern (this is what ``!'_'`` " "expresses). It is instead treated as a :token:`~python-grammar:" "wildcard_pattern`." msgstr "" -#: ../../reference/compound_stmts.rst:873 +#: ../../reference/compound_stmts.rst:870 msgid "" "In a given pattern, a given name can only be bound once. E.g. ``case x, " "x: ...`` is invalid while ``case [x] | x: ...`` is allowed." msgstr "" -#: ../../reference/compound_stmts.rst:876 +#: ../../reference/compound_stmts.rst:873 msgid "" "Capture patterns always succeed. The binding follows scoping rules " "established by the assignment expression operator in :pep:`572`; the name " @@ -844,55 +842,55 @@ msgid "" "there's an applicable :keyword:`global` or :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/compound_stmts.rst:881 +#: ../../reference/compound_stmts.rst:878 msgid "" "In simple terms ``NAME`` will always succeed and it will set ``NAME = " "``." msgstr "" -#: ../../reference/compound_stmts.rst:886 +#: ../../reference/compound_stmts.rst:883 msgid "Wildcard Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:888 +#: ../../reference/compound_stmts.rst:885 msgid "" "A wildcard pattern always succeeds (matches anything) and binds no name. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:894 +#: ../../reference/compound_stmts.rst:891 msgid "" "``_`` is a :ref:`soft keyword ` within any pattern, but only " "within patterns. It is an identifier, as usual, even within ``match`` " "subject expressions, ``guard``\\ s, and ``case`` blocks." msgstr "" -#: ../../reference/compound_stmts.rst:898 +#: ../../reference/compound_stmts.rst:895 msgid "In simple terms, ``_`` will always succeed." msgstr "" -#: ../../reference/compound_stmts.rst:903 +#: ../../reference/compound_stmts.rst:900 msgid "Value Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:905 +#: ../../reference/compound_stmts.rst:902 msgid "A value pattern represents a named value in Python. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:913 +#: ../../reference/compound_stmts.rst:910 msgid "" "The dotted name in the pattern is looked up using standard Python :ref:`name " "resolution rules `. The pattern succeeds if the value found " "compares equal to the subject value (using the ``==`` equality operator)." msgstr "" -#: ../../reference/compound_stmts.rst:918 +#: ../../reference/compound_stmts.rst:915 msgid "" "In simple terms ``NAME1.NAME2`` will succeed only if `` == NAME1." "NAME2``" msgstr "" -#: ../../reference/compound_stmts.rst:922 +#: ../../reference/compound_stmts.rst:919 msgid "" "If the same value occurs multiple times in the same match statement, the " "interpreter may cache the first value found and reuse it rather than repeat " @@ -900,44 +898,44 @@ msgid "" "given match statement." msgstr "" -#: ../../reference/compound_stmts.rst:930 +#: ../../reference/compound_stmts.rst:927 msgid "Group Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:932 +#: ../../reference/compound_stmts.rst:929 msgid "" "A group pattern allows users to add parentheses around patterns to emphasize " "the intended grouping. Otherwise, it has no additional syntax. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:939 +#: ../../reference/compound_stmts.rst:936 msgid "In simple terms ``(P)`` has the same effect as ``P``." msgstr "" -#: ../../reference/compound_stmts.rst:944 +#: ../../reference/compound_stmts.rst:941 msgid "Sequence Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:946 +#: ../../reference/compound_stmts.rst:943 msgid "" "A sequence pattern contains several subpatterns to be matched against " "sequence elements. The syntax is similar to the unpacking of a list or tuple." msgstr "" -#: ../../reference/compound_stmts.rst:957 +#: ../../reference/compound_stmts.rst:954 msgid "" "There is no difference if parentheses or square brackets are used for " "sequence patterns (i.e. ``(...)`` vs ``[...]`` )." msgstr "" -#: ../../reference/compound_stmts.rst:961 +#: ../../reference/compound_stmts.rst:958 msgid "" "A single pattern enclosed in parentheses without a trailing comma (e.g. ``(3 " "| 4)``) is a :ref:`group pattern `. While a single pattern " "enclosed in square brackets (e.g. ``[3 | 4]``) is still a sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:966 +#: ../../reference/compound_stmts.rst:963 msgid "" "At most one star subpattern may be in a sequence pattern. The star " "subpattern may occur in any position. If no star subpattern is present, the " @@ -945,40 +943,40 @@ msgid "" "variable-length sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:971 +#: ../../reference/compound_stmts.rst:968 msgid "" "The following is the logical flow for matching a sequence pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:974 +#: ../../reference/compound_stmts.rst:971 msgid "" "If the subject value is not a sequence [#]_, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:977 +#: ../../reference/compound_stmts.rst:974 msgid "" "If the subject value is an instance of ``str``, ``bytes`` or ``bytearray`` " "the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:980 +#: ../../reference/compound_stmts.rst:977 msgid "" "The subsequent steps depend on whether the sequence pattern is fixed or " "variable-length." msgstr "" -#: ../../reference/compound_stmts.rst:983 +#: ../../reference/compound_stmts.rst:980 msgid "If the sequence pattern is fixed-length:" msgstr "" -#: ../../reference/compound_stmts.rst:985 +#: ../../reference/compound_stmts.rst:982 msgid "" "If the length of the subject sequence is not equal to the number of " "subpatterns, the sequence pattern fails" msgstr "" -#: ../../reference/compound_stmts.rst:988 +#: ../../reference/compound_stmts.rst:985 msgid "" "Subpatterns in the sequence pattern are matched to their corresponding items " "in the subject sequence from left to right. Matching stops as soon as a " @@ -986,118 +984,118 @@ msgid "" "corresponding item, the sequence pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:993 +#: ../../reference/compound_stmts.rst:990 msgid "Otherwise, if the sequence pattern is variable-length:" msgstr "" -#: ../../reference/compound_stmts.rst:995 +#: ../../reference/compound_stmts.rst:992 msgid "" "If the length of the subject sequence is less than the number of non-star " "subpatterns, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:998 +#: ../../reference/compound_stmts.rst:995 msgid "" "The leading non-star subpatterns are matched to their corresponding items as " "for fixed-length sequences." msgstr "" -#: ../../reference/compound_stmts.rst:1001 +#: ../../reference/compound_stmts.rst:998 msgid "" "If the previous step succeeds, the star subpattern matches a list formed of " "the remaining subject items, excluding the remaining items corresponding to " "non-star subpatterns following the star subpattern." msgstr "" -#: ../../reference/compound_stmts.rst:1005 +#: ../../reference/compound_stmts.rst:1002 msgid "" "Remaining non-star subpatterns are matched to their corresponding subject " "items, as for a fixed-length sequence." msgstr "" -#: ../../reference/compound_stmts.rst:1008 +#: ../../reference/compound_stmts.rst:1005 msgid "" "The length of the subject sequence is obtained via :func:`len` (i.e. via " "the :meth:`__len__` protocol). This length may be cached by the interpreter " "in a similar manner as :ref:`value patterns `." msgstr "" -#: ../../reference/compound_stmts.rst:1014 +#: ../../reference/compound_stmts.rst:1011 msgid "" "In simple terms ``[P1, P2, P3,`` ... ``, P]`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1017 +#: ../../reference/compound_stmts.rst:1014 msgid "check ```` is a sequence" msgstr "" -#: ../../reference/compound_stmts.rst:1018 +#: ../../reference/compound_stmts.rst:1015 msgid "``len(subject) == ``" msgstr "``len(subject) == ``" -#: ../../reference/compound_stmts.rst:1019 +#: ../../reference/compound_stmts.rst:1016 msgid "" "``P1`` matches ``[0]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1020 +#: ../../reference/compound_stmts.rst:1017 msgid "" "``P2`` matches ``[1]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1021 +#: ../../reference/compound_stmts.rst:1018 msgid "... and so on for the corresponding pattern/element." msgstr "" -#: ../../reference/compound_stmts.rst:1026 +#: ../../reference/compound_stmts.rst:1023 msgid "Mapping Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1028 +#: ../../reference/compound_stmts.rst:1025 msgid "" "A mapping pattern contains one or more key-value patterns. The syntax is " "similar to the construction of a dictionary. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1039 +#: ../../reference/compound_stmts.rst:1036 msgid "" "At most one double star pattern may be in a mapping pattern. The double " "star pattern must be the last subpattern in the mapping pattern." msgstr "" -#: ../../reference/compound_stmts.rst:1042 +#: ../../reference/compound_stmts.rst:1039 msgid "" "Duplicate keys in mapping patterns are disallowed. Duplicate literal keys " "will raise a :exc:`SyntaxError`. Two keys that otherwise have the same value " "will raise a :exc:`ValueError` at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1046 +#: ../../reference/compound_stmts.rst:1043 msgid "" "The following is the logical flow for matching a mapping pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1049 +#: ../../reference/compound_stmts.rst:1046 msgid "If the subject value is not a mapping [#]_,the mapping pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1051 +#: ../../reference/compound_stmts.rst:1048 msgid "" "If every key given in the mapping pattern is present in the subject mapping, " "and the pattern for each key matches the corresponding item of the subject " "mapping, the mapping pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1055 +#: ../../reference/compound_stmts.rst:1052 msgid "" "If duplicate keys are detected in the mapping pattern, the pattern is " "considered invalid. A :exc:`SyntaxError` is raised for duplicate literal " "values; or a :exc:`ValueError` for named keys of the same value." msgstr "" -#: ../../reference/compound_stmts.rst:1059 +#: ../../reference/compound_stmts.rst:1056 msgid "" "Key-value pairs are matched using the two-argument form of the mapping " "subject's ``get()`` method. Matched key-value pairs must already be present " @@ -1105,256 +1103,256 @@ msgid "" "`__getitem__`." msgstr "" -#: ../../reference/compound_stmts.rst:1064 +#: ../../reference/compound_stmts.rst:1061 msgid "" "In simple terms ``{KEY1: P1, KEY2: P2, ... }`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1067 +#: ../../reference/compound_stmts.rst:1064 msgid "check ```` is a mapping" msgstr "" -#: ../../reference/compound_stmts.rst:1068 +#: ../../reference/compound_stmts.rst:1065 msgid "``KEY1 in ``" msgstr "``KEY1 in ``" -#: ../../reference/compound_stmts.rst:1069 +#: ../../reference/compound_stmts.rst:1066 msgid "``P1`` matches ``[KEY1]``" msgstr "" -#: ../../reference/compound_stmts.rst:1070 +#: ../../reference/compound_stmts.rst:1067 msgid "... and so on for the corresponding KEY/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1076 +#: ../../reference/compound_stmts.rst:1073 msgid "Class Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1078 +#: ../../reference/compound_stmts.rst:1075 msgid "" "A class pattern represents a class and its positional and keyword arguments " "(if any). Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1089 +#: ../../reference/compound_stmts.rst:1086 msgid "The same keyword should not be repeated in class patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1091 +#: ../../reference/compound_stmts.rst:1088 msgid "" "The following is the logical flow for matching a class pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1094 +#: ../../reference/compound_stmts.rst:1091 msgid "" "If ``name_or_attr`` is not an instance of the builtin :class:`type` , raise :" "exc:`TypeError`." msgstr "" -#: ../../reference/compound_stmts.rst:1097 +#: ../../reference/compound_stmts.rst:1094 msgid "" "If the subject value is not an instance of ``name_or_attr`` (tested via :" "func:`isinstance`), the class pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1100 +#: ../../reference/compound_stmts.rst:1097 msgid "" "If no pattern arguments are present, the pattern succeeds. Otherwise, the " "subsequent steps depend on whether keyword or positional argument patterns " "are present." msgstr "" -#: ../../reference/compound_stmts.rst:1104 +#: ../../reference/compound_stmts.rst:1101 msgid "" "For a number of built-in types (specified below), a single positional " "subpattern is accepted which will match the entire subject; for these types " "keyword patterns also work as for other types." msgstr "" -#: ../../reference/compound_stmts.rst:1108 +#: ../../reference/compound_stmts.rst:1105 msgid "" "If only keyword patterns are present, they are processed as follows, one by " "one:" msgstr "" -#: ../../reference/compound_stmts.rst:1111 +#: ../../reference/compound_stmts.rst:1108 msgid "I. The keyword is looked up as an attribute on the subject." msgstr "" -#: ../../reference/compound_stmts.rst:1113 +#: ../../reference/compound_stmts.rst:1110 msgid "" "If this raises an exception other than :exc:`AttributeError`, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1116 +#: ../../reference/compound_stmts.rst:1113 msgid "If this raises :exc:`AttributeError`, the class pattern has failed." msgstr "" -#: ../../reference/compound_stmts.rst:1118 +#: ../../reference/compound_stmts.rst:1115 msgid "" "Else, the subpattern associated with the keyword pattern is matched against " "the subject's attribute value. If this fails, the class pattern fails; if " "this succeeds, the match proceeds to the next keyword." msgstr "" -#: ../../reference/compound_stmts.rst:1123 +#: ../../reference/compound_stmts.rst:1120 msgid "II. If all keyword patterns succeed, the class pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1125 +#: ../../reference/compound_stmts.rst:1122 msgid "" "If any positional patterns are present, they are converted to keyword " "patterns using the :data:`~object.__match_args__` attribute on the class " "``name_or_attr`` before matching:" msgstr "" -#: ../../reference/compound_stmts.rst:1129 +#: ../../reference/compound_stmts.rst:1126 msgid "" "I. The equivalent of ``getattr(cls, \"__match_args__\", ())`` is called." msgstr "" -#: ../../reference/compound_stmts.rst:1131 +#: ../../reference/compound_stmts.rst:1128 msgid "If this raises an exception, the exception bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1133 +#: ../../reference/compound_stmts.rst:1130 msgid "" "If the returned value is not a tuple, the conversion fails and :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1136 +#: ../../reference/compound_stmts.rst:1133 msgid "" "If there are more positional patterns than ``len(cls.__match_args__)``, :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1139 +#: ../../reference/compound_stmts.rst:1136 msgid "" "Otherwise, positional pattern ``i`` is converted to a keyword pattern using " "``__match_args__[i]`` as the keyword. ``__match_args__[i]`` must be a " "string; if not :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1143 +#: ../../reference/compound_stmts.rst:1140 msgid "If there are duplicate keywords, :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1145 +#: ../../reference/compound_stmts.rst:1142 msgid ":ref:`class-pattern-matching`" msgstr ":ref:`class-pattern-matching`" -#: ../../reference/compound_stmts.rst:1148 +#: ../../reference/compound_stmts.rst:1145 msgid "" "II. Once all positional patterns have been converted to keyword patterns," msgstr "" -#: ../../reference/compound_stmts.rst:1148 +#: ../../reference/compound_stmts.rst:1145 msgid "the match proceeds as if there were only keyword patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1150 +#: ../../reference/compound_stmts.rst:1147 msgid "" "For the following built-in types the handling of positional subpatterns is " "different:" msgstr "" -#: ../../reference/compound_stmts.rst:1153 +#: ../../reference/compound_stmts.rst:1150 msgid ":class:`bool`" msgstr ":class:`bool`" -#: ../../reference/compound_stmts.rst:1154 +#: ../../reference/compound_stmts.rst:1151 msgid ":class:`bytearray`" msgstr ":class:`bytearray`" -#: ../../reference/compound_stmts.rst:1155 +#: ../../reference/compound_stmts.rst:1152 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../reference/compound_stmts.rst:1156 +#: ../../reference/compound_stmts.rst:1153 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../reference/compound_stmts.rst:1157 +#: ../../reference/compound_stmts.rst:1154 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../reference/compound_stmts.rst:1158 +#: ../../reference/compound_stmts.rst:1155 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../reference/compound_stmts.rst:1159 +#: ../../reference/compound_stmts.rst:1156 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../reference/compound_stmts.rst:1160 -#: ../../reference/compound_stmts.rst:1611 +#: ../../reference/compound_stmts.rst:1157 +#: ../../reference/compound_stmts.rst:1608 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../reference/compound_stmts.rst:1161 +#: ../../reference/compound_stmts.rst:1158 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../reference/compound_stmts.rst:1162 +#: ../../reference/compound_stmts.rst:1159 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../reference/compound_stmts.rst:1163 -#: ../../reference/compound_stmts.rst:1614 +#: ../../reference/compound_stmts.rst:1160 +#: ../../reference/compound_stmts.rst:1611 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../reference/compound_stmts.rst:1165 +#: ../../reference/compound_stmts.rst:1162 msgid "" "These classes accept a single positional argument, and the pattern there is " "matched against the whole object rather than an attribute. For example " "``int(0|1)`` matches the value ``0``, but not the value ``0.0``." msgstr "" -#: ../../reference/compound_stmts.rst:1169 +#: ../../reference/compound_stmts.rst:1166 msgid "" "In simple terms ``CLS(P1, attr=P2)`` matches only if the following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1171 +#: ../../reference/compound_stmts.rst:1168 msgid "``isinstance(, CLS)``" msgstr "``isinstance(, CLS)``" -#: ../../reference/compound_stmts.rst:1172 +#: ../../reference/compound_stmts.rst:1169 msgid "convert ``P1`` to a keyword pattern using ``CLS.__match_args__``" msgstr "" -#: ../../reference/compound_stmts.rst:1174 +#: ../../reference/compound_stmts.rst:1171 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1174 +#: ../../reference/compound_stmts.rst:1171 msgid "``hasattr(, \"attr\")``" msgstr "``hasattr(, \"attr\")``" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1172 msgid "``P2`` matches ``.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1176 +#: ../../reference/compound_stmts.rst:1173 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1191 +#: ../../reference/compound_stmts.rst:1188 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1206 +#: ../../reference/compound_stmts.rst:1203 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1225 +#: ../../reference/compound_stmts.rst:1222 msgid "" "A function definition is an executable statement. Its execution binds the " "function name in the current local namespace to a function object (a wrapper " @@ -1363,13 +1361,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1231 +#: ../../reference/compound_stmts.rst:1228 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1237 +#: ../../reference/compound_stmts.rst:1234 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1380,28 +1378,28 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1248 -#: ../../reference/compound_stmts.rst:1425 +#: ../../reference/compound_stmts.rst:1245 +#: ../../reference/compound_stmts.rst:1422 msgid "is roughly equivalent to ::" msgstr "" "大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1253 +#: ../../reference/compound_stmts.rst:1250 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1255 +#: ../../reference/compound_stmts.rst:1252 msgid "" "Functions may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1265 +#: ../../reference/compound_stmts.rst:1262 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1412,7 +1410,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1270 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1425,7 +1423,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1294 +#: ../../reference/compound_stmts.rst:1291 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1441,13 +1439,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1306 +#: ../../reference/compound_stmts.rst:1303 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1315 +#: ../../reference/compound_stmts.rst:1312 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1464,7 +1462,7 @@ msgid "" "different order than they appear in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1330 +#: ../../reference/compound_stmts.rst:1327 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1476,7 +1474,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1338 +#: ../../reference/compound_stmts.rst:1335 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1485,51 +1483,51 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1347 +#: ../../reference/compound_stmts.rst:1344 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1347 +#: ../../reference/compound_stmts.rst:1344 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1350 +#: ../../reference/compound_stmts.rst:1347 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1350 +#: ../../reference/compound_stmts.rst:1347 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1354 +#: ../../reference/compound_stmts.rst:1351 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1353 +#: ../../reference/compound_stmts.rst:1350 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables" msgstr "" -#: ../../reference/compound_stmts.rst:1357 +#: ../../reference/compound_stmts.rst:1354 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1357 +#: ../../reference/compound_stmts.rst:1354 msgid "" "Support for forward references within annotations by preserving annotations " "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:1364 +#: ../../reference/compound_stmts.rst:1361 msgid "Class definitions" msgstr "" -#: ../../reference/compound_stmts.rst:1379 +#: ../../reference/compound_stmts.rst:1376 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1386 +#: ../../reference/compound_stmts.rst:1383 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1538,11 +1536,11 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1395 +#: ../../reference/compound_stmts.rst:1392 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1400 +#: ../../reference/compound_stmts.rst:1397 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -1554,7 +1552,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1409 +#: ../../reference/compound_stmts.rst:1406 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's ``__dict__``. Note that this is reliable only right after " @@ -1562,30 +1560,30 @@ msgid "" "definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1414 +#: ../../reference/compound_stmts.rst:1411 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1419 +#: ../../reference/compound_stmts.rst:1416 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1430 +#: ../../reference/compound_stmts.rst:1427 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:1433 +#: ../../reference/compound_stmts.rst:1430 msgid "" "Classes may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1438 +#: ../../reference/compound_stmts.rst:1435 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1598,35 +1596,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1453 +#: ../../reference/compound_stmts.rst:1450 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1451 +#: ../../reference/compound_stmts.rst:1448 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:1456 +#: ../../reference/compound_stmts.rst:1453 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../reference/compound_stmts.rst:1456 +#: ../../reference/compound_stmts.rst:1453 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1463 +#: ../../reference/compound_stmts.rst:1460 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1471 +#: ../../reference/compound_stmts.rst:1468 msgid "Coroutine function definition" msgstr "" -#: ../../reference/compound_stmts.rst:1481 +#: ../../reference/compound_stmts.rst:1478 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1634,189 +1632,189 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1485 +#: ../../reference/compound_stmts.rst:1482 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:1488 +#: ../../reference/compound_stmts.rst:1485 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1491 +#: ../../reference/compound_stmts.rst:1488 msgid "An example of a coroutine function::" msgstr "" "一個協程韓式函式範例:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1497 +#: ../../reference/compound_stmts.rst:1494 msgid "" "``await`` and ``async`` are now keywords; previously they were only treated " "as such inside the body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1505 +#: ../../reference/compound_stmts.rst:1502 msgid "The :keyword:`!async for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1510 +#: ../../reference/compound_stmts.rst:1507 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:1514 +#: ../../reference/compound_stmts.rst:1511 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1524 +#: ../../reference/compound_stmts.rst:1521 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1540 +#: ../../reference/compound_stmts.rst:1537 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "" "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`\\ 。" -#: ../../reference/compound_stmts.rst:1542 +#: ../../reference/compound_stmts.rst:1539 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1550 +#: ../../reference/compound_stmts.rst:1547 msgid "The :keyword:`!async with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1555 +#: ../../reference/compound_stmts.rst:1552 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:1582 +#: ../../reference/compound_stmts.rst:1579 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "" "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`\\ 。" -#: ../../reference/compound_stmts.rst:1584 +#: ../../reference/compound_stmts.rst:1581 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1590 +#: ../../reference/compound_stmts.rst:1587 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1590 +#: ../../reference/compound_stmts.rst:1587 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1595 +#: ../../reference/compound_stmts.rst:1592 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1596 +#: ../../reference/compound_stmts.rst:1593 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:1600 +#: ../../reference/compound_stmts.rst:1597 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1602 +#: ../../reference/compound_stmts.rst:1599 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1603 +#: ../../reference/compound_stmts.rst:1600 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1604 +#: ../../reference/compound_stmts.rst:1601 msgid "" "a builtin class that has its (CPython) :data:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1605 -#: ../../reference/compound_stmts.rst:1624 +#: ../../reference/compound_stmts.rst:1602 +#: ../../reference/compound_stmts.rst:1621 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1607 +#: ../../reference/compound_stmts.rst:1604 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1609 +#: ../../reference/compound_stmts.rst:1606 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1610 +#: ../../reference/compound_stmts.rst:1607 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1612 +#: ../../reference/compound_stmts.rst:1609 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1613 +#: ../../reference/compound_stmts.rst:1610 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1616 +#: ../../reference/compound_stmts.rst:1613 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1619 +#: ../../reference/compound_stmts.rst:1616 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1621 +#: ../../reference/compound_stmts.rst:1618 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1622 +#: ../../reference/compound_stmts.rst:1619 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1623 +#: ../../reference/compound_stmts.rst:1620 msgid "" "a builtin class that has its (CPython) :data:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1626 +#: ../../reference/compound_stmts.rst:1623 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1629 +#: ../../reference/compound_stmts.rst:1626 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's ``__doc__`` attribute and therefore the " "function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1633 +#: ../../reference/compound_stmts.rst:1630 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's ``__doc__`` item and therefore the class's :" diff --git a/reference/datamodel.po b/reference/datamodel.po index b2b6a6c012..3b27fb52c7 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:32+0000\n" +"POT-Creation-Date: 2023-02-22 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1156,7 +1156,7 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1219 +#: ../../reference/datamodel.rst:1220 msgid "Internal types" msgstr "" @@ -1357,18 +1357,18 @@ msgstr "" msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1175 +#: ../../reference/datamodel.rst:1176 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1127 +#: ../../reference/datamodel.rst:1128 msgid "" "Traceback objects represent a stack trace of an exception. A traceback " "object is implicitly created when an exception occurs, and may also be " "explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1131 +#: ../../reference/datamodel.rst:1132 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1378,21 +1378,21 @@ msgid "" "exc_info()``, and as the ``__traceback__`` attribute of the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1139 +#: ../../reference/datamodel.rst:1140 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " "interactive, it is also made available to the user as ``sys.last_traceback``." msgstr "" -#: ../../reference/datamodel.rst:1144 +#: ../../reference/datamodel.rst:1145 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the ``tb_next`` attributes should be linked to form a full " "stack trace." msgstr "" -#: ../../reference/datamodel.rst:1154 +#: ../../reference/datamodel.rst:1155 msgid "" "Special read-only attributes: :attr:`tb_frame` points to the execution frame " "of the current level; :attr:`tb_lineno` gives the line number where the " @@ -1402,47 +1402,47 @@ msgid "" "statement with no matching except clause or with a finally clause." msgstr "" -#: ../../reference/datamodel.rst:1163 +#: ../../reference/datamodel.rst:1164 msgid "" "Accessing ``tb_frame`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." msgstr "" -#: ../../reference/datamodel.rst:1169 +#: ../../reference/datamodel.rst:1170 msgid "" "Special writable attribute: :attr:`tb_next` is the next level in the stack " "trace (towards the frame where the exception occurred), or ``None`` if there " "is no next level." msgstr "" -#: ../../reference/datamodel.rst:1173 +#: ../../reference/datamodel.rst:1174 msgid "" "Traceback objects can now be explicitly instantiated from Python code, and " "the ``tb_next`` attribute of existing instances can be updated." msgstr "" -#: ../../reference/datamodel.rst:1202 +#: ../../reference/datamodel.rst:1203 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1180 +#: ../../reference/datamodel.rst:1181 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1189 +#: ../../reference/datamodel.rst:1190 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1193 +#: ../../reference/datamodel.rst:1194 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1197 +#: ../../reference/datamodel.rst:1198 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1452,11 +1452,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1211 +#: ../../reference/datamodel.rst:1212 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1205 +#: ../../reference/datamodel.rst:1206 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1467,11 +1467,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1219 +#: ../../reference/datamodel.rst:1220 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1214 +#: ../../reference/datamodel.rst:1215 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -1480,11 +1480,11 @@ msgid "" "objects are created by the built-in :func:`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1224 +#: ../../reference/datamodel.rst:1225 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1230 +#: ../../reference/datamodel.rst:1231 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1498,7 +1498,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1241 +#: ../../reference/datamodel.rst:1242 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1507,7 +1507,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1247 +#: ../../reference/datamodel.rst:1248 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1517,11 +1517,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1258 +#: ../../reference/datamodel.rst:1259 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1264 +#: ../../reference/datamodel.rst:1265 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1531,7 +1531,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1271 +#: ../../reference/datamodel.rst:1272 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1539,7 +1539,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1276 +#: ../../reference/datamodel.rst:1277 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -1548,13 +1548,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1281 +#: ../../reference/datamodel.rst:1282 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1284 +#: ../../reference/datamodel.rst:1285 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1562,7 +1562,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1293 +#: ../../reference/datamodel.rst:1294 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1572,7 +1572,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1300 +#: ../../reference/datamodel.rst:1301 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1580,7 +1580,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1313 +#: ../../reference/datamodel.rst:1314 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1589,7 +1589,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1319 +#: ../../reference/datamodel.rst:1320 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1599,20 +1599,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1326 +#: ../../reference/datamodel.rst:1327 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1331 +#: ../../reference/datamodel.rst:1332 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1336 +#: ../../reference/datamodel.rst:1337 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -1623,18 +1623,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1346 +#: ../../reference/datamodel.rst:1347 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1350 +#: ../../reference/datamodel.rst:1351 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1354 +#: ../../reference/datamodel.rst:1355 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1643,7 +1643,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1360 +#: ../../reference/datamodel.rst:1361 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1654,7 +1654,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1375 +#: ../../reference/datamodel.rst:1376 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1666,13 +1666,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1384 +#: ../../reference/datamodel.rst:1385 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1395 +#: ../../reference/datamodel.rst:1396 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1680,26 +1680,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1400 +#: ../../reference/datamodel.rst:1401 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1404 +#: ../../reference/datamodel.rst:1405 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1414 +#: ../../reference/datamodel.rst:1415 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1426 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1711,28 +1711,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1435 +#: ../../reference/datamodel.rst:1436 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1437 +#: ../../reference/datamodel.rst:1438 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1439 +#: ../../reference/datamodel.rst:1440 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1443 +#: ../../reference/datamodel.rst:1444 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1459 +#: ../../reference/datamodel.rst:1460 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1548 +#: ../../reference/datamodel.rst:1549 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -1851,7 +1851,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1557 +#: ../../reference/datamodel.rst:1558 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -1859,7 +1859,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1562 +#: ../../reference/datamodel.rst:1563 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -1867,22 +1867,22 @@ msgid "" "ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1567 +#: ../../reference/datamodel.rst:1568 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1571 +#: ../../reference/datamodel.rst:1572 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1573 +#: ../../reference/datamodel.rst:1574 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1581 +#: ../../reference/datamodel.rst:1582 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -1891,18 +1891,18 @@ msgid "" "`__len__` nor :meth:`__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1592 +#: ../../reference/datamodel.rst:1593 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1594 +#: ../../reference/datamodel.rst:1595 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1602 +#: ../../reference/datamodel.rst:1603 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -1912,7 +1912,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1609 +#: ../../reference/datamodel.rst:1610 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -1925,7 +1925,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1622 +#: ../../reference/datamodel.rst:1623 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -1937,7 +1937,7 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1633 +#: ../../reference/datamodel.rst:1634 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or built-in functions. " @@ -1950,20 +1950,20 @@ msgid "" "arguments ``obj``, ``name``." msgstr "" -#: ../../reference/datamodel.rst:1639 +#: ../../reference/datamodel.rst:1640 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1646 +#: ../../reference/datamodel.rst:1647 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1650 +#: ../../reference/datamodel.rst:1651 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." @@ -1976,14 +1976,14 @@ msgid "" "arguments ``obj``, ``name``, ``value``." msgstr "" -#: ../../reference/datamodel.rst:1656 +#: ../../reference/datamodel.rst:1657 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1663 +#: ../../reference/datamodel.rst:1664 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " @@ -1996,23 +1996,23 @@ msgid "" "arguments ``obj``, ``name``." msgstr "" -#: ../../reference/datamodel.rst:1668 +#: ../../reference/datamodel.rst:1669 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1675 +#: ../../reference/datamodel.rst:1676 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1680 +#: ../../reference/datamodel.rst:1681 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1687 +#: ../../reference/datamodel.rst:1688 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2024,21 +2024,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1697 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1700 +#: ../../reference/datamodel.rst:1701 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:1718 +#: ../../reference/datamodel.rst:1719 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2046,27 +2046,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1723 +#: ../../reference/datamodel.rst:1724 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:1726 +#: ../../reference/datamodel.rst:1727 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:1731 +#: ../../reference/datamodel.rst:1732 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:1732 +#: ../../reference/datamodel.rst:1733 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:1738 +#: ../../reference/datamodel.rst:1739 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1740 +#: ../../reference/datamodel.rst:1741 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2076,7 +2076,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1750 +#: ../../reference/datamodel.rst:1751 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2085,13 +2085,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1757 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1759 +#: ../../reference/datamodel.rst:1760 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2101,25 +2101,25 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:1768 +#: ../../reference/datamodel.rst:1769 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:1771 +#: ../../reference/datamodel.rst:1772 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:1777 +#: ../../reference/datamodel.rst:1778 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:1780 +#: ../../reference/datamodel.rst:1781 msgid "" "The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2130,11 +2130,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:1791 +#: ../../reference/datamodel.rst:1792 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1793 +#: ../../reference/datamodel.rst:1794 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2143,7 +2143,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:1799 +#: ../../reference/datamodel.rst:1800 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2151,7 +2151,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:1804 +#: ../../reference/datamodel.rst:1805 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2159,54 +2159,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:1809 +#: ../../reference/datamodel.rst:1810 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:1814 +#: ../../reference/datamodel.rst:1815 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:1813 +#: ../../reference/datamodel.rst:1814 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:1818 +#: ../../reference/datamodel.rst:1819 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:1817 +#: ../../reference/datamodel.rst:1818 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:1822 +#: ../../reference/datamodel.rst:1823 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:1821 +#: ../../reference/datamodel.rst:1822 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:1829 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:1825 +#: ../../reference/datamodel.rst:1826 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:1862 +#: ../../reference/datamodel.rst:1863 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2223,7 +2223,7 @@ msgid "" "can be overridden by instances." msgstr "" -#: ../../reference/datamodel.rst:1876 +#: ../../reference/datamodel.rst:1877 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2232,30 +2232,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:1882 +#: ../../reference/datamodel.rst:1883 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:1889 +#: ../../reference/datamodel.rst:1890 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:1891 +#: ../../reference/datamodel.rst:1892 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:1895 +#: ../../reference/datamodel.rst:1896 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:1900 +#: ../../reference/datamodel.rst:1901 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2263,18 +2263,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:1910 +#: ../../reference/datamodel.rst:1911 msgid "Notes on using *__slots__*" msgstr "" -#: ../../reference/datamodel.rst:1912 +#: ../../reference/datamodel.rst:1913 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:1916 +#: ../../reference/datamodel.rst:1917 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2283,7 +2283,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1923 +#: ../../reference/datamodel.rst:1924 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2291,7 +2291,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1929 +#: ../../reference/datamodel.rst:1930 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2299,7 +2299,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:1935 +#: ../../reference/datamodel.rst:1936 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2308,7 +2308,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:1941 +#: ../../reference/datamodel.rst:1942 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2317,18 +2317,18 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:1946 +#: ../../reference/datamodel.rst:1947 msgid "" "Nonempty *__slots__* does not work for classes derived from \"variable-" "length\" built-in types such as :class:`int`, :class:`bytes` and :class:" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:1949 +#: ../../reference/datamodel.rst:1950 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1951 +#: ../../reference/datamodel.rst:1952 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2336,13 +2336,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:1956 +#: ../../reference/datamodel.rst:1957 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1959 +#: ../../reference/datamodel.rst:1960 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2350,18 +2350,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:1965 +#: ../../reference/datamodel.rst:1966 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:1973 +#: ../../reference/datamodel.rst:1974 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:1975 +#: ../../reference/datamodel.rst:1976 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2371,14 +2371,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:1984 +#: ../../reference/datamodel.rst:1985 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:1988 +#: ../../reference/datamodel.rst:1989 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2386,13 +2386,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2002 +#: ../../reference/datamodel.rst:2003 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2007 +#: ../../reference/datamodel.rst:2008 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2400,41 +2400,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2015 +#: ../../reference/datamodel.rst:2016 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2020 +#: ../../reference/datamodel.rst:2021 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2026 +#: ../../reference/datamodel.rst:2027 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2037 +#: ../../reference/datamodel.rst:2038 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2045 +#: ../../reference/datamodel.rst:2046 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2052 +#: ../../reference/datamodel.rst:2053 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2056 +#: ../../reference/datamodel.rst:2057 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2442,41 +2442,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2070 +#: ../../reference/datamodel.rst:2071 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2073 +#: ../../reference/datamodel.rst:2074 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2075 +#: ../../reference/datamodel.rst:2076 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2076 +#: ../../reference/datamodel.rst:2077 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2077 +#: ../../reference/datamodel.rst:2078 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2078 +#: ../../reference/datamodel.rst:2079 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2079 +#: ../../reference/datamodel.rst:2080 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2083 +#: ../../reference/datamodel.rst:2084 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2085 +#: ../../reference/datamodel.rst:2086 msgid "" "If a base that appears in class definition is not an instance of :class:" "`type`, then an ``__mro_entries__`` method is searched on it. If found, it " @@ -2485,37 +2485,37 @@ msgid "" "such case the original base is ignored." msgstr "" -#: ../../reference/datamodel.rst:2093 +#: ../../reference/datamodel.rst:2094 msgid ":pep:`560` - Core support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2097 +#: ../../reference/datamodel.rst:2098 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2101 +#: ../../reference/datamodel.rst:2102 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2103 +#: ../../reference/datamodel.rst:2104 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2104 +#: ../../reference/datamodel.rst:2105 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2106 +#: ../../reference/datamodel.rst:2107 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2109 +#: ../../reference/datamodel.rst:2110 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2524,11 +2524,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2119 +#: ../../reference/datamodel.rst:2120 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2124 +#: ../../reference/datamodel.rst:2125 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2540,25 +2540,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2133 +#: ../../reference/datamodel.rst:2134 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2138 +#: ../../reference/datamodel.rst:2139 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2139 +#: ../../reference/datamodel.rst:2140 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2143 +#: ../../reference/datamodel.rst:2144 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2148 +#: ../../reference/datamodel.rst:2149 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2567,7 +2567,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2154 +#: ../../reference/datamodel.rst:2155 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2576,11 +2576,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2163 +#: ../../reference/datamodel.rst:2164 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2170 +#: ../../reference/datamodel.rst:2171 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2588,7 +2588,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2175 +#: ../../reference/datamodel.rst:2176 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2599,7 +2599,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2185 +#: ../../reference/datamodel.rst:2186 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2608,39 +2608,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2191 +#: ../../reference/datamodel.rst:2192 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2195 +#: ../../reference/datamodel.rst:2196 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2197 +#: ../../reference/datamodel.rst:2198 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2199 +#: ../../reference/datamodel.rst:2200 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2202 +#: ../../reference/datamodel.rst:2203 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2206 +#: ../../reference/datamodel.rst:2207 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2648,19 +2648,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2213 +#: ../../reference/datamodel.rst:2214 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2214 +#: ../../reference/datamodel.rst:2215 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2219 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2220 +#: ../../reference/datamodel.rst:2221 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2668,17 +2668,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2227 +#: ../../reference/datamodel.rst:2228 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2229 +#: ../../reference/datamodel.rst:2230 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2232 +#: ../../reference/datamodel.rst:2233 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2686,21 +2686,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2239 +#: ../../reference/datamodel.rst:2240 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2246 +#: ../../reference/datamodel.rst:2247 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2251 +#: ../../reference/datamodel.rst:2252 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2708,11 +2708,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2262 +#: ../../reference/datamodel.rst:2263 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2259 +#: ../../reference/datamodel.rst:2260 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2721,11 +2721,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2267 +#: ../../reference/datamodel.rst:2268 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2269 +#: ../../reference/datamodel.rst:2270 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2733,65 +2733,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:2278 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:2278 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2281 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2281 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2283 +#: ../../reference/datamodel.rst:2284 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2283 +#: ../../reference/datamodel.rst:2284 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2286 +#: ../../reference/datamodel.rst:2287 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2291 +#: ../../reference/datamodel.rst:2292 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2294 +#: ../../reference/datamodel.rst:2295 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2300 +#: ../../reference/datamodel.rst:2301 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2302 +#: ../../reference/datamodel.rst:2303 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2306 +#: ../../reference/datamodel.rst:2307 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2800,7 +2800,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2312 +#: ../../reference/datamodel.rst:2313 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2808,11 +2808,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2322 +#: ../../reference/datamodel.rst:2323 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2324 +#: ../../reference/datamodel.rst:2325 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2822,14 +2822,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2332 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2359 +#: ../../reference/datamodel.rst:2360 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2839,40 +2839,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2378 +#: ../../reference/datamodel.rst:2379 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2403 +#: ../../reference/datamodel.rst:2404 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2402 +#: ../../reference/datamodel.rst:2403 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2410 +#: ../../reference/datamodel.rst:2411 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2417 +#: ../../reference/datamodel.rst:2418 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2424 +#: ../../reference/datamodel.rst:2425 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2426 +#: ../../reference/datamodel.rst:2427 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2908,7 +2908,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2466 +#: ../../reference/datamodel.rst:2467 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2916,7 +2916,7 @@ msgid "" "zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2473 +#: ../../reference/datamodel.rst:2474 msgid "" "In CPython, the length is required to be at most :attr:`sys.maxsize`. If the " "length is larger than :attr:`!sys.maxsize` some features (such as :func:" @@ -2925,7 +2925,7 @@ msgid "" "`__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2482 +#: ../../reference/datamodel.rst:2483 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2935,20 +2935,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2496 +#: ../../reference/datamodel.rst:2497 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2500 +#: ../../reference/datamodel.rst:2501 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2504 +#: ../../reference/datamodel.rst:2505 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2509 +#: ../../reference/datamodel.rst:2510 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -2961,20 +2961,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2521 +#: ../../reference/datamodel.rst:2522 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2526 +#: ../../reference/datamodel.rst:2527 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2534 +#: ../../reference/datamodel.rst:2535 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2983,7 +2983,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2543 +#: ../../reference/datamodel.rst:2544 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2992,13 +2992,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2552 +#: ../../reference/datamodel.rst:2553 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2558 +#: ../../reference/datamodel.rst:2559 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3006,14 +3006,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2566 +#: ../../reference/datamodel.rst:2567 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2570 +#: ../../reference/datamodel.rst:2571 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3022,7 +3022,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2577 +#: ../../reference/datamodel.rst:2578 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3030,14 +3030,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2584 +#: ../../reference/datamodel.rst:2585 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2588 +#: ../../reference/datamodel.rst:2589 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3045,11 +3045,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2597 +#: ../../reference/datamodel.rst:2598 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2599 +#: ../../reference/datamodel.rst:2600 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3057,7 +3057,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2625 +#: ../../reference/datamodel.rst:2626 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3071,13 +3071,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2636 +#: ../../reference/datamodel.rst:2637 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2659 +#: ../../reference/datamodel.rst:2660 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3090,13 +3090,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2671 +#: ../../reference/datamodel.rst:2672 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2676 +#: ../../reference/datamodel.rst:2677 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3105,7 +3105,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2697 +#: ../../reference/datamodel.rst:2698 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3121,19 +3121,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2718 +#: ../../reference/datamodel.rst:2719 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2731 +#: ../../reference/datamodel.rst:2732 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2738 +#: ../../reference/datamodel.rst:2739 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3142,14 +3142,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2744 +#: ../../reference/datamodel.rst:2745 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2756 +#: ../../reference/datamodel.rst:2757 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3158,21 +3158,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2762 +#: ../../reference/datamodel.rst:2763 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2765 +#: ../../reference/datamodel.rst:2766 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2772 +#: ../../reference/datamodel.rst:2773 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2774 +#: ../../reference/datamodel.rst:2775 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3182,32 +3182,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2785 +#: ../../reference/datamodel.rst:2786 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2788 +#: ../../reference/datamodel.rst:2789 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2793 +#: ../../reference/datamodel.rst:2794 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2800 +#: ../../reference/datamodel.rst:2801 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2804 +#: ../../reference/datamodel.rst:2805 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3215,27 +3215,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2808 +#: ../../reference/datamodel.rst:2809 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2815 +#: ../../reference/datamodel.rst:2816 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2815 +#: ../../reference/datamodel.rst:2816 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2822 +#: ../../reference/datamodel.rst:2823 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2824 +#: ../../reference/datamodel.rst:2825 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3243,7 +3243,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2831 +#: ../../reference/datamodel.rst:2832 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3252,7 +3252,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2837 +#: ../../reference/datamodel.rst:2838 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3262,19 +3262,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2847 +#: ../../reference/datamodel.rst:2848 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2848 +#: ../../reference/datamodel.rst:2849 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2854 +#: ../../reference/datamodel.rst:2855 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2856 +#: ../../reference/datamodel.rst:2857 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3282,7 +3282,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2871 +#: ../../reference/datamodel.rst:2872 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3291,21 +3291,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2885 +#: ../../reference/datamodel.rst:2886 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:2894 +#: ../../reference/datamodel.rst:2895 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:2920 +#: ../../reference/datamodel.rst:2921 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3314,36 +3314,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:2931 +#: ../../reference/datamodel.rst:2932 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:2935 +#: ../../reference/datamodel.rst:2936 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:2937 +#: ../../reference/datamodel.rst:2938 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:2943 +#: ../../reference/datamodel.rst:2944 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:2949 +#: ../../reference/datamodel.rst:2950 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:2955 +#: ../../reference/datamodel.rst:2956 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3351,15 +3351,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:2963 +#: ../../reference/datamodel.rst:2964 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:2969 +#: ../../reference/datamodel.rst:2970 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:2971 +#: ../../reference/datamodel.rst:2972 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3370,18 +3370,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:2979 +#: ../../reference/datamodel.rst:2980 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:2983 +#: ../../reference/datamodel.rst:2984 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:2989 +#: ../../reference/datamodel.rst:2990 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3392,7 +3392,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3000 +#: ../../reference/datamodel.rst:3001 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3403,7 +3403,7 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3011 +#: ../../reference/datamodel.rst:3012 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3413,99 +3413,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3019 +#: ../../reference/datamodel.rst:3020 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3025 +#: ../../reference/datamodel.rst:3026 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3027 +#: ../../reference/datamodel.rst:3028 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3030 +#: ../../reference/datamodel.rst:3031 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3034 +#: ../../reference/datamodel.rst:3035 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3038 +#: ../../reference/datamodel.rst:3039 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3041 +#: ../../reference/datamodel.rst:3042 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3058 +#: ../../reference/datamodel.rst:3059 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3063 +#: ../../reference/datamodel.rst:3064 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3071 +#: ../../reference/datamodel.rst:3072 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3073 +#: ../../reference/datamodel.rst:3074 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3076 +#: ../../reference/datamodel.rst:3077 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3080 +#: ../../reference/datamodel.rst:3081 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3085 +#: ../../reference/datamodel.rst:3086 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3088 +#: ../../reference/datamodel.rst:3089 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3101 +#: ../../reference/datamodel.rst:3102 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3102 +#: ../../reference/datamodel.rst:3103 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3106 +#: ../../reference/datamodel.rst:3107 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3513,7 +3513,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3112 +#: ../../reference/datamodel.rst:3113 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3521,7 +3521,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3118 +#: ../../reference/datamodel.rst:3119 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " From 890797561ea3c9ec0ef39d0e19a3f14f17d2ba92 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 23 Feb 2023 00:34:19 +0000 Subject: [PATCH 032/130] sync with cpython bf0a8362 --- library/queue.po | 72 +++++++++++++++++++++++++---------------------- library/turtle.po | 55 ++++++++++++++++++------------------ 2 files changed, 66 insertions(+), 61 deletions(-) diff --git a/library/queue.po b/library/queue.po index 4bc739ef99..49ba1349a8 100644 --- a/library/queue.po +++ b/library/queue.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-22 00:30+0000\n" +"POT-Creation-Date: 2023-02-23 00:32+0000\n" "PO-Revision-Date: 2022-09-27 00:12+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,13 +42,14 @@ msgstr "" "class 實作所有必需的鎖定語義 (locking semantics)。" #: ../../library/queue.rst:16 +#, fuzzy msgid "" "The module implements three types of queue, which differ only in the order " "in which the entries are retrieved. In a :abbr:`FIFO (first-in, first-out)` " -"queue, the first tasks added are the first retrieved. In a :abbr:`LIFO (last-" -"in, first-out)` queue, the most recently added entry is the first retrieved " -"(operating like a stack). With a priority queue, the entries are kept " -"sorted (using the :mod:`heapq` module) and the lowest valued entry is " +"queue, the first tasks added are the first retrieved. In a :abbr:`LIFO " +"(last-in, first-out)` queue, the most recently added entry is the first " +"retrieved (operating like a stack). With a priority queue, the entries are " +"kept sorted (using the :mod:`heapq` module) and the lowest valued entry is " "retrieved first." msgstr "" "此 module 實作三種型別的佇列,它們僅在取出條目的順序上有所不同。在 :abbr:" @@ -119,7 +120,7 @@ msgstr "" #, fuzzy msgid "" "The lowest valued entries are retrieved first (the lowest valued entry is " -"the one that would be returned by ``min(entries)``). A typical pattern for " +"the one that would be returned by ``min(entries)``). A typical pattern for " "entries is a tuple in the form: ``(priority_number, data)``." msgstr "" "最低值的條目會最先被取出(最低值的條目是被 ``sorted(list(entries))[0]`` 回傳" @@ -203,14 +204,15 @@ msgstr "" "則不保證後續呼叫 put() 不會阻塞。" #: ../../library/queue.rst:130 +#, fuzzy msgid "" -"Put *item* into the queue. If optional args *block* is true and *timeout* is " -"``None`` (the default), block if necessary until a free slot is available. " -"If *timeout* is a positive number, it blocks at most *timeout* seconds and " -"raises the :exc:`Full` exception if no free slot was available within that " -"time. Otherwise (*block* is false), put an item on the queue if a free slot " -"is immediately available, else raise the :exc:`Full` exception (*timeout* is " -"ignored in that case)." +"Put *item* into the queue. If optional args *block* is true and *timeout* " +"is ``None`` (the default), block if necessary until a free slot is " +"available. If *timeout* is a positive number, it blocks at most *timeout* " +"seconds and raises the :exc:`Full` exception if no free slot was available " +"within that time. Otherwise (*block* is false), put an item on the queue if " +"a free slot is immediately available, else raise the :exc:`Full` exception " +"(*timeout* is ignored in that case)." msgstr "" "將 *item* 放入佇列中。如果可選的 args *block* 為 true、*timeout* 為 " "``None``\\ (預設值),則在必要時阻塞,直到自由槽 (free slot) 可用。如果 " @@ -222,9 +224,9 @@ msgstr "" msgid "Equivalent to ``put(item, block=False)``." msgstr "等效於 ``put(item, block=False)``。" -#: ../../library/queue.rst:146 +#: ../../library/queue.rst:146 ../../library/queue.rst:258 msgid "" -"Remove and return an item from the queue. If optional args *block* is true " +"Remove and return an item from the queue. If optional args *block* is true " "and *timeout* is ``None`` (the default), block if necessary until an item is " "available. If *timeout* is a positive number, it blocks at most *timeout* " "seconds and raises the :exc:`Empty` exception if no item was available " @@ -239,10 +241,11 @@ msgstr "" "發 :exc:`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" #: ../../library/queue.rst:153 +#, fuzzy msgid "" "Prior to 3.0 on POSIX systems, and for all versions on Windows, if *block* " "is true and *timeout* is ``None``, this operation goes into an " -"uninterruptible wait on an underlying lock. This means that no exceptions " +"uninterruptible wait on an underlying lock. This means that no exceptions " "can occur, and in particular a SIGINT will not trigger a :exc:" "`KeyboardInterrupt`." msgstr "" @@ -291,11 +294,12 @@ msgid "Blocks until all items in the queue have been gotten and processed." msgstr "持續阻塞直到佇列中的所有項目都已被獲取並處理完畢。" #: ../../library/queue.rst:185 +#, fuzzy msgid "" "The count of unfinished tasks goes up whenever an item is added to the " "queue. The count goes down whenever a consumer thread calls :meth:" "`task_done` to indicate that the item was retrieved and all work on it is " -"complete. When the count of unfinished tasks drops to zero, :meth:`join` " +"complete. When the count of unfinished tasks drops to zero, :meth:`join` " "unblocks." msgstr "" "每當項目被加到佇列中時,未完成任務的計數都會增加。每當消費者執行緒呼叫 :meth:" @@ -326,8 +330,9 @@ msgstr "" "傳回佇列的近似大小。注意,qsize() > 0 並不能保證後續的 get() 不會阻塞。" #: ../../library/queue.rst:230 +#, fuzzy msgid "" -"Return ``True`` if the queue is empty, ``False`` otherwise. If empty() " +"Return ``True`` if the queue is empty, ``False`` otherwise. If empty() " "returns ``False`` it doesn't guarantee that a subsequent call to get() will " "not block." msgstr "" @@ -365,22 +370,6 @@ msgid "" msgstr "" "等效於 ``put(item, block=False)``,用於與 :meth:`Queue.put_nowait` 相容。" -#: ../../library/queue.rst:258 -msgid "" -"Remove and return an item from the queue. If optional args *block* is true " -"and *timeout* is ``None`` (the default), block if necessary until an item is " -"available. If *timeout* is a positive number, it blocks at most *timeout* " -"seconds and raises the :exc:`Empty` exception if no item was available " -"within that time. Otherwise (*block* is false), return an item if one is " -"immediately available, else raise the :exc:`Empty` exception (*timeout* is " -"ignored in that case)." -msgstr "" -"從佇列中移除並回傳一個項目。如果可選的 args *block* 為 true,且 *timeout* 為 " -"``None``\\ (預設值),則在必要時阻塞,直到有可用的項目。如果 *timeout* 是正" -"數,則最多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:" -"`Empty` 例外。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引" -"發 :exc:`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" - #: ../../library/queue.rst:275 msgid "Class :class:`multiprocessing.Queue`" msgstr "Class :class:`multiprocessing.Queue`" @@ -403,3 +392,18 @@ msgstr "" ":class:`collections.deque` 是無界佇列的替代實作,有快速且具原子性 (atomic) " "的 :meth:`~collections.deque.append` 和 :meth:`~collections.deque.popleft` 操" "作,這些操作不需要鎖定,並且還支持索引。" + +#~ msgid "" +#~ "Remove and return an item from the queue. If optional args *block* is " +#~ "true and *timeout* is ``None`` (the default), block if necessary until an " +#~ "item is available. If *timeout* is a positive number, it blocks at most " +#~ "*timeout* seconds and raises the :exc:`Empty` exception if no item was " +#~ "available within that time. Otherwise (*block* is false), return an item " +#~ "if one is immediately available, else raise the :exc:`Empty` exception " +#~ "(*timeout* is ignored in that case)." +#~ msgstr "" +#~ "從佇列中移除並回傳一個項目。如果可選的 args *block* 為 true,且 *timeout* " +#~ "為 ``None``\\ (預設值),則在必要時阻塞,直到有可用的項目。如果 " +#~ "*timeout* 是正數,則最多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目," +#~ "則會引發 :exc:`Empty` 例外。否則(*block* 為 false),如果立即可用,則回傳" +#~ "一個項目,否則引發 :exc:`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" diff --git a/library/turtle.po b/library/turtle.po index 93aeec3950..122f31a7fc 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-23 00:32+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -445,7 +445,7 @@ msgstr ":func:`end_poly`" msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2457 msgid ":func:`clone`" msgstr ":func:`clone`" @@ -1240,9 +1240,10 @@ msgstr "" msgid "" "Set turtle shape to shape with given *name* or, if name is not given, return " "name of current shape. Shape with *name* must exist in the TurtleScreen's " -"shape dictionary. Initially there are the following polygon shapes: \"arrow" -"\", \"turtle\", \"circle\", \"square\", \"triangle\", \"classic\". To learn " -"about how to deal with shapes see Screen method :func:`register_shape`." +"shape dictionary. Initially there are the following polygon shapes: " +"\"arrow\", \"turtle\", \"circle\", \"square\", \"triangle\", \"classic\". " +"To learn about how to deal with shapes see Screen method :func:" +"`register_shape`." msgstr "" #: ../../library/turtle.rst:1181 @@ -2437,61 +2438,61 @@ msgid "compound shapes, :class:`Vec2D`" msgstr "" #: ../../library/turtle.rst:2447 +msgid "rosette" +msgstr "" + +#: ../../library/turtle.rst:2447 +msgid "a pattern from the wikipedia article on turtle graphics" +msgstr "" + +#: ../../library/turtle.rst:2447 +msgid ":func:`clone`, :func:`undo`" +msgstr ":func:`clone`, :func:`undo`" + +#: ../../library/turtle.rst:2450 msgid "round_dance" msgstr "round_dance" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2450 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2450 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2454 msgid "sorting_animate" msgstr "sorting_animate" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2454 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2454 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2457 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2457 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2460 msgid "two_canvases" msgstr "two_canvases" -#: ../../library/turtle.rst:2457 -msgid "simple design" -msgstr "" - -#: ../../library/turtle.rst:2457 -msgid "turtles on two canvases" -msgstr "" - #: ../../library/turtle.rst:2460 -msgid "wikipedia" +msgid "simple design" msgstr "" #: ../../library/turtle.rst:2460 -msgid "a pattern from the wikipedia article on turtle graphics" +msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2460 -msgid ":func:`clone`, :func:`undo`" -msgstr ":func:`clone`, :func:`undo`" - #: ../../library/turtle.rst:2463 msgid "yinyang" msgstr "" From 9eef467340c5b6efc83fa66c01f0da29cb9f2e36 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 24 Feb 2023 00:35:28 +0000 Subject: [PATCH 033/130] sync with cpython 5e1bbb58 --- library/asyncio-stream.po | 128 +++++++++++++++++++++----------------- 1 file changed, 72 insertions(+), 56 deletions(-) diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 891df4854e..b9ee4fffbc 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-02-24 00:33+0000\n" "PO-Revision-Date: 2022-10-31 16:28+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -223,41 +223,50 @@ msgstr "" "`start_server` 會是較好的做法。" #: ../../library/asyncio-stream.rst:209 -msgid "" -"Read up to *n* bytes. If *n* is not provided, or set to ``-1``, read until " -"EOF and return all read bytes." +msgid "Read up to *n* bytes from the stream." msgstr "" -"讀取至多 *n* 個位元組。如果沒有設定 *n* 或被設為 ``-1``,則表示要持續讀取直" -"到 EOF 並回傳所有已讀取的位元組。" -#: ../../library/asyncio-stream.rst:212 +#: ../../library/asyncio-stream.rst:211 +#, fuzzy msgid "" -"If EOF was received and the internal buffer is empty, return an empty " -"``bytes`` object." +"If *n* is not provided or set to ``-1``, read until EOF, then return all " +"read :class:`bytes`. If EOF was received and the internal buffer is empty, " +"return an empty ``bytes`` object." msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:217 +#: ../../library/asyncio-stream.rst:216 +msgid "If *n* is ``0``, return an empty ``bytes`` object immediately." +msgstr "" + +#: ../../library/asyncio-stream.rst:218 +msgid "" +"If *n* is positive, return at most *n* available ``bytes`` as soon as at " +"least 1 byte is available in the internal buffer. If EOF is received before " +"any byte is read, return an empty ``bytes`` object." +msgstr "" + +#: ../../library/asyncio-stream.rst:225 msgid "" "Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." msgstr "讀取一行,其中\"行\"指的是以 ``\\n`` 結尾的位元組序列。" -#: ../../library/asyncio-stream.rst:220 +#: ../../library/asyncio-stream.rst:228 msgid "" "If EOF is received and ``\\n`` was not found, the method returns partially " "read data." msgstr "如果讀取到 EOF 而沒有找到 ``\\n``,該方法會回傳部分的已讀取資料。" -#: ../../library/asyncio-stream.rst:223 +#: ../../library/asyncio-stream.rst:231 msgid "" "If EOF is received and the internal buffer is empty, return an empty " "``bytes`` object." msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:228 +#: ../../library/asyncio-stream.rst:236 msgid "Read exactly *n* bytes." msgstr "讀取剛好 *n* 個位元組。" -#: ../../library/asyncio-stream.rst:230 +#: ../../library/asyncio-stream.rst:238 msgid "" "Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be " "read. Use the :attr:`IncompleteReadError.partial` attribute to get the " @@ -267,11 +276,11 @@ msgstr "" "`IncompleteReadError`。使用 :attr:`IncompleteReadError.partial` 屬性來獲取串" "流結束前已讀取的部分資料。" -#: ../../library/asyncio-stream.rst:236 +#: ../../library/asyncio-stream.rst:244 msgid "Read data from the stream until *separator* is found." msgstr "從串流中持續讀取資料直到出現 *separator*。" -#: ../../library/asyncio-stream.rst:238 +#: ../../library/asyncio-stream.rst:246 msgid "" "On success, the data and separator will be removed from the internal buffer " "(consumed). Returned data will include the separator at the end." @@ -279,7 +288,7 @@ msgstr "" "成功後,資料和 separator(分隔符號)會從內部緩衝區中刪除(或者說是被消費掉 " "(consumed))。回傳的資料在末尾會有一個 separator。" -#: ../../library/asyncio-stream.rst:242 +#: ../../library/asyncio-stream.rst:250 msgid "" "If the amount of data read exceeds the configured stream limit, a :exc:" "`LimitOverrunError` exception is raised, and the data is left in the " @@ -288,7 +297,7 @@ msgstr "" "如果讀取的資料量超過了設定的串流限制,將會引發 :exc:`LimitOverrunError` 例" "外,資料將被留在內部緩衝區中,並可以再次被讀取。" -#: ../../library/asyncio-stream.rst:246 +#: ../../library/asyncio-stream.rst:254 msgid "" "If EOF is reached before the complete separator is found, an :exc:" "`IncompleteReadError` exception is raised, and the internal buffer is " @@ -299,20 +308,20 @@ msgstr "" "`IncompleteReadError` 例外,且內部緩衝區會被重置。:attr:`IncompleteReadError." "partial` 屬性可能包含一部分的 separator。" -#: ../../library/asyncio-stream.rst:255 +#: ../../library/asyncio-stream.rst:263 msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." msgstr "如果緩衝區是空的且 :meth:`feed_eof` 曾被呼叫則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:260 +#: ../../library/asyncio-stream.rst:268 msgid "StreamWriter" msgstr "StreamWriter" -#: ../../library/asyncio-stream.rst:264 +#: ../../library/asyncio-stream.rst:272 msgid "" "Represents a writer object that provides APIs to write data to the IO stream." msgstr "表示一個有提供 API 來將資料寫入 IO 串流的 writer 物件。" -#: ../../library/asyncio-stream.rst:267 +#: ../../library/asyncio-stream.rst:275 msgid "" "It is not recommended to instantiate *StreamWriter* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -320,7 +329,7 @@ msgstr "" "不建議直接實例化 *StreamWriter* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:273 +#: ../../library/asyncio-stream.rst:281 msgid "" "The method attempts to write the *data* to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -329,14 +338,14 @@ msgstr "" "此方法會嘗試立即將 *data* 寫入到底層的 socket。如果失敗,資料會被放到內部寫入" "緩衝中排隊等待 (queue),直到它可被發送。" -#: ../../library/asyncio-stream.rst:277 ../../library/asyncio-stream.rst:289 +#: ../../library/asyncio-stream.rst:285 ../../library/asyncio-stream.rst:297 msgid "The method should be used along with the ``drain()`` method::" msgstr "" "此方法應當與 ``drain()`` 方法一起使用:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:284 +#: ../../library/asyncio-stream.rst:292 msgid "" "The method writes a list (or any iterable) of bytes to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -345,11 +354,11 @@ msgstr "" "此方法會立即嘗試將一個位元組 list(或任何可疊代物件 (iterable))寫入到底層的 " "socket。如果失敗,資料會被放到內部寫入緩衝中排隊等待,直到它可被發送。" -#: ../../library/asyncio-stream.rst:296 +#: ../../library/asyncio-stream.rst:304 msgid "The method closes the stream and the underlying socket." msgstr "此方法會關閉串流以及底層的 socket。" -#: ../../library/asyncio-stream.rst:298 +#: ../../library/asyncio-stream.rst:306 #, fuzzy msgid "" "The method should be used, though not mandatory, along with the " @@ -359,7 +368,7 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:306 +#: ../../library/asyncio-stream.rst:314 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." @@ -367,29 +376,29 @@ msgstr "" "如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 " "``False``。" -#: ../../library/asyncio-stream.rst:311 +#: ../../library/asyncio-stream.rst:319 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。" -#: ../../library/asyncio-stream.rst:316 +#: ../../library/asyncio-stream.rst:324 msgid "Return the underlying asyncio transport." msgstr "回傳底層的 asyncio 傳輸。" -#: ../../library/asyncio-stream.rst:320 +#: ../../library/asyncio-stream.rst:328 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。" -#: ../../library/asyncio-stream.rst:325 +#: ../../library/asyncio-stream.rst:333 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "" "等待直到可以繼續寫入到串流。範例:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:331 +#: ../../library/asyncio-stream.rst:339 msgid "" "This is a flow control method that interacts with the underlying IO write " "buffer. When the size of the buffer reaches the high watermark, *drain()* " @@ -401,41 +410,41 @@ msgstr "" "(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low " "watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。" -#: ../../library/asyncio-stream.rst:341 +#: ../../library/asyncio-stream.rst:349 msgid "Upgrade an existing stream-based connection to TLS." msgstr "" -#: ../../library/asyncio-stream.rst:343 +#: ../../library/asyncio-stream.rst:351 msgid "Parameters:" msgstr "" -#: ../../library/asyncio-stream.rst:345 +#: ../../library/asyncio-stream.rst:353 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-stream.rst:347 +#: ../../library/asyncio-stream.rst:355 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-stream.rst:350 +#: ../../library/asyncio-stream.rst:358 msgid "" "*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake " "to complete before aborting the connection. ``60.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-stream.rst:358 +#: ../../library/asyncio-stream.rst:366 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:365 +#: ../../library/asyncio-stream.rst:373 msgid "Wait until the stream is closed." msgstr "等待直到串流被關閉。" -#: ../../library/asyncio-stream.rst:367 +#: ../../library/asyncio-stream.rst:375 #, fuzzy msgid "" "Should be called after :meth:`close` to wait until the underlying connection " @@ -443,22 +452,22 @@ msgid "" "program." msgstr "應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉。" -#: ../../library/asyncio-stream.rst:375 +#: ../../library/asyncio-stream.rst:383 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-stream.rst:380 +#: ../../library/asyncio-stream.rst:388 msgid "TCP echo client using streams" msgstr "使用串流的 TCP echo 客戶端" -#: ../../library/asyncio-stream.rst:382 +#: ../../library/asyncio-stream.rst:390 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "" "使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:406 +#: ../../library/asyncio-stream.rst:414 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" @@ -467,18 +476,18 @@ msgstr "" "使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 " "`\\ 範例。" -#: ../../library/asyncio-stream.rst:413 +#: ../../library/asyncio-stream.rst:421 msgid "TCP echo server using streams" msgstr "使用串流的 TCP echo 伺服器" -#: ../../library/asyncio-stream.rst:415 +#: ../../library/asyncio-stream.rst:423 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "" "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:449 +#: ../../library/asyncio-stream.rst:457 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." @@ -487,11 +496,11 @@ msgstr "" "使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 " "` 範例。" -#: ../../library/asyncio-stream.rst:454 +#: ../../library/asyncio-stream.rst:462 msgid "Get HTTP headers" msgstr "獲取 HTTP 標頭" -#: ../../library/asyncio-stream.rst:456 +#: ../../library/asyncio-stream.rst:464 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "" @@ -499,25 +508,25 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:495 +#: ../../library/asyncio-stream.rst:503 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:499 +#: ../../library/asyncio-stream.rst:507 msgid "or with HTTPS::" msgstr "" "或使用 HTTPS:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:507 +#: ../../library/asyncio-stream.rst:515 msgid "Register an open socket to wait for data using streams" msgstr "註冊一個使用串流來等待資料的開放 socket" -#: ../../library/asyncio-stream.rst:509 +#: ../../library/asyncio-stream.rst:517 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" @@ -526,7 +535,7 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:544 +#: ../../library/asyncio-stream.rst:552 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " @@ -536,7 +545,7 @@ msgstr "" "`\\ 範例中,有使用了低階協定以及 :meth:" "`loop.create_connection` 方法。" -#: ../../library/asyncio-stream.rst:548 +#: ../../library/asyncio-stream.rst:556 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." @@ -544,3 +553,10 @@ msgid "" msgstr "" "在\\ :ref:`監視檔案描述器以讀取事件 `\\ 範例中,有" "使用低階的 :meth:`loop.add_reader` 方法來監視檔案描述器。" + +#~ msgid "" +#~ "Read up to *n* bytes. If *n* is not provided, or set to ``-1``, read " +#~ "until EOF and return all read bytes." +#~ msgstr "" +#~ "讀取至多 *n* 個位元組。如果沒有設定 *n* 或被設為 ``-1``,則表示要持續讀取" +#~ "直到 EOF 並回傳所有已讀取的位元組。" From 8c2676ea84b7d48a4ea9c4c30dc1324c40b58d3a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 25 Feb 2023 00:35:20 +0000 Subject: [PATCH 034/130] sync with cpython 3b4f8fc8 --- library/functions.po | 13 +++++++------ library/itertools.po | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/library/functions.po b/library/functions.po index 4244b761ca..22082e1214 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-03 00:16+0000\n" +"POT-Creation-Date: 2023-02-25 00:33+0000\n" "PO-Revision-Date: 2023-01-04 14:53+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1223,12 +1223,12 @@ msgid "Added the *closure* parameter." msgstr "增加了 *closure* 參數。" #: ../../library/functions.rst:624 +#, fuzzy msgid "" "Construct an iterator from those elements of *iterable* for which *function* " -"returns true. *iterable* may be either a sequence, a container which " -"supports iteration, or an iterator. If *function* is ``None``, the identity " -"function is assumed, that is, all elements of *iterable* that are false are " -"removed." +"is true. *iterable* may be either a sequence, a container which supports " +"iteration, or an iterator. If *function* is ``None``, the identity function " +"is assumed, that is, all elements of *iterable* that are false are removed." msgstr "" "用 *iterable* 中函式 *function* 回傳 True 的那些元素,構建一個新的 iterator。" "*iterable* 可以是一個序列、一個支援疊代的容器、或一個 iterator。如果 " @@ -1247,9 +1247,10 @@ msgstr "" "function 是 ``None`` 的時候為 ``(item for item in iterable if item)``。" #: ../../library/functions.rst:635 +#, fuzzy msgid "" "See :func:`itertools.filterfalse` for the complementary function that " -"returns elements of *iterable* for which *function* returns false." +"returns elements of *iterable* for which *function* is false." msgstr "" "請參閱 :func:`itertools.filterfalse`,只有 *function* 回傳 false 時才選取 " "*iterable* 中元素的互補函數。" diff --git a/library/itertools.po b/library/itertools.po index bd005e9b6f..72f4308370 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-08 00:17+0000\n" +"POT-Creation-Date: 2023-02-25 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -580,7 +580,7 @@ msgstr "" #: ../../library/itertools.rst:361 msgid "" "Make an iterator that filters elements from iterable returning only those " -"for which the predicate is ``False``. If *predicate* is ``None``, return the " +"for which the predicate is false. If *predicate* is ``None``, return the " "items that are false. Roughly equivalent to::" msgstr "" From 7246254af29682b0d2ec4cfef9fbfc66fdcd3484 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 Feb 2023 00:40:44 +0000 Subject: [PATCH 035/130] sync with cpython 735ff5ae --- library/asyncio-eventloop.po | 4 +- library/decimal.po | 287 +++++++++++----------- library/importlib.resources.abc.po | 38 +-- library/typing.po | 8 +- library/zipfile.po | 371 +++++++++++++++-------------- 5 files changed, 360 insertions(+), 348 deletions(-) diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index db2464eefe..ed37d8ad75 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-19 00:33+0000\n" +"POT-Creation-Date: 2023-02-26 00:38+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -696,7 +696,7 @@ msgid "" "IPv4 path and protocol are working, but the server's IPv6 path and protocol " "are not working, a dual-stack client application experiences significant " "connection delay compared to an IPv4-only client. This is undesirable " -"because it causes the dual- stack client to have a worse user experience. " +"because it causes the dual-stack client to have a worse user experience. " "This document specifies requirements for algorithms that reduce this user-" "visible delay and provides an algorithm." msgstr "" diff --git a/library/decimal.po b/library/decimal.po index 5fb2c571ca..2d9d024873 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-26 00:38+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,18 +44,18 @@ msgstr "" #: ../../library/decimal.rst:42 msgid "" -"Decimal numbers can be represented exactly. In contrast, numbers like :" -"const:`1.1` and :const:`2.2` do not have exact representations in binary " -"floating point. End users typically would not expect ``1.1 + 2.2`` to " -"display as :const:`3.3000000000000003` as it does with binary floating point." +"Decimal numbers can be represented exactly. In contrast, numbers like " +"``1.1`` and ``2.2`` do not have exact representations in binary floating " +"point. End users typically would not expect ``1.1 + 2.2`` to display as " +"``3.3000000000000003`` as it does with binary floating point." msgstr "" #: ../../library/decimal.rst:47 msgid "" "The exactness carries over into arithmetic. In decimal floating point, " "``0.1 + 0.1 + 0.1 - 0.3`` is exactly equal to zero. In binary floating " -"point, the result is :const:`5.5511151231257827e-017`. While near to zero, " -"the differences prevent reliable equality testing and differences can " +"point, the result is ``5.5511151231257827e-017``. While near to zero, the " +"differences prevent reliable equality testing and differences can " "accumulate. For this reason, decimal is preferred in accounting applications " "which have strict equality invariants." msgstr "" @@ -63,11 +63,11 @@ msgstr "" #: ../../library/decimal.rst:54 msgid "" "The decimal module incorporates a notion of significant places so that " -"``1.30 + 1.20`` is :const:`2.50`. The trailing zero is kept to indicate " +"``1.30 + 1.20`` is ``2.50``. The trailing zero is kept to indicate " "significance. This is the customary presentation for monetary applications. " "For multiplication, the \"schoolbook\" approach uses all the figures in the " -"multiplicands. For instance, ``1.3 * 1.2`` gives :const:`1.56` while ``1.30 " -"* 1.20`` gives :const:`1.5600`." +"multiplicands. For instance, ``1.3 * 1.2`` gives ``1.56`` while ``1.30 * " +"1.20`` gives ``1.5600``." msgstr "" #: ../../library/decimal.rst:61 @@ -105,9 +105,9 @@ msgstr "" msgid "" "A decimal number is immutable. It has a sign, coefficient digits, and an " "exponent. To preserve significance, the coefficient digits do not truncate " -"trailing zeros. Decimals also include special values such as :const:" -"`Infinity`, :const:`-Infinity`, and :const:`NaN`. The standard also " -"differentiates :const:`-0` from :const:`+0`." +"trailing zeros. Decimals also include special values such as ``Infinity``, " +"``-Infinity``, and ``NaN``. The standard also differentiates ``-0`` from " +"``+0``." msgstr "" #: ../../library/decimal.rst:94 @@ -161,8 +161,8 @@ msgid "" "Decimal instances can be constructed from integers, strings, floats, or " "tuples. Construction from an integer or a float performs an exact conversion " "of the value of that integer or float. Decimal numbers include special " -"values such as :const:`NaN` which stands for \"Not a number\", positive and " -"negative :const:`Infinity`, and :const:`-0`::" +"values such as ``NaN`` which stands for \"Not a number\", positive and " +"negative ``Infinity``, and ``-0``::" msgstr "" #: ../../library/decimal.rst:163 @@ -197,9 +197,9 @@ msgstr "" #: ../../library/decimal.rst:253 msgid "" -"The :meth:`quantize` method rounds a number to a fixed exponent. This " -"method is useful for monetary applications that often round results to a " -"fixed number of places:" +"The :meth:`~Decimal.quantize` method rounds a number to a fixed exponent. " +"This method is useful for monetary applications that often round results to " +"a fixed number of places:" msgstr "" #: ../../library/decimal.rst:262 @@ -229,20 +229,20 @@ msgid "" "Contexts also have signal flags for monitoring exceptional conditions " "encountered during computations. The flags remain set until explicitly " "cleared, so it is best to clear the flags before each set of monitored " -"computations by using the :meth:`clear_flags` method. ::" +"computations by using the :meth:`~Context.clear_flags` method. ::" msgstr "" #: ../../library/decimal.rst:312 msgid "" -"The *flags* entry shows that the rational approximation to :const:`Pi` was " -"rounded (digits beyond the context precision were thrown away) and that the " -"result is inexact (some of the discarded digits were non-zero)." +"The *flags* entry shows that the rational approximation to pi was rounded " +"(digits beyond the context precision were thrown away) and that the result " +"is inexact (some of the discarded digits were non-zero)." msgstr "" #: ../../library/decimal.rst:316 msgid "" -"Individual traps are set using the dictionary in the :attr:`traps` field of " -"a context:" +"Individual traps are set using the dictionary in the :attr:`~Context.traps` " +"attribute of a context:" msgstr "" #: ../../library/decimal.rst:331 @@ -281,10 +281,10 @@ msgstr "" #: ../../library/decimal.rst:371 msgid "" -"If *value* is a :class:`tuple`, it should have three components, a sign (:" -"const:`0` for positive or :const:`1` for negative), a :class:`tuple` of " -"digits, and an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), " -"-3))`` returns ``Decimal('1.414')``." +"If *value* is a :class:`tuple`, it should have three components, a sign " +"(``0`` for positive or ``1`` for negative), a :class:`tuple` of digits, and " +"an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), -3))`` returns " +"``Decimal('1.414')``." msgstr "" #: ../../library/decimal.rst:376 @@ -309,7 +309,7 @@ msgid "" "The purpose of the *context* argument is determining what to do if *value* " "is a malformed string. If the context traps :const:`InvalidOperation`, an " "exception is raised; otherwise, the constructor returns a new Decimal with " -"the value of :const:`NaN`." +"the value of ``NaN``." msgstr "" #: ../../library/decimal.rst:392 @@ -639,7 +639,7 @@ msgstr "" #: ../../library/decimal.rst:703 msgid "" "Like ``max(self, other)`` except that the context rounding rule is applied " -"before returning and that :const:`NaN` values are either signaled or ignored " +"before returning and that ``NaN`` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" @@ -652,7 +652,7 @@ msgstr "" #: ../../library/decimal.rst:715 msgid "" "Like ``min(self, other)`` except that the context rounding rule is applied " -"before returning and that :const:`NaN` values are either signaled or ignored " +"before returning and that ``NaN`` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" @@ -687,11 +687,10 @@ msgstr "" #: ../../library/decimal.rst:746 msgid "" "Normalize the number by stripping the rightmost trailing zeros and " -"converting any result equal to :const:`Decimal('0')` to :const:" -"`Decimal('0e0')`. Used for producing canonical values for attributes of an " -"equivalence class. For example, ``Decimal('32.100')`` and " -"``Decimal('0.321000e+2')`` both normalize to the equivalent value " -"``Decimal('32.1')``." +"converting any result equal to ``Decimal('0')`` to ``Decimal('0e0')``. Used " +"for producing canonical values for attributes of an equivalence class. For " +"example, ``Decimal('32.100')`` and ``Decimal('0.321000e+2')`` both normalize " +"to the equivalent value ``Decimal('32.1')``." msgstr "" #: ../../library/decimal.rst:755 @@ -776,7 +775,7 @@ msgstr "" #: ../../library/decimal.rst:792 msgid "" "An error is returned whenever the resulting exponent is greater than :attr:" -"`Emax` or less than :attr:`Etiny`." +"`~Context.Emax` or less than :meth:`~Context.Etiny`." msgstr "" #: ../../library/decimal.rst:797 @@ -812,8 +811,8 @@ msgstr "" #: ../../library/decimal.rst:832 msgid "" -"Test whether self and other have the same exponent or whether both are :" -"const:`NaN`." +"Test whether self and other have the same exponent or whether both are " +"``NaN``." msgstr "" #: ../../library/decimal.rst:841 @@ -882,10 +881,11 @@ msgstr "" #: ../../library/decimal.rst:895 msgid "" -"The :meth:`logical_and`, :meth:`logical_invert`, :meth:`logical_or`, and :" -"meth:`logical_xor` methods expect their arguments to be *logical operands*. " -"A *logical operand* is a :class:`Decimal` instance whose exponent and sign " -"are both zero, and whose digits are all either :const:`0` or :const:`1`." +"The :meth:`~Decimal.logical_and`, :meth:`~Decimal.logical_invert`, :meth:" +"`~Decimal.logical_or`, and :meth:`~Decimal.logical_xor` methods expect their " +"arguments to be *logical operands*. A *logical operand* is a :class:" +"`Decimal` instance whose exponent and sign are both zero, and whose digits " +"are all either ``0`` or ``1``." msgstr "" #: ../../library/decimal.rst:907 @@ -983,9 +983,9 @@ msgstr "" #: ../../library/decimal.rst:984 msgid "" "Because the traps are disabled, this context is useful for applications that " -"prefer to have result value of :const:`NaN` or :const:`Infinity` instead of " -"raising exceptions. This allows an application to complete a run in the " -"presence of conditions that would otherwise halt the program." +"prefer to have result value of ``NaN`` or ``Infinity`` instead of raising " +"exceptions. This allows an application to complete a run in the presence of " +"conditions that would otherwise halt the program." msgstr "" #: ../../library/decimal.rst:992 @@ -1012,9 +1012,9 @@ msgstr "" #: ../../library/decimal.rst:1004 msgid "" -"The default values are :attr:`prec`\\ =\\ :const:`28`, :attr:`rounding`\\ =" -"\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:`Overflow`, :class:" -"`InvalidOperation`, and :class:`DivisionByZero`." +"The default values are :attr:`Context.prec`\\ =\\ ``28``, :attr:`Context." +"rounding`\\ =\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:" +"`Overflow`, :class:`InvalidOperation`, and :class:`DivisionByZero`." msgstr "" #: ../../library/decimal.rst:1009 @@ -1032,8 +1032,8 @@ msgstr "" #: ../../library/decimal.rst:1019 msgid "" -"*prec* is an integer in the range [:const:`1`, :const:`MAX_PREC`] that sets " -"the precision for arithmetic operations in the context." +"*prec* is an integer in the range [``1``, :const:`MAX_PREC`] that sets the " +"precision for arithmetic operations in the context." msgstr "" #: ../../library/decimal.rst:1022 @@ -1051,35 +1051,35 @@ msgstr "" #: ../../library/decimal.rst:1028 msgid "" "The *Emin* and *Emax* fields are integers specifying the outer limits " -"allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, :" -"const:`0`], *Emax* in the range [:const:`0`, :const:`MAX_EMAX`]." +"allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, " +"``0``], *Emax* in the range [``0``, :const:`MAX_EMAX`]." msgstr "" #: ../../library/decimal.rst:1032 msgid "" -"The *capitals* field is either :const:`0` or :const:`1` (the default). If " -"set to :const:`1`, exponents are printed with a capital :const:`E`; " -"otherwise, a lowercase :const:`e` is used: :const:`Decimal('6.02e+23')`." +"The *capitals* field is either ``0`` or ``1`` (the default). If set to " +"``1``, exponents are printed with a capital ``E``; otherwise, a lowercase " +"``e`` is used: ``Decimal('6.02e+23')``." msgstr "" #: ../../library/decimal.rst:1036 msgid "" -"The *clamp* field is either :const:`0` (the default) or :const:`1`. If set " -"to :const:`1`, the exponent ``e`` of a :class:`Decimal` instance " -"representable in this context is strictly limited to the range ``Emin - prec " -"+ 1 <= e <= Emax - prec + 1``. If *clamp* is :const:`0` then a weaker " -"condition holds: the adjusted exponent of the :class:`Decimal` instance is " -"at most ``Emax``. When *clamp* is :const:`1`, a large normal number will, " -"where possible, have its exponent reduced and a corresponding number of " -"zeros added to its coefficient, in order to fit the exponent constraints; " -"this preserves the value of the number but loses information about " -"significant trailing zeros. For example::" +"The *clamp* field is either ``0`` (the default) or ``1``. If set to ``1``, " +"the exponent ``e`` of a :class:`Decimal` instance representable in this " +"context is strictly limited to the range ``Emin - prec + 1 <= e <= Emax - " +"prec + 1``. If *clamp* is ``0`` then a weaker condition holds: the adjusted " +"exponent of the :class:`Decimal` instance is at most :attr:`~Context.Emax`. " +"When *clamp* is ``1``, a large normal number will, where possible, have its " +"exponent reduced and a corresponding number of zeros added to its " +"coefficient, in order to fit the exponent constraints; this preserves the " +"value of the number but loses information about significant trailing zeros. " +"For example::" msgstr "" #: ../../library/decimal.rst:1051 msgid "" -"A *clamp* value of :const:`1` allows compatibility with the fixed-width " -"decimal interchange formats specified in IEEE 754." +"A *clamp* value of ``1`` allows compatibility with the fixed-width decimal " +"interchange formats specified in IEEE 754." msgstr "" #: ../../library/decimal.rst:1054 @@ -1087,20 +1087,20 @@ msgid "" "The :class:`Context` class defines several general purpose methods as well " "as a large number of methods for doing arithmetic directly in a given " "context. In addition, for each of the :class:`Decimal` methods described " -"above (with the exception of the :meth:`adjusted` and :meth:`as_tuple` " -"methods) there is a corresponding :class:`Context` method. For example, for " -"a :class:`Context` instance ``C`` and :class:`Decimal` instance ``x``, ``C." -"exp(x)`` is equivalent to ``x.exp(context=C)``. Each :class:`Context` " -"method accepts a Python integer (an instance of :class:`int`) anywhere that " -"a Decimal instance is accepted." +"above (with the exception of the :meth:`~Decimal.adjusted` and :meth:" +"`~Decimal.as_tuple` methods) there is a corresponding :class:`Context` " +"method. For example, for a :class:`Context` instance ``C`` and :class:" +"`Decimal` instance ``x``, ``C.exp(x)`` is equivalent to ``x." +"exp(context=C)``. Each :class:`Context` method accepts a Python integer (an " +"instance of :class:`int`) anywhere that a Decimal instance is accepted." msgstr "" #: ../../library/decimal.rst:1067 -msgid "Resets all of the flags to :const:`0`." +msgid "Resets all of the flags to ``0``." msgstr "" #: ../../library/decimal.rst:1071 -msgid "Resets all of the traps to :const:`0`." +msgid "Resets all of the traps to ``0``." msgstr "" #: ../../library/decimal.rst:1077 @@ -1473,27 +1473,33 @@ msgid "64-bit" msgstr "" #: ../../library/decimal.rst:1486 ../../library/decimal.rst:1488 -msgid ":const:`425000000`" +#, fuzzy +msgid "``425000000``" msgstr ":const:`425000000`" #: ../../library/decimal.rst:1486 ../../library/decimal.rst:1488 -msgid ":const:`999999999999999999`" +#, fuzzy +msgid "``999999999999999999``" msgstr ":const:`999999999999999999`" #: ../../library/decimal.rst:1490 -msgid ":const:`-425000000`" +#, fuzzy +msgid "``-425000000``" msgstr ":const:`-425000000`" #: ../../library/decimal.rst:1490 -msgid ":const:`-999999999999999999`" +#, fuzzy +msgid "``-999999999999999999``" msgstr ":const:`-999999999999999999`" #: ../../library/decimal.rst:1492 -msgid ":const:`-849999999`" +#, fuzzy +msgid "``-849999999``" msgstr ":const:`-849999999`" #: ../../library/decimal.rst:1492 -msgid ":const:`-1999999999999999997`" +#, fuzzy +msgid "``-1999999999999999997``" msgstr ":const:`-1999999999999999997`" #: ../../library/decimal.rst:1498 @@ -1519,7 +1525,7 @@ msgid "Rounding modes" msgstr "" #: ../../library/decimal.rst:1517 -msgid "Round towards :const:`Infinity`." +msgid "Round towards ``Infinity``." msgstr "" #: ../../library/decimal.rst:1521 @@ -1527,7 +1533,7 @@ msgid "Round towards zero." msgstr "" #: ../../library/decimal.rst:1525 -msgid "Round towards :const:`-Infinity`." +msgid "Round towards ``-Infinity``." msgstr "" #: ../../library/decimal.rst:1529 @@ -1585,8 +1591,8 @@ msgstr "" #: ../../library/decimal.rst:1572 msgid "" "Typically, clamping occurs when an exponent falls outside the context's :" -"attr:`Emin` and :attr:`Emax` limits. If possible, the exponent is reduced " -"to fit by adding zeros to the coefficient." +"attr:`~Context.Emin` and :attr:`~Context.Emax` limits. If possible, the " +"exponent is reduced to fit by adding zeros to the coefficient." msgstr "" #: ../../library/decimal.rst:1579 @@ -1600,9 +1606,8 @@ msgstr "" #: ../../library/decimal.rst:1586 msgid "" "Can occur with division, modulo division, or when raising a number to a " -"negative power. If this signal is not trapped, returns :const:`Infinity` " -"or :const:`-Infinity` with the sign determined by the inputs to the " -"calculation." +"negative power. If this signal is not trapped, returns ``Infinity`` or ``-" +"Infinity`` with the sign determined by the inputs to the calculation." msgstr "" #: ../../library/decimal.rst:1593 @@ -1623,7 +1628,7 @@ msgstr "" #: ../../library/decimal.rst:1604 msgid "" "Indicates that an operation was requested that does not make sense. If not " -"trapped, returns :const:`NaN`. Possible causes include::" +"trapped, returns ``NaN``. Possible causes include::" msgstr "" #: ../../library/decimal.rst:1620 @@ -1632,10 +1637,10 @@ msgstr "" #: ../../library/decimal.rst:1622 msgid "" -"Indicates the exponent is larger than :attr:`Emax` after rounding has " -"occurred. If not trapped, the result depends on the rounding mode, either " -"pulling inward to the largest representable finite number or rounding " -"outward to :const:`Infinity`. In either case, :class:`Inexact` and :class:" +"Indicates the exponent is larger than :attr:`Context.Emax` after rounding " +"has occurred. If not trapped, the result depends on the rounding mode, " +"either pulling inward to the largest representable finite number or rounding " +"outward to ``Infinity``. In either case, :class:`Inexact` and :class:" "`Rounded` are also signaled." msgstr "" @@ -1646,13 +1651,12 @@ msgstr "" #: ../../library/decimal.rst:1633 msgid "" "Signaled whenever rounding discards digits; even if those digits are zero " -"(such as rounding :const:`5.00` to :const:`5.0`). If not trapped, returns " -"the result unchanged. This signal is used to detect loss of significant " -"digits." +"(such as rounding ``5.00`` to ``5.0``). If not trapped, returns the result " +"unchanged. This signal is used to detect loss of significant digits." msgstr "" #: ../../library/decimal.rst:1641 -msgid "Exponent was lower than :attr:`Emin` prior to rounding." +msgid "Exponent was lower than :attr:`~Context.Emin` prior to rounding." msgstr "" #: ../../library/decimal.rst:1643 @@ -1708,9 +1712,9 @@ msgstr "" #: ../../library/decimal.rst:1698 msgid "" "The use of decimal floating point eliminates decimal representation error " -"(making it possible to represent :const:`0.1` exactly); however, some " -"operations can still incur round-off error when non-zero digits exceed the " -"fixed precision." +"(making it possible to represent ``0.1`` exactly); however, some operations " +"can still incur round-off error when non-zero digits exceed the fixed " +"precision." msgstr "" #: ../../library/decimal.rst:1702 @@ -1735,8 +1739,8 @@ msgstr "" #: ../../library/decimal.rst:1748 msgid "" "The number system for the :mod:`decimal` module provides special values " -"including :const:`NaN`, :const:`sNaN`, :const:`-Infinity`, :const:" -"`Infinity`, and two zeros, :const:`+0` and :const:`-0`." +"including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, " +"``+0`` and ``-0``." msgstr "" #: ../../library/decimal.rst:1752 @@ -1757,37 +1761,37 @@ msgstr "" #: ../../library/decimal.rst:1761 msgid "" -"Some operations are indeterminate and return :const:`NaN`, or if the :exc:" +"Some operations are indeterminate and return ``NaN``, or if the :exc:" "`InvalidOperation` signal is trapped, raise an exception. For example, " -"``0/0`` returns :const:`NaN` which means \"not a number\". This variety of :" -"const:`NaN` is quiet and, once created, will flow through other computations " -"always resulting in another :const:`NaN`. This behavior can be useful for a " +"``0/0`` returns ``NaN`` which means \"not a number\". This variety of " +"``NaN`` is quiet and, once created, will flow through other computations " +"always resulting in another ``NaN``. This behavior can be useful for a " "series of computations that occasionally have missing inputs --- it allows " "the calculation to proceed while flagging specific results as invalid." msgstr "" #: ../../library/decimal.rst:1769 msgid "" -"A variant is :const:`sNaN` which signals rather than remaining quiet after " -"every operation. This is a useful return value when an invalid result needs " -"to interrupt a calculation for special handling." +"A variant is ``sNaN`` which signals rather than remaining quiet after every " +"operation. This is a useful return value when an invalid result needs to " +"interrupt a calculation for special handling." msgstr "" #: ../../library/decimal.rst:1773 msgid "" "The behavior of Python's comparison operators can be a little surprising " -"where a :const:`NaN` is involved. A test for equality where one of the " -"operands is a quiet or signaling :const:`NaN` always returns :const:`False` " -"(even when doing ``Decimal('NaN')==Decimal('NaN')``), while a test for " -"inequality always returns :const:`True`. An attempt to compare two Decimals " -"using any of the ``<``, ``<=``, ``>`` or ``>=`` operators will raise the :" -"exc:`InvalidOperation` signal if either operand is a :const:`NaN`, and " -"return :const:`False` if this signal is not trapped. Note that the General " -"Decimal Arithmetic specification does not specify the behavior of direct " -"comparisons; these rules for comparisons involving a :const:`NaN` were taken " -"from the IEEE 854 standard (see Table 3 in section 5.7). To ensure strict " -"standards-compliance, use the :meth:`compare` and :meth:`compare-signal` " -"methods instead." +"where a ``NaN`` is involved. A test for equality where one of the operands " +"is a quiet or signaling ``NaN`` always returns :const:`False` (even when " +"doing ``Decimal('NaN')==Decimal('NaN')``), while a test for inequality " +"always returns :const:`True`. An attempt to compare two Decimals using any " +"of the ``<``, ``<=``, ``>`` or ``>=`` operators will raise the :exc:" +"`InvalidOperation` signal if either operand is a ``NaN``, and return :const:" +"`False` if this signal is not trapped. Note that the General Decimal " +"Arithmetic specification does not specify the behavior of direct " +"comparisons; these rules for comparisons involving a ``NaN`` were taken from " +"the IEEE 854 standard (see Table 3 in section 5.7). To ensure strict " +"standards-compliance, use the :meth:`~Decimal.compare` and :meth:`~Decimal." +"compare_signal` methods instead." msgstr "" #: ../../library/decimal.rst:1786 @@ -1874,8 +1878,9 @@ msgstr "" #: ../../library/decimal.rst:2016 msgid "" -"A. The :meth:`quantize` method rounds to a fixed number of decimal places. " -"If the :const:`Inexact` trap is set, it is also useful for validation:" +"A. The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal " +"places. If the :const:`Inexact` trap is set, it is also useful for " +"validation:" msgstr "" #: ../../library/decimal.rst:2034 @@ -1889,27 +1894,27 @@ msgid "" "A. Some operations like addition, subtraction, and multiplication by an " "integer will automatically preserve fixed point. Others operations, like " "division and non-integer multiplication, will change the number of decimal " -"places and need to be followed-up with a :meth:`quantize` step:" +"places and need to be followed-up with a :meth:`~Decimal.quantize` step:" msgstr "" #: ../../library/decimal.rst:2055 msgid "" "In developing fixed-point applications, it is convenient to define functions " -"to handle the :meth:`quantize` step:" +"to handle the :meth:`~Decimal.quantize` step:" msgstr "" #: ../../library/decimal.rst:2068 msgid "" -"Q. There are many ways to express the same value. The numbers :const:" -"`200`, :const:`200.000`, :const:`2E2`, and :const:`.02E+4` all have the same " -"value at various precisions. Is there a way to transform them to a single " -"recognizable canonical value?" +"Q. There are many ways to express the same value. The numbers ``200``, " +"``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various " +"precisions. Is there a way to transform them to a single recognizable " +"canonical value?" msgstr "" #: ../../library/decimal.rst:2073 msgid "" -"A. The :meth:`normalize` method maps all equivalent values to a single " -"representative:" +"A. The :meth:`~Decimal.normalize` method maps all equivalent values to a " +"single representative:" msgstr "" #: ../../library/decimal.rst:2080 @@ -1921,8 +1926,8 @@ msgstr "" #: ../../library/decimal.rst:2083 msgid "" "A. For some values, exponential notation is the only way to express the " -"number of significant places in the coefficient. For example, expressing :" -"const:`5.0E+3` as :const:`5000` keeps the value constant but cannot show the " +"number of significant places in the coefficient. For example, expressing " +"``5.0E+3`` as ``5000`` keeps the value constant but cannot show the " "original's two-place significance." msgstr "" @@ -2006,15 +2011,15 @@ msgstr "" #: ../../library/decimal.rst:2161 msgid "" "The context must be adapted for exact arbitrary precision arithmetic. :attr:" -"`Emin` and :attr:`Emax` should always be set to the maximum values, :attr:" -"`clamp` should always be 0 (the default). Setting :attr:`prec` requires " -"some care." +"`~Context.Emin` and :attr:`~Context.Emax` should always be set to the " +"maximum values, :attr:`~Context.clamp` should always be 0 (the default). " +"Setting :attr:`~Context.prec` requires some care." msgstr "" #: ../../library/decimal.rst:2165 msgid "" "The easiest approach for trying out bignum arithmetic is to use the maximum " -"value for :attr:`prec` as well [#]_::" +"value for :attr:`~Context.prec` as well [#]_::" msgstr "" #: ../../library/decimal.rst:2174 @@ -2026,9 +2031,9 @@ msgstr "" #: ../../library/decimal.rst:2182 msgid "" "On systems with overallocation (e.g. Linux), a more sophisticated approach " -"is to adjust :attr:`prec` to the amount of available RAM. Suppose that you " -"have 8GB of RAM and expect 10 simultaneous operands using a maximum of 500MB " -"each::" +"is to adjust :attr:`~Context.prec` to the amount of available RAM. Suppose " +"that you have 8GB of RAM and expect 10 simultaneous operands using a maximum " +"of 500MB each::" msgstr "" #: ../../library/decimal.rst:2206 diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index c8751d6a93..f6f5c13943 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-27 00:19+0000\n" +"POT-Creation-Date: 2023-02-26 00:38+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -114,52 +114,58 @@ msgstr "" #: ../../library/importlib.resources.abc.rst:89 msgid "" -"An object with a subset of pathlib.Path methods suitable for traversing " -"directories and opening files." +"An object with a subset of :class:`pathlib.Path` methods suitable for " +"traversing directories and opening files." msgstr "" -#: ../../library/importlib.resources.abc.rst:96 +#: ../../library/importlib.resources.abc.rst:92 +msgid "" +"For a representation of the object on the file-system, use :meth:`importlib." +"resources.as_file`." +msgstr "" + +#: ../../library/importlib.resources.abc.rst:99 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.resources.abc.rst:100 +#: ../../library/importlib.resources.abc.rst:103 msgid "Yield Traversable objects in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:104 +#: ../../library/importlib.resources.abc.rst:107 msgid "Return True if self is a directory." msgstr "" -#: ../../library/importlib.resources.abc.rst:108 +#: ../../library/importlib.resources.abc.rst:111 msgid "Return True if self is a file." msgstr "" -#: ../../library/importlib.resources.abc.rst:112 -#: ../../library/importlib.resources.abc.rst:116 +#: ../../library/importlib.resources.abc.rst:115 +#: ../../library/importlib.resources.abc.rst:119 msgid "Return Traversable child in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:120 +#: ../../library/importlib.resources.abc.rst:123 msgid "" "*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " "suitable for reading (same as :attr:`pathlib.Path.open`)." msgstr "" -#: ../../library/importlib.resources.abc.rst:123 +#: ../../library/importlib.resources.abc.rst:126 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "attr:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.resources.abc.rst:128 +#: ../../library/importlib.resources.abc.rst:131 msgid "Read contents of self as bytes." msgstr "" -#: ../../library/importlib.resources.abc.rst:132 +#: ../../library/importlib.resources.abc.rst:135 msgid "Read contents of self as text." msgstr "" -#: ../../library/importlib.resources.abc.rst:137 +#: ../../library/importlib.resources.abc.rst:140 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`importlib." @@ -169,13 +175,13 @@ msgid "" "also supplies ResourceReader." msgstr "" -#: ../../library/importlib.resources.abc.rst:144 +#: ../../library/importlib.resources.abc.rst:147 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.resources.abc.rst:151 +#: ../../library/importlib.resources.abc.rst:154 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." diff --git a/library/typing.po b/library/typing.po index 4a51af16e6..bdd73a9c41 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:32+0000\n" +"POT-Creation-Date: 2023-02-26 00:38+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1508,9 +1508,9 @@ msgid "" ":func:`runtime_checkable` will check only the presence of the required " "methods, not their type signatures. For example, :class:`ssl.SSLObject` is a " "class, therefore it passes an :func:`issubclass` check against :data:" -"`Callable`. However, the :meth:`ssl.SSLObject.__init__` method exists only " -"to raise a :exc:`TypeError` with a more informative message, therefore " -"making it impossible to call (instantiate) :class:`ssl.SSLObject`." +"`Callable`. However, the ``ssl.SSLObject.__init__`` method exists only to " +"raise a :exc:`TypeError` with a more informative message, therefore making " +"it impossible to call (instantiate) :class:`ssl.SSLObject`." msgstr "" #: ../../library/typing.rst:1598 diff --git a/library/zipfile.po b/library/zipfile.po index 6fd3c7394d..c1a4f14ae2 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-21 00:16+0000\n" +"POT-Creation-Date: 2023-02-26 00:38+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,15 +70,16 @@ msgstr "" #: ../../library/zipfile.rst:58 msgid "" -"A pathlib-compatible wrapper for zip files. See section :ref:`path-objects` " -"for details." +"Class that implements a subset of the interface provided by :class:`pathlib." +"Path`, including the full :class:`importlib.resources.abc.Traversable` " +"interface." msgstr "" -#: ../../library/zipfile.rst:67 +#: ../../library/zipfile.rst:68 msgid "Class for creating ZIP archives containing Python libraries." msgstr "" -#: ../../library/zipfile.rst:72 +#: ../../library/zipfile.rst:73 msgid "" "Class used to represent information about a member of an archive. Instances " "of this class are returned by the :meth:`.getinfo` and :meth:`.infolist` " @@ -90,40 +91,40 @@ msgid "" "ref:`zipinfo-objects`." msgstr "" -#: ../../library/zipfile.rst:83 +#: ../../library/zipfile.rst:84 msgid "" "Returns ``True`` if *filename* is a valid ZIP file based on its magic " "number, otherwise returns ``False``. *filename* may be a file or file-like " "object too." msgstr "" -#: ../../library/zipfile.rst:86 +#: ../../library/zipfile.rst:87 msgid "Support for file and file-like objects." msgstr "" -#: ../../library/zipfile.rst:92 +#: ../../library/zipfile.rst:93 msgid "The numeric constant for an uncompressed archive member." msgstr "" -#: ../../library/zipfile.rst:97 +#: ../../library/zipfile.rst:98 msgid "" "The numeric constant for the usual ZIP compression method. This requires " "the :mod:`zlib` module." msgstr "" -#: ../../library/zipfile.rst:103 +#: ../../library/zipfile.rst:104 msgid "" "The numeric constant for the BZIP2 compression method. This requires the :" "mod:`bz2` module." msgstr "" -#: ../../library/zipfile.rst:110 +#: ../../library/zipfile.rst:111 msgid "" "The numeric constant for the LZMA compression method. This requires the :" "mod:`lzma` module." msgstr "" -#: ../../library/zipfile.rst:117 +#: ../../library/zipfile.rst:118 msgid "" "The ZIP file format specification has included support for bzip2 compression " "since 2001, and for LZMA compression since 2006. However, some tools " @@ -132,37 +133,37 @@ msgid "" "individual files." msgstr "" -#: ../../library/zipfile.rst:128 +#: ../../library/zipfile.rst:129 msgid "`PKZIP Application Note`_" msgstr "" -#: ../../library/zipfile.rst:127 +#: ../../library/zipfile.rst:128 msgid "" "Documentation on the ZIP file format by Phil Katz, the creator of the format " "and algorithms used." msgstr "" -#: ../../library/zipfile.rst:131 +#: ../../library/zipfile.rst:132 msgid "`Info-ZIP Home Page `_" msgstr "`Info-ZIP 首頁 `_" -#: ../../library/zipfile.rst:131 +#: ../../library/zipfile.rst:132 msgid "" "Information about the Info-ZIP project's ZIP archive programs and " "development libraries." msgstr "" -#: ../../library/zipfile.rst:138 +#: ../../library/zipfile.rst:139 msgid "ZipFile Objects" msgstr "ZipFile 物件" -#: ../../library/zipfile.rst:145 +#: ../../library/zipfile.rst:146 msgid "" "Open a ZIP file, where *file* can be a path to a file (a string), a file-" "like object or a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:148 +#: ../../library/zipfile.rst:149 msgid "" "The *mode* parameter should be ``'r'`` to read an existing file, ``'w'`` to " "truncate and write a new file, ``'a'`` to append to an existing file, or " @@ -176,7 +177,7 @@ msgid "" "``'r'`` or ``'a'``, the file should be seekable." msgstr "" -#: ../../library/zipfile.rst:160 +#: ../../library/zipfile.rst:161 msgid "" "*compression* is the ZIP compression method to use when writing the archive, " "and should be :const:`ZIP_STORED`, :const:`ZIP_DEFLATED`, :const:`ZIP_BZIP2` " @@ -187,7 +188,7 @@ msgid "" "is raised. The default is :const:`ZIP_STORED`." msgstr "" -#: ../../library/zipfile.rst:168 +#: ../../library/zipfile.rst:169 msgid "" "If *allowZip64* is ``True`` (the default) zipfile will create ZIP files that " "use the ZIP64 extensions when the zipfile is larger than 4 GiB. If it is " @@ -195,7 +196,7 @@ msgid "" "require ZIP64 extensions." msgstr "" -#: ../../library/zipfile.rst:173 +#: ../../library/zipfile.rst:174 msgid "" "The *compresslevel* parameter controls the compression level to use when " "writing files to the archive. When using :const:`ZIP_STORED` or :const:" @@ -205,7 +206,7 @@ msgid "" "accepted (see :class:`bz2 ` for more information)." msgstr "" -#: ../../library/zipfile.rst:181 ../../library/zipfile.rst:733 +#: ../../library/zipfile.rst:182 ../../library/zipfile.rst:734 msgid "" "The *strict_timestamps* argument, when set to ``False``, allows to zip files " "older than 1980-01-01 at the cost of setting the timestamp to 1980-01-01. " @@ -213,34 +214,34 @@ msgid "" "also set to the limit." msgstr "" -#: ../../library/zipfile.rst:187 +#: ../../library/zipfile.rst:188 msgid "" "When mode is ``'r'``, *metadata_encoding* may be set to the name of a codec, " "which will be used to decode metadata such as the names of members and ZIP " "comments." msgstr "" -#: ../../library/zipfile.rst:191 +#: ../../library/zipfile.rst:192 msgid "" "If the file is created with mode ``'w'``, ``'x'`` or ``'a'`` and then :meth:" "`closed ` without adding any files to the archive, the appropriate " "ZIP structures for an empty archive will be written to the file." msgstr "" -#: ../../library/zipfile.rst:195 +#: ../../library/zipfile.rst:196 msgid "" "ZipFile is also a context manager and therefore supports the :keyword:`with` " "statement. In the example, *myzip* is closed after the :keyword:`!with` " "statement's suite is finished---even if an exception occurs::" msgstr "" -#: ../../library/zipfile.rst:204 +#: ../../library/zipfile.rst:205 msgid "" "*metadata_encoding* is an instance-wide setting for the ZipFile. It is not " "currently possible to set this on a per-member basis." msgstr "" -#: ../../library/zipfile.rst:207 +#: ../../library/zipfile.rst:208 msgid "" "This attribute is a workaround for legacy implementations which produce " "archives with names in the current locale encoding or code page (mostly on " @@ -250,73 +251,73 @@ msgid "" "is a Python-specific extension." msgstr "" -#: ../../library/zipfile.rst:215 +#: ../../library/zipfile.rst:216 msgid "Added the ability to use :class:`ZipFile` as a context manager." msgstr "" -#: ../../library/zipfile.rst:218 +#: ../../library/zipfile.rst:219 msgid "Added support for :mod:`bzip2 ` and :mod:`lzma` compression." msgstr "" -#: ../../library/zipfile.rst:221 ../../library/zipfile.rst:647 +#: ../../library/zipfile.rst:222 ../../library/zipfile.rst:648 msgid "ZIP64 extensions are enabled by default." msgstr "" -#: ../../library/zipfile.rst:224 +#: ../../library/zipfile.rst:225 msgid "" "Added support for writing to unseekable streams. Added support for the " "``'x'`` mode." msgstr "" -#: ../../library/zipfile.rst:228 +#: ../../library/zipfile.rst:229 msgid "" "Previously, a plain :exc:`RuntimeError` was raised for unrecognized " "compression values." msgstr "" -#: ../../library/zipfile.rst:232 +#: ../../library/zipfile.rst:233 msgid "The *file* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:235 +#: ../../library/zipfile.rst:236 msgid "Add the *compresslevel* parameter." msgstr "" -#: ../../library/zipfile.rst:238 ../../library/zipfile.rst:744 +#: ../../library/zipfile.rst:239 ../../library/zipfile.rst:745 msgid "The *strict_timestamps* keyword-only argument" msgstr "" -#: ../../library/zipfile.rst:241 +#: ../../library/zipfile.rst:242 msgid "" "Added support for specifying member name encoding for reading metadata in " "the zipfile's directory and file headers." msgstr "" -#: ../../library/zipfile.rst:248 +#: ../../library/zipfile.rst:249 msgid "" "Close the archive file. You must call :meth:`close` before exiting your " "program or essential records will not be written." msgstr "" -#: ../../library/zipfile.rst:254 +#: ../../library/zipfile.rst:255 msgid "" "Return a :class:`ZipInfo` object with information about the archive member " "*name*. Calling :meth:`getinfo` for a name not currently contained in the " "archive will raise a :exc:`KeyError`." msgstr "" -#: ../../library/zipfile.rst:261 +#: ../../library/zipfile.rst:262 msgid "" "Return a list containing a :class:`ZipInfo` object for each member of the " "archive. The objects are in the same order as their entries in the actual " "ZIP file on disk if an existing archive was opened." msgstr "" -#: ../../library/zipfile.rst:268 +#: ../../library/zipfile.rst:269 msgid "Return a list of archive members by name." msgstr "" -#: ../../library/zipfile.rst:273 +#: ../../library/zipfile.rst:274 msgid "" "Access a member of the archive as a binary file-like object. *name* can be " "either the name of a file within the archive or a :class:`ZipInfo` object. " @@ -325,13 +326,13 @@ msgid "" "class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:279 +#: ../../library/zipfile.rst:280 msgid "" ":meth:`~ZipFile.open` is also a context manager and therefore supports the :" "keyword:`with` statement::" msgstr "" -#: ../../library/zipfile.rst:286 +#: ../../library/zipfile.rst:287 msgid "" "With *mode* ``'r'`` the file-like object (``ZipExtFile``) is read-only and " "provides the following methods: :meth:`~io.BufferedIOBase.read`, :meth:`~io." @@ -340,7 +341,7 @@ msgid "" "objects can operate independently of the ZipFile." msgstr "" -#: ../../library/zipfile.rst:293 +#: ../../library/zipfile.rst:294 msgid "" "With ``mode='w'``, a writable file handle is returned, which supports the :" "meth:`~io.BufferedIOBase.write` method. While a writable file handle is " @@ -348,7 +349,7 @@ msgid "" "exc:`ValueError`." msgstr "" -#: ../../library/zipfile.rst:298 +#: ../../library/zipfile.rst:299 msgid "" "When writing a file, if the file size is not known in advance but may exceed " "2 GiB, pass ``force_zip64=True`` to ensure that the header format is capable " @@ -357,32 +358,32 @@ msgid "" "as the *name* parameter." msgstr "" -#: ../../library/zipfile.rst:306 +#: ../../library/zipfile.rst:307 msgid "" "The :meth:`.open`, :meth:`read` and :meth:`extract` methods can take a " "filename or a :class:`ZipInfo` object. You will appreciate this when trying " "to read a ZIP file that contains members with duplicate names." msgstr "" -#: ../../library/zipfile.rst:310 +#: ../../library/zipfile.rst:311 msgid "" "Removed support of ``mode='U'``. Use :class:`io.TextIOWrapper` for reading " "compressed text files in :term:`universal newlines` mode." msgstr "" -#: ../../library/zipfile.rst:314 +#: ../../library/zipfile.rst:315 msgid "" ":meth:`ZipFile.open` can now be used to write files into the archive with " "the ``mode='w'`` option." msgstr "" -#: ../../library/zipfile.rst:318 +#: ../../library/zipfile.rst:319 msgid "" "Calling :meth:`.open` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:325 +#: ../../library/zipfile.rst:326 msgid "" "Extract a member from the archive to the current working directory; *member* " "must be its full name or a :class:`ZipInfo` object. Its file information is " @@ -391,11 +392,11 @@ msgid "" "*pwd* is the password used for encrypted files as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:331 +#: ../../library/zipfile.rst:332 msgid "Returns the normalized path created (a directory or new file)." msgstr "" -#: ../../library/zipfile.rst:335 +#: ../../library/zipfile.rst:336 msgid "" "If a member filename is an absolute path, a drive/UNC sharepoint and leading " "(back)slashes will be stripped, e.g.: ``///foo/bar`` becomes ``foo/bar`` on " @@ -406,17 +407,17 @@ msgid "" "(``_``)." msgstr "" -#: ../../library/zipfile.rst:343 +#: ../../library/zipfile.rst:344 msgid "" "Calling :meth:`extract` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:347 ../../library/zipfile.rst:370 +#: ../../library/zipfile.rst:348 ../../library/zipfile.rst:371 msgid "The *path* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:353 +#: ../../library/zipfile.rst:354 msgid "" "Extract all members from the archive to the current working directory. " "*path* specifies a different directory to extract to. *members* is optional " @@ -424,7 +425,7 @@ msgid "" "password used for encrypted files as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:360 +#: ../../library/zipfile.rst:361 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of *path*, e.g. members that have " @@ -432,23 +433,23 @@ msgid "" "\"``. This module attempts to prevent that. See :meth:`extract` note." msgstr "" -#: ../../library/zipfile.rst:366 +#: ../../library/zipfile.rst:367 msgid "" "Calling :meth:`extractall` on a closed ZipFile will raise a :exc:" "`ValueError`. Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:376 +#: ../../library/zipfile.rst:377 msgid "Print a table of contents for the archive to ``sys.stdout``." msgstr "" -#: ../../library/zipfile.rst:381 +#: ../../library/zipfile.rst:382 msgid "" "Set *pwd* (a :class:`bytes` object) as default password to extract encrypted " "files." msgstr "" -#: ../../library/zipfile.rst:386 +#: ../../library/zipfile.rst:387 msgid "" "Return the bytes of the file *name* in the archive. *name* is the name of " "the file in the archive, or a :class:`ZipInfo` object. The archive must be " @@ -461,25 +462,25 @@ msgid "" "compression module is not available." msgstr "" -#: ../../library/zipfile.rst:395 +#: ../../library/zipfile.rst:396 msgid "" "Calling :meth:`read` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:402 +#: ../../library/zipfile.rst:403 msgid "" "Read all the files in the archive and check their CRC's and file headers. " "Return the name of the first bad file, or else return ``None``." msgstr "" -#: ../../library/zipfile.rst:405 +#: ../../library/zipfile.rst:406 msgid "" "Calling :meth:`testzip` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:413 +#: ../../library/zipfile.rst:414 msgid "" "Write the file named *filename* to the archive, giving it the archive name " "*arcname* (by default, this will be the same as *filename*, but without a " @@ -490,7 +491,7 @@ msgid "" "``'x'`` or ``'a'``." msgstr "" -#: ../../library/zipfile.rst:423 +#: ../../library/zipfile.rst:424 msgid "" "The ZIP file standard historically did not specify a metadata encoding, but " "strongly recommended CP437 (the original IBM PC encoding) for " @@ -500,33 +501,33 @@ msgid "" "in any encoding other than ASCII or UTF-8." msgstr "" -#: ../../library/zipfile.rst:432 +#: ../../library/zipfile.rst:433 msgid "" "Archive names should be relative to the archive root, that is, they should " "not start with a path separator." msgstr "" -#: ../../library/zipfile.rst:437 +#: ../../library/zipfile.rst:438 msgid "" "If ``arcname`` (or ``filename``, if ``arcname`` is not given) contains a " "null byte, the name of the file in the archive will be truncated at the null " "byte." msgstr "" -#: ../../library/zipfile.rst:442 +#: ../../library/zipfile.rst:443 msgid "" "A leading slash in the filename may lead to the archive being impossible to " "open in some zip programs on Windows systems." msgstr "" -#: ../../library/zipfile.rst:445 +#: ../../library/zipfile.rst:446 msgid "" "Calling :meth:`write` on a ZipFile created with mode ``'r'`` or a closed " "ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` " "was raised." msgstr "" -#: ../../library/zipfile.rst:454 +#: ../../library/zipfile.rst:455 msgid "" "Write a file into the archive. The contents is *data*, which may be either " "a :class:`str` or a :class:`bytes` instance; if it is a :class:`str`, it is " @@ -537,7 +538,7 @@ msgid "" "must be opened with mode ``'w'``, ``'x'`` or ``'a'``." msgstr "" -#: ../../library/zipfile.rst:462 +#: ../../library/zipfile.rst:463 msgid "" "If given, *compress_type* overrides the value given for the *compression* " "parameter to the constructor for the new entry, or in the *zinfo_or_arcname* " @@ -545,7 +546,7 @@ msgid "" "override the constructor if given." msgstr "" -#: ../../library/zipfile.rst:469 +#: ../../library/zipfile.rst:470 msgid "" "When passing a :class:`ZipInfo` instance as the *zinfo_or_arcname* " "parameter, the compression method used will be that specified in the " @@ -553,18 +554,18 @@ msgid "" "the :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`." msgstr "" -#: ../../library/zipfile.rst:474 +#: ../../library/zipfile.rst:475 msgid "The *compress_type* argument." msgstr "*compress_type* 引數。" -#: ../../library/zipfile.rst:477 +#: ../../library/zipfile.rst:478 msgid "" "Calling :meth:`writestr` on a ZipFile created with mode ``'r'`` or a closed " "ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` " "was raised." msgstr "" -#: ../../library/zipfile.rst:484 +#: ../../library/zipfile.rst:485 msgid "" "Create a directory inside the archive. If *zinfo_or_directory* is a string, " "a directory is created inside the archive with the mode that is specified in " @@ -572,26 +573,26 @@ msgid "" "instance then the *mode* argument is ignored." msgstr "" -#: ../../library/zipfile.rst:489 +#: ../../library/zipfile.rst:490 msgid "The archive must be opened with mode ``'w'``, ``'x'`` or ``'a'``." msgstr "" -#: ../../library/zipfile.rst:494 +#: ../../library/zipfile.rst:495 msgid "The following data attributes are also available:" msgstr "" -#: ../../library/zipfile.rst:498 +#: ../../library/zipfile.rst:499 msgid "Name of the ZIP file." msgstr "" -#: ../../library/zipfile.rst:502 +#: ../../library/zipfile.rst:503 msgid "" "The level of debug output to use. This may be set from ``0`` (the default, " "no output) to ``3`` (the most output). Debugging information is written to " "``sys.stdout``." msgstr "" -#: ../../library/zipfile.rst:508 +#: ../../library/zipfile.rst:509 msgid "" "The comment associated with the ZIP file as a :class:`bytes` object. If " "assigning a comment to a :class:`ZipFile` instance created with mode " @@ -599,37 +600,37 @@ msgid "" "Comments longer than this will be truncated." msgstr "" -#: ../../library/zipfile.rst:518 +#: ../../library/zipfile.rst:519 msgid "Path Objects" msgstr "" -#: ../../library/zipfile.rst:522 +#: ../../library/zipfile.rst:523 msgid "" "Construct a Path object from a ``root`` zipfile (which may be a :class:" "`ZipFile` instance or ``file`` suitable for passing to the :class:`ZipFile` " "constructor)." msgstr "" -#: ../../library/zipfile.rst:526 +#: ../../library/zipfile.rst:527 msgid "" "``at`` specifies the location of this Path within the zipfile, e.g. 'dir/" "file.txt', 'dir/', or ''. Defaults to the empty string, indicating the root." msgstr "" -#: ../../library/zipfile.rst:530 +#: ../../library/zipfile.rst:531 msgid "" "Path objects expose the following features of :mod:`pathlib.Path` objects:" msgstr "" -#: ../../library/zipfile.rst:533 +#: ../../library/zipfile.rst:534 msgid "Path objects are traversable using the ``/`` operator or ``joinpath``." msgstr "" -#: ../../library/zipfile.rst:537 +#: ../../library/zipfile.rst:538 msgid "The final path component." msgstr "" -#: ../../library/zipfile.rst:541 +#: ../../library/zipfile.rst:542 msgid "" "Invoke :meth:`ZipFile.open` on the current path. Allows opening for read or " "write, text or binary through supported modes: 'r', 'w', 'rb', 'wb'. " @@ -638,12 +639,12 @@ msgid "" "``pwd`` parameter to :meth:`ZipFile.open`." msgstr "" -#: ../../library/zipfile.rst:550 +#: ../../library/zipfile.rst:551 msgid "" "Added support for text and binary modes for open. Default mode is now text." msgstr "" -#: ../../library/zipfile.rst:554 ../../library/zipfile.rst:605 +#: ../../library/zipfile.rst:555 ../../library/zipfile.rst:606 msgid "" "The ``encoding`` parameter can be supplied as a positional argument without " "causing a :exc:`TypeError`. As it could in 3.9. Code needing to be " @@ -651,117 +652,117 @@ msgid "" "TextIOWrapper` arguments, ``encoding`` included, as keywords." msgstr "" -#: ../../library/zipfile.rst:562 +#: ../../library/zipfile.rst:563 msgid "Enumerate the children of the current directory." msgstr "" -#: ../../library/zipfile.rst:566 +#: ../../library/zipfile.rst:567 msgid "Return ``True`` if the current context references a directory." msgstr "" -#: ../../library/zipfile.rst:570 +#: ../../library/zipfile.rst:571 msgid "Return ``True`` if the current context references a file." msgstr "" -#: ../../library/zipfile.rst:574 +#: ../../library/zipfile.rst:575 msgid "" "Return ``True`` if the current context references a file or directory in the " "zip file." msgstr "" -#: ../../library/zipfile.rst:579 +#: ../../library/zipfile.rst:580 msgid "The file extension of the final component." msgstr "" -#: ../../library/zipfile.rst:581 +#: ../../library/zipfile.rst:582 msgid "Added :data:`Path.suffix` property." msgstr "" -#: ../../library/zipfile.rst:586 +#: ../../library/zipfile.rst:587 msgid "The final path component, without its suffix." msgstr "" -#: ../../library/zipfile.rst:588 +#: ../../library/zipfile.rst:589 msgid "Added :data:`Path.stem` property." msgstr "" -#: ../../library/zipfile.rst:593 +#: ../../library/zipfile.rst:594 msgid "A list of the path’s file extensions." msgstr "" -#: ../../library/zipfile.rst:595 +#: ../../library/zipfile.rst:596 msgid "Added :data:`Path.suffixes` property." msgstr "" -#: ../../library/zipfile.rst:600 +#: ../../library/zipfile.rst:601 msgid "" "Read the current file as unicode text. Positional and keyword arguments are " "passed through to :class:`io.TextIOWrapper` (except ``buffer``, which is " "implied by the context)." msgstr "" -#: ../../library/zipfile.rst:613 +#: ../../library/zipfile.rst:614 msgid "Read the current file as bytes." msgstr "" -#: ../../library/zipfile.rst:617 +#: ../../library/zipfile.rst:618 msgid "" "Return a new Path object with each of the *other* arguments joined. The " "following are equivalent::" msgstr "" -#: ../../library/zipfile.rst:624 +#: ../../library/zipfile.rst:625 msgid "" "Prior to 3.10, ``joinpath`` was undocumented and accepted exactly one " "parameter." msgstr "" -#: ../../library/zipfile.rst:628 +#: ../../library/zipfile.rst:629 msgid "" "The `zipp `_ project provides backports of " "the latest path object functionality to older Pythons. Use ``zipp.Path`` in " "place of ``zipfile.Path`` for early access to changes." msgstr "" -#: ../../library/zipfile.rst:636 +#: ../../library/zipfile.rst:637 msgid "PyZipFile Objects" msgstr "PyZipFile 物件" -#: ../../library/zipfile.rst:638 +#: ../../library/zipfile.rst:639 msgid "" "The :class:`PyZipFile` constructor takes the same parameters as the :class:" "`ZipFile` constructor, and one additional parameter, *optimize*." msgstr "" -#: ../../library/zipfile.rst:644 +#: ../../library/zipfile.rst:645 msgid "The *optimize* parameter." msgstr "*optimize* 參數。" -#: ../../library/zipfile.rst:650 +#: ../../library/zipfile.rst:651 msgid "" "Instances have one method in addition to those of :class:`ZipFile` objects:" msgstr "" -#: ../../library/zipfile.rst:654 +#: ../../library/zipfile.rst:655 msgid "" "Search for files :file:`\\*.py` and add the corresponding file to the " "archive." msgstr "" -#: ../../library/zipfile.rst:657 +#: ../../library/zipfile.rst:658 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was not given or ``-1``, " "the corresponding file is a :file:`\\*.pyc` file, compiling if necessary." msgstr "" -#: ../../library/zipfile.rst:660 +#: ../../library/zipfile.rst:661 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was ``0``, ``1`` or ``2``, " "only files with that optimization level (see :func:`compile`) are added to " "the archive, compiling if necessary." msgstr "" -#: ../../library/zipfile.rst:664 +#: ../../library/zipfile.rst:665 msgid "" "If *pathname* is a file, the filename must end with :file:`.py`, and just " "the (corresponding :file:`\\*.pyc`) file is added at the top level (no path " @@ -774,11 +775,11 @@ msgid "" "in sorted order." msgstr "" -#: ../../library/zipfile.rst:674 +#: ../../library/zipfile.rst:675 msgid "*basename* is intended for internal use only." msgstr "" -#: ../../library/zipfile.rst:676 +#: ../../library/zipfile.rst:677 msgid "" "*filterfunc*, if given, must be a function taking a single string argument. " "It will be passed each path (including each individual full file path) " @@ -789,286 +790,286 @@ msgid "" "exclude them::" msgstr "" -#: ../../library/zipfile.rst:690 +#: ../../library/zipfile.rst:691 msgid "The :meth:`writepy` method makes archives with file names like this::" msgstr "" -#: ../../library/zipfile.rst:699 +#: ../../library/zipfile.rst:700 msgid "The *filterfunc* parameter." msgstr "*filterfunc* 參數。" -#: ../../library/zipfile.rst:702 +#: ../../library/zipfile.rst:703 msgid "The *pathname* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:705 +#: ../../library/zipfile.rst:706 msgid "Recursion sorts directory entries." msgstr "" -#: ../../library/zipfile.rst:712 +#: ../../library/zipfile.rst:713 msgid "ZipInfo Objects" msgstr "ZipInfo 物件" -#: ../../library/zipfile.rst:714 +#: ../../library/zipfile.rst:715 msgid "" "Instances of the :class:`ZipInfo` class are returned by the :meth:`.getinfo` " "and :meth:`.infolist` methods of :class:`ZipFile` objects. Each object " "stores information about a single member of the ZIP archive." msgstr "" -#: ../../library/zipfile.rst:718 +#: ../../library/zipfile.rst:719 msgid "" "There is one classmethod to make a :class:`ZipInfo` instance for a " "filesystem file:" msgstr "" -#: ../../library/zipfile.rst:724 +#: ../../library/zipfile.rst:725 msgid "" "Construct a :class:`ZipInfo` instance for a file on the filesystem, in " "preparation for adding it to a zip file." msgstr "" -#: ../../library/zipfile.rst:727 +#: ../../library/zipfile.rst:728 msgid "*filename* should be the path to a file or directory on the filesystem." msgstr "" -#: ../../library/zipfile.rst:729 +#: ../../library/zipfile.rst:730 msgid "" "If *arcname* is specified, it is used as the name within the archive. If " "*arcname* is not specified, the name will be the same as *filename*, but " "with any drive letter and leading path separators removed." msgstr "" -#: ../../library/zipfile.rst:741 +#: ../../library/zipfile.rst:742 msgid "The *filename* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:748 +#: ../../library/zipfile.rst:749 msgid "Instances have the following methods and attributes:" msgstr "" -#: ../../library/zipfile.rst:752 +#: ../../library/zipfile.rst:753 msgid "Return ``True`` if this archive member is a directory." msgstr "" -#: ../../library/zipfile.rst:754 +#: ../../library/zipfile.rst:755 msgid "This uses the entry's name: directories should always end with ``/``." msgstr "" -#: ../../library/zipfile.rst:761 +#: ../../library/zipfile.rst:762 msgid "Name of the file in the archive." msgstr "" -#: ../../library/zipfile.rst:766 +#: ../../library/zipfile.rst:767 msgid "" "The time and date of the last modification to the archive member. This is a " "tuple of six values:" msgstr "" -#: ../../library/zipfile.rst:770 +#: ../../library/zipfile.rst:771 msgid "Index" msgstr "" -#: ../../library/zipfile.rst:770 +#: ../../library/zipfile.rst:771 msgid "Value" msgstr "" -#: ../../library/zipfile.rst:772 +#: ../../library/zipfile.rst:773 msgid "``0``" msgstr "``0``" -#: ../../library/zipfile.rst:772 +#: ../../library/zipfile.rst:773 msgid "Year (>= 1980)" msgstr "" -#: ../../library/zipfile.rst:774 +#: ../../library/zipfile.rst:775 msgid "``1``" msgstr "``1``" -#: ../../library/zipfile.rst:774 +#: ../../library/zipfile.rst:775 msgid "Month (one-based)" msgstr "" -#: ../../library/zipfile.rst:776 +#: ../../library/zipfile.rst:777 msgid "``2``" msgstr "``2``" -#: ../../library/zipfile.rst:776 +#: ../../library/zipfile.rst:777 msgid "Day of month (one-based)" msgstr "" -#: ../../library/zipfile.rst:778 +#: ../../library/zipfile.rst:779 msgid "``3``" msgstr "``3``" -#: ../../library/zipfile.rst:778 +#: ../../library/zipfile.rst:779 msgid "Hours (zero-based)" msgstr "" -#: ../../library/zipfile.rst:780 +#: ../../library/zipfile.rst:781 msgid "``4``" msgstr "``4``" -#: ../../library/zipfile.rst:780 +#: ../../library/zipfile.rst:781 msgid "Minutes (zero-based)" msgstr "" -#: ../../library/zipfile.rst:782 +#: ../../library/zipfile.rst:783 msgid "``5``" msgstr "``5``" -#: ../../library/zipfile.rst:782 +#: ../../library/zipfile.rst:783 msgid "Seconds (zero-based)" msgstr "" -#: ../../library/zipfile.rst:787 +#: ../../library/zipfile.rst:788 msgid "The ZIP file format does not support timestamps before 1980." msgstr "" -#: ../../library/zipfile.rst:792 +#: ../../library/zipfile.rst:793 msgid "Type of compression for the archive member." msgstr "" -#: ../../library/zipfile.rst:797 +#: ../../library/zipfile.rst:798 msgid "Comment for the individual archive member as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:802 +#: ../../library/zipfile.rst:803 msgid "" "Expansion field data. The `PKZIP Application Note`_ contains some comments " "on the internal structure of the data contained in this :class:`bytes` " "object." msgstr "" -#: ../../library/zipfile.rst:809 +#: ../../library/zipfile.rst:810 msgid "System which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:814 +#: ../../library/zipfile.rst:815 msgid "PKZIP version which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:819 +#: ../../library/zipfile.rst:820 msgid "PKZIP version needed to extract archive." msgstr "" -#: ../../library/zipfile.rst:824 +#: ../../library/zipfile.rst:825 msgid "Must be zero." msgstr "" -#: ../../library/zipfile.rst:829 +#: ../../library/zipfile.rst:830 msgid "ZIP flag bits." msgstr "" -#: ../../library/zipfile.rst:834 +#: ../../library/zipfile.rst:835 msgid "Volume number of file header." msgstr "" -#: ../../library/zipfile.rst:839 +#: ../../library/zipfile.rst:840 msgid "Internal attributes." msgstr "" -#: ../../library/zipfile.rst:844 +#: ../../library/zipfile.rst:845 msgid "External file attributes." msgstr "" -#: ../../library/zipfile.rst:849 +#: ../../library/zipfile.rst:850 msgid "Byte offset to the file header." msgstr "" -#: ../../library/zipfile.rst:854 +#: ../../library/zipfile.rst:855 msgid "CRC-32 of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:859 +#: ../../library/zipfile.rst:860 msgid "Size of the compressed data." msgstr "" -#: ../../library/zipfile.rst:864 +#: ../../library/zipfile.rst:865 msgid "Size of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:871 +#: ../../library/zipfile.rst:872 msgid "Command-Line Interface" msgstr "" -#: ../../library/zipfile.rst:873 +#: ../../library/zipfile.rst:874 msgid "" "The :mod:`zipfile` module provides a simple command-line interface to " "interact with ZIP archives." msgstr "" -#: ../../library/zipfile.rst:876 +#: ../../library/zipfile.rst:877 msgid "" "If you want to create a new ZIP archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/zipfile.rst:883 +#: ../../library/zipfile.rst:884 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/zipfile.rst:889 +#: ../../library/zipfile.rst:890 msgid "" "If you want to extract a ZIP archive into the specified directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/zipfile.rst:896 +#: ../../library/zipfile.rst:897 msgid "For a list of the files in a ZIP archive, use the :option:`-l` option:" msgstr "" -#: ../../library/zipfile.rst:904 +#: ../../library/zipfile.rst:905 msgid "Command-line options" msgstr "" -#: ../../library/zipfile.rst:909 +#: ../../library/zipfile.rst:910 msgid "List files in a zipfile." msgstr "" -#: ../../library/zipfile.rst:914 +#: ../../library/zipfile.rst:915 msgid "Create zipfile from source files." msgstr "" -#: ../../library/zipfile.rst:919 +#: ../../library/zipfile.rst:920 msgid "Extract zipfile into target directory." msgstr "" -#: ../../library/zipfile.rst:924 +#: ../../library/zipfile.rst:925 msgid "Test whether the zipfile is valid or not." msgstr "" -#: ../../library/zipfile.rst:928 +#: ../../library/zipfile.rst:929 msgid "" "Specify encoding of member names for :option:`-l`, :option:`-e` and :option:" "`-t`." msgstr "" -#: ../../library/zipfile.rst:935 +#: ../../library/zipfile.rst:936 msgid "Decompression pitfalls" msgstr "" -#: ../../library/zipfile.rst:937 +#: ../../library/zipfile.rst:938 msgid "" "The extraction in zipfile module might fail due to some pitfalls listed " "below." msgstr "" -#: ../../library/zipfile.rst:940 +#: ../../library/zipfile.rst:941 msgid "From file itself" msgstr "" -#: ../../library/zipfile.rst:942 +#: ../../library/zipfile.rst:943 msgid "" "Decompression may fail due to incorrect password / CRC checksum / ZIP format " "or unsupported compression method / decryption." msgstr "" -#: ../../library/zipfile.rst:946 +#: ../../library/zipfile.rst:947 msgid "File System limitations" msgstr "" -#: ../../library/zipfile.rst:948 +#: ../../library/zipfile.rst:949 msgid "" "Exceeding limitations on different file systems can cause decompression " "failed. Such as allowable characters in the directory entries, length of the " @@ -1076,33 +1077,33 @@ msgid "" "files, etc." msgstr "" -#: ../../library/zipfile.rst:955 +#: ../../library/zipfile.rst:956 msgid "Resources limitations" msgstr "" -#: ../../library/zipfile.rst:957 +#: ../../library/zipfile.rst:958 msgid "" "The lack of memory or disk volume would lead to decompression failed. For " "example, decompression bombs (aka `ZIP bomb`_) apply to zipfile library that " "can cause disk volume exhaustion." msgstr "" -#: ../../library/zipfile.rst:962 +#: ../../library/zipfile.rst:963 msgid "Interruption" msgstr "" -#: ../../library/zipfile.rst:964 +#: ../../library/zipfile.rst:965 msgid "" "Interruption during the decompression, such as pressing control-C or killing " "the decompression process may result in incomplete decompression of the " "archive." msgstr "" -#: ../../library/zipfile.rst:968 +#: ../../library/zipfile.rst:969 msgid "Default behaviors of extraction" msgstr "" -#: ../../library/zipfile.rst:970 +#: ../../library/zipfile.rst:971 msgid "" "Not knowing the default extraction behaviors can cause unexpected " "decompression results. For example, when extracting the same archive twice, " From db218aee8349c48250be225c90c3fa0095c2b569 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 27 Feb 2023 00:36:30 +0000 Subject: [PATCH 036/130] sync with cpython 64d3715d --- bugs.po | 5 +- howto/logging-cookbook.po | 4 +- library/cmath.po | 155 +++++------ library/re.po | 523 +++++++++++++++++++------------------- 4 files changed, 350 insertions(+), 337 deletions(-) diff --git a/bugs.po b/bugs.po index 306433153d..f9e5ebd9e0 100644 --- a/bugs.po +++ b/bugs.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-07 00:34+0000\n" +"POT-Creation-Date: 2023-02-27 00:34+0000\n" "PO-Revision-Date: 2022-08-31 12:34+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -180,9 +180,10 @@ msgid "The submission form has two fields, \"Title\" and \"Comment\"." msgstr "提交的表單中有兩個欄位,「Title」及「Comment」。" #: ../../bugs.rst:72 +#, fuzzy msgid "" "For the \"Title\" field, enter a *very* short description of the problem; " -"less than ten words is good." +"fewer than ten words is good." msgstr "" "在「Title」欄位,輸入對該問題\\ *非常*\\ 簡短的描述;最好少於十個單字。" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 9f10861ecc..2e4934ddb3 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-21 00:16+0000\n" +"POT-Creation-Date: 2023-02-27 00:34+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-" @@ -1358,7 +1358,7 @@ msgid "" "additional contextual information to be added to the log). So you cannot " "directly make logging calls using :meth:`str.format` or :class:`string." "Template` syntax, because internally the logging package uses %-formatting " -"to merge the format string and the variable arguments. There would no " +"to merge the format string and the variable arguments. There would be no " "changing this while preserving backward compatibility, since all logging " "calls which are out there in existing code will be using %-format strings." msgstr "" diff --git a/library/cmath.po b/library/cmath.po index 524cfa7601..abf0fe1f87 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-02-27 00:34+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-" @@ -35,25 +35,41 @@ msgstr "" #: ../../library/cmath.rst:18 msgid "" -"On platforms with hardware and system-level support for signed zeros, " -"functions involving branch cuts are continuous on *both* sides of the branch " -"cut: the sign of the zero distinguishes one side of the branch cut from the " -"other. On platforms that do not support signed zeros the continuity is as " -"specified below." +"For functions involving branch cuts, we have the problem of deciding how to " +"define those functions on the cut itself. Following Kahan's \"Branch cuts " +"for complex elementary functions\" paper, as well as Annex G of C99 and " +"later C standards, we use the sign of zero to distinguish one side of the " +"branch cut from the other: for a branch cut along (a portion of) the real " +"axis we look at the sign of the imaginary part, while for a branch cut along " +"the imaginary axis we look at the sign of the real part." msgstr "" #: ../../library/cmath.rst:26 +msgid "" +"For example, the :func:`cmath.sqrt` function has a branch cut along the " +"negative real axis. An argument of ``complex(-2.0, -0.0)`` is treated as " +"though it lies *below* the branch cut, and so gives a result on the negative " +"imaginary axis::" +msgstr "" + +#: ../../library/cmath.rst:34 +msgid "" +"But an argument of ``complex(-2.0, 0.0)`` is treated as though it lies above " +"the branch cut::" +msgstr "" + +#: ../../library/cmath.rst:42 msgid "Conversions to and from polar coordinates" msgstr "" -#: ../../library/cmath.rst:28 +#: ../../library/cmath.rst:44 msgid "" "A Python complex number ``z`` is stored internally using *rectangular* or " "*Cartesian* coordinates. It is completely determined by its *real part* ``z." "real`` and its *imaginary part* ``z.imag``. In other words::" msgstr "" -#: ../../library/cmath.rst:35 +#: ../../library/cmath.rst:51 msgid "" "*Polar coordinates* give an alternative way to represent a complex number. " "In polar coordinates, a complex number *z* is defined by the modulus *r* and " @@ -63,180 +79,175 @@ msgid "" "to *z*." msgstr "" -#: ../../library/cmath.rst:42 +#: ../../library/cmath.rst:58 msgid "" "The following functions can be used to convert from the native rectangular " "coordinates to polar coordinates and back." msgstr "" -#: ../../library/cmath.rst:47 +#: ../../library/cmath.rst:63 msgid "" -"Return the phase of *x* (also known as the *argument* of *x*), as a float. " +"Return the phase of *x* (also known as the *argument* of *x*), as a float. " "``phase(x)`` is equivalent to ``math.atan2(x.imag, x.real)``. The result " "lies in the range [-\\ *π*, *π*], and the branch cut for this operation lies " -"along the negative real axis, continuous from above. On systems with " -"support for signed zeros (which includes most systems in current use), this " -"means that the sign of the result is the same as the sign of ``x.imag``, " -"even when ``x.imag`` is zero::" +"along the negative real axis. The sign of the result is the same as the " +"sign of ``x.imag``, even when ``x.imag`` is zero::" msgstr "" -#: ../../library/cmath.rst:64 +#: ../../library/cmath.rst:77 msgid "" "The modulus (absolute value) of a complex number *x* can be computed using " "the built-in :func:`abs` function. There is no separate :mod:`cmath` module " "function for this operation." msgstr "" -#: ../../library/cmath.rst:71 +#: ../../library/cmath.rst:84 msgid "" "Return the representation of *x* in polar coordinates. Returns a pair ``(r, " "phi)`` where *r* is the modulus of *x* and phi is the phase of *x*. " "``polar(x)`` is equivalent to ``(abs(x), phase(x))``." msgstr "" -#: ../../library/cmath.rst:79 +#: ../../library/cmath.rst:92 msgid "" "Return the complex number *x* with polar coordinates *r* and *phi*. " "Equivalent to ``r * (math.cos(phi) + math.sin(phi)*1j)``." msgstr "" -#: ../../library/cmath.rst:84 +#: ../../library/cmath.rst:97 msgid "Power and logarithmic functions" msgstr "" -#: ../../library/cmath.rst:88 +#: ../../library/cmath.rst:101 msgid "" "Return *e* raised to the power *x*, where *e* is the base of natural " "logarithms." msgstr "" -#: ../../library/cmath.rst:94 +#: ../../library/cmath.rst:107 msgid "" "Returns the logarithm of *x* to the given *base*. If the *base* is not " "specified, returns the natural logarithm of *x*. There is one branch cut, " -"from 0 along the negative real axis to -∞, continuous from above." +"from 0 along the negative real axis to -∞." msgstr "" -#: ../../library/cmath.rst:101 +#: ../../library/cmath.rst:114 msgid "" "Return the base-10 logarithm of *x*. This has the same branch cut as :func:" "`log`." msgstr "" -#: ../../library/cmath.rst:107 +#: ../../library/cmath.rst:120 msgid "" "Return the square root of *x*. This has the same branch cut as :func:`log`." msgstr "" -#: ../../library/cmath.rst:111 +#: ../../library/cmath.rst:124 msgid "Trigonometric functions" msgstr "" -#: ../../library/cmath.rst:115 +#: ../../library/cmath.rst:128 msgid "" "Return the arc cosine of *x*. There are two branch cuts: One extends right " -"from 1 along the real axis to ∞, continuous from below. The other extends " -"left from -1 along the real axis to -∞, continuous from above." +"from 1 along the real axis to ∞. The other extends left from -1 along the " +"real axis to -∞." msgstr "" -#: ../../library/cmath.rst:122 +#: ../../library/cmath.rst:135 msgid "" "Return the arc sine of *x*. This has the same branch cuts as :func:`acos`." msgstr "" -#: ../../library/cmath.rst:127 +#: ../../library/cmath.rst:140 msgid "" "Return the arc tangent of *x*. There are two branch cuts: One extends from " -"``1j`` along the imaginary axis to ``∞j``, continuous from the right. The " -"other extends from ``-1j`` along the imaginary axis to ``-∞j``, continuous " -"from the left." +"``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` " +"along the imaginary axis to ``-∞j``." msgstr "" -#: ../../library/cmath.rst:135 +#: ../../library/cmath.rst:147 msgid "Return the cosine of *x*." msgstr "" -#: ../../library/cmath.rst:140 +#: ../../library/cmath.rst:152 msgid "Return the sine of *x*." msgstr "" -#: ../../library/cmath.rst:145 +#: ../../library/cmath.rst:157 msgid "Return the tangent of *x*." msgstr "" -#: ../../library/cmath.rst:149 +#: ../../library/cmath.rst:161 msgid "Hyperbolic functions" msgstr "" -#: ../../library/cmath.rst:153 +#: ../../library/cmath.rst:165 msgid "" "Return the inverse hyperbolic cosine of *x*. There is one branch cut, " -"extending left from 1 along the real axis to -∞, continuous from above." +"extending left from 1 along the real axis to -∞." msgstr "" -#: ../../library/cmath.rst:159 +#: ../../library/cmath.rst:171 msgid "" "Return the inverse hyperbolic sine of *x*. There are two branch cuts: One " -"extends from ``1j`` along the imaginary axis to ``∞j``, continuous from the " -"right. The other extends from ``-1j`` along the imaginary axis to ``-∞j``, " -"continuous from the left." +"extends from ``1j`` along the imaginary axis to ``∞j``. The other extends " +"from ``-1j`` along the imaginary axis to ``-∞j``." msgstr "" -#: ../../library/cmath.rst:167 +#: ../../library/cmath.rst:178 msgid "" "Return the inverse hyperbolic tangent of *x*. There are two branch cuts: One " -"extends from ``1`` along the real axis to ``∞``, continuous from below. The " -"other extends from ``-1`` along the real axis to ``-∞``, continuous from " -"above." +"extends from ``1`` along the real axis to ``∞``. The other extends from " +"``-1`` along the real axis to ``-∞``." msgstr "" -#: ../../library/cmath.rst:175 +#: ../../library/cmath.rst:185 msgid "Return the hyperbolic cosine of *x*." msgstr "" -#: ../../library/cmath.rst:180 +#: ../../library/cmath.rst:190 msgid "Return the hyperbolic sine of *x*." msgstr "" -#: ../../library/cmath.rst:185 +#: ../../library/cmath.rst:195 msgid "Return the hyperbolic tangent of *x*." msgstr "" -#: ../../library/cmath.rst:189 +#: ../../library/cmath.rst:199 msgid "Classification functions" msgstr "" -#: ../../library/cmath.rst:193 +#: ../../library/cmath.rst:203 msgid "" "Return ``True`` if both the real and imaginary parts of *x* are finite, and " "``False`` otherwise." msgstr "" -#: ../../library/cmath.rst:201 +#: ../../library/cmath.rst:211 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is an " "infinity, and ``False`` otherwise." msgstr "" -#: ../../library/cmath.rst:207 +#: ../../library/cmath.rst:217 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is a NaN, " "and ``False`` otherwise." msgstr "" -#: ../../library/cmath.rst:213 +#: ../../library/cmath.rst:223 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." msgstr "" -#: ../../library/cmath.rst:216 +#: ../../library/cmath.rst:226 msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances." msgstr "" -#: ../../library/cmath.rst:219 +#: ../../library/cmath.rst:229 msgid "" "*rel_tol* is the relative tolerance -- it is the maximum allowed difference " "between *a* and *b*, relative to the larger absolute value of *a* or *b*. " @@ -245,19 +256,19 @@ msgid "" "within about 9 decimal digits. *rel_tol* must be greater than zero." msgstr "" -#: ../../library/cmath.rst:225 +#: ../../library/cmath.rst:235 msgid "" "*abs_tol* is the minimum absolute tolerance -- useful for comparisons near " "zero. *abs_tol* must be at least zero." msgstr "" -#: ../../library/cmath.rst:228 +#: ../../library/cmath.rst:238 msgid "" "If no errors occur, the result will be: ``abs(a-b) <= max(rel_tol * " "max(abs(a), abs(b)), abs_tol)``." msgstr "" -#: ../../library/cmath.rst:231 +#: ../../library/cmath.rst:241 msgid "" "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " "handled according to IEEE rules. Specifically, ``NaN`` is not considered " @@ -265,49 +276,49 @@ msgid "" "considered close to themselves." msgstr "" -#: ../../library/cmath.rst:240 +#: ../../library/cmath.rst:250 msgid ":pep:`485` -- A function for testing approximate equality" msgstr "" -#: ../../library/cmath.rst:244 +#: ../../library/cmath.rst:254 msgid "Constants" msgstr "常數" -#: ../../library/cmath.rst:248 +#: ../../library/cmath.rst:258 msgid "The mathematical constant *π*, as a float." msgstr "" -#: ../../library/cmath.rst:253 +#: ../../library/cmath.rst:263 msgid "The mathematical constant *e*, as a float." msgstr "" -#: ../../library/cmath.rst:258 +#: ../../library/cmath.rst:268 msgid "The mathematical constant *τ*, as a float." msgstr "" -#: ../../library/cmath.rst:265 +#: ../../library/cmath.rst:275 msgid "Floating-point positive infinity. Equivalent to ``float('inf')``." msgstr "" -#: ../../library/cmath.rst:272 +#: ../../library/cmath.rst:282 msgid "" "Complex number with zero real part and positive infinity imaginary part. " "Equivalent to ``complex(0.0, float('inf'))``." msgstr "" -#: ../../library/cmath.rst:280 +#: ../../library/cmath.rst:290 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to " "``float('nan')``." msgstr "" -#: ../../library/cmath.rst:288 +#: ../../library/cmath.rst:298 msgid "" "Complex number with zero real part and NaN imaginary part. Equivalent to " "``complex(0.0, float('nan'))``." msgstr "" -#: ../../library/cmath.rst:296 +#: ../../library/cmath.rst:306 msgid "" "Note that the selection of functions is similar, but not identical, to that " "in module :mod:`math`. The reason for having two modules is that some users " @@ -319,7 +330,7 @@ msgid "" "zero)." msgstr "" -#: ../../library/cmath.rst:304 +#: ../../library/cmath.rst:314 msgid "" "A note on branch cuts: They are curves along which the given function fails " "to be continuous. They are a necessary feature of many complex functions. " @@ -330,7 +341,7 @@ msgid "" "following:" msgstr "" -#: ../../library/cmath.rst:314 +#: ../../library/cmath.rst:324 msgid "" "Kahan, W: Branch cuts for complex elementary functions; or, Much ado about " "nothing's sign bit. In Iserles, A., and Powell, M. (eds.), The state of the " diff --git a/library/re.po b/library/re.po index c662d1f822..e894fbf633 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-21 00:15+0000\n" +"POT-Creation-Date: 2023-02-27 00:34+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -146,7 +146,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1525 +#: ../../library/re.rst:104 ../../library/re.rst:1526 msgid "``.``" msgstr "``.``" @@ -330,7 +330,7 @@ msgid "" "recommended that you use raw strings for all but the simplest expressions." msgstr "" -#: ../../library/re.rst:293 +#: ../../library/re.rst:294 msgid "``[]``" msgstr "``[]``" @@ -382,10 +382,11 @@ msgstr "" msgid "" "To match a literal ``']'`` inside a set, precede it with a backslash, or " "place it at the beginning of the set. For example, both ``[()[\\]{}]`` and " -"``[]()[{}]`` will both match a parenthesis." +"``[]()[{}]`` will match a right bracket, as well as left bracket, braces, " +"and parentheses." msgstr "" -#: ../../library/re.rst:281 +#: ../../library/re.rst:282 msgid "" "Support of nested sets and set operations as in `Unicode Technical Standard " "#18`_ might be added in the future. This would change the syntax, so to " @@ -395,17 +396,17 @@ msgid "" "``'||'``. To avoid a warning escape them with a backslash." msgstr "" -#: ../../library/re.rst:291 +#: ../../library/re.rst:292 msgid "" ":exc:`FutureWarning` is raised if a character set contains constructs that " "will change semantically in the future." msgstr "" -#: ../../library/re.rst:306 +#: ../../library/re.rst:307 msgid "``|``" msgstr "``|``" -#: ../../library/re.rst:298 +#: ../../library/re.rst:299 msgid "" "``A|B``, where *A* and *B* can be arbitrary REs, creates a regular " "expression that will match either *A* or *B*. An arbitrary number of REs " @@ -418,11 +419,11 @@ msgid "" "use ``\\|``, or enclose it inside a character class, as in ``[|]``." msgstr "" -#: ../../library/re.rst:316 +#: ../../library/re.rst:317 msgid "``(...)``" msgstr "``(...)``" -#: ../../library/re.rst:312 +#: ../../library/re.rst:313 msgid "" "Matches whatever regular expression is inside the parentheses, and indicates " "the start and end of a group; the contents of a group can be retrieved after " @@ -432,11 +433,11 @@ msgid "" "character class: ``[(]``, ``[)]``." msgstr "" -#: ../../library/re.rst:325 +#: ../../library/re.rst:326 msgid "``(?...)``" msgstr "``(?...)``" -#: ../../library/re.rst:321 +#: ../../library/re.rst:322 msgid "" "This is an extension notation (a ``'?'`` following a ``'('`` is not " "meaningful otherwise). The first character after the ``'?'`` determines " @@ -445,11 +446,11 @@ msgid "" "rule. Following are the currently supported extensions." msgstr "" -#: ../../library/re.rst:342 +#: ../../library/re.rst:343 msgid "``(?aiLmsux)``" msgstr "``(?aiLmsux)``" -#: ../../library/re.rst:328 +#: ../../library/re.rst:329 msgid "" "(One or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, " "``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters " @@ -463,15 +464,15 @@ msgid "" "first in the expression string." msgstr "" -#: ../../library/re.rst:341 +#: ../../library/re.rst:342 msgid "This construction can only be used at the start of the expression." msgstr "" -#: ../../library/re.rst:350 +#: ../../library/re.rst:351 msgid "``(?:...)``" msgstr "``(?:...)``" -#: ../../library/re.rst:347 +#: ../../library/re.rst:348 msgid "" "A non-capturing version of regular parentheses. Matches whatever regular " "expression is inside the parentheses, but the substring matched by the group " @@ -479,11 +480,11 @@ msgid "" "pattern." msgstr "" -#: ../../library/re.rst:376 +#: ../../library/re.rst:377 msgid "``(?aiLmsux-imsx:...)``" msgstr "``(?aiLmsux-imsx:...)``" -#: ../../library/re.rst:353 +#: ../../library/re.rst:354 msgid "" "(Zero or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, " "``'s'``, ``'u'``, ``'x'``, optionally followed by ``'-'`` followed by one or " @@ -495,7 +496,7 @@ msgid "" "flags are described in :ref:`contents-of-module-re`.)" msgstr "" -#: ../../library/re.rst:363 +#: ../../library/re.rst:364 msgid "" "The letters ``'a'``, ``'L'`` and ``'u'`` are mutually exclusive when used as " "inline flags, so they can't be combined or follow ``'-'``. Instead, when " @@ -508,15 +509,15 @@ msgid "" "restored outside of the group." msgstr "" -#: ../../library/re.rst:375 +#: ../../library/re.rst:376 msgid "The letters ``'a'``, ``'L'`` and ``'u'`` also can be used in a group." msgstr "" -#: ../../library/re.rst:391 +#: ../../library/re.rst:392 msgid "``(?>...)``" msgstr "``(?>...)``" -#: ../../library/re.rst:379 +#: ../../library/re.rst:380 msgid "" "Attempts to match ``...`` as if it was a separate regular expression, and if " "successful, continues to match the rest of the pattern following it. If the " @@ -530,11 +531,11 @@ msgid "" "thus fail to match." msgstr "" -#: ../../library/re.rst:421 +#: ../../library/re.rst:422 msgid "``(?P...)``" msgstr "``(?P...)``" -#: ../../library/re.rst:396 +#: ../../library/re.rst:397 msgid "" "Similar to regular parentheses, but the substring matched by the group is " "accessible via the symbolic group name *name*. Group names must be valid " @@ -543,106 +544,106 @@ msgid "" "the group were not named." msgstr "" -#: ../../library/re.rst:402 +#: ../../library/re.rst:403 msgid "" "Named groups can be referenced in three contexts. If the pattern is ``(?" "P['\"]).*?(?P=quote)`` (i.e. matching a string quoted with either " "single or double quotes):" msgstr "" -#: ../../library/re.rst:407 +#: ../../library/re.rst:408 msgid "Context of reference to group \"quote\"" msgstr "" -#: ../../library/re.rst:407 +#: ../../library/re.rst:408 msgid "Ways to reference it" msgstr "" -#: ../../library/re.rst:409 +#: ../../library/re.rst:410 msgid "in the same pattern itself" msgstr "" -#: ../../library/re.rst:409 +#: ../../library/re.rst:410 msgid "``(?P=quote)`` (as shown)" msgstr "" -#: ../../library/re.rst:410 ../../library/re.rst:417 +#: ../../library/re.rst:411 ../../library/re.rst:418 msgid "``\\1``" msgstr "``\\1``" -#: ../../library/re.rst:412 +#: ../../library/re.rst:413 msgid "when processing match object *m*" msgstr "" -#: ../../library/re.rst:412 +#: ../../library/re.rst:413 msgid "``m.group('quote')``" msgstr "``m.group('quote')``" -#: ../../library/re.rst:413 +#: ../../library/re.rst:414 msgid "``m.end('quote')`` (etc.)" msgstr "" -#: ../../library/re.rst:415 +#: ../../library/re.rst:416 msgid "in a string passed to the *repl* argument of ``re.sub()``" msgstr "" -#: ../../library/re.rst:415 +#: ../../library/re.rst:416 msgid "``\\g``" msgstr "``\\g``" -#: ../../library/re.rst:416 +#: ../../library/re.rst:417 msgid "``\\g<1>``" msgstr "``\\g<1>``" -#: ../../library/re.rst:420 +#: ../../library/re.rst:421 msgid "Group names containing non-ASCII characters in bytes patterns." msgstr "" -#: ../../library/re.rst:427 +#: ../../library/re.rst:428 msgid "``(?P=name)``" msgstr "``(?P=name)``" -#: ../../library/re.rst:426 +#: ../../library/re.rst:427 msgid "" "A backreference to a named group; it matches whatever text was matched by " "the earlier group named *name*." msgstr "" -#: ../../library/re.rst:432 +#: ../../library/re.rst:433 msgid "``(?#...)``" msgstr "``(?#...)``" -#: ../../library/re.rst:432 +#: ../../library/re.rst:433 msgid "A comment; the contents of the parentheses are simply ignored." msgstr "" -#: ../../library/re.rst:439 +#: ../../library/re.rst:440 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../library/re.rst:437 +#: ../../library/re.rst:438 msgid "" "Matches if ``...`` matches next, but doesn't consume any of the string. " "This is called a :dfn:`lookahead assertion`. For example, ``Isaac (?" "=Asimov)`` will match ``'Isaac '`` only if it's followed by ``'Asimov'``." msgstr "" -#: ../../library/re.rst:446 +#: ../../library/re.rst:447 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../library/re.rst:444 +#: ../../library/re.rst:445 msgid "" "Matches if ``...`` doesn't match next. This is a :dfn:`negative lookahead " "assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only " "if it's *not* followed by ``'Asimov'``." msgstr "" -#: ../../library/re.rst:473 +#: ../../library/re.rst:474 msgid "``(?<=...)``" msgstr "``(?<=...)``" -#: ../../library/re.rst:451 +#: ../../library/re.rst:452 msgid "" "Matches if the current position in the string is preceded by a match for " "``...`` that ends at the current position. This is called a :dfn:`positive " @@ -656,19 +657,19 @@ msgid "" "func:`match` function:" msgstr "" -#: ../../library/re.rst:466 +#: ../../library/re.rst:467 msgid "This example looks for a word following a hyphen:" msgstr "" -#: ../../library/re.rst:472 +#: ../../library/re.rst:473 msgid "Added support for group references of fixed length." msgstr "" -#: ../../library/re.rst:482 +#: ../../library/re.rst:483 msgid "``(?'``." msgstr "" -#: ../../library/re.rst:495 +#: ../../library/re.rst:496 msgid "Group *id* containing anything except ASCII digits." msgstr "" -#: ../../library/re.rst:499 +#: ../../library/re.rst:500 msgid "" "The special sequences consist of ``'\\'`` and a character from the list " "below. If the ordinary character is not an ASCII digit or an ASCII letter, " @@ -703,11 +704,11 @@ msgid "" "matches the character ``'$'``." msgstr "" -#: ../../library/re.rst:514 +#: ../../library/re.rst:515 msgid "``\\number``" msgstr "``\\number``" -#: ../../library/re.rst:507 +#: ../../library/re.rst:508 msgid "" "Matches the contents of the group of the same number. Groups are numbered " "starting from 1. For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 " @@ -719,19 +720,19 @@ msgid "" "escapes are treated as characters." msgstr "" -#: ../../library/re.rst:519 +#: ../../library/re.rst:520 msgid "``\\A``" msgstr "``\\A``" -#: ../../library/re.rst:519 +#: ../../library/re.rst:520 msgid "Matches only at the start of the string." msgstr "" -#: ../../library/re.rst:535 +#: ../../library/re.rst:536 msgid "``\\b``" msgstr "``\\b``" -#: ../../library/re.rst:524 +#: ../../library/re.rst:525 msgid "" "Matches the empty string, but only at the beginning or end of a word. A word " "is defined as a sequence of word characters. Note that formally, ``\\b`` is " @@ -741,7 +742,7 @@ msgid "" "baz'`` but not ``'foobar'`` or ``'foo3'``." msgstr "" -#: ../../library/re.rst:531 +#: ../../library/re.rst:532 msgid "" "By default Unicode alphanumerics are the ones used in Unicode patterns, but " "this can be changed by using the :const:`ASCII` flag. Word boundaries are " @@ -750,11 +751,11 @@ msgid "" "compatibility with Python's string literals." msgstr "" -#: ../../library/re.rst:546 +#: ../../library/re.rst:547 msgid "``\\B``" msgstr "``\\B``" -#: ../../library/re.rst:540 +#: ../../library/re.rst:541 msgid "" "Matches the empty string, but only when it is *not* at the beginning or end " "of a word. This means that ``r'py\\B'`` matches ``'python'``, ``'py3'``, " @@ -765,15 +766,15 @@ msgid "" "the :const:`LOCALE` flag is used." msgstr "" -#: ../../library/re.rst:558 +#: ../../library/re.rst:559 msgid "``\\d``" msgstr "``\\d``" -#: ../../library/re.rst:555 ../../library/re.rst:575 ../../library/re.rst:594 +#: ../../library/re.rst:556 ../../library/re.rst:576 ../../library/re.rst:595 msgid "For Unicode (str) patterns:" msgstr "" -#: ../../library/re.rst:552 +#: ../../library/re.rst:553 msgid "" "Matches any Unicode decimal digit (that is, any character in Unicode " "character category [Nd]). This includes ``[0-9]``, and also many other " @@ -781,30 +782,30 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:558 ../../library/re.rst:579 ../../library/re.rst:600 +#: ../../library/re.rst:559 ../../library/re.rst:580 ../../library/re.rst:601 msgid "For 8-bit (bytes) patterns:" msgstr "" -#: ../../library/re.rst:558 +#: ../../library/re.rst:559 msgid "Matches any decimal digit; this is equivalent to ``[0-9]``." msgstr "" -#: ../../library/re.rst:565 +#: ../../library/re.rst:566 msgid "``\\D``" msgstr "``\\D``" -#: ../../library/re.rst:563 +#: ../../library/re.rst:564 msgid "" "Matches any character which is not a decimal digit. This is the opposite of " "``\\d``. If the :const:`ASCII` flag is used this becomes the equivalent of " "``[^0-9]``." msgstr "" -#: ../../library/re.rst:579 +#: ../../library/re.rst:580 msgid "``\\s``" msgstr "``\\s``" -#: ../../library/re.rst:571 +#: ../../library/re.rst:572 msgid "" "Matches Unicode whitespace characters (which includes " "``[ \\t\\n\\r\\f\\v]``, and also many other characters, for example the non-" @@ -812,35 +813,35 @@ msgid "" "const:`ASCII` flag is used, only ``[ \\t\\n\\r\\f\\v]`` is matched." msgstr "" -#: ../../library/re.rst:578 +#: ../../library/re.rst:579 msgid "" "Matches characters considered whitespace in the ASCII character set; this is " "equivalent to ``[ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:586 +#: ../../library/re.rst:587 msgid "``\\S``" msgstr "``\\S``" -#: ../../library/re.rst:584 +#: ../../library/re.rst:585 msgid "" "Matches any character which is not a whitespace character. This is the " "opposite of ``\\s``. If the :const:`ASCII` flag is used this becomes the " "equivalent of ``[^ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:600 +#: ../../library/re.rst:601 msgid "``\\w``" msgstr "``\\w``" -#: ../../library/re.rst:592 +#: ../../library/re.rst:593 msgid "" "Matches Unicode word characters; this includes alphanumeric characters (as " "defined by :meth:`str.isalnum`) as well as the underscore (``_``). If the :" "const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched." msgstr "" -#: ../../library/re.rst:597 +#: ../../library/re.rst:598 msgid "" "Matches characters considered alphanumeric in the ASCII character set; this " "is equivalent to ``[a-zA-Z0-9_]``. If the :const:`LOCALE` flag is used, " @@ -848,11 +849,11 @@ msgid "" "underscore." msgstr "" -#: ../../library/re.rst:609 +#: ../../library/re.rst:610 msgid "``\\W``" msgstr "``\\W``" -#: ../../library/re.rst:605 +#: ../../library/re.rst:606 msgid "" "Matches any character which is not a word character. This is the opposite of " "``\\w``. If the :const:`ASCII` flag is used this becomes the equivalent of " @@ -860,34 +861,34 @@ msgid "" "which are neither alphanumeric in the current locale nor the underscore." msgstr "" -#: ../../library/re.rst:614 +#: ../../library/re.rst:615 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../library/re.rst:614 +#: ../../library/re.rst:615 msgid "Matches only at the end of the string." msgstr "" -#: ../../library/re.rst:630 +#: ../../library/re.rst:631 msgid "" "Most of the standard escapes supported by Python string literals are also " "accepted by the regular expression parser::" msgstr "" -#: ../../library/re.rst:637 +#: ../../library/re.rst:638 msgid "" "(Note that ``\\b`` is used to represent word boundaries, and means " "\"backspace\" only inside character classes.)" msgstr "" -#: ../../library/re.rst:640 +#: ../../library/re.rst:641 msgid "" "``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in " "Unicode patterns. In bytes patterns they are errors. Unknown escapes of " "ASCII letters are reserved for future use and treated as errors." msgstr "" -#: ../../library/re.rst:644 +#: ../../library/re.rst:645 msgid "" "Octal escapes are included in a limited form. If the first digit is a 0, or " "if there are three octal digits, it is considered an octal escape. " @@ -895,26 +896,26 @@ msgid "" "are always at most three digits in length." msgstr "" -#: ../../library/re.rst:649 +#: ../../library/re.rst:650 msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added." msgstr "" -#: ../../library/re.rst:652 +#: ../../library/re.rst:653 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors." msgstr "" -#: ../../library/re.rst:655 +#: ../../library/re.rst:656 msgid "" "The ``'\\N{name}'`` escape sequence has been added. As in string literals, " "it expands to the named Unicode character (e.g. ``'\\N{EM DASH}'``)." msgstr "" -#: ../../library/re.rst:663 +#: ../../library/re.rst:664 msgid "Module Contents" msgstr "模組內容" -#: ../../library/re.rst:665 +#: ../../library/re.rst:666 msgid "" "The module defines several functions, constants, and an exception. Some of " "the functions are simplified versions of the full featured methods for " @@ -922,26 +923,26 @@ msgid "" "compiled form." msgstr "" -#: ../../library/re.rst:672 +#: ../../library/re.rst:673 msgid "Flags" msgstr "" -#: ../../library/re.rst:674 +#: ../../library/re.rst:675 msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" -#: ../../library/re.rst:681 +#: ../../library/re.rst:682 msgid "" "An :class:`enum.IntFlag` class containing the regex options listed below." msgstr "" -#: ../../library/re.rst:683 +#: ../../library/re.rst:684 msgid "- added to ``__all__``" msgstr "" -#: ../../library/re.rst:688 +#: ../../library/re.rst:689 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " "``\\S`` perform ASCII-only matching instead of full Unicode matching. This " @@ -949,7 +950,7 @@ msgid "" "Corresponds to the inline flag ``(?a)``." msgstr "" -#: ../../library/re.rst:693 +#: ../../library/re.rst:694 msgid "" "Note that for backward compatibility, the :const:`re.U` flag still exists " "(as well as its synonym :const:`re.UNICODE` and its embedded counterpart ``(?" @@ -957,13 +958,13 @@ msgid "" "default for strings (and Unicode matching isn't allowed for bytes)." msgstr "" -#: ../../library/re.rst:702 +#: ../../library/re.rst:703 msgid "" "Display debug information about compiled expression. No corresponding inline " "flag." msgstr "" -#: ../../library/re.rst:709 +#: ../../library/re.rst:710 msgid "" "Perform case-insensitive matching; expressions like ``[A-Z]`` will also " "match lowercase letters. Full Unicode matching (such as ``Ü`` matching " @@ -973,7 +974,7 @@ msgid "" "flag ``(?i)``." msgstr "" -#: ../../library/re.rst:716 +#: ../../library/re.rst:717 msgid "" "Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in " "combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " @@ -984,7 +985,7 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:727 +#: ../../library/re.rst:728 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale. This flag can be used only with bytes " @@ -995,20 +996,20 @@ msgid "" "locales/languages. Corresponds to the inline flag ``(?L)``." msgstr "" -#: ../../library/re.rst:736 +#: ../../library/re.rst:737 msgid "" ":const:`re.LOCALE` can be used only with bytes patterns and is not " "compatible with :const:`re.ASCII`." msgstr "" -#: ../../library/re.rst:740 +#: ../../library/re.rst:741 msgid "" "Compiled regular expression objects with the :const:`re.LOCALE` flag no " "longer depend on the locale at compile time. Only the locale at matching " "time affects the result of matching." msgstr "" -#: ../../library/re.rst:749 +#: ../../library/re.rst:750 msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -1019,7 +1020,7 @@ msgid "" "the end of the string. Corresponds to the inline flag ``(?m)``." msgstr "" -#: ../../library/re.rst:759 +#: ../../library/re.rst:760 msgid "" "Indicates no flag being applied, the value is ``0``. This flag may be used " "as a default value for a function keyword argument or as a base value that " @@ -1027,14 +1028,14 @@ msgid "" "value::" msgstr "" -#: ../../library/re.rst:772 +#: ../../library/re.rst:773 msgid "" "Make the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline. " "Corresponds to the inline flag ``(?s)``." msgstr "" -#: ../../library/re.rst:782 +#: ../../library/re.rst:783 msgid "" "This flag allows you to write regular expressions that look nicer and are " "more readable by allowing you to visually separate logical sections of the " @@ -1047,53 +1048,53 @@ msgid "" "ignored." msgstr "" -#: ../../library/re.rst:792 +#: ../../library/re.rst:793 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: ../../library/re.rst:800 +#: ../../library/re.rst:801 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: ../../library/re.rst:804 +#: ../../library/re.rst:805 msgid "Functions" msgstr "" -#: ../../library/re.rst:808 +#: ../../library/re.rst:809 msgid "" "Compile a regular expression pattern into a :ref:`regular expression object " "`, which can be used for matching using its :func:`~Pattern." "match`, :func:`~Pattern.search` and other methods, described below." msgstr "" -#: ../../library/re.rst:813 +#: ../../library/re.rst:814 msgid "" "The expression's behaviour can be modified by specifying a *flags* value. " "Values can be any of the following variables, combined using bitwise OR (the " "``|`` operator)." msgstr "" -#: ../../library/re.rst:817 +#: ../../library/re.rst:818 msgid "The sequence ::" msgstr "" -#: ../../library/re.rst:822 +#: ../../library/re.rst:823 msgid "is equivalent to ::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/re.rst:826 +#: ../../library/re.rst:827 msgid "" "but using :func:`re.compile` and saving the resulting regular expression " "object for reuse is more efficient when the expression will be used several " "times in a single program." msgstr "" -#: ../../library/re.rst:832 +#: ../../library/re.rst:833 msgid "" "The compiled versions of the most recent patterns passed to :func:`re." "compile` and the module-level matching functions are cached, so programs " @@ -1101,7 +1102,7 @@ msgid "" "compiling regular expressions." msgstr "" -#: ../../library/re.rst:840 +#: ../../library/re.rst:841 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :ref:" @@ -1110,7 +1111,7 @@ msgid "" "length match at some point in the string." msgstr "" -#: ../../library/re.rst:849 +#: ../../library/re.rst:850 msgid "" "If zero or more characters at the beginning of *string* match the regular " "expression *pattern*, return a corresponding :ref:`match object `. Return ``None`` if the " @@ -1138,7 +1139,7 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:873 +#: ../../library/re.rst:874 msgid "" "Split *string* by the occurrences of *pattern*. If capturing parentheses " "are used in *pattern*, then the text of all groups in the pattern are also " @@ -1147,42 +1148,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:888 +#: ../../library/re.rst:889 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" -#: ../../library/re.rst:895 +#: ../../library/re.rst:896 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:898 +#: ../../library/re.rst:899 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:908 ../../library/re.rst:998 ../../library/re.rst:1026 +#: ../../library/re.rst:909 ../../library/re.rst:999 ../../library/re.rst:1027 msgid "Added the optional flags argument." msgstr "" -#: ../../library/re.rst:911 +#: ../../library/re.rst:912 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:917 +#: ../../library/re.rst:918 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " "strings or tuples. The *string* is scanned left-to-right, and matches are " "returned in the order found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:921 +#: ../../library/re.rst:922 msgid "" "The result depends on the number of capturing groups in the pattern. If " "there are no groups, return a list of strings matching the whole pattern. " @@ -1192,11 +1193,11 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:933 ../../library/re.rst:944 +#: ../../library/re.rst:934 ../../library/re.rst:945 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:939 +#: ../../library/re.rst:940 msgid "" "Return an :term:`iterator` yielding :ref:`match objects ` " "over all non-overlapping matches for the RE *pattern* in *string*. The " @@ -1204,7 +1205,7 @@ msgid "" "found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:950 +#: ../../library/re.rst:951 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1218,18 +1219,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:966 +#: ../../library/re.rst:967 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :ref:`match object ` argument, and returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:978 +#: ../../library/re.rst:979 msgid "The pattern may be a string or a :ref:`pattern object `." msgstr "" -#: ../../library/re.rst:980 +#: ../../library/re.rst:981 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1238,7 +1239,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:988 +#: ../../library/re.rst:989 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1251,59 +1252,59 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:1001 ../../library/re.rst:1029 -#: ../../library/re.rst:1263 +#: ../../library/re.rst:1002 ../../library/re.rst:1030 +#: ../../library/re.rst:1264 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:1004 +#: ../../library/re.rst:1005 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:1008 +#: ../../library/re.rst:1009 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:1012 +#: ../../library/re.rst:1013 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:1016 +#: ../../library/re.rst:1017 msgid "" "Group *id* containing anything except ASCII digits. Group names containing " "non-ASCII characters in bytes replacement strings." msgstr "" -#: ../../library/re.rst:1023 +#: ../../library/re.rst:1024 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:1035 +#: ../../library/re.rst:1036 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: ../../library/re.rst:1050 +#: ../../library/re.rst:1051 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: ../../library/re.rst:1058 +#: ../../library/re.rst:1059 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:1061 +#: ../../library/re.rst:1062 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1311,15 +1312,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:1070 +#: ../../library/re.rst:1071 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:1074 +#: ../../library/re.rst:1075 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:1078 +#: ../../library/re.rst:1079 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " @@ -1328,41 +1329,41 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:1086 +#: ../../library/re.rst:1087 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1090 +#: ../../library/re.rst:1091 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1094 +#: ../../library/re.rst:1095 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1098 +#: ../../library/re.rst:1099 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1102 +#: ../../library/re.rst:1103 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1104 +#: ../../library/re.rst:1105 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1110 +#: ../../library/re.rst:1111 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1112 +#: ../../library/re.rst:1113 msgid "" "Compiled regular expression objects support the following methods and " "attributes:" msgstr "" -#: ../../library/re.rst:1117 +#: ../../library/re.rst:1118 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :ref:`match object " @@ -1371,7 +1372,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:1123 +#: ../../library/re.rst:1124 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1380,7 +1381,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1129 +#: ../../library/re.rst:1130 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1390,7 +1391,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1144 +#: ../../library/re.rst:1145 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :ref:`match object `. " @@ -1398,19 +1399,19 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:1149 ../../library/re.rst:1167 +#: ../../library/re.rst:1150 ../../library/re.rst:1168 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1157 +#: ../../library/re.rst:1158 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:1163 +#: ../../library/re.rst:1164 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :ref:`match object `. Return ``None`` if the " @@ -1418,76 +1419,76 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:1181 +#: ../../library/re.rst:1182 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1186 +#: ../../library/re.rst:1187 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1193 +#: ../../library/re.rst:1194 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1200 +#: ../../library/re.rst:1201 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1205 +#: ../../library/re.rst:1206 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1210 +#: ../../library/re.rst:1211 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :data:`UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1217 +#: ../../library/re.rst:1218 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1222 +#: ../../library/re.rst:1223 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: ../../library/re.rst:1229 +#: ../../library/re.rst:1230 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1232 +#: ../../library/re.rst:1233 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1240 +#: ../../library/re.rst:1241 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1242 +#: ../../library/re.rst:1243 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: ../../library/re.rst:1251 +#: ../../library/re.rst:1252 msgid "Match objects support the following methods and attributes:" msgstr "" -#: ../../library/re.rst:1256 +#: ../../library/re.rst:1257 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1496,7 +1497,7 @@ msgid "" "``\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1268 +#: ../../library/re.rst:1269 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1511,7 +1512,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1290 +#: ../../library/re.rst:1291 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1519,57 +1520,57 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1295 +#: ../../library/re.rst:1296 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1303 +#: ../../library/re.rst:1304 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1310 +#: ../../library/re.rst:1311 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1319 +#: ../../library/re.rst:1320 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1330 +#: ../../library/re.rst:1331 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1343 +#: ../../library/re.rst:1344 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1347 ../../library/re.rst:1572 +#: ../../library/re.rst:1348 ../../library/re.rst:1573 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1353 +#: ../../library/re.rst:1354 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1366 +#: ../../library/re.rst:1367 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1378 +#: ../../library/re.rst:1379 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1578,7 +1579,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1386 +#: ../../library/re.rst:1387 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1586,32 +1587,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1391 +#: ../../library/re.rst:1392 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1401 +#: ../../library/re.rst:1402 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1408 +#: ../../library/re.rst:1409 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1415 +#: ../../library/re.rst:1416 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1422 +#: ../../library/re.rst:1423 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1620,43 +1621,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1431 +#: ../../library/re.rst:1432 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1437 +#: ../../library/re.rst:1438 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1443 +#: ../../library/re.rst:1444 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1446 +#: ../../library/re.rst:1447 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1454 +#: ../../library/re.rst:1455 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1458 +#: ../../library/re.rst:1459 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1460 +#: ../../library/re.rst:1461 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1468 +#: ../../library/re.rst:1469 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1664,28 +1665,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1473 +#: ../../library/re.rst:1474 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1483 +#: ../../library/re.rst:1484 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1493 +#: ../../library/re.rst:1494 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1512 +#: ../../library/re.rst:1513 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1516 +#: ../../library/re.rst:1517 msgid "" "Python does not currently have an equivalent to :c:func:`scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -1694,124 +1695,124 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1523 +#: ../../library/re.rst:1524 msgid ":c:func:`scanf` Token" msgstr "" -#: ../../library/re.rst:1523 +#: ../../library/re.rst:1524 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1525 +#: ../../library/re.rst:1526 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1527 +#: ../../library/re.rst:1528 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1527 +#: ../../library/re.rst:1528 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1529 +#: ../../library/re.rst:1530 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1529 +#: ../../library/re.rst:1530 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1531 +#: ../../library/re.rst:1532 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1531 +#: ../../library/re.rst:1532 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1533 +#: ../../library/re.rst:1534 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1533 +#: ../../library/re.rst:1534 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1535 +#: ../../library/re.rst:1536 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1535 +#: ../../library/re.rst:1536 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1537 +#: ../../library/re.rst:1538 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1537 +#: ../../library/re.rst:1538 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1539 +#: ../../library/re.rst:1540 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1539 +#: ../../library/re.rst:1540 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1541 +#: ../../library/re.rst:1542 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1541 +#: ../../library/re.rst:1542 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1544 +#: ../../library/re.rst:1545 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1548 +#: ../../library/re.rst:1549 msgid "you would use a :c:func:`scanf` format like ::" msgstr "" -#: ../../library/re.rst:1552 +#: ../../library/re.rst:1553 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1560 +#: ../../library/re.rst:1561 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1564 +#: ../../library/re.rst:1565 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1566 +#: ../../library/re.rst:1567 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1567 +#: ../../library/re.rst:1568 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1569 +#: ../../library/re.rst:1570 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1581 +#: ../../library/re.rst:1582 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1589 +#: ../../library/re.rst:1590 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1819,11 +1820,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1599 +#: ../../library/re.rst:1600 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1601 +#: ../../library/re.rst:1602 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1831,37 +1832,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1606 +#: ../../library/re.rst:1607 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1619 +#: ../../library/re.rst:1620 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1632 +#: ../../library/re.rst:1633 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1645 +#: ../../library/re.rst:1646 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1660 +#: ../../library/re.rst:1661 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1662 +#: ../../library/re.rst:1663 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1869,11 +1870,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1679 +#: ../../library/re.rst:1680 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1681 +#: ../../library/re.rst:1682 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1881,11 +1882,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1692 +#: ../../library/re.rst:1693 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1694 +#: ../../library/re.rst:1695 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :ref:`match objects " @@ -1894,11 +1895,11 @@ msgid "" "text, they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1708 +#: ../../library/re.rst:1709 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1710 +#: ../../library/re.rst:1711 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1906,7 +1907,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1720 +#: ../../library/re.rst:1721 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1914,29 +1915,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1732 +#: ../../library/re.rst:1733 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1734 +#: ../../library/re.rst:1735 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1738 +#: ../../library/re.rst:1739 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1794 +#: ../../library/re.rst:1795 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1817 +#: ../../library/re.rst:1818 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " From 0d8773bde32b1cd55340587773003ddf2805c981 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Feb 2023 00:35:25 +0000 Subject: [PATCH 037/130] sync with cpython 1ef6e45f --- library/inspect.po | 293 +++++++++++++++++++++++---------------------- library/types.po | 5 +- 2 files changed, 150 insertions(+), 148 deletions(-) diff --git a/library/inspect.po b/library/inspect.po index df29ff1afb..9e9d665c11 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:32+0000\n" +"POT-Creation-Date: 2023-02-28 00:33+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -969,7 +969,7 @@ msgid "" "including keyword-only parameters." msgstr "" -#: ../../library/inspect.rst:683 ../../library/inspect.rst:1007 +#: ../../library/inspect.rst:683 ../../library/inspect.rst:1008 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " @@ -1069,83 +1069,84 @@ msgstr "" #: ../../library/inspect.rst:783 msgid "" -"Describes how argument values are bound to the parameter. Possible values " -"(accessible via :class:`Parameter`, like ``Parameter.KEYWORD_ONLY``):" +"Describes how argument values are bound to the parameter. The possible " +"values are accessible via :class:`Parameter` (like ``Parameter." +"KEYWORD_ONLY``), and support comparison and ordering, in the following order:" msgstr "" -#: ../../library/inspect.rst:789 +#: ../../library/inspect.rst:790 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:789 +#: ../../library/inspect.rst:790 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:791 +#: ../../library/inspect.rst:792 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:791 +#: ../../library/inspect.rst:792 msgid "" "Value must be supplied as a positional argument. Positional only parameters " "are those which appear before a ``/`` entry (if present) in a Python " "function definition." msgstr "" -#: ../../library/inspect.rst:796 +#: ../../library/inspect.rst:797 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:796 +#: ../../library/inspect.rst:797 msgid "" "Value may be supplied as either a keyword or positional argument (this is " "the standard binding behaviour for functions implemented in Python.)" msgstr "" -#: ../../library/inspect.rst:801 +#: ../../library/inspect.rst:802 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:801 +#: ../../library/inspect.rst:802 msgid "" "A tuple of positional arguments that aren't bound to any other parameter. " "This corresponds to a ``*args`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:806 +#: ../../library/inspect.rst:807 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:806 +#: ../../library/inspect.rst:807 msgid "" "Value must be supplied as a keyword argument. Keyword only parameters are " "those which appear after a ``*`` or ``*args`` entry in a Python function " "definition." msgstr "" -#: ../../library/inspect.rst:811 +#: ../../library/inspect.rst:812 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:811 +#: ../../library/inspect.rst:812 msgid "" "A dict of keyword arguments that aren't bound to any other parameter. This " "corresponds to a ``**kwargs`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:817 +#: ../../library/inspect.rst:818 msgid "Example: print all keyword-only arguments without default values::" msgstr "" -#: ../../library/inspect.rst:831 +#: ../../library/inspect.rst:832 msgid "Describes a enum value of Parameter.kind." msgstr "" -#: ../../library/inspect.rst:835 +#: ../../library/inspect.rst:836 msgid "Example: print all descriptions of arguments::" msgstr "" -#: ../../library/inspect.rst:850 +#: ../../library/inspect.rst:851 msgid "" "Create a new Parameter instance based on the instance replaced was invoked " "on. To override a :class:`Parameter` attribute, pass the corresponding " @@ -1153,94 +1154,94 @@ msgid "" "pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:868 +#: ../../library/inspect.rst:869 msgid "" "In Python 3.3 Parameter objects were allowed to have ``name`` set to " "``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no longer " "permitted." msgstr "" -#: ../../library/inspect.rst:875 +#: ../../library/inspect.rst:876 msgid "" "Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. " "Holds the mapping of arguments to the function's parameters." msgstr "" -#: ../../library/inspect.rst:880 +#: ../../library/inspect.rst:881 msgid "" "A mutable mapping of parameters' names to arguments' values. Contains only " "explicitly bound arguments. Changes in :attr:`arguments` will reflect in :" "attr:`args` and :attr:`kwargs`." msgstr "" -#: ../../library/inspect.rst:884 +#: ../../library/inspect.rst:885 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:889 +#: ../../library/inspect.rst:890 msgid "" "Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` " "relied on a default value are skipped. However, if needed, use :meth:" "`BoundArguments.apply_defaults` to add them." msgstr "" -#: ../../library/inspect.rst:894 +#: ../../library/inspect.rst:895 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:900 +#: ../../library/inspect.rst:901 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:905 +#: ../../library/inspect.rst:906 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:910 +#: ../../library/inspect.rst:911 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:914 +#: ../../library/inspect.rst:915 msgid "Set default values for missing arguments." msgstr "" -#: ../../library/inspect.rst:916 +#: ../../library/inspect.rst:917 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:919 +#: ../../library/inspect.rst:920 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:932 +#: ../../library/inspect.rst:933 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions::" msgstr "" -#: ../../library/inspect.rst:945 +#: ../../library/inspect.rst:946 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:946 +#: ../../library/inspect.rst:947 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:952 +#: ../../library/inspect.rst:953 msgid "Classes and functions" msgstr "" -#: ../../library/inspect.rst:956 +#: ../../library/inspect.rst:957 msgid "" "Arrange the given list of classes into a hierarchy of nested lists. Where a " "nested list appears, it contains classes derived from the class whose entry " @@ -1251,19 +1252,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:967 +#: ../../library/inspect.rst:968 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:970 +#: ../../library/inspect.rst:971 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:973 +#: ../../library/inspect.rst:974 msgid "" "*args* is a list of the positional parameter names. *varargs* is the name of " "the ``*`` parameter or ``None`` if arbitrary positional arguments are not " @@ -1278,7 +1279,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:988 +#: ../../library/inspect.rst:989 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1288,14 +1289,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:995 +#: ../../library/inspect.rst:996 msgid "" "This function is now based on :func:`signature`, but still ignores " "``__wrapped__`` attributes and includes the already bound first parameter in " "the signature output for bound methods." msgstr "" -#: ../../library/inspect.rst:1000 +#: ../../library/inspect.rst:1001 msgid "" "This method was previously documented as deprecated in favour of :func:" "`signature` in Python 3.5, but that decision has been reversed in order to " @@ -1303,7 +1304,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1015 +#: ../../library/inspect.rst:1016 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1312,18 +1313,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1022 ../../library/inspect.rst:1032 +#: ../../library/inspect.rst:1023 ../../library/inspect.rst:1033 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1027 +#: ../../library/inspect.rst:1028 msgid "" "Format a pretty argument spec from the four values returned by :func:" "`getargvalues`. The format\\* arguments are the corresponding optional " "formatting functions that are called to turn names and values into strings." msgstr "" -#: ../../library/inspect.rst:1037 +#: ../../library/inspect.rst:1038 msgid "" "Return a tuple of class cls's base classes, including cls, in method " "resolution order. No class appears more than once in this tuple. Note that " @@ -1331,7 +1332,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1045 +#: ../../library/inspect.rst:1046 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -1344,11 +1345,11 @@ msgid "" "example::" msgstr "" -#: ../../library/inspect.rst:1068 +#: ../../library/inspect.rst:1069 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "" -#: ../../library/inspect.rst:1074 +#: ../../library/inspect.rst:1075 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1360,18 +1361,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1083 +#: ../../library/inspect.rst:1084 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "" -#: ../../library/inspect.rst:1090 +#: ../../library/inspect.rst:1091 msgid "" "Get the object wrapped by *func*. It follows the chain of :attr:" "`__wrapped__` attributes returning the last object in the chain." msgstr "" -#: ../../library/inspect.rst:1093 +#: ../../library/inspect.rst:1094 msgid "" "*stop* is an optional callback accepting an object in the wrapper chain as " "its sole argument that allows the unwrapping to be terminated early if the " @@ -1381,68 +1382,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1100 +#: ../../library/inspect.rst:1101 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "" -#: ../../library/inspect.rst:1107 +#: ../../library/inspect.rst:1108 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1109 +#: ../../library/inspect.rst:1110 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1112 +#: ../../library/inspect.rst:1113 msgid "" "Returns a dict. ``get_annotations()`` returns a new dict every time it's " "called; calling it twice on the same object will return two different but " "equivalent dicts." msgstr "" -#: ../../library/inspect.rst:1116 +#: ../../library/inspect.rst:1117 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1118 +#: ../../library/inspect.rst:1119 msgid "" "If ``eval_str`` is true, values of type ``str`` will be un-stringized using :" "func:`eval()`. This is intended for use with stringized annotations (``from " "__future__ import annotations``)." msgstr "" -#: ../../library/inspect.rst:1122 +#: ../../library/inspect.rst:1123 msgid "" "If ``obj`` doesn't have an annotations dict, returns an empty dict. " "(Functions and methods always have an annotations dict; classes, modules, " "and other types of callables may not.)" msgstr "" -#: ../../library/inspect.rst:1126 +#: ../../library/inspect.rst:1127 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1128 +#: ../../library/inspect.rst:1129 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1130 +#: ../../library/inspect.rst:1131 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1132 +#: ../../library/inspect.rst:1133 msgid "" "``eval_str`` controls whether or not values of type ``str`` are replaced " "with the result of calling :func:`eval()` on those values:" msgstr "" -#: ../../library/inspect.rst:1135 +#: ../../library/inspect.rst:1136 msgid "" "If eval_str is true, :func:`eval()` is called on values of type ``str``. " "(Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval()` " @@ -1450,12 +1451,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1139 +#: ../../library/inspect.rst:1140 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1141 +#: ../../library/inspect.rst:1142 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1463,35 +1464,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1146 +#: ../../library/inspect.rst:1147 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1147 +#: ../../library/inspect.rst:1148 msgid "" "If ``obj`` is a class, ``globals`` defaults to ``sys.modules[obj.__module__]." "__dict__`` and ``locals`` defaults to the ``obj`` class namespace." msgstr "" -#: ../../library/inspect.rst:1150 +#: ../../library/inspect.rst:1151 msgid "" "If ``obj`` is a callable, ``globals`` defaults to ``obj.__globals__``, " "although if ``obj`` is a wrapped function (using ``functools." "update_wrapper()``) it is first unwrapped." msgstr "" -#: ../../library/inspect.rst:1154 +#: ../../library/inspect.rst:1155 msgid "" "Calling ``get_annotations`` is best practice for accessing the annotations " "dict of any object. See :ref:`annotations-howto` for more information on " "annotations best practices." msgstr "" -#: ../../library/inspect.rst:1164 +#: ../../library/inspect.rst:1165 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1166 +#: ../../library/inspect.rst:1167 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1499,95 +1500,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1175 +#: ../../library/inspect.rst:1176 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1179 +#: ../../library/inspect.rst:1180 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1184 +#: ../../library/inspect.rst:1185 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1189 +#: ../../library/inspect.rst:1190 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1193 +#: ../../library/inspect.rst:1194 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1198 ../../library/inspect.rst:1237 +#: ../../library/inspect.rst:1199 ../../library/inspect.rst:1238 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1202 +#: ../../library/inspect.rst:1203 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1206 +#: ../../library/inspect.rst:1207 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1209 +#: ../../library/inspect.rst:1210 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1218 +#: ../../library/inspect.rst:1219 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1223 +#: ../../library/inspect.rst:1224 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1228 +#: ../../library/inspect.rst:1229 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1232 +#: ../../library/inspect.rst:1233 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1241 +#: ../../library/inspect.rst:1242 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1246 +#: ../../library/inspect.rst:1247 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1253 +#: ../../library/inspect.rst:1254 msgid "" "Keeping references to frame objects, as found in the first element of the " "frame records these functions return, can cause your program to create " @@ -1599,7 +1600,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1261 +#: ../../library/inspect.rst:1262 msgid "" "Though the cycle detector will catch these, destruction of the frames (and " "local variables) can be made deterministic by removing the cycle in a :" @@ -1607,31 +1608,31 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1273 +#: ../../library/inspect.rst:1274 msgid "" "If you want to keep the frame around (for example to print a traceback " "later), you can also break reference cycles by using the :meth:`frame.clear` " "method." msgstr "" -#: ../../library/inspect.rst:1277 +#: ../../library/inspect.rst:1278 msgid "" "The optional *context* argument supported by most of these functions " "specifies the number of lines of context to return, which are centered " "around the current line." msgstr "" -#: ../../library/inspect.rst:1284 +#: ../../library/inspect.rst:1285 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1287 +#: ../../library/inspect.rst:1288 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1292 +#: ../../library/inspect.rst:1293 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -1639,19 +1640,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1297 ../../library/inspect.rst:1312 -#: ../../library/inspect.rst:1338 ../../library/inspect.rst:1353 +#: ../../library/inspect.rst:1298 ../../library/inspect.rst:1313 +#: ../../library/inspect.rst:1339 ../../library/inspect.rst:1354 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1302 ../../library/inspect.rst:1317 -#: ../../library/inspect.rst:1343 ../../library/inspect.rst:1358 +#: ../../library/inspect.rst:1303 ../../library/inspect.rst:1318 +#: ../../library/inspect.rst:1344 ../../library/inspect.rst:1359 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "" -#: ../../library/inspect.rst:1307 +#: ../../library/inspect.rst:1308 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -1659,11 +1660,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1322 +#: ../../library/inspect.rst:1323 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1326 +#: ../../library/inspect.rst:1327 msgid "" "This function relies on Python stack frame support in the interpreter, which " "isn't guaranteed to exist in all implementations of Python. If running in " @@ -1671,14 +1672,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1334 +#: ../../library/inspect.rst:1335 msgid "" "Return a list of :class:`FrameInfo` objects for the caller's stack. The " "first entry in the returned list represents the caller; the last entry " "represents the outermost call on the stack." msgstr "" -#: ../../library/inspect.rst:1348 +#: ../../library/inspect.rst:1349 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -1686,11 +1687,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1362 +#: ../../library/inspect.rst:1363 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1364 +#: ../../library/inspect.rst:1365 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1698,20 +1699,20 @@ msgid "" "`__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1369 +#: ../../library/inspect.rst:1370 msgid "" "For cases where you want passive introspection, like documentation tools, " "this can be inconvenient. :func:`getattr_static` has the same signature as :" "func:`getattr` but avoids executing code when it fetches attributes." msgstr "" -#: ../../library/inspect.rst:1375 +#: ../../library/inspect.rst:1376 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`__getattr__` or :meth:`__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1378 +#: ../../library/inspect.rst:1379 msgid "" "Note: this function may not be able to retrieve all attributes that getattr " "can fetch (like dynamically created attributes) and may find attributes that " @@ -1719,31 +1720,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1384 +#: ../../library/inspect.rst:1385 msgid "" "If the instance :attr:`~object.__dict__` is shadowed by another member (for " "example a property) then this function will be unable to find instance " "members." msgstr "" -#: ../../library/inspect.rst:1390 +#: ../../library/inspect.rst:1391 msgid "" ":func:`getattr_static` does not resolve descriptors, for example slot " "descriptors or getset descriptors on objects implemented in C. The " "descriptor object is returned instead of the underlying attribute." msgstr "" -#: ../../library/inspect.rst:1394 +#: ../../library/inspect.rst:1395 msgid "" "You can handle these with code like the following. Note that for arbitrary " "getset descriptors invoking these may trigger code execution::" msgstr "" -#: ../../library/inspect.rst:1420 +#: ../../library/inspect.rst:1421 msgid "Current State of Generators and Coroutines" msgstr "" -#: ../../library/inspect.rst:1422 +#: ../../library/inspect.rst:1423 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1752,31 +1753,31 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1430 +#: ../../library/inspect.rst:1431 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1436 ../../library/inspect.rst:1451 +#: ../../library/inspect.rst:1437 ../../library/inspect.rst:1452 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1433 +#: ../../library/inspect.rst:1434 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1434 +#: ../../library/inspect.rst:1435 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1435 +#: ../../library/inspect.rst:1436 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1436 +#: ../../library/inspect.rst:1437 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1442 +#: ../../library/inspect.rst:1443 msgid "" "Get current state of a coroutine object. The function is intended to be " "used with coroutine objects created by :keyword:`async def` functions, but " @@ -1784,30 +1785,30 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1448 +#: ../../library/inspect.rst:1449 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1449 +#: ../../library/inspect.rst:1450 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1450 +#: ../../library/inspect.rst:1451 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1451 +#: ../../library/inspect.rst:1452 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1455 +#: ../../library/inspect.rst:1456 msgid "" "The current internal state of the generator can also be queried. This is " "mostly useful for testing purposes, to ensure that internal state is being " "updated as expected:" msgstr "" -#: ../../library/inspect.rst:1461 +#: ../../library/inspect.rst:1462 msgid "" "Get the mapping of live local variables in *generator* to their current " "values. A dictionary is returned that maps from variable names to values. " @@ -1815,14 +1816,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1466 +#: ../../library/inspect.rst:1467 msgid "" "If *generator* is a :term:`generator` with no currently associated frame, " "then an empty dictionary is returned. :exc:`TypeError` is raised if " "*generator* is not a Python generator object." msgstr "" -#: ../../library/inspect.rst:1472 +#: ../../library/inspect.rst:1473 msgid "" "This function relies on the generator exposing a Python stack frame for " "introspection, which isn't guaranteed to be the case in all implementations " @@ -1830,72 +1831,72 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1481 +#: ../../library/inspect.rst:1482 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1490 +#: ../../library/inspect.rst:1491 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1492 +#: ../../library/inspect.rst:1493 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1497 +#: ../../library/inspect.rst:1498 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1501 +#: ../../library/inspect.rst:1502 msgid "" "If set, a new dict will be created for the frame's ``f_locals`` when the " "code object is executed." msgstr "" -#: ../../library/inspect.rst:1506 +#: ../../library/inspect.rst:1507 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1510 +#: ../../library/inspect.rst:1511 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1514 +#: ../../library/inspect.rst:1515 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1518 +#: ../../library/inspect.rst:1519 msgid "" "The flag is set when the code object is a generator function, i.e. a " "generator object is returned when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1523 +#: ../../library/inspect.rst:1524 msgid "" "The flag is set when the code object is a coroutine function. When the code " "object is executed it returns a coroutine object. See :pep:`492` for more " "details." msgstr "" -#: ../../library/inspect.rst:1531 +#: ../../library/inspect.rst:1532 msgid "" "The flag is used to transform generators into generator-based coroutines. " "Generator objects with this flag can be used in ``await`` expression, and " "can ``yield from`` coroutine objects. See :pep:`492` for more details." msgstr "" -#: ../../library/inspect.rst:1540 +#: ../../library/inspect.rst:1541 msgid "" "The flag is set when the code object is an asynchronous generator function. " "When the code object is executed it returns an asynchronous generator " "object. See :pep:`525` for more details." msgstr "" -#: ../../library/inspect.rst:1547 +#: ../../library/inspect.rst:1548 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1903,24 +1904,24 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1557 +#: ../../library/inspect.rst:1558 msgid "Command Line Interface" msgstr "" -#: ../../library/inspect.rst:1559 +#: ../../library/inspect.rst:1560 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1564 +#: ../../library/inspect.rst:1565 msgid "" "By default, accepts the name of a module and prints the source of that " "module. A class or function within the module can be printed instead by " "appended a colon and the qualified name of the target object." msgstr "" -#: ../../library/inspect.rst:1570 +#: ../../library/inspect.rst:1571 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/types.po b/library/types.po index 5f04014c18..2f4f2dd697 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-22 00:30+0000\n" +"POT-Creation-Date: 2023-02-28 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -538,7 +538,8 @@ msgid "" "`coroutine function` which returns a generator-based coroutine. The " "generator-based coroutine is still a :term:`generator iterator`, but is also " "considered to be a :term:`coroutine` object and is :term:`awaitable`. " -"However, it may not necessarily implement the :meth:`__await__` method." +"However, it may not necessarily implement the :meth:`~object.__await__` " +"method." msgstr "" #: ../../library/types.rst:485 From 3a941eb3df5b6c9e3878570f602b54bba25a4bf0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 3 Mar 2023 02:30:33 +0000 Subject: [PATCH 038/130] sync with cpython 3b1201da --- library/sqlite3.po | 4 +- library/sys.po | 632 ++++++++++++++++++++++++--------------------- 2 files changed, 335 insertions(+), 301 deletions(-) diff --git a/library/sqlite3.po b/library/sqlite3.po index 006977abe4..b693ae5f09 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-11 00:28+0000\n" +"POT-Creation-Date: 2023-03-03 02:28+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-" @@ -107,7 +107,7 @@ msgstr "" #: ../../library/sqlite3.rst:73 msgid "" "First, we need to create a new database and open a database connection to " -"allow :mod:`!sqlite3` to work with it. Call :func:`sqlite3.connect` to to " +"allow :mod:`!sqlite3` to work with it. Call :func:`sqlite3.connect` to " "create a connection to the database :file:`tutorial.db` in the current " "working directory, implicitly creating it if it does not exist:" msgstr "" diff --git a/library/sys.po b/library/sys.po index badff1b291..2cac7f261a 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-03-03 02:28+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -346,8 +346,8 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:278 ../../library/sys.rst:873 -#: ../../library/sys.rst:1579 ../../library/sys.rst:1812 +#: ../../library/sys.rst:278 ../../library/sys.rst:879 +#: ../../library/sys.rst:1585 ../../library/sys.rst:1818 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -392,13 +392,13 @@ msgid "" "in the future." msgstr "" -#: ../../library/sys.rst:335 ../../library/sys.rst:1020 -#: ../../library/sys.rst:1695 +#: ../../library/sys.rst:335 ../../library/sys.rst:1026 +#: ../../library/sys.rst:1701 msgid "Attribute" msgstr "屬性" -#: ../../library/sys.rst:335 ../../library/sys.rst:1020 -#: ../../library/sys.rst:1695 +#: ../../library/sys.rst:335 ../../library/sys.rst:1026 +#: ../../library/sys.rst:1701 msgid "Explanation" msgstr "解釋" @@ -632,7 +632,7 @@ msgid "" msgstr "" #: ../../library/sys.rst:515 ../../library/sys.rst:572 -#: ../../library/sys.rst:919 +#: ../../library/sys.rst:925 msgid "attribute" msgstr "" @@ -819,16 +819,18 @@ msgstr "" msgid "float.h macro" msgstr "" -#: ../../library/sys.rst:572 ../../library/sys.rst:919 +#: ../../library/sys.rst:572 ../../library/sys.rst:925 msgid "explanation" msgstr "" #: ../../library/sys.rst:574 -msgid ":const:`epsilon`" +#, fuzzy +msgid "``epsilon``" msgstr ":const:`epsilon`" #: ../../library/sys.rst:574 -msgid "DBL_EPSILON" +#, fuzzy +msgid "``DBL_EPSILON``" msgstr "DBL_EPSILON" #: ../../library/sys.rst:574 @@ -842,11 +844,12 @@ msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`\\ 。" #: ../../library/sys.rst:579 -msgid ":const:`dig`" -msgstr ":const:`dig`" +msgid "``dig``" +msgstr "" #: ../../library/sys.rst:579 -msgid "DBL_DIG" +#, fuzzy +msgid "``DBL_DIG``" msgstr "DBL_DIG" #: ../../library/sys.rst:579 @@ -856,11 +859,13 @@ msgid "" msgstr "" #: ../../library/sys.rst:582 -msgid ":const:`mant_dig`" +#, fuzzy +msgid "``mant_dig``" msgstr ":const:`mant_dig`" #: ../../library/sys.rst:582 -msgid "DBL_MANT_DIG" +#, fuzzy +msgid "``DBL_MANT_DIG``" msgstr "DBL_MANT_DIG" #: ../../library/sys.rst:582 @@ -870,11 +875,12 @@ msgid "" msgstr "" #: ../../library/sys.rst:585 -msgid ":const:`max`" -msgstr ":const:`max`" +msgid "``max``" +msgstr "" #: ../../library/sys.rst:585 -msgid "DBL_MAX" +#, fuzzy +msgid "``DBL_MAX``" msgstr "DBL_MAX" #: ../../library/sys.rst:585 @@ -882,11 +888,13 @@ msgid "maximum representable positive finite float" msgstr "" #: ../../library/sys.rst:587 -msgid ":const:`max_exp`" +#, fuzzy +msgid "``max_exp``" msgstr ":const:`max_exp`" #: ../../library/sys.rst:587 -msgid "DBL_MAX_EXP" +#, fuzzy +msgid "``DBL_MAX_EXP``" msgstr "DBL_MAX_EXP" #: ../../library/sys.rst:587 @@ -896,11 +904,13 @@ msgid "" msgstr "" #: ../../library/sys.rst:590 -msgid ":const:`max_10_exp`" +#, fuzzy +msgid "``max_10_exp``" msgstr ":const:`max_10_exp`" #: ../../library/sys.rst:590 -msgid "DBL_MAX_10_EXP" +#, fuzzy +msgid "``DBL_MAX_10_EXP``" msgstr "DBL_MAX_10_EXP" #: ../../library/sys.rst:590 @@ -910,11 +920,12 @@ msgid "" msgstr "" #: ../../library/sys.rst:593 -msgid ":const:`min`" -msgstr ":const:`min`" +msgid "``min``" +msgstr "" #: ../../library/sys.rst:593 -msgid "DBL_MIN" +#, fuzzy +msgid "``DBL_MIN``" msgstr "DBL_MIN" #: ../../library/sys.rst:593 @@ -928,11 +939,13 @@ msgid "" msgstr "" #: ../../library/sys.rst:599 -msgid ":const:`min_exp`" +#, fuzzy +msgid "``min_exp``" msgstr ":const:`min_exp`" #: ../../library/sys.rst:599 -msgid "DBL_MIN_EXP" +#, fuzzy +msgid "``DBL_MIN_EXP``" msgstr "DBL_MIN_EXP" #: ../../library/sys.rst:599 @@ -940,11 +953,13 @@ msgid "minimum integer *e* such that ``radix**(e-1)`` is a normalized float" msgstr "" #: ../../library/sys.rst:602 -msgid ":const:`min_10_exp`" +#, fuzzy +msgid "``min_10_exp``" msgstr ":const:`min_10_exp`" #: ../../library/sys.rst:602 -msgid "DBL_MIN_10_EXP" +#, fuzzy +msgid "``DBL_MIN_10_EXP``" msgstr "DBL_MIN_10_EXP" #: ../../library/sys.rst:602 @@ -952,11 +967,13 @@ msgid "minimum integer *e* such that ``10**e`` is a normalized float" msgstr "" #: ../../library/sys.rst:605 -msgid ":const:`radix`" +#, fuzzy +msgid "``radix``" msgstr ":const:`radix`" #: ../../library/sys.rst:605 -msgid "FLT_RADIX" +#, fuzzy +msgid "``FLT_RADIX``" msgstr "FLT_RADIX" #: ../../library/sys.rst:605 @@ -964,22 +981,30 @@ msgid "radix of exponent representation" msgstr "" #: ../../library/sys.rst:607 -msgid ":const:`rounds`" +#, fuzzy +msgid "``rounds``" msgstr ":const:`rounds`" #: ../../library/sys.rst:607 -msgid "FLT_ROUNDS" +#, fuzzy +msgid "``FLT_ROUNDS``" msgstr "FLT_ROUNDS" #: ../../library/sys.rst:607 msgid "" -"integer constant representing the rounding mode used for arithmetic " -"operations. This reflects the value of the system FLT_ROUNDS macro at " -"interpreter startup time. See section 5.2.4.2.2 of the C99 standard for an " -"explanation of the possible values and their meanings." +"integer representing the rounding mode for floating-point arithmetic. This " +"reflects the value of the system ``FLT_ROUNDS`` macro at interpreter startup " +"time: ``-1`` indeterminable, ``0`` toward zero, ``1`` to nearest, ``2`` " +"toward positive infinity, ``3`` toward negative infinity" msgstr "" -#: ../../library/sys.rst:615 +#: ../../library/sys.rst:617 +msgid "" +"All other values for ``FLT_ROUNDS`` characterize implementation-defined " +"rounding behavior." +msgstr "" + +#: ../../library/sys.rst:621 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`sys." @@ -987,13 +1012,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:628 +#: ../../library/sys.rst:634 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:637 +#: ../../library/sys.rst:643 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -1003,7 +1028,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:650 +#: ../../library/sys.rst:656 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -1013,38 +1038,38 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:657 +#: ../../library/sys.rst:663 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:665 +#: ../../library/sys.rst:671 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:667 +#: ../../library/sys.rst:673 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:674 +#: ../../library/sys.rst:680 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:680 +#: ../../library/sys.rst:686 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (``RTLD_xxx`` constants, e.g. :data:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:685 ../../library/sys.rst:1341 +#: ../../library/sys.rst:691 ../../library/sys.rst:1347 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:690 +#: ../../library/sys.rst:696 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:723 +#: ../../library/sys.rst:729 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1099,20 +1124,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:741 +#: ../../library/sys.rst:747 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:748 +#: ../../library/sys.rst:754 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:755 +#: ../../library/sys.rst:761 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1120,46 +1145,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:763 +#: ../../library/sys.rst:769 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:768 +#: ../../library/sys.rst:774 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:771 +#: ../../library/sys.rst:777 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:774 +#: ../../library/sys.rst:780 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:778 +#: ../../library/sys.rst:784 msgid "" "See `recursive sizeof recipe `_ " "for an example of using :func:`getsizeof` recursively to find the size of " "containers and all their contents." msgstr "" -#: ../../library/sys.rst:784 +#: ../../library/sys.rst:790 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:792 +#: ../../library/sys.rst:798 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1174,21 +1199,21 @@ msgid "" "``frame``." msgstr "" -#: ../../library/sys.rst:801 +#: ../../library/sys.rst:807 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:811 +#: ../../library/sys.rst:817 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:820 +#: ../../library/sys.rst:826 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:824 +#: ../../library/sys.rst:830 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1196,7 +1221,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:832 +#: ../../library/sys.rst:838 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1208,54 +1233,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:843 +#: ../../library/sys.rst:849 msgid "*platform* will be :const:`2 (VER_PLATFORM_WIN32_NT)`." msgstr "" -#: ../../library/sys.rst:845 +#: ../../library/sys.rst:851 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:848 +#: ../../library/sys.rst:854 msgid "Constant" msgstr "" -#: ../../library/sys.rst:848 +#: ../../library/sys.rst:854 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:850 +#: ../../library/sys.rst:856 msgid ":const:`1 (VER_NT_WORKSTATION)`" msgstr ":const:`1 (VER_NT_WORKSTATION)`" -#: ../../library/sys.rst:850 +#: ../../library/sys.rst:856 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:852 +#: ../../library/sys.rst:858 msgid ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" msgstr ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" -#: ../../library/sys.rst:852 +#: ../../library/sys.rst:858 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:855 +#: ../../library/sys.rst:861 msgid ":const:`3 (VER_NT_SERVER)`" msgstr ":const:`3 (VER_NT_SERVER)`" -#: ../../library/sys.rst:855 +#: ../../library/sys.rst:861 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:859 +#: ../../library/sys.rst:865 msgid "" "This function wraps the Win32 :c:func:`GetVersionEx` function; see the " "Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:863 +#: ../../library/sys.rst:869 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1263,24 +1288,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:869 +#: ../../library/sys.rst:875 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:875 +#: ../../library/sys.rst:881 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:879 +#: ../../library/sys.rst:885 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:885 +#: ../../library/sys.rst:891 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1290,103 +1315,103 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:892 +#: ../../library/sys.rst:898 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:896 ../../library/sys.rst:1543 +#: ../../library/sys.rst:902 ../../library/sys.rst:1549 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:902 +#: ../../library/sys.rst:908 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:908 ../../library/sys.rst:1564 +#: ../../library/sys.rst:914 ../../library/sys.rst:1570 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:914 +#: ../../library/sys.rst:920 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:921 +#: ../../library/sys.rst:927 msgid ":const:`width`" msgstr ":const:`width`" -#: ../../library/sys.rst:921 +#: ../../library/sys.rst:927 msgid "width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:923 +#: ../../library/sys.rst:929 msgid ":const:`modulus`" msgstr ":const:`modulus`" -#: ../../library/sys.rst:923 +#: ../../library/sys.rst:929 msgid "prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:925 +#: ../../library/sys.rst:931 msgid ":const:`inf`" msgstr ":const:`inf`" -#: ../../library/sys.rst:925 +#: ../../library/sys.rst:931 msgid "hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:927 +#: ../../library/sys.rst:933 msgid ":const:`nan`" msgstr ":const:`nan`" -#: ../../library/sys.rst:927 +#: ../../library/sys.rst:933 msgid "(this attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:929 +#: ../../library/sys.rst:935 msgid ":const:`imag`" msgstr ":const:`imag`" -#: ../../library/sys.rst:929 +#: ../../library/sys.rst:935 msgid "multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:932 +#: ../../library/sys.rst:938 msgid ":const:`algorithm`" msgstr ":const:`algorithm`" -#: ../../library/sys.rst:932 +#: ../../library/sys.rst:938 msgid "name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:935 +#: ../../library/sys.rst:941 msgid ":const:`hash_bits`" msgstr ":const:`hash_bits`" -#: ../../library/sys.rst:935 +#: ../../library/sys.rst:941 msgid "internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:937 +#: ../../library/sys.rst:943 msgid ":const:`seed_bits`" msgstr ":const:`seed_bits`" -#: ../../library/sys.rst:937 +#: ../../library/sys.rst:943 msgid "size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:943 +#: ../../library/sys.rst:949 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:949 +#: ../../library/sys.rst:955 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1394,7 +1419,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:960 +#: ../../library/sys.rst:966 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1402,25 +1427,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:965 +#: ../../library/sys.rst:971 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:970 +#: ../../library/sys.rst:976 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:974 +#: ../../library/sys.rst:980 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:978 +#: ../../library/sys.rst:984 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1432,13 +1457,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:988 +#: ../../library/sys.rst:994 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:991 +#: ../../library/sys.rst:997 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1447,7 +1472,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:998 +#: ../../library/sys.rst:1004 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1457,61 +1482,61 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1009 +#: ../../library/sys.rst:1015 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1014 +#: ../../library/sys.rst:1020 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1022 +#: ../../library/sys.rst:1028 msgid ":const:`bits_per_digit`" msgstr ":const:`bits_per_digit`" -#: ../../library/sys.rst:1022 +#: ../../library/sys.rst:1028 msgid "" "number of bits held in each digit. Python integers are stored internally in " "base ``2**int_info.bits_per_digit``" msgstr "" -#: ../../library/sys.rst:1026 +#: ../../library/sys.rst:1032 msgid ":const:`sizeof_digit`" msgstr ":const:`sizeof_digit`" -#: ../../library/sys.rst:1026 +#: ../../library/sys.rst:1032 msgid "size in bytes of the C type used to represent a digit" msgstr "" -#: ../../library/sys.rst:1029 +#: ../../library/sys.rst:1035 msgid ":const:`default_max_str_digits`" msgstr ":const:`default_max_str_digits`" -#: ../../library/sys.rst:1029 +#: ../../library/sys.rst:1035 msgid "" "default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1033 +#: ../../library/sys.rst:1039 msgid ":const:`str_digits_check_threshold`" msgstr ":const:`str_digits_check_threshold`" -#: ../../library/sys.rst:1033 +#: ../../library/sys.rst:1039 msgid "" "minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1041 +#: ../../library/sys.rst:1047 msgid "Added ``default_max_str_digits`` and ``str_digits_check_threshold``." msgstr "新增 ``default_max_str_digits`` 和 ``str_digits_check_threshold``。" -#: ../../library/sys.rst:1047 +#: ../../library/sys.rst:1053 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1064 +#: ../../library/sys.rst:1070 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1544,19 +1569,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1072 +#: ../../library/sys.rst:1078 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1078 +#: ../../library/sys.rst:1084 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1088 +#: ../../library/sys.rst:1094 msgid "" "These three variables are not always defined; they are set when an exception " "is not handled and the interpreter prints an error message and a stack " @@ -1567,33 +1592,33 @@ msgid "" "information.)" msgstr "" -#: ../../library/sys.rst:1096 +#: ../../library/sys.rst:1102 msgid "" "The meaning of the variables is the same as that of the return values from :" "func:`exc_info` above." msgstr "" -#: ../../library/sys.rst:1102 +#: ../../library/sys.rst:1108 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1109 +#: ../../library/sys.rst:1115 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1112 +#: ../../library/sys.rst:1118 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1120 +#: ../../library/sys.rst:1126 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1606,27 +1631,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1133 +#: ../../library/sys.rst:1139 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1133 +#: ../../library/sys.rst:1139 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1137 +#: ../../library/sys.rst:1143 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1142 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1142 +#: ../../library/sys.rst:1148 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:" @@ -1635,7 +1660,7 @@ msgid "" "MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1150 +#: ../../library/sys.rst:1156 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1647,78 +1672,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1162 +#: ../../library/sys.rst:1168 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1165 +#: ../../library/sys.rst:1171 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1174 +#: ../../library/sys.rst:1180 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1178 +#: ../../library/sys.rst:1184 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1182 +#: ../../library/sys.rst:1188 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1184 +#: ../../library/sys.rst:1190 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1186 +#: ../../library/sys.rst:1192 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1189 +#: ../../library/sys.rst:1195 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1192 +#: ../../library/sys.rst:1198 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1198 +#: ../../library/sys.rst:1204 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1203 +#: ../../library/sys.rst:1209 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1207 ../../library/sys.rst:1218 +#: ../../library/sys.rst:1213 ../../library/sys.rst:1224 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1218 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1726,19 +1751,19 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1220 +#: ../../library/sys.rst:1226 msgid "" "``None`` is stored instead of :class:`imp.NullImporter` when no finder is " "found." msgstr "" -#: ../../library/sys.rst:1227 +#: ../../library/sys.rst:1233 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1230 +#: ../../library/sys.rst:1236 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1747,75 +1772,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1249 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1246 +#: ../../library/sys.rst:1252 msgid "System" msgstr "" -#: ../../library/sys.rst:1246 +#: ../../library/sys.rst:1252 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1248 +#: ../../library/sys.rst:1254 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1248 +#: ../../library/sys.rst:1254 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1249 +#: ../../library/sys.rst:1255 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1249 +#: ../../library/sys.rst:1255 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1250 +#: ../../library/sys.rst:1256 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1250 +#: ../../library/sys.rst:1256 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1251 +#: ../../library/sys.rst:1257 msgid "WASI" msgstr "" -#: ../../library/sys.rst:1251 +#: ../../library/sys.rst:1257 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1258 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1258 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1253 +#: ../../library/sys.rst:1259 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1253 +#: ../../library/sys.rst:1259 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1254 +#: ../../library/sys.rst:1260 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1254 +#: ../../library/sys.rst:1260 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1257 +#: ../../library/sys.rst:1263 msgid "" "On Linux, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1823,7 +1848,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1263 +#: ../../library/sys.rst:1269 msgid "" "On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1831,57 +1856,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1271 +#: ../../library/sys.rst:1277 msgid "" ":attr:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1274 +#: ../../library/sys.rst:1280 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1280 +#: ../../library/sys.rst:1286 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1283 +#: ../../library/sys.rst:1289 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1287 +#: ../../library/sys.rst:1293 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1289 +#: ../../library/sys.rst:1295 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1292 +#: ../../library/sys.rst:1298 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1294 +#: ../../library/sys.rst:1300 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1302 +#: ../../library/sys.rst:1308 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is ``'/usr/" @@ -1890,14 +1915,14 @@ msgid "" "paths." msgstr "" -#: ../../library/sys.rst:1308 +#: ../../library/sys.rst:1314 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1329 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1907,7 +1932,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1333 +#: ../../library/sys.rst:1339 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1918,14 +1943,14 @@ msgid "" "data:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1345 +#: ../../library/sys.rst:1351 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1357 +#: ../../library/sys.rst:1363 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1940,7 +1965,7 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1368 +#: ../../library/sys.rst:1374 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1954,65 +1979,65 @@ msgid "" "arguments." msgstr "" -#: ../../library/sys.rst:1375 ../../library/sys.rst:1456 +#: ../../library/sys.rst:1381 ../../library/sys.rst:1462 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1379 ../../library/sys.rst:1461 +#: ../../library/sys.rst:1385 ../../library/sys.rst:1467 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1378 +#: ../../library/sys.rst:1384 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1384 ../../library/sys.rst:1476 +#: ../../library/sys.rst:1390 ../../library/sys.rst:1482 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1382 +#: ../../library/sys.rst:1388 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1394 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1387 +#: ../../library/sys.rst:1393 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1397 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1397 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1399 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1394 +#: ../../library/sys.rst:1400 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1398 +#: ../../library/sys.rst:1404 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1402 +#: ../../library/sys.rst:1408 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -2020,19 +2045,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1407 +#: ../../library/sys.rst:1413 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1410 +#: ../../library/sys.rst:1416 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1417 +#: ../../library/sys.rst:1423 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2043,7 +2068,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1434 +#: ../../library/sys.rst:1440 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -2052,7 +2077,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1439 +#: ../../library/sys.rst:1445 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2060,7 +2085,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1444 +#: ../../library/sys.rst:1450 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2068,31 +2093,31 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1449 +#: ../../library/sys.rst:1455 msgid "" "The local trace function should return a reference to itself (or to another " "function for further tracing in that scope), or ``None`` to turn off tracing " "in that scope." msgstr "" -#: ../../library/sys.rst:1453 +#: ../../library/sys.rst:1459 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1459 +#: ../../library/sys.rst:1465 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1470 +#: ../../library/sys.rst:1476 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1464 +#: ../../library/sys.rst:1470 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2102,7 +2127,7 @@ msgid "" "const:`False` on that frame." msgstr "" -#: ../../library/sys.rst:1473 +#: ../../library/sys.rst:1479 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2110,22 +2135,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1481 +#: ../../library/sys.rst:1487 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1479 +#: ../../library/sys.rst:1485 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1489 +#: ../../library/sys.rst:1495 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1484 +#: ../../library/sys.rst:1490 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2134,13 +2159,13 @@ msgid "" "`f_trace_opcodes` to :const:`True` on the frame." msgstr "" -#: ../../library/sys.rst:1491 +#: ../../library/sys.rst:1497 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1494 +#: ../../library/sys.rst:1500 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2154,7 +2179,7 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1505 +#: ../../library/sys.rst:1511 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" @@ -2164,7 +2189,7 @@ msgid "" "arguments." msgstr "" -#: ../../library/sys.rst:1511 +#: ../../library/sys.rst:1517 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2172,13 +2197,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1518 +#: ../../library/sys.rst:1524 msgid "" "``'opcode'`` event type added; :attr:`f_trace_lines` and :attr:" "`f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1523 +#: ../../library/sys.rst:1529 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2199,20 +2224,20 @@ msgid "" "set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" -#: ../../library/sys.rst:1533 +#: ../../library/sys.rst:1539 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1536 +#: ../../library/sys.rst:1542 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1548 +#: ../../library/sys.rst:1554 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2221,74 +2246,74 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1555 +#: ../../library/sys.rst:1561 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1559 +#: ../../library/sys.rst:1565 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1569 +#: ../../library/sys.rst:1575 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1573 +#: ../../library/sys.rst:1579 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1576 +#: ../../library/sys.rst:1582 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1581 +#: ../../library/sys.rst:1587 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1588 +#: ../../library/sys.rst:1594 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1591 +#: ../../library/sys.rst:1597 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1593 +#: ../../library/sys.rst:1599 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1595 +#: ../../library/sys.rst:1601 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1597 +#: ../../library/sys.rst:1603 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1601 +#: ../../library/sys.rst:1607 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1604 +#: ../../library/sys.rst:1610 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2299,14 +2324,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1613 +#: ../../library/sys.rst:1619 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1618 +#: ../../library/sys.rst:1624 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2315,7 +2340,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1625 +#: ../../library/sys.rst:1631 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2324,19 +2349,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1631 +#: ../../library/sys.rst:1637 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1643 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1641 +#: ../../library/sys.rst:1647 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2344,7 +2369,7 @@ msgid "" "support the :attr:`~io.BufferedIOBase.buffer` attribute." msgstr "" -#: ../../library/sys.rst:1651 +#: ../../library/sys.rst:1657 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2352,7 +2377,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1656 +#: ../../library/sys.rst:1662 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2360,7 +2385,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1662 +#: ../../library/sys.rst:1668 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2368,12 +2393,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1670 +#: ../../library/sys.rst:1676 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1672 +#: ../../library/sys.rst:1678 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2381,7 +2406,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1677 +#: ../../library/sys.rst:1683 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2389,72 +2414,72 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1682 +#: ../../library/sys.rst:1688 msgid "See also the :attr:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1689 +#: ../../library/sys.rst:1695 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1697 +#: ../../library/sys.rst:1703 msgid ":const:`name`" msgstr ":const:`name`" -#: ../../library/sys.rst:1697 +#: ../../library/sys.rst:1703 msgid "Name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1699 +#: ../../library/sys.rst:1705 msgid "``'nt'``: Windows threads" msgstr "" -#: ../../library/sys.rst:1700 +#: ../../library/sys.rst:1706 msgid "``'pthread'``: POSIX threads" msgstr "" -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:1707 msgid "" "``'pthread-stubs'``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1703 +#: ../../library/sys.rst:1709 msgid "``'solaris'``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1705 +#: ../../library/sys.rst:1711 msgid ":const:`lock`" msgstr ":const:`lock`" -#: ../../library/sys.rst:1705 +#: ../../library/sys.rst:1711 msgid "Name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1707 +#: ../../library/sys.rst:1713 msgid "``'semaphore'``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1708 +#: ../../library/sys.rst:1714 msgid "``'mutex+cond'``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1710 +#: ../../library/sys.rst:1716 msgid "``None`` if this information is unknown" msgstr "" -#: ../../library/sys.rst:1712 +#: ../../library/sys.rst:1718 msgid ":const:`version`" msgstr ":const:`version`" -#: ../../library/sys.rst:1712 +#: ../../library/sys.rst:1718 msgid "" "Name and version of the thread library. It is a string, or ``None`` if this " "information is unknown." msgstr "" -#: ../../library/sys.rst:1721 +#: ../../library/sys.rst:1727 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2463,68 +2488,68 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1729 +#: ../../library/sys.rst:1735 msgid "Handle an unraisable exception." msgstr "" -#: ../../library/sys.rst:1731 +#: ../../library/sys.rst:1737 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1735 +#: ../../library/sys.rst:1741 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1737 +#: ../../library/sys.rst:1743 msgid "*exc_type*: Exception type." msgstr "" -#: ../../library/sys.rst:1738 +#: ../../library/sys.rst:1744 msgid "*exc_value*: Exception value, can be ``None``." msgstr "" -#: ../../library/sys.rst:1739 +#: ../../library/sys.rst:1745 msgid "*exc_traceback*: Exception traceback, can be ``None``." msgstr "" -#: ../../library/sys.rst:1740 +#: ../../library/sys.rst:1746 msgid "*err_msg*: Error message, can be ``None``." msgstr "" -#: ../../library/sys.rst:1741 +#: ../../library/sys.rst:1747 msgid "*object*: Object causing the exception, can be ``None``." msgstr "" -#: ../../library/sys.rst:1743 +#: ../../library/sys.rst:1749 msgid "" "The default hook formats *err_msg* and *object* as: ``f'{err_msg}: {object!" "r}'``; use \"Exception ignored in\" error message if *err_msg* is ``None``." msgstr "" -#: ../../library/sys.rst:1747 +#: ../../library/sys.rst:1753 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1750 +#: ../../library/sys.rst:1756 msgid "" "Storing *exc_value* using a custom hook can create a reference cycle. It " "should be cleared explicitly to break the reference cycle when the exception " "is no longer needed." msgstr "" -#: ../../library/sys.rst:1754 +#: ../../library/sys.rst:1760 msgid "" "Storing *object* using a custom hook can resurrect it if it is set to an " "object which is being finalized. Avoid storing *object* after the custom " "hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1758 +#: ../../library/sys.rst:1764 msgid "See also :func:`excepthook` which handles uncaught exceptions." msgstr "" @@ -2534,7 +2559,7 @@ msgid "" "arguments ``hook``, ``unraisable``." msgstr "" -#: ../../library/sys.rst:1762 +#: ../../library/sys.rst:1768 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments ``hook``, " "``unraisable`` when an exception that cannot be handled occurs. The " @@ -2542,7 +2567,7 @@ msgid "" "hook has been set, ``hook`` may be ``None``." msgstr "" -#: ../../library/sys.rst:1771 +#: ../../library/sys.rst:1777 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2551,13 +2576,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1780 +#: ../../library/sys.rst:1786 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1786 +#: ../../library/sys.rst:1792 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2568,18 +2593,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1794 +#: ../../library/sys.rst:1800 msgid "Added named component attributes." msgstr "" -#: ../../library/sys.rst:1799 +#: ../../library/sys.rst:1805 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1806 +#: ../../library/sys.rst:1812 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2588,27 +2613,36 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1817 +#: ../../library/sys.rst:1823 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1833 +#: ../../library/sys.rst:1839 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1841 +#: ../../library/sys.rst:1847 msgid "Citations" msgstr "" -#: ../../library/sys.rst:1842 +#: ../../library/sys.rst:1848 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" "n1256.pdf\\ ." msgstr "" + +#~ msgid ":const:`dig`" +#~ msgstr ":const:`dig`" + +#~ msgid ":const:`max`" +#~ msgstr ":const:`max`" + +#~ msgid ":const:`min`" +#~ msgstr ":const:`min`" From 787078737ebdf8734f4ebf60a17fc50bbe766f86 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 4 Mar 2023 00:34:57 +0000 Subject: [PATCH 039/130] sync with cpython 00791f23 --- library/os.po | 1774 +++++++++++++++++++++++++------------------------ 1 file changed, 891 insertions(+), 883 deletions(-) diff --git a/library/os.po b/library/os.po index aae454e8b7..e1cade5078 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-03-04 00:32+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -285,42 +285,42 @@ msgid "" "Return the filename corresponding to the controlling terminal of the process." msgstr "" -#: ../../library/os.rst:181 ../../library/os.rst:353 ../../library/os.rst:362 -#: ../../library/os.rst:384 ../../library/os.rst:393 ../../library/os.rst:429 -#: ../../library/os.rst:437 ../../library/os.rst:475 ../../library/os.rst:486 -#: ../../library/os.rst:496 ../../library/os.rst:506 ../../library/os.rst:529 -#: ../../library/os.rst:563 ../../library/os.rst:570 ../../library/os.rst:577 -#: ../../library/os.rst:586 ../../library/os.rst:598 ../../library/os.rst:607 -#: ../../library/os.rst:624 ../../library/os.rst:633 ../../library/os.rst:640 -#: ../../library/os.rst:649 ../../library/os.rst:658 ../../library/os.rst:665 -#: ../../library/os.rst:672 ../../library/os.rst:681 ../../library/os.rst:1046 -#: ../../library/os.rst:1190 ../../library/os.rst:1216 -#: ../../library/os.rst:1453 ../../library/os.rst:1488 -#: ../../library/os.rst:1497 ../../library/os.rst:1861 -#: ../../library/os.rst:1950 ../../library/os.rst:1990 -#: ../../library/os.rst:2207 ../../library/os.rst:2229 -#: ../../library/os.rst:3757 ../../library/os.rst:3764 -#: ../../library/os.rst:3771 ../../library/os.rst:3778 -#: ../../library/os.rst:3785 ../../library/os.rst:3792 -#: ../../library/os.rst:3799 ../../library/os.rst:3807 -#: ../../library/os.rst:3815 ../../library/os.rst:3822 -#: ../../library/os.rst:3829 ../../library/os.rst:3838 -#: ../../library/os.rst:3846 ../../library/os.rst:3854 -#: ../../library/os.rst:3861 ../../library/os.rst:3868 -#: ../../library/os.rst:3889 ../../library/os.rst:3906 -#: ../../library/os.rst:3946 ../../library/os.rst:3953 -#: ../../library/os.rst:3974 ../../library/os.rst:4101 -#: ../../library/os.rst:4150 ../../library/os.rst:4387 -#: ../../library/os.rst:4421 ../../library/os.rst:4479 -#: ../../library/os.rst:4493 ../../library/os.rst:4510 -#: ../../library/os.rst:4525 ../../library/os.rst:4536 -#: ../../library/os.rst:4548 ../../library/os.rst:4561 -#: ../../library/os.rst:4570 ../../library/os.rst:4580 -#: ../../library/os.rst:4593 ../../library/os.rst:4644 -#: ../../library/os.rst:4655 ../../library/os.rst:4667 -#: ../../library/os.rst:4674 ../../library/os.rst:4683 -#: ../../library/os.rst:4692 ../../library/os.rst:4701 -#: ../../library/os.rst:4710 +#: ../../library/os.rst:181 ../../library/os.rst:358 ../../library/os.rst:367 +#: ../../library/os.rst:389 ../../library/os.rst:398 ../../library/os.rst:434 +#: ../../library/os.rst:442 ../../library/os.rst:480 ../../library/os.rst:491 +#: ../../library/os.rst:501 ../../library/os.rst:511 ../../library/os.rst:534 +#: ../../library/os.rst:568 ../../library/os.rst:575 ../../library/os.rst:582 +#: ../../library/os.rst:591 ../../library/os.rst:603 ../../library/os.rst:612 +#: ../../library/os.rst:629 ../../library/os.rst:638 ../../library/os.rst:645 +#: ../../library/os.rst:654 ../../library/os.rst:663 ../../library/os.rst:670 +#: ../../library/os.rst:677 ../../library/os.rst:686 ../../library/os.rst:1051 +#: ../../library/os.rst:1195 ../../library/os.rst:1221 +#: ../../library/os.rst:1458 ../../library/os.rst:1493 +#: ../../library/os.rst:1502 ../../library/os.rst:1866 +#: ../../library/os.rst:1955 ../../library/os.rst:1995 +#: ../../library/os.rst:2212 ../../library/os.rst:2234 +#: ../../library/os.rst:3762 ../../library/os.rst:3769 +#: ../../library/os.rst:3776 ../../library/os.rst:3783 +#: ../../library/os.rst:3790 ../../library/os.rst:3797 +#: ../../library/os.rst:3804 ../../library/os.rst:3812 +#: ../../library/os.rst:3820 ../../library/os.rst:3827 +#: ../../library/os.rst:3834 ../../library/os.rst:3843 +#: ../../library/os.rst:3851 ../../library/os.rst:3859 +#: ../../library/os.rst:3866 ../../library/os.rst:3873 +#: ../../library/os.rst:3894 ../../library/os.rst:3911 +#: ../../library/os.rst:3951 ../../library/os.rst:3958 +#: ../../library/os.rst:3979 ../../library/os.rst:4106 +#: ../../library/os.rst:4155 ../../library/os.rst:4392 +#: ../../library/os.rst:4426 ../../library/os.rst:4484 +#: ../../library/os.rst:4498 ../../library/os.rst:4515 +#: ../../library/os.rst:4530 ../../library/os.rst:4541 +#: ../../library/os.rst:4553 ../../library/os.rst:4566 +#: ../../library/os.rst:4575 ../../library/os.rst:4585 +#: ../../library/os.rst:4598 ../../library/os.rst:4649 +#: ../../library/os.rst:4660 ../../library/os.rst:4672 +#: ../../library/os.rst:4679 ../../library/os.rst:4688 +#: ../../library/os.rst:4697 ../../library/os.rst:4706 +#: ../../library/os.rst:4715 #, fuzzy msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -356,19 +356,26 @@ msgid "" "to use a different encoding." msgstr "" -#: ../../library/os.rst:206 +#: ../../library/os.rst:204 +msgid "" +"On Windows, the keys are converted to uppercase. This also applies when " +"getting, setting, or deleting an item. For example, ``environ['monty'] = " +"'python'`` maps the key ``'MONTY'`` to the value ``'python'``." +msgstr "" + +#: ../../library/os.rst:211 msgid "" "Calling :func:`putenv` directly does not change :data:`os.environ`, so it's " "better to modify :data:`os.environ`." msgstr "" -#: ../../library/os.rst:211 +#: ../../library/os.rst:216 msgid "" "On some platforms, including FreeBSD and macOS, setting ``environ`` may " "cause memory leaks. Refer to the system documentation for :c:func:`putenv`." msgstr "" -#: ../../library/os.rst:215 +#: ../../library/os.rst:220 msgid "" "You can delete items in this mapping to unset environment variables. :func:" "`unsetenv` will be called automatically when an item is deleted from :data:" @@ -376,12 +383,12 @@ msgid "" "called." msgstr "" -#: ../../library/os.rst:220 ../../library/os.rst:236 +#: ../../library/os.rst:225 ../../library/os.rst:241 msgid "" "Updated to support :pep:`584`'s merge (``|``) and update (``|=``) operators." msgstr "" -#: ../../library/os.rst:226 +#: ../../library/os.rst:231 msgid "" "Bytes version of :data:`environ`: a :term:`mapping` object where both keys " "and values are :class:`bytes` objects representing the process environment. :" @@ -389,47 +396,47 @@ msgid "" "`environb` updates :data:`environ`, and vice versa)." msgstr "" -#: ../../library/os.rst:231 +#: ../../library/os.rst:236 msgid "" ":data:`environb` is only available if :data:`supports_bytes_environ` is " "``True``." msgstr "" -#: ../../library/os.rst:245 +#: ../../library/os.rst:250 msgid "These functions are described in :ref:`os-file-dir`." msgstr "" -#: ../../library/os.rst:250 +#: ../../library/os.rst:255 msgid "" "Encode :term:`path-like ` *filename* to the :term:" "`filesystem encoding and error handler`; return :class:`bytes` unchanged." msgstr "" -#: ../../library/os.rst:254 +#: ../../library/os.rst:259 msgid ":func:`fsdecode` is the reverse function." msgstr "" -#: ../../library/os.rst:258 ../../library/os.rst:273 +#: ../../library/os.rst:263 ../../library/os.rst:278 msgid "" "Support added to accept objects implementing the :class:`os.PathLike` " "interface." msgstr "" -#: ../../library/os.rst:265 +#: ../../library/os.rst:270 msgid "" "Decode the :term:`path-like ` *filename* from the :term:" "`filesystem encoding and error handler`; return :class:`str` unchanged." msgstr "" -#: ../../library/os.rst:269 +#: ../../library/os.rst:274 msgid ":func:`fsencode` is the reverse function." msgstr "" -#: ../../library/os.rst:280 +#: ../../library/os.rst:285 msgid "Return the file system representation of the path." msgstr "" -#: ../../library/os.rst:282 +#: ../../library/os.rst:287 msgid "" "If :class:`str` or :class:`bytes` is passed in, it is returned unchanged. " "Otherwise :meth:`~os.PathLike.__fspath__` is called and its value is " @@ -437,23 +444,23 @@ msgid "" "other cases, :exc:`TypeError` is raised." msgstr "" -#: ../../library/os.rst:292 +#: ../../library/os.rst:297 msgid "" "An :term:`abstract base class` for objects representing a file system path, " "e.g. :class:`pathlib.PurePath`." msgstr "" -#: ../../library/os.rst:299 +#: ../../library/os.rst:304 msgid "Return the file system path representation of the object." msgstr "" -#: ../../library/os.rst:301 +#: ../../library/os.rst:306 msgid "" "The method should only return a :class:`str` or :class:`bytes` object, with " "the preference being for :class:`str`." msgstr "" -#: ../../library/os.rst:307 +#: ../../library/os.rst:312 msgid "" "Return the value of the environment variable *key* as a string if it exists, " "or *default* if it doesn't. *key* is a string. Note that since :func:" @@ -462,24 +469,24 @@ msgid "" "changes." msgstr "" -#: ../../library/os.rst:313 +#: ../../library/os.rst:318 msgid "" "On Unix, keys and values are decoded with :func:`sys.getfilesystemencoding` " "and ``'surrogateescape'`` error handler. Use :func:`os.getenvb` if you would " "like to use a different encoding." msgstr "" -#: ../../library/os.rst:317 ../../library/os.rst:975 ../../library/os.rst:986 -#: ../../library/os.rst:1202 ../../library/os.rst:1637 -#: ../../library/os.rst:2034 ../../library/os.rst:2307 -#: ../../library/os.rst:3097 ../../library/os.rst:3134 -#: ../../library/os.rst:3749 ../../library/os.rst:4238 -#: ../../library/os.rst:4249 ../../library/os.rst:4366 +#: ../../library/os.rst:322 ../../library/os.rst:980 ../../library/os.rst:991 +#: ../../library/os.rst:1207 ../../library/os.rst:1642 +#: ../../library/os.rst:2039 ../../library/os.rst:2312 +#: ../../library/os.rst:3102 ../../library/os.rst:3139 +#: ../../library/os.rst:3754 ../../library/os.rst:4243 +#: ../../library/os.rst:4254 ../../library/os.rst:4371 #, fuzzy msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/os.rst:322 +#: ../../library/os.rst:327 msgid "" "Return the value of the environment variable *key* as bytes if it exists, or " "*default* if it doesn't. *key* must be bytes. Note that since :func:" @@ -488,32 +495,33 @@ msgid "" "environment changes." msgstr "" -#: ../../library/os.rst:329 +#: ../../library/os.rst:334 msgid "" ":func:`getenvb` is only available if :data:`supports_bytes_environ` is " "``True``." msgstr "" -#: ../../library/os.rst:332 ../../library/os.rst:371 ../../library/os.rst:517 -#: ../../library/os.rst:733 ../../library/os.rst:893 ../../library/os.rst:908 -#: ../../library/os.rst:919 ../../library/os.rst:942 ../../library/os.rst:963 -#: ../../library/os.rst:999 ../../library/os.rst:1023 ../../library/os.rst:1035 -#: ../../library/os.rst:1241 ../../library/os.rst:1256 -#: ../../library/os.rst:1269 ../../library/os.rst:1338 -#: ../../library/os.rst:1473 ../../library/os.rst:1548 -#: ../../library/os.rst:1575 ../../library/os.rst:1610 -#: ../../library/os.rst:1933 ../../library/os.rst:1964 -#: ../../library/os.rst:2005 ../../library/os.rst:2018 -#: ../../library/os.rst:2273 ../../library/os.rst:2285 -#: ../../library/os.rst:2963 ../../library/os.rst:3120 -#: ../../library/os.rst:3353 ../../library/os.rst:4856 -#: ../../library/os.rst:4865 ../../library/os.rst:4886 -#: ../../library/os.rst:4896 ../../library/os.rst:4905 +#: ../../library/os.rst:337 ../../library/os.rst:376 ../../library/os.rst:522 +#: ../../library/os.rst:738 ../../library/os.rst:898 ../../library/os.rst:913 +#: ../../library/os.rst:924 ../../library/os.rst:947 ../../library/os.rst:968 +#: ../../library/os.rst:1004 ../../library/os.rst:1028 +#: ../../library/os.rst:1040 ../../library/os.rst:1246 +#: ../../library/os.rst:1261 ../../library/os.rst:1274 +#: ../../library/os.rst:1343 ../../library/os.rst:1478 +#: ../../library/os.rst:1553 ../../library/os.rst:1580 +#: ../../library/os.rst:1615 ../../library/os.rst:1938 +#: ../../library/os.rst:1969 ../../library/os.rst:2010 +#: ../../library/os.rst:2023 ../../library/os.rst:2278 +#: ../../library/os.rst:2290 ../../library/os.rst:2968 +#: ../../library/os.rst:3125 ../../library/os.rst:3358 +#: ../../library/os.rst:4861 ../../library/os.rst:4870 +#: ../../library/os.rst:4891 ../../library/os.rst:4901 +#: ../../library/os.rst:4910 #, fuzzy msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/os.rst:339 +#: ../../library/os.rst:344 msgid "" "Returns the list of directories that will be searched for a named " "executable, similar to a shell, when launching a process. *env*, when " @@ -521,28 +529,28 @@ msgid "" "in. By default, when *env* is ``None``, :data:`environ` is used." msgstr "" -#: ../../library/os.rst:350 +#: ../../library/os.rst:355 msgid "" "Return the effective group id of the current process. This corresponds to " "the \"set id\" bit on the file being executed in the current process." msgstr "" -#: ../../library/os.rst:360 +#: ../../library/os.rst:365 msgid "Return the current process's effective user id." msgstr "" -#: ../../library/os.rst:369 +#: ../../library/os.rst:374 msgid "Return the real group id of the current process." msgstr "" -#: ../../library/os.rst:373 ../../library/os.rst:446 ../../library/os.rst:519 -#: ../../library/os.rst:704 +#: ../../library/os.rst:378 ../../library/os.rst:451 ../../library/os.rst:524 +#: ../../library/os.rst:709 msgid "" "The function is a stub on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." msgstr "" -#: ../../library/os.rst:379 +#: ../../library/os.rst:384 msgid "" "Return list of group ids that *user* belongs to. If *group* is not in the " "list, it is included; typically, *group* is specified as the group ID field " @@ -550,12 +558,12 @@ msgid "" "potentially omitted." msgstr "" -#: ../../library/os.rst:391 +#: ../../library/os.rst:396 msgid "" "Return list of supplemental group ids associated with the current process." msgstr "" -#: ../../library/os.rst:397 +#: ../../library/os.rst:402 msgid "" "On macOS, :func:`getgroups` behavior differs somewhat from other Unix " "platforms. If the Python interpreter was built with a deployment target of :" @@ -572,7 +580,7 @@ msgid "" "get_config_var`." msgstr "" -#: ../../library/os.rst:414 +#: ../../library/os.rst:419 msgid "" "Return the name of the user logged in on the controlling terminal of the " "process. For most purposes, it is more useful to use :func:`getpass." @@ -581,41 +589,41 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:421 ../../library/os.rst:457 ../../library/os.rst:3714 -#: ../../library/os.rst:3930 ../../library/os.rst:4219 -#: ../../library/os.rst:4343 ../../library/os.rst:4459 -#: ../../library/os.rst:4628 +#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3719 +#: ../../library/os.rst:3935 ../../library/os.rst:4224 +#: ../../library/os.rst:4348 ../../library/os.rst:4464 +#: ../../library/os.rst:4633 #, fuzzy msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" -#: ../../library/os.rst:426 +#: ../../library/os.rst:431 msgid "" "Return the process group id of the process with process id *pid*. If *pid* " "is 0, the process group id of the current process is returned." msgstr "" -#: ../../library/os.rst:435 +#: ../../library/os.rst:440 msgid "Return the id of the current process group." msgstr "" -#: ../../library/os.rst:444 +#: ../../library/os.rst:449 msgid "Return the current process id." msgstr "" -#: ../../library/os.rst:453 +#: ../../library/os.rst:458 msgid "" "Return the parent's process id. When the parent process has exited, on Unix " "the id returned is the one of the init process (1), on Windows it is still " "the same id, which may be already reused by another process." msgstr "" -#: ../../library/os.rst:459 +#: ../../library/os.rst:464 msgid "Added support for Windows." msgstr "新增對 Windows 的支援。" -#: ../../library/os.rst:467 +#: ../../library/os.rst:472 msgid "" "Get program scheduling priority. The value *which* is one of :const:" "`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " @@ -626,42 +634,42 @@ msgid "" "user ID of the calling process." msgstr "" -#: ../../library/os.rst:484 +#: ../../library/os.rst:489 msgid "" "Parameters for the :func:`getpriority` and :func:`setpriority` functions." msgstr "" -#: ../../library/os.rst:493 +#: ../../library/os.rst:498 msgid "" "Return a tuple (ruid, euid, suid) denoting the current process's real, " "effective, and saved user ids." msgstr "" -#: ../../library/os.rst:503 +#: ../../library/os.rst:508 msgid "" "Return a tuple (rgid, egid, sgid) denoting the current process's real, " "effective, and saved group ids." msgstr "" -#: ../../library/os.rst:515 +#: ../../library/os.rst:520 msgid "Return the current process's real user id." msgstr "" -#: ../../library/os.rst:525 +#: ../../library/os.rst:530 msgid "" "Call the system initgroups() to initialize the group access list with all of " "the groups of which the specified username is a member, plus the specified " "group id." msgstr "" -#: ../../library/os.rst:538 +#: ../../library/os.rst:543 msgid "" "Set the environment variable named *key* to the string *value*. Such " "changes to the environment affect subprocesses started with :func:`os." "system`, :func:`popen` or :func:`fork` and :func:`execv`." msgstr "" -#: ../../library/os.rst:542 +#: ../../library/os.rst:547 msgid "" "Assignments to items in :data:`os.environ` are automatically translated into " "corresponding calls to :func:`putenv`; however, calls to :func:`putenv` " @@ -671,7 +679,7 @@ msgid "" "in their implementations." msgstr "" -#: ../../library/os.rst:550 +#: ../../library/os.rst:555 msgid "" "On some platforms, including FreeBSD and macOS, setting ``environ`` may " "cause memory leaks. Refer to the system documentation for :c:func:`putenv`." @@ -683,23 +691,23 @@ msgid "" "``key``, ``value``." msgstr "" -#: ../../library/os.rst:555 +#: ../../library/os.rst:560 msgid "The function is now always available." msgstr "" -#: ../../library/os.rst:561 +#: ../../library/os.rst:566 msgid "Set the current process's effective group id." msgstr "" -#: ../../library/os.rst:568 +#: ../../library/os.rst:573 msgid "Set the current process's effective user id." msgstr "" -#: ../../library/os.rst:575 +#: ../../library/os.rst:580 msgid "Set the current process' group id." msgstr "" -#: ../../library/os.rst:582 +#: ../../library/os.rst:587 msgid "" "Set the list of supplemental group ids associated with the current process " "to *groups*. *groups* must be a sequence, and each element must be an " @@ -707,7 +715,7 @@ msgid "" "the superuser." msgstr "" -#: ../../library/os.rst:588 +#: ../../library/os.rst:593 msgid "" "On macOS, the length of *groups* may not exceed the system-defined maximum " "number of effective group ids, typically 16. See the documentation for :func:" @@ -715,21 +723,21 @@ msgid "" "calling setgroups()." msgstr "" -#: ../../library/os.rst:595 +#: ../../library/os.rst:600 msgid "" "Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on " "which version is implemented (if any). See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:603 +#: ../../library/os.rst:608 msgid "" "Call the system call :c:func:`setpgid` to set the process group id of the " "process with id *pid* to the process group with id *pgrp*. See the Unix " "manual for the semantics." msgstr "" -#: ../../library/os.rst:614 +#: ../../library/os.rst:619 msgid "" "Set program scheduling priority. The value *which* is one of :const:" "`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " @@ -742,109 +750,109 @@ msgid "" "scheduling." msgstr "" -#: ../../library/os.rst:631 +#: ../../library/os.rst:636 msgid "Set the current process's real and effective group ids." msgstr "" -#: ../../library/os.rst:638 +#: ../../library/os.rst:643 msgid "Set the current process's real, effective, and saved group ids." msgstr "" -#: ../../library/os.rst:647 +#: ../../library/os.rst:652 msgid "Set the current process's real, effective, and saved user ids." msgstr "" -#: ../../library/os.rst:656 +#: ../../library/os.rst:661 msgid "Set the current process's real and effective user ids." msgstr "" -#: ../../library/os.rst:663 +#: ../../library/os.rst:668 msgid "" "Call the system call :c:func:`getsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:670 +#: ../../library/os.rst:675 msgid "" "Call the system call :c:func:`setsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:679 +#: ../../library/os.rst:684 msgid "Set the current process's user id." msgstr "" -#: ../../library/os.rst:687 +#: ../../library/os.rst:692 msgid "" "Return the error message corresponding to the error code in *code*. On " "platforms where :c:func:`strerror` returns ``NULL`` when given an unknown " "error number, :exc:`ValueError` is raised." msgstr "" -#: ../../library/os.rst:694 +#: ../../library/os.rst:699 msgid "" "``True`` if the native OS type of the environment is bytes (eg. ``False`` on " "Windows)." msgstr "" -#: ../../library/os.rst:702 +#: ../../library/os.rst:707 msgid "Set the current numeric umask and return the previous umask." msgstr "" -#: ../../library/os.rst:714 +#: ../../library/os.rst:719 msgid "" "Returns information identifying the current operating system. The return " "value is an object with five attributes:" msgstr "" -#: ../../library/os.rst:717 +#: ../../library/os.rst:722 msgid ":attr:`sysname` - operating system name" msgstr ":attr:`sysname` - 作業系統名稱" -#: ../../library/os.rst:718 +#: ../../library/os.rst:723 msgid ":attr:`nodename` - name of machine on network (implementation-defined)" msgstr "" -#: ../../library/os.rst:719 +#: ../../library/os.rst:724 msgid ":attr:`release` - operating system release" msgstr "" -#: ../../library/os.rst:720 +#: ../../library/os.rst:725 msgid ":attr:`version` - operating system version" msgstr ":attr:`version` - 作業系統版本" -#: ../../library/os.rst:721 +#: ../../library/os.rst:726 msgid ":attr:`machine` - hardware identifier" msgstr "" -#: ../../library/os.rst:723 +#: ../../library/os.rst:728 msgid "" "For backwards compatibility, this object is also iterable, behaving like a " "five-tuple containing :attr:`sysname`, :attr:`nodename`, :attr:`release`, :" "attr:`version`, and :attr:`machine` in that order." msgstr "" -#: ../../library/os.rst:728 +#: ../../library/os.rst:733 msgid "" "Some systems truncate :attr:`nodename` to 8 characters or to the leading " "component; a better way to get the hostname is :func:`socket.gethostname` " "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:735 ../../library/os.rst:4368 +#: ../../library/os.rst:740 ../../library/os.rst:4373 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." msgstr "" -#: ../../library/os.rst:744 +#: ../../library/os.rst:749 msgid "" "Unset (delete) the environment variable named *key*. Such changes to the " "environment affect subprocesses started with :func:`os.system`, :func:" "`popen` or :func:`fork` and :func:`execv`." msgstr "" -#: ../../library/os.rst:748 +#: ../../library/os.rst:753 msgid "" "Deletion of items in :data:`os.environ` is automatically translated into a " "corresponding call to :func:`unsetenv`; however, calls to :func:`unsetenv` " @@ -858,21 +866,21 @@ msgid "" "``key``." msgstr "" -#: ../../library/os.rst:755 +#: ../../library/os.rst:760 msgid "The function is now always available and is also available on Windows." msgstr "" -#: ../../library/os.rst:762 +#: ../../library/os.rst:767 msgid "File Object Creation" msgstr "" -#: ../../library/os.rst:764 +#: ../../library/os.rst:769 msgid "" "These functions create new :term:`file objects `. (See also :" "func:`~os.open` for opening file descriptors.)" msgstr "" -#: ../../library/os.rst:770 +#: ../../library/os.rst:775 msgid "" "Return an open file object connected to the file descriptor *fd*. This is " "an alias of the :func:`open` built-in function and accepts the same " @@ -880,16 +888,16 @@ msgid "" "must always be an integer." msgstr "" -#: ../../library/os.rst:779 +#: ../../library/os.rst:784 msgid "File Descriptor Operations" msgstr "" -#: ../../library/os.rst:781 +#: ../../library/os.rst:786 msgid "" "These functions operate on I/O streams referenced using file descriptors." msgstr "" -#: ../../library/os.rst:783 +#: ../../library/os.rst:788 msgid "" "File descriptors are small integers corresponding to a file that has been " "opened by the current process. For example, standard input is usually file " @@ -899,7 +907,7 @@ msgid "" "pipes are also referenced by file descriptors." msgstr "" -#: ../../library/os.rst:790 +#: ../../library/os.rst:795 msgid "" "The :meth:`~io.IOBase.fileno` method can be used to obtain the file " "descriptor associated with a :term:`file object` when required. Note that " @@ -907,11 +915,11 @@ msgid "" "ignoring aspects such as internal buffering of data." msgstr "" -#: ../../library/os.rst:798 +#: ../../library/os.rst:803 msgid "Close file descriptor *fd*." msgstr "" -#: ../../library/os.rst:802 +#: ../../library/os.rst:807 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To close a " @@ -919,13 +927,13 @@ msgid "" "`popen` or :func:`fdopen`, use its :meth:`~io.IOBase.close` method." msgstr "" -#: ../../library/os.rst:810 +#: ../../library/os.rst:815 msgid "" "Close all file descriptors from *fd_low* (inclusive) to *fd_high* " "(exclusive), ignoring errors. Equivalent to (but much faster than)::" msgstr "" -#: ../../library/os.rst:822 +#: ../../library/os.rst:827 msgid "" "Copy *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -935,7 +943,7 @@ msgid "" "attr:`~OSError.errno` set to :data:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:829 ../../library/os.rst:1513 +#: ../../library/os.rst:834 ../../library/os.rst:1518 msgid "" "This copy is done without the additional cost of transferring data from the " "kernel to user space and then back into the kernel. Additionally, some " @@ -943,53 +951,53 @@ msgid "" "files are opened as binary." msgstr "" -#: ../../library/os.rst:834 +#: ../../library/os.rst:839 msgid "" "The return value is the amount of bytes copied. This could be less than the " "amount requested." msgstr "" -#: ../../library/os.rst:837 +#: ../../library/os.rst:842 msgid ":ref:`Availability `: Linux >= 4.5 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 4.5 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:844 +#: ../../library/os.rst:849 msgid "" "Return a string describing the encoding of the device associated with *fd* " "if it is connected to a terminal; else return :const:`None`." msgstr "" -#: ../../library/os.rst:847 +#: ../../library/os.rst:852 msgid "" "On Unix, if the :ref:`Python UTF-8 Mode ` is enabled, return " "``'UTF-8'`` rather than the device encoding." msgstr "" -#: ../../library/os.rst:850 +#: ../../library/os.rst:855 msgid "On Unix, the function now implements the Python UTF-8 Mode." msgstr "" -#: ../../library/os.rst:856 +#: ../../library/os.rst:861 msgid "" "Return a duplicate of file descriptor *fd*. The new file descriptor is :ref:" "`non-inheritable `." msgstr "" -#: ../../library/os.rst:859 +#: ../../library/os.rst:864 msgid "" "On Windows, when duplicating a standard stream (0: stdin, 1: stdout, 2: " "stderr), the new file descriptor is :ref:`inheritable `." msgstr "" -#: ../../library/os.rst:863 ../../library/os.rst:876 +#: ../../library/os.rst:868 ../../library/os.rst:881 msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" -#: ../../library/os.rst:865 ../../library/os.rst:1089 +#: ../../library/os.rst:870 ../../library/os.rst:1094 msgid "The new file descriptor is now non-inheritable." msgstr "" -#: ../../library/os.rst:871 +#: ../../library/os.rst:876 msgid "" "Duplicate file descriptor *fd* to *fd2*, closing the latter first if " "necessary. Return *fd2*. The new file descriptor is :ref:`inheritable " @@ -997,15 +1005,15 @@ msgid "" "``False``." msgstr "" -#: ../../library/os.rst:878 +#: ../../library/os.rst:883 msgid "Add the optional *inheritable* parameter." msgstr "" -#: ../../library/os.rst:881 +#: ../../library/os.rst:886 msgid "Return *fd2* on success. Previously, ``None`` was always returned." msgstr "" -#: ../../library/os.rst:887 +#: ../../library/os.rst:892 msgid "" "Change the mode of the file given by *fd* to the numeric *mode*. See the " "docs for :func:`chmod` for possible values of *mode*. As of Python 3.3, " @@ -1018,15 +1026,15 @@ msgid "" "``path``, ``mode``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:895 ../../library/os.rst:910 ../../library/os.rst:1001 -#: ../../library/os.rst:1475 ../../library/os.rst:1906 -#: ../../library/os.rst:1935 ../../library/os.rst:3099 +#: ../../library/os.rst:900 ../../library/os.rst:915 ../../library/os.rst:1006 +#: ../../library/os.rst:1480 ../../library/os.rst:1911 +#: ../../library/os.rst:1940 ../../library/os.rst:3104 msgid "" "The function is limited on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." msgstr "" -#: ../../library/os.rst:901 +#: ../../library/os.rst:906 msgid "" "Change the owner and group id of the file given by *fd* to the numeric *uid* " "and *gid*. To leave one of the ids unchanged, set it to -1. See :func:" @@ -1039,17 +1047,17 @@ msgid "" "``path``, ``uid``, ``gid``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:916 +#: ../../library/os.rst:921 msgid "" "Force write of file with filedescriptor *fd* to disk. Does not force update " "of metadata." msgstr "" -#: ../../library/os.rst:922 +#: ../../library/os.rst:927 msgid "This function is not available on MacOS." msgstr "" -#: ../../library/os.rst:927 +#: ../../library/os.rst:932 msgid "" "Return system configuration information relevant to an open file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -1060,7 +1068,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:935 ../../library/os.rst:2265 +#: ../../library/os.rst:940 ../../library/os.rst:2270 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -1068,46 +1076,46 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:940 +#: ../../library/os.rst:945 msgid "As of Python 3.3, this is equivalent to ``os.pathconf(fd, name)``." msgstr "" -#: ../../library/os.rst:947 +#: ../../library/os.rst:952 msgid "" "Get the status of the file descriptor *fd*. Return a :class:`stat_result` " "object." msgstr "" -#: ../../library/os.rst:950 +#: ../../library/os.rst:955 msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:954 ../../library/os.rst:2100 +#: ../../library/os.rst:959 ../../library/os.rst:2105 msgid "The :func:`.stat` function." msgstr "" -#: ../../library/os.rst:959 +#: ../../library/os.rst:964 msgid "" "Return information about the filesystem containing the file associated with " "file descriptor *fd*, like :func:`statvfs`. As of Python 3.3, this is " "equivalent to ``os.statvfs(fd)``." msgstr "" -#: ../../library/os.rst:968 +#: ../../library/os.rst:973 msgid "" "Force write of file with filedescriptor *fd* to disk. On Unix, this calls " "the native :c:func:`fsync` function; on Windows, the MS :c:func:`_commit` " "function." msgstr "" -#: ../../library/os.rst:971 +#: ../../library/os.rst:976 msgid "" "If you're starting with a buffered Python :term:`file object` *f*, first do " "``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all " "internal buffers associated with *f* are written to disk." msgstr "" -#: ../../library/os.rst:980 +#: ../../library/os.rst:985 msgid "" "Truncate the file corresponding to file descriptor *fd*, so that it is at " "most *length* bytes in size. As of Python 3.3, this is equivalent to ``os." @@ -1120,28 +1128,28 @@ msgid "" "``fd``, ``length``." msgstr "" -#: ../../library/os.rst:988 ../../library/os.rst:3138 +#: ../../library/os.rst:993 ../../library/os.rst:3143 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" -#: ../../library/os.rst:994 +#: ../../library/os.rst:999 msgid "" "Get the blocking mode of the file descriptor: ``False`` if the :data:" "`O_NONBLOCK` flag is set, ``True`` if the flag is cleared." msgstr "" -#: ../../library/os.rst:997 +#: ../../library/os.rst:1002 msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`set_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1009 +#: ../../library/os.rst:1014 msgid "" "Return ``True`` if the file descriptor *fd* is open and connected to a tty(-" "like) device, else ``False``." msgstr "" -#: ../../library/os.rst:1015 +#: ../../library/os.rst:1020 msgid "" "Apply, test or remove a POSIX lock on an open file descriptor. *fd* is an " "open file descriptor. *cmd* specifies the command to use - one of :data:" @@ -1155,18 +1163,18 @@ msgid "" "``fd``, ``cmd``, ``len``." msgstr "" -#: ../../library/os.rst:1033 +#: ../../library/os.rst:1038 msgid "Flags that specify what action :func:`lockf` will take." msgstr "" -#: ../../library/os.rst:1042 +#: ../../library/os.rst:1047 msgid "" "Prepare the tty of which fd is a file descriptor for a new login session. " "Make the calling process a session leader; make the tty the controlling tty, " "the stdin, the stdout, and the stderr of the calling process; close fd." msgstr "" -#: ../../library/os.rst:1053 +#: ../../library/os.rst:1058 msgid "" "Set the current position of file descriptor *fd* to position *pos*, modified " "by *how*: :const:`SEEK_SET` or ``0`` to set the position relative to the " @@ -1176,19 +1184,19 @@ msgid "" "beginning." msgstr "" -#: ../../library/os.rst:1064 +#: ../../library/os.rst:1069 msgid "" "Parameters to the :func:`lseek` function. Their values are 0, 1, and 2, " "respectively." msgstr "" -#: ../../library/os.rst:1067 +#: ../../library/os.rst:1072 msgid "" "Some operating systems could support additional values, like :data:`os." "SEEK_HOLE` or :data:`os.SEEK_DATA`." msgstr "" -#: ../../library/os.rst:1074 +#: ../../library/os.rst:1079 msgid "" "Open the file *path* and set various flags according to *flags* and possibly " "its mode according to *mode*. When computing *mode*, the current umask " @@ -1196,7 +1204,7 @@ msgid "" "file. The new file descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:1079 +#: ../../library/os.rst:1084 msgid "" "For a description of the flag and mode values, see the C run-time " "documentation; flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) " @@ -1204,7 +1212,7 @@ msgid "" "const:`O_BINARY` is needed to open files in binary mode." msgstr "" -#: ../../library/os.rst:1084 +#: ../../library/os.rst:1089 msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." @@ -1216,7 +1224,7 @@ msgid "" "``mode``, ``flags``." msgstr "" -#: ../../library/os.rst:1094 +#: ../../library/os.rst:1099 msgid "" "This function is intended for low-level I/O. For normal usage, use the " "built-in function :func:`open`, which returns a :term:`file object` with :" @@ -1224,39 +1232,39 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1099 ../../library/os.rst:2141 -#: ../../library/os.rst:2209 ../../library/os.rst:2231 -#: ../../library/os.rst:2312 ../../library/os.rst:2343 +#: ../../library/os.rst:1104 ../../library/os.rst:2146 +#: ../../library/os.rst:2214 ../../library/os.rst:2236 +#: ../../library/os.rst:2317 ../../library/os.rst:2348 msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" -#: ../../library/os.rst:1102 ../../library/os.rst:1421 -#: ../../library/os.rst:1592 ../../library/os.rst:4461 +#: ../../library/os.rst:1107 ../../library/os.rst:1426 +#: ../../library/os.rst:1597 ../../library/os.rst:4466 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" "exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/os.rst:1107 ../../library/os.rst:1803 -#: ../../library/os.rst:1835 ../../library/os.rst:1866 -#: ../../library/os.rst:1915 ../../library/os.rst:1952 -#: ../../library/os.rst:1992 ../../library/os.rst:2007 -#: ../../library/os.rst:2020 ../../library/os.rst:2079 -#: ../../library/os.rst:2108 ../../library/os.rst:2144 -#: ../../library/os.rst:2185 ../../library/os.rst:2212 -#: ../../library/os.rst:2234 ../../library/os.rst:2275 -#: ../../library/os.rst:2346 ../../library/os.rst:2365 -#: ../../library/os.rst:2453 ../../library/os.rst:2726 -#: ../../library/os.rst:2977 ../../library/os.rst:3141 -#: ../../library/os.rst:3157 ../../library/os.rst:3197 -#: ../../library/os.rst:3296 ../../library/os.rst:3357 -#: ../../library/os.rst:3541 ../../library/os.rst:3720 -#: ../../library/os.rst:4226 +#: ../../library/os.rst:1112 ../../library/os.rst:1808 +#: ../../library/os.rst:1840 ../../library/os.rst:1871 +#: ../../library/os.rst:1920 ../../library/os.rst:1957 +#: ../../library/os.rst:1997 ../../library/os.rst:2012 +#: ../../library/os.rst:2025 ../../library/os.rst:2084 +#: ../../library/os.rst:2113 ../../library/os.rst:2149 +#: ../../library/os.rst:2190 ../../library/os.rst:2217 +#: ../../library/os.rst:2239 ../../library/os.rst:2280 +#: ../../library/os.rst:2351 ../../library/os.rst:2370 +#: ../../library/os.rst:2458 ../../library/os.rst:2731 +#: ../../library/os.rst:2982 ../../library/os.rst:3146 +#: ../../library/os.rst:3162 ../../library/os.rst:3202 +#: ../../library/os.rst:3301 ../../library/os.rst:3362 +#: ../../library/os.rst:3546 ../../library/os.rst:3725 +#: ../../library/os.rst:4231 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1110 +#: ../../library/os.rst:1115 msgid "" "The following constants are options for the *flags* parameter to the :func:" "`~os.open` function. They can be combined using the bitwise OR operator ``|" @@ -1266,45 +1274,45 @@ msgid "" "on Windows." msgstr "" -#: ../../library/os.rst:1125 +#: ../../library/os.rst:1130 msgid "The above constants are available on Unix and Windows." msgstr "" -#: ../../library/os.rst:1136 +#: ../../library/os.rst:1141 msgid "The above constants are only available on Unix." msgstr "" -#: ../../library/os.rst:1138 +#: ../../library/os.rst:1143 msgid "Add :data:`O_CLOEXEC` constant." msgstr "" -#: ../../library/os.rst:1149 +#: ../../library/os.rst:1154 msgid "The above constants are only available on Windows." msgstr "" -#: ../../library/os.rst:1156 +#: ../../library/os.rst:1161 msgid "The above constants are only available on macOS." msgstr "" -#: ../../library/os.rst:1158 +#: ../../library/os.rst:1163 msgid "" "Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK` and :data:" "`O_NOFOLLOW_ANY` constants." msgstr "" -#: ../../library/os.rst:1172 +#: ../../library/os.rst:1177 msgid "" "The above constants are extensions and not present if they are not defined " "by the C library." msgstr "" -#: ../../library/os.rst:1175 +#: ../../library/os.rst:1180 msgid "" "Add :data:`O_PATH` on systems that support it. Add :data:`O_TMPFILE`, only " "available on Linux Kernel 3.11 or newer." msgstr "" -#: ../../library/os.rst:1185 +#: ../../library/os.rst:1190 msgid "" "Open a new pseudo-terminal pair. Return a pair of file descriptors " "``(master, slave)`` for the pty and the tty, respectively. The new file " @@ -1312,18 +1320,18 @@ msgid "" "more portable approach, use the :mod:`pty` module." msgstr "" -#: ../../library/os.rst:1192 ../../library/os.rst:1204 +#: ../../library/os.rst:1197 ../../library/os.rst:1209 msgid "The new file descriptors are now non-inheritable." msgstr "" -#: ../../library/os.rst:1198 +#: ../../library/os.rst:1203 msgid "" "Create a pipe. Return a pair of file descriptors ``(r, w)`` usable for " "reading and writing, respectively. The new file descriptor is :ref:`non-" "inheritable `." msgstr "" -#: ../../library/os.rst:1210 +#: ../../library/os.rst:1215 msgid "" "Create a pipe with *flags* set atomically. *flags* can be constructed by " "ORing together one or more of these values: :data:`O_NONBLOCK`, :data:" @@ -1331,17 +1339,17 @@ msgid "" "and writing, respectively." msgstr "" -#: ../../library/os.rst:1223 +#: ../../library/os.rst:1228 msgid "" "Ensures that enough disk space is allocated for the file specified by *fd* " "starting from *offset* and continuing for *len* bytes." msgstr "" -#: ../../library/os.rst:1226 +#: ../../library/os.rst:1231 msgid ":ref:`Availability `: Unix, not Emscripten." msgstr ":ref:`適用 `:Unix、非 Emscripten。" -#: ../../library/os.rst:1233 +#: ../../library/os.rst:1238 msgid "" "Announces an intention to access data in a specific pattern thus allowing " "the kernel to make optimizations. The advice applies to the region of the " @@ -1352,25 +1360,25 @@ msgid "" "`POSIX_FADV_DONTNEED`." msgstr "" -#: ../../library/os.rst:1253 +#: ../../library/os.rst:1258 msgid "" "Flags that can be used in *advice* in :func:`posix_fadvise` that specify the " "access pattern that is likely to be used." msgstr "" -#: ../../library/os.rst:1263 +#: ../../library/os.rst:1268 msgid "" "Read at most *n* bytes from file descriptor *fd* at a position of *offset*, " "leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1266 ../../library/os.rst:1410 +#: ../../library/os.rst:1271 ../../library/os.rst:1415 msgid "" "Return a bytestring containing the bytes read. If the end of the file " "referred to by *fd* has been reached, an empty bytes object is returned." msgstr "" -#: ../../library/os.rst:1276 +#: ../../library/os.rst:1281 msgid "" "Read from a file descriptor *fd* at a position of *offset* into mutable :" "term:`bytes-like objects ` *buffers*, leaving the file " @@ -1378,38 +1386,38 @@ msgid "" "move on to the next buffer in the sequence to hold the rest of the data." msgstr "" -#: ../../library/os.rst:1281 ../../library/os.rst:1351 +#: ../../library/os.rst:1286 ../../library/os.rst:1356 msgid "" "The flags argument contains a bitwise OR of zero or more of the following " "flags:" msgstr "" -#: ../../library/os.rst:1284 +#: ../../library/os.rst:1289 msgid ":data:`RWF_HIPRI`" msgstr ":data:`RWF_HIPRI`" -#: ../../library/os.rst:1285 +#: ../../library/os.rst:1290 msgid ":data:`RWF_NOWAIT`" msgstr ":data:`RWF_NOWAIT`" -#: ../../library/os.rst:1287 ../../library/os.rst:1542 +#: ../../library/os.rst:1292 ../../library/os.rst:1547 msgid "" "Return the total number of bytes actually read which can be less than the " "total capacity of all the objects." msgstr "" -#: ../../library/os.rst:1290 ../../library/os.rst:1360 -#: ../../library/os.rst:1545 ../../library/os.rst:1607 +#: ../../library/os.rst:1295 ../../library/os.rst:1365 +#: ../../library/os.rst:1550 ../../library/os.rst:1612 msgid "" "The operating system may set a limit (:func:`sysconf` value " "``'SC_IOV_MAX'``) on the number of buffers that can be used." msgstr "" -#: ../../library/os.rst:1293 +#: ../../library/os.rst:1298 msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: ../../library/os.rst:1295 ../../library/os.rst:1365 +#: ../../library/os.rst:1300 ../../library/os.rst:1370 #, fuzzy msgid "" ":ref:`Availability `: Linux >= 2.6.30, FreeBSD >= 6.0, OpenBSD " @@ -1418,55 +1426,55 @@ msgstr "" ":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD 2.7 " "以上、AIX 7.1 以上。" -#: ../../library/os.rst:1297 ../../library/os.rst:1367 +#: ../../library/os.rst:1302 ../../library/os.rst:1372 msgid "Using flags requires Linux >= 4.6." msgstr "" -#: ../../library/os.rst:1304 +#: ../../library/os.rst:1309 msgid "" "Do not wait for data which is not immediately available. If this flag is " "specified, the system call will return instantly if it would have to read " "data from the backing storage or wait for a lock." msgstr "" -#: ../../library/os.rst:1308 +#: ../../library/os.rst:1313 msgid "" "If some data was successfully read, it will return the number of bytes read. " "If no bytes were read, it will return ``-1`` and set errno to :data:`errno." "EAGAIN`." msgstr "" -#: ../../library/os.rst:1312 +#: ../../library/os.rst:1317 msgid ":ref:`Availability `: Linux >= 4.14." msgstr ":ref:`適用 `:Linux 4.14 以上。" -#: ../../library/os.rst:1319 +#: ../../library/os.rst:1324 msgid "" "High priority read/write. Allows block-based filesystems to use polling of " "the device, which provides lower latency, but may use additional resources." msgstr "" -#: ../../library/os.rst:1323 +#: ../../library/os.rst:1328 msgid "" "Currently, on Linux, this feature is usable only on a file descriptor opened " "using the :data:`O_DIRECT` flag." msgstr "" -#: ../../library/os.rst:1326 +#: ../../library/os.rst:1331 msgid ":ref:`Availability `: Linux >= 4.6." msgstr ":ref:`適用 `:Linux 4.6 以上。" -#: ../../library/os.rst:1333 +#: ../../library/os.rst:1338 msgid "" "Write the bytestring in *str* to file descriptor *fd* at position of " "*offset*, leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1336 ../../library/os.rst:1582 +#: ../../library/os.rst:1341 ../../library/os.rst:1587 msgid "Return the number of bytes actually written." msgstr "" -#: ../../library/os.rst:1345 +#: ../../library/os.rst:1350 msgid "" "Write the *buffers* contents to file descriptor *fd* at a offset *offset*, " "leaving the file offset unchanged. *buffers* must be a sequence of :term:" @@ -1475,43 +1483,43 @@ msgid "" "the second, and so on." msgstr "" -#: ../../library/os.rst:1354 +#: ../../library/os.rst:1359 msgid ":data:`RWF_DSYNC`" msgstr ":data:`RWF_DSYNC`" -#: ../../library/os.rst:1355 +#: ../../library/os.rst:1360 msgid ":data:`RWF_SYNC`" msgstr ":data:`RWF_SYNC`" -#: ../../library/os.rst:1356 +#: ../../library/os.rst:1361 msgid ":data:`RWF_APPEND`" msgstr ":data:`RWF_APPEND`" -#: ../../library/os.rst:1358 +#: ../../library/os.rst:1363 msgid "Return the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1363 +#: ../../library/os.rst:1368 msgid "Combine the functionality of :func:`os.writev` and :func:`os.pwrite`." msgstr "" -#: ../../library/os.rst:1374 +#: ../../library/os.rst:1379 msgid "" "Provide a per-write equivalent of the :data:`O_DSYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1377 ../../library/os.rst:1387 +#: ../../library/os.rst:1382 ../../library/os.rst:1392 msgid ":ref:`Availability `: Linux >= 4.7." msgstr ":ref:`適用 `:Linux 4.7 以上。" -#: ../../library/os.rst:1384 +#: ../../library/os.rst:1389 msgid "" "Provide a per-write equivalent of the :data:`O_SYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1394 +#: ../../library/os.rst:1399 msgid "" "Provide a per-write equivalent of the :data:`O_APPEND` :func:`os.open` flag. " "This flag is meaningful only for :func:`os.pwritev`, and its effect applies " @@ -1521,15 +1529,15 @@ msgid "" "*offset* is updated." msgstr "" -#: ../../library/os.rst:1401 +#: ../../library/os.rst:1406 msgid ":ref:`Availability `: Linux >= 4.16." msgstr ":ref:`適用 `:Linux 4.16 以上。" -#: ../../library/os.rst:1408 +#: ../../library/os.rst:1413 msgid "Read at most *n* bytes from file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1415 +#: ../../library/os.rst:1420 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To read a \"file " @@ -1538,26 +1546,26 @@ msgid "" "`~file.readline` methods." msgstr "" -#: ../../library/os.rst:1430 +#: ../../library/os.rst:1435 msgid "" "Copy *count* bytes from file descriptor *in_fd* to file descriptor *out_fd* " "starting at *offset*. Return the number of bytes sent. When EOF is reached " "return ``0``." msgstr "" -#: ../../library/os.rst:1434 +#: ../../library/os.rst:1439 msgid "" "The first function notation is supported by all platforms that define :func:" "`sendfile`." msgstr "" -#: ../../library/os.rst:1437 +#: ../../library/os.rst:1442 msgid "" "On Linux, if *offset* is given as ``None``, the bytes are read from the " "current position of *in_fd* and the position of *in_fd* is updated." msgstr "" -#: ../../library/os.rst:1440 +#: ../../library/os.rst:1445 msgid "" "The second case may be used on macOS and FreeBSD where *headers* and " "*trailers* are arbitrary sequences of buffers that are written before and " @@ -1565,59 +1573,59 @@ msgid "" "case." msgstr "" -#: ../../library/os.rst:1444 +#: ../../library/os.rst:1449 msgid "" "On macOS and FreeBSD, a value of ``0`` for *count* specifies to send until " "the end of *in_fd* is reached." msgstr "" -#: ../../library/os.rst:1447 +#: ../../library/os.rst:1452 msgid "" "All platforms support sockets as *out_fd* file descriptor, and some " "platforms allow other types (e.g. regular file, pipe) as well." msgstr "" -#: ../../library/os.rst:1450 +#: ../../library/os.rst:1455 msgid "" "Cross-platform applications should not use *headers*, *trailers* and *flags* " "arguments." msgstr "" -#: ../../library/os.rst:1457 +#: ../../library/os.rst:1462 msgid "" "For a higher-level wrapper of :func:`sendfile`, see :meth:`socket.socket." "sendfile`." msgstr "" -#: ../../library/os.rst:1462 +#: ../../library/os.rst:1467 msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: ../../library/os.rst:1468 +#: ../../library/os.rst:1473 msgid "" "Set the blocking mode of the specified file descriptor. Set the :data:" "`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise." msgstr "" -#: ../../library/os.rst:1471 +#: ../../library/os.rst:1476 msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1485 +#: ../../library/os.rst:1490 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: ../../library/os.rst:1494 +#: ../../library/os.rst:1499 msgid "" "Parameter to the :func:`sendfile` function, if the implementation supports " "it. The data won't be cached in the virtual memory and will be freed " "afterwards." msgstr "" -#: ../../library/os.rst:1504 +#: ../../library/os.rst:1509 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1629,7 +1637,7 @@ msgid "" "`~OSError.errno` set to :data:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:1518 +#: ../../library/os.rst:1523 msgid "" "Upon successful completion, returns the number of bytes spliced to or from " "the pipe. A return value of 0 means end of input. If *src* refers to a pipe, " @@ -1638,11 +1646,11 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1524 +#: ../../library/os.rst:1529 msgid ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" -#: ../../library/os.rst:1537 +#: ../../library/os.rst:1542 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects ` *buffers*. Transfer data into each buffer until " @@ -1650,34 +1658,34 @@ msgid "" "rest of the data." msgstr "" -#: ../../library/os.rst:1555 +#: ../../library/os.rst:1560 msgid "" "Return the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`)." msgstr "" -#: ../../library/os.rst:1558 ../../library/os.rst:1566 +#: ../../library/os.rst:1563 ../../library/os.rst:1571 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/os.rst:1563 +#: ../../library/os.rst:1568 msgid "" "Set the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`) to *pg*." msgstr "" -#: ../../library/os.rst:1571 +#: ../../library/os.rst:1576 msgid "" "Return a string which specifies the terminal device associated with file " "descriptor *fd*. If *fd* is not associated with a terminal device, an " "exception is raised." msgstr "" -#: ../../library/os.rst:1580 +#: ../../library/os.rst:1585 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1586 +#: ../../library/os.rst:1591 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To write a " @@ -1686,7 +1694,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: ../../library/os.rst:1600 +#: ../../library/os.rst:1605 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects `. Buffers are " @@ -1694,70 +1702,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: ../../library/os.rst:1605 +#: ../../library/os.rst:1610 msgid "Returns the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1618 +#: ../../library/os.rst:1623 msgid "Querying the size of a terminal" msgstr "" -#: ../../library/os.rst:1624 +#: ../../library/os.rst:1629 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: ../../library/os.rst:1627 +#: ../../library/os.rst:1632 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: ../../library/os.rst:1630 +#: ../../library/os.rst:1635 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: ../../library/os.rst:1633 +#: ../../library/os.rst:1638 msgid "" ":func:`shutil.get_terminal_size` is the high-level function which should " "normally be used, ``os.get_terminal_size`` is the low-level implementation." msgstr "" -#: ../../library/os.rst:1641 +#: ../../library/os.rst:1646 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: ../../library/os.rst:1645 +#: ../../library/os.rst:1650 msgid "Width of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1649 +#: ../../library/os.rst:1654 msgid "Height of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1655 +#: ../../library/os.rst:1660 msgid "Inheritance of File Descriptors" msgstr "" -#: ../../library/os.rst:1659 +#: ../../library/os.rst:1664 msgid "" "A file descriptor has an \"inheritable\" flag which indicates if the file " "descriptor can be inherited by child processes. Since Python 3.4, file " "descriptors created by Python are non-inheritable by default." msgstr "" -#: ../../library/os.rst:1663 +#: ../../library/os.rst:1668 msgid "" "On UNIX, non-inheritable file descriptors are closed in child processes at " "the execution of a new program, other file descriptors are inherited." msgstr "" -#: ../../library/os.rst:1666 +#: ../../library/os.rst:1671 msgid "" "On Windows, non-inheritable handles and file descriptors are closed in child " "processes, except for standard streams (file descriptors 0, 1 and 2: stdin, " @@ -1768,46 +1776,46 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1674 +#: ../../library/os.rst:1679 msgid "" "On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, the file " "descriptor cannot be modified." msgstr "" -#: ../../library/os.rst:1679 +#: ../../library/os.rst:1684 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1683 +#: ../../library/os.rst:1688 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1687 +#: ../../library/os.rst:1692 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1689 ../../library/os.rst:1695 -#: ../../library/os.rst:3646 ../../library/os.rst:4261 -#: ../../library/os.rst:4306 +#: ../../library/os.rst:1694 ../../library/os.rst:1700 +#: ../../library/os.rst:3651 ../../library/os.rst:4266 +#: ../../library/os.rst:4311 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:1693 +#: ../../library/os.rst:1698 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:1701 +#: ../../library/os.rst:1706 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:1703 +#: ../../library/os.rst:1708 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:1708 +#: ../../library/os.rst:1713 msgid "" "**specifying a file descriptor:** Normally the *path* argument provided to " "functions in the :mod:`os` module must be a string specifying a file path. " @@ -1818,7 +1826,7 @@ msgid "" "``chdir``).)" msgstr "" -#: ../../library/os.rst:1716 +#: ../../library/os.rst:1721 msgid "" "You can check whether or not *path* can be specified as a file descriptor " "for a particular function on your platform using :data:`os.supports_fd`. If " @@ -1826,13 +1834,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1721 +#: ../../library/os.rst:1726 msgid "" "If the function also supports *dir_fd* or *follow_symlinks* arguments, it's " "an error to specify one of those when supplying *path* as a file descriptor." msgstr "" -#: ../../library/os.rst:1726 +#: ../../library/os.rst:1731 msgid "" "**paths relative to directory descriptors:** If *dir_fd* is not ``None``, it " "should be a file descriptor referring to a directory, and the path to " @@ -1843,14 +1851,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:1733 +#: ../../library/os.rst:1738 msgid "" "You can check whether or not *dir_fd* is supported for a particular function " "on your platform using :data:`os.supports_dir_fd`. If it's unavailable, " "using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1739 +#: ../../library/os.rst:1744 msgid "" "**not following symlinks:** If *follow_symlinks* is ``False``, and the last " "element of the path to operate on is a symbolic link, the function will " @@ -1859,14 +1867,14 @@ msgid "" "function.)" msgstr "" -#: ../../library/os.rst:1745 +#: ../../library/os.rst:1750 msgid "" "You can check whether or not *follow_symlinks* is supported for a particular " "function on your platform using :data:`os.supports_follow_symlinks`. If it's " "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1753 +#: ../../library/os.rst:1758 msgid "" "Use the real uid/gid to test for access to *path*. Note that most " "operations will use the effective uid/gid, therefore this routine can be " @@ -1878,13 +1886,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:1762 +#: ../../library/os.rst:1767 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1765 +#: ../../library/os.rst:1770 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -1893,7 +1901,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1773 +#: ../../library/os.rst:1778 msgid "" "Using :func:`access` to check if a user is authorized to e.g. open a file " "before actually doing so using :func:`open` creates a security hole, because " @@ -1902,39 +1910,39 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:1784 +#: ../../library/os.rst:1789 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:1796 +#: ../../library/os.rst:1801 msgid "" "I/O operations may fail even when :func:`access` indicates that they would " "succeed, particularly for operations on network filesystems which may have " "permissions semantics beyond the usual POSIX permission-bit model." msgstr "" -#: ../../library/os.rst:1800 +#: ../../library/os.rst:1805 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "新增 *dir_fd*\\ 、\\ *effective_ids* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:1812 +#: ../../library/os.rst:1817 msgid "" "Values to pass as the *mode* parameter of :func:`access` to test the " "existence, readability, writability and executability of *path*, " "respectively." msgstr "" -#: ../../library/os.rst:1821 +#: ../../library/os.rst:1826 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:1823 +#: ../../library/os.rst:1828 msgid "" "This function can support :ref:`specifying a file descriptor `. " "The descriptor must refer to an opened directory, not an open file." msgstr "" -#: ../../library/os.rst:1826 +#: ../../library/os.rst:1831 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." @@ -1946,67 +1954,67 @@ msgid "" "``path``." msgstr "" -#: ../../library/os.rst:1831 +#: ../../library/os.rst:1836 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:1841 +#: ../../library/os.rst:1846 msgid "" "Set the flags of *path* to the numeric *flags*. *flags* may take a " "combination (bitwise OR) of the following values (as defined in the :mod:" "`stat` module):" msgstr "" -#: ../../library/os.rst:1844 +#: ../../library/os.rst:1849 msgid ":data:`stat.UF_NODUMP`" msgstr ":data:`stat.UF_NODUMP`" -#: ../../library/os.rst:1845 +#: ../../library/os.rst:1850 msgid ":data:`stat.UF_IMMUTABLE`" msgstr ":data:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:1846 +#: ../../library/os.rst:1851 msgid ":data:`stat.UF_APPEND`" msgstr ":data:`stat.UF_APPEND`" -#: ../../library/os.rst:1847 +#: ../../library/os.rst:1852 msgid ":data:`stat.UF_OPAQUE`" msgstr ":data:`stat.UF_OPAQUE`" -#: ../../library/os.rst:1848 +#: ../../library/os.rst:1853 msgid ":data:`stat.UF_NOUNLINK`" msgstr ":data:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:1849 +#: ../../library/os.rst:1854 msgid ":data:`stat.UF_COMPRESSED`" msgstr ":data:`stat.UF_COMPRESSED`" -#: ../../library/os.rst:1850 +#: ../../library/os.rst:1855 msgid ":data:`stat.UF_HIDDEN`" msgstr ":data:`stat.UF_HIDDEN`" -#: ../../library/os.rst:1851 +#: ../../library/os.rst:1856 msgid ":data:`stat.SF_ARCHIVED`" msgstr ":data:`stat.SF_ARCHIVED`" -#: ../../library/os.rst:1852 +#: ../../library/os.rst:1857 msgid ":data:`stat.SF_IMMUTABLE`" msgstr ":data:`stat.SF_IMMUTABLE`" -#: ../../library/os.rst:1853 +#: ../../library/os.rst:1858 msgid ":data:`stat.SF_APPEND`" msgstr ":data:`stat.SF_APPEND`" -#: ../../library/os.rst:1854 +#: ../../library/os.rst:1859 msgid ":data:`stat.SF_NOUNLINK`" msgstr ":data:`stat.SF_NOUNLINK`" -#: ../../library/os.rst:1855 +#: ../../library/os.rst:1860 msgid ":data:`stat.SF_SNAPSHOT`" msgstr ":data:`stat.SF_SNAPSHOT`" -#: ../../library/os.rst:1857 +#: ../../library/os.rst:1862 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" @@ -2017,164 +2025,164 @@ msgid "" "``path``, ``flags``." msgstr "" -#: ../../library/os.rst:1863 +#: ../../library/os.rst:1868 msgid "The *follow_symlinks* argument." msgstr "*follow_symlinks* 引數。" -#: ../../library/os.rst:1872 +#: ../../library/os.rst:1877 msgid "" "Change the mode of *path* to the numeric *mode*. *mode* may take one of the " "following values (as defined in the :mod:`stat` module) or bitwise ORed " "combinations of them:" msgstr "" -#: ../../library/os.rst:1876 +#: ../../library/os.rst:1881 msgid ":data:`stat.S_ISUID`" msgstr ":data:`stat.S_ISUID`" -#: ../../library/os.rst:1877 +#: ../../library/os.rst:1882 msgid ":data:`stat.S_ISGID`" msgstr ":data:`stat.S_ISGID`" -#: ../../library/os.rst:1878 +#: ../../library/os.rst:1883 msgid ":data:`stat.S_ENFMT`" msgstr ":data:`stat.S_ENFMT`" -#: ../../library/os.rst:1879 +#: ../../library/os.rst:1884 msgid ":data:`stat.S_ISVTX`" msgstr ":data:`stat.S_ISVTX`" -#: ../../library/os.rst:1880 +#: ../../library/os.rst:1885 msgid ":data:`stat.S_IREAD`" msgstr ":data:`stat.S_IREAD`" -#: ../../library/os.rst:1881 +#: ../../library/os.rst:1886 msgid ":data:`stat.S_IWRITE`" msgstr ":data:`stat.S_IWRITE`" -#: ../../library/os.rst:1882 +#: ../../library/os.rst:1887 msgid ":data:`stat.S_IEXEC`" msgstr ":data:`stat.S_IEXEC`" -#: ../../library/os.rst:1883 +#: ../../library/os.rst:1888 msgid ":data:`stat.S_IRWXU`" msgstr ":data:`stat.S_IRWXU`" -#: ../../library/os.rst:1884 +#: ../../library/os.rst:1889 msgid ":data:`stat.S_IRUSR`" msgstr ":data:`stat.S_IRUSR`" -#: ../../library/os.rst:1885 +#: ../../library/os.rst:1890 msgid ":data:`stat.S_IWUSR`" msgstr ":data:`stat.S_IWUSR`" -#: ../../library/os.rst:1886 +#: ../../library/os.rst:1891 msgid ":data:`stat.S_IXUSR`" msgstr ":data:`stat.S_IXUSR`" -#: ../../library/os.rst:1887 +#: ../../library/os.rst:1892 msgid ":data:`stat.S_IRWXG`" msgstr ":data:`stat.S_IRWXG`" -#: ../../library/os.rst:1888 +#: ../../library/os.rst:1893 msgid ":data:`stat.S_IRGRP`" msgstr ":data:`stat.S_IRGRP`" -#: ../../library/os.rst:1889 +#: ../../library/os.rst:1894 msgid ":data:`stat.S_IWGRP`" msgstr ":data:`stat.S_IWGRP`" -#: ../../library/os.rst:1890 +#: ../../library/os.rst:1895 msgid ":data:`stat.S_IXGRP`" msgstr ":data:`stat.S_IXGRP`" -#: ../../library/os.rst:1891 +#: ../../library/os.rst:1896 msgid ":data:`stat.S_IRWXO`" msgstr ":data:`stat.S_IRWXO`" -#: ../../library/os.rst:1892 +#: ../../library/os.rst:1897 msgid ":data:`stat.S_IROTH`" msgstr ":data:`stat.S_IROTH`" -#: ../../library/os.rst:1893 +#: ../../library/os.rst:1898 msgid ":data:`stat.S_IWOTH`" msgstr ":data:`stat.S_IWOTH`" -#: ../../library/os.rst:1894 +#: ../../library/os.rst:1899 msgid ":data:`stat.S_IXOTH`" msgstr ":data:`stat.S_IXOTH`" -#: ../../library/os.rst:1896 ../../library/os.rst:1924 -#: ../../library/os.rst:3187 +#: ../../library/os.rst:1901 ../../library/os.rst:1929 +#: ../../library/os.rst:3192 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " "following symlinks `." msgstr "" -#: ../../library/os.rst:1902 +#: ../../library/os.rst:1907 msgid "" "Although Windows supports :func:`chmod`, you can only set the file's read-" "only flag with it (via the ``stat.S_IWRITE`` and ``stat.S_IREAD`` constants " "or a corresponding integer value). All other bits are ignored." msgstr "" -#: ../../library/os.rst:1911 ../../library/os.rst:1938 +#: ../../library/os.rst:1916 ../../library/os.rst:1943 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:1921 +#: ../../library/os.rst:1926 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. To " "leave one of the ids unchanged, set it to -1." msgstr "" -#: ../../library/os.rst:1928 +#: ../../library/os.rst:1933 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:1942 +#: ../../library/os.rst:1947 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1948 +#: ../../library/os.rst:1953 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:1958 +#: ../../library/os.rst:1963 msgid "" "Change the current working directory to the directory represented by the " "file descriptor *fd*. The descriptor must refer to an opened directory, not " "an open file. As of Python 3.3, this is equivalent to ``os.chdir(fd)``." msgstr "" -#: ../../library/os.rst:1969 +#: ../../library/os.rst:1974 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:1974 +#: ../../library/os.rst:1979 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:1976 +#: ../../library/os.rst:1981 msgid "" "The function now uses the UTF-8 encoding on Windows, rather than the ANSI " "code page: see :pep:`529` for the rationale. The function is no longer " "deprecated on Windows." msgstr "" -#: ../../library/os.rst:1984 +#: ../../library/os.rst:1989 msgid "" "Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do " "not follow symbolic links. As of Python 3.3, this is equivalent to ``os." "chflags(path, flags, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:1998 +#: ../../library/os.rst:2003 msgid "" "Change the mode of *path* to the numeric *mode*. If path is a symlink, this " "affects the symlink rather than the target. See the docs for :func:`chmod` " @@ -2182,18 +2190,18 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2012 +#: ../../library/os.rst:2017 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. " "This function will not follow symbolic links. As of Python 3.3, this is " "equivalent to ``os.chown(path, uid, gid, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2026 +#: ../../library/os.rst:2031 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2028 +#: ../../library/os.rst:2033 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `, and :ref:" @@ -2206,20 +2214,20 @@ msgid "" "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -#: ../../library/os.rst:2036 +#: ../../library/os.rst:2041 msgid "Added Windows support." msgstr "新支援 Windows。" -#: ../../library/os.rst:2039 +#: ../../library/os.rst:2044 msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* arguments." msgstr "增加 *src_dir_fd*\\ 、\\ *dst_dir_fd* 與 *follow_symlinks* 引數。" -#: ../../library/os.rst:2042 ../../library/os.rst:2397 -#: ../../library/os.rst:2434 ../../library/os.rst:3109 +#: ../../library/os.rst:2047 ../../library/os.rst:2402 +#: ../../library/os.rst:2439 ../../library/os.rst:3114 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:2048 +#: ../../library/os.rst:2053 msgid "" "Return a list containing the names of the entries in the directory given by " "*path*. The list is in arbitrary order, and does not include the special " @@ -2228,7 +2236,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:2054 +#: ../../library/os.rst:2059 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2236,7 +2244,7 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2059 ../../library/os.rst:2482 +#: ../../library/os.rst:2064 ../../library/os.rst:2487 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." @@ -2248,61 +2256,61 @@ msgid "" "``path``." msgstr "" -#: ../../library/os.rst:2065 +#: ../../library/os.rst:2070 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:2069 +#: ../../library/os.rst:2074 msgid "" "The :func:`scandir` function returns directory entries along with file " "attribute information, giving better performance for many common use cases." msgstr "" -#: ../../library/os.rst:2073 +#: ../../library/os.rst:2078 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2076 ../../library/os.rst:2968 +#: ../../library/os.rst:2081 ../../library/os.rst:2973 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2085 +#: ../../library/os.rst:2090 msgid "" "Perform the equivalent of an :c:func:`lstat` system call on the given path. " "Similar to :func:`~os.stat`, but does not follow symbolic links. Return a :" "class:`stat_result` object." msgstr "" -#: ../../library/os.rst:2089 +#: ../../library/os.rst:2094 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2092 +#: ../../library/os.rst:2097 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2095 ../../library/os.rst:2133 -#: ../../library/os.rst:2198 ../../library/os.rst:2226 -#: ../../library/os.rst:2300 +#: ../../library/os.rst:2100 ../../library/os.rst:2138 +#: ../../library/os.rst:2203 ../../library/os.rst:2231 +#: ../../library/os.rst:2305 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2102 ../../library/os.rst:2309 -#: ../../library/os.rst:3102 +#: ../../library/os.rst:2107 ../../library/os.rst:2314 +#: ../../library/os.rst:3107 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2105 +#: ../../library/os.rst:2110 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" -#: ../../library/os.rst:2111 +#: ../../library/os.rst:2116 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2310,18 +2318,18 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2120 +#: ../../library/os.rst:2125 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2122 +#: ../../library/os.rst:2127 msgid "" "If the directory already exists, :exc:`FileExistsError` is raised. If a " "parent directory in the path does not exist, :exc:`FileNotFoundError` is " "raised." msgstr "" -#: ../../library/os.rst:2127 +#: ../../library/os.rst:2132 msgid "" "On some systems, *mode* is ignored. Where it is used, the current umask " "value is first masked out. If bits other than the last 9 (i.e. the last 3 " @@ -2330,7 +2338,7 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2136 +#: ../../library/os.rst:2141 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." @@ -2342,13 +2350,13 @@ msgid "" "``path``, ``mode``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2154 +#: ../../library/os.rst:2159 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2157 +#: ../../library/os.rst:2162 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2357,27 +2365,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2163 +#: ../../library/os.rst:2168 msgid "" "If *exist_ok* is ``False`` (the default), a :exc:`FileExistsError` is raised " "if the target directory already exists." msgstr "" -#: ../../library/os.rst:2168 +#: ../../library/os.rst:2173 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2171 +#: ../../library/os.rst:2176 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2175 +#: ../../library/os.rst:2180 msgid "The *exist_ok* parameter." msgstr "*exist_ok* 參數。" -#: ../../library/os.rst:2180 +#: ../../library/os.rst:2185 msgid "" "Before Python 3.4.1, if *exist_ok* was ``True`` and the directory existed, :" "func:`makedirs` would still raise an error if *mode* did not match the mode " @@ -2385,19 +2393,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2188 +#: ../../library/os.rst:2193 msgid "" "The *mode* argument no longer affects the file permission bits of newly " "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2195 +#: ../../library/os.rst:2200 msgid "" "Create a FIFO (a named pipe) named *path* with numeric mode *mode*. The " "current umask value is first masked out from the mode." msgstr "" -#: ../../library/os.rst:2201 +#: ../../library/os.rst:2206 msgid "" "FIFOs are pipes that can be accessed like regular files. FIFOs exist until " "they are deleted (for example with :func:`os.unlink`). Generally, FIFOs are " @@ -2407,7 +2415,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2218 +#: ../../library/os.rst:2223 msgid "" "Create a filesystem node (file, device special file or named pipe) named " "*path*. *mode* specifies both the permissions to use and the type of node to " @@ -2418,23 +2426,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2240 +#: ../../library/os.rst:2245 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:type:`stat`)." msgstr "" -#: ../../library/os.rst:2246 +#: ../../library/os.rst:2251 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:type:`stat`)." msgstr "" -#: ../../library/os.rst:2252 +#: ../../library/os.rst:2257 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2257 +#: ../../library/os.rst:2262 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2445,20 +2453,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2270 ../../library/os.rst:2961 -#: ../../library/os.rst:3130 +#: ../../library/os.rst:2275 ../../library/os.rst:2966 +#: ../../library/os.rst:3135 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2281 +#: ../../library/os.rst:2286 msgid "" "Dictionary mapping names accepted by :func:`pathconf` and :func:`fpathconf` " "to the integer values defined for those names by the host operating system. " "This can be used to determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:2290 +#: ../../library/os.rst:2295 msgid "" "Return a string representing the path to which the symbolic link points. " "The result may be either an absolute or relative pathname; if it is " @@ -2466,7 +2474,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2295 +#: ../../library/os.rst:2300 msgid "" "If the *path* is a string object (directly or indirectly through a :class:" "`PathLike` interface), the result will also be a string object, and the call " @@ -2474,42 +2482,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2303 +#: ../../library/os.rst:2308 msgid "" "When trying to resolve a path that may contain links, use :func:`~os.path." "realpath` to properly handle recursion and platform differences." msgstr "" -#: ../../library/os.rst:2315 +#: ../../library/os.rst:2320 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2318 +#: ../../library/os.rst:2323 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2321 +#: ../../library/os.rst:2326 msgid "" "Added support for directory junctions, and changed to return the " "substitution path (which typically includes ``\\\\?\\`` prefix) rather than " "the optional \"print name\" field that was previously returned." msgstr "" -#: ../../library/os.rst:2328 +#: ../../library/os.rst:2333 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " "does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/os.rst:2332 ../../library/os.rst:2445 -#: ../../library/os.rst:3081 +#: ../../library/os.rst:2337 ../../library/os.rst:2450 +#: ../../library/os.rst:3086 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2335 +#: ../../library/os.rst:2340 msgid "" "On Windows, attempting to remove a file that is in use causes an exception " "to be raised; on Unix, the directory entry is removed but the storage " @@ -2517,7 +2525,7 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2339 +#: ../../library/os.rst:2344 msgid "This function is semantically identical to :func:`unlink`." msgstr "" @@ -2527,7 +2535,7 @@ msgid "" "``path``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2354 +#: ../../library/os.rst:2359 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2539,20 +2547,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2371 +#: ../../library/os.rst:2376 msgid "" "Rename the file or directory *src* to *dst*. If *dst* exists, the operation " "will fail with an :exc:`OSError` subclass in a number of cases:" msgstr "" -#: ../../library/os.rst:2374 +#: ../../library/os.rst:2379 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " "operation may fail if *src* and *dst* are on different filesystems. Use :" "func:`shutil.move` to support moves to a different filesystem." msgstr "" -#: ../../library/os.rst:2378 +#: ../../library/os.rst:2383 msgid "" "On Unix, if *src* is a file and *dst* is a directory or vice-versa, an :exc:" "`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " @@ -2564,13 +2572,13 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2387 ../../library/os.rst:2427 +#: ../../library/os.rst:2392 ../../library/os.rst:2432 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `." msgstr "" -#: ../../library/os.rst:2390 +#: ../../library/os.rst:2395 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." @@ -2582,11 +2590,11 @@ msgid "" "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -#: ../../library/os.rst:2394 +#: ../../library/os.rst:2399 msgid "The *src_dir_fd* and *dst_dir_fd* arguments." msgstr "" -#: ../../library/os.rst:2403 +#: ../../library/os.rst:2408 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2595,17 +2603,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2410 +#: ../../library/os.rst:2415 msgid "" "This function can fail with the new directory structure made if you lack " "permissions needed to remove the leaf directory or file." msgstr "" -#: ../../library/os.rst:2415 +#: ../../library/os.rst:2420 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2421 +#: ../../library/os.rst:2426 msgid "" "Rename the file or directory *src* to *dst*. If *dst* is a non-empty " "directory, :exc:`OSError` will be raised. If *dst* exists and is a file, it " @@ -2614,7 +2622,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2440 +#: ../../library/os.rst:2445 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2628,11 +2636,11 @@ msgid "" "``path``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2450 ../../library/os.rst:3154 +#: ../../library/os.rst:2455 ../../library/os.rst:3159 msgid "The *dir_fd* parameter." msgstr "*dir_fd* 參數。" -#: ../../library/os.rst:2459 +#: ../../library/os.rst:2464 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2642,7 +2650,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2466 +#: ../../library/os.rst:2471 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2654,7 +2662,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2476 +#: ../../library/os.rst:2481 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the type " @@ -2669,24 +2677,24 @@ msgid "" "``path``." msgstr "" -#: ../../library/os.rst:2487 +#: ../../library/os.rst:2492 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2492 +#: ../../library/os.rst:2497 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2494 +#: ../../library/os.rst:2499 msgid "" "This is called automatically when the iterator is exhausted or garbage " "collected, or when an error happens during iterating. However it is " "advisable to call it explicitly or use the :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:2501 +#: ../../library/os.rst:2506 msgid "" "The following example shows a simple use of :func:`scandir` to display all " "the files (excluding directories) in the given *path* that don't start with " @@ -2694,7 +2702,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2513 +#: ../../library/os.rst:2518 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -2705,7 +2713,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2525 +#: ../../library/os.rst:2530 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -2713,28 +2721,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2531 +#: ../../library/os.rst:2536 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2533 +#: ../../library/os.rst:2538 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2539 +#: ../../library/os.rst:2544 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2542 +#: ../../library/os.rst:2547 msgid "" ":func:`scandir` will provide as much of this information as possible without " "making additional system calls. When a ``stat()`` or ``lstat()`` system call " "is made, the ``os.DirEntry`` object will cache the result." msgstr "" -#: ../../library/os.rst:2546 +#: ../../library/os.rst:2551 msgid "" "``os.DirEntry`` instances are not intended to be stored in long-lived data " "structures; if you know the file metadata has changed or if a long time has " @@ -2742,7 +2750,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2551 +#: ../../library/os.rst:2556 msgid "" "Because the ``os.DirEntry`` methods can make operating system calls, they " "may also raise :exc:`OSError`. If you need very fine-grained control over " @@ -2750,29 +2758,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2556 +#: ../../library/os.rst:2561 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2559 +#: ../../library/os.rst:2564 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2563 +#: ../../library/os.rst:2568 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2566 +#: ../../library/os.rst:2571 msgid "" "The :attr:`name` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2572 +#: ../../library/os.rst:2577 msgid "" "The entry's full path name: equivalent to ``os.path.join(scandir_path, entry." "name)`` where *scandir_path* is the :func:`scandir` *path* argument. The " @@ -2782,51 +2790,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2579 +#: ../../library/os.rst:2584 msgid "" "The :attr:`path` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2585 +#: ../../library/os.rst:2590 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2587 +#: ../../library/os.rst:2592 msgid "" "The result is cached on the ``os.DirEntry`` object. Use ``os.stat(entry." "path, follow_symlinks=False).st_ino`` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2591 +#: ../../library/os.rst:2596 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2596 +#: ../../library/os.rst:2601 msgid "" "Return ``True`` if this entry is a directory or a symbolic link pointing to " "a directory; return ``False`` if the entry is or points to any other kind of " "file, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2600 +#: ../../library/os.rst:2605 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "directory (without following symlinks); return ``False`` if the entry is any " "other kind of file or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2604 +#: ../../library/os.rst:2609 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` along " "with :func:`stat.S_ISDIR` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2608 +#: ../../library/os.rst:2613 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, for non-symlinks, neither Windows or Unix require a system " @@ -2836,46 +2844,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2615 ../../library/os.rst:2645 +#: ../../library/os.rst:2620 ../../library/os.rst:2650 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2620 +#: ../../library/os.rst:2625 msgid "" "Return ``True`` if this entry is a file or a symbolic link pointing to a " "file; return ``False`` if the entry is or points to a directory or other non-" "file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2624 +#: ../../library/os.rst:2629 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "file (without following symlinks); return ``False`` if the entry is a " "directory or other non-file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2628 +#: ../../library/os.rst:2633 msgid "" "The result is cached on the ``os.DirEntry`` object. Caching, system calls " "made, and exceptions raised are as per :func:`~os.DirEntry.is_dir`." msgstr "" -#: ../../library/os.rst:2633 +#: ../../library/os.rst:2638 msgid "" "Return ``True`` if this entry is a symbolic link (even if broken); return " "``False`` if the entry points to a directory or any kind of file, or if it " "doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2637 +#: ../../library/os.rst:2642 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "islink` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2640 +#: ../../library/os.rst:2645 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, neither Windows or Unix require a system call, except on " @@ -2883,35 +2891,35 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2650 +#: ../../library/os.rst:2655 msgid "" "Return a :class:`stat_result` object for this entry. This method follows " "symbolic links by default; to stat a symbolic link add the " "``follow_symlinks=False`` argument." msgstr "" -#: ../../library/os.rst:2654 +#: ../../library/os.rst:2659 msgid "" "On Unix, this method always requires a system call. On Windows, it only " "requires a system call if *follow_symlinks* is ``True`` and the entry is a " "reparse point (for example, a symbolic link or directory junction)." msgstr "" -#: ../../library/os.rst:2659 +#: ../../library/os.rst:2664 msgid "" "On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of the :" "class:`stat_result` are always set to zero. Call :func:`os.stat` to get " "these attributes." msgstr "" -#: ../../library/os.rst:2663 +#: ../../library/os.rst:2668 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` to fetch " "up-to-date information." msgstr "" -#: ../../library/os.rst:2667 +#: ../../library/os.rst:2672 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -2919,13 +2927,13 @@ msgid "" "``is_file()``, ``is_symlink()`` and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2675 +#: ../../library/os.rst:2680 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2682 +#: ../../library/os.rst:2687 msgid "" "Get the status of a file or a file descriptor. Perform the equivalent of a :" "c:func:`stat` system call on the given path. *path* may be specified as " @@ -2934,21 +2942,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2688 +#: ../../library/os.rst:2693 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2691 ../../library/os.rst:3520 -#: ../../library/os.rst:3536 ../../library/os.rst:3552 -#: ../../library/os.rst:3572 +#: ../../library/os.rst:2696 ../../library/os.rst:3525 +#: ../../library/os.rst:3541 ../../library/os.rst:3557 +#: ../../library/os.rst:3577 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2694 +#: ../../library/os.rst:2699 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -2962,24 +2970,24 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2707 ../../library/os.rst:3440 +#: ../../library/os.rst:2712 ../../library/os.rst:3445 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/os.rst:2720 +#: ../../library/os.rst:2725 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:2722 +#: ../../library/os.rst:2727 msgid "" "Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " "descriptor instead of a path." msgstr "" -#: ../../library/os.rst:2729 +#: ../../library/os.rst:2734 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -2989,100 +2997,100 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2740 +#: ../../library/os.rst:2745 msgid "" "Object whose attributes correspond roughly to the members of the :c:type:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:2744 +#: ../../library/os.rst:2749 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2748 +#: ../../library/os.rst:2753 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2752 +#: ../../library/os.rst:2757 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2755 +#: ../../library/os.rst:2760 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2756 +#: ../../library/os.rst:2761 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:2762 +#: ../../library/os.rst:2767 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:2766 +#: ../../library/os.rst:2771 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:2770 +#: ../../library/os.rst:2775 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:2774 +#: ../../library/os.rst:2779 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:2778 +#: ../../library/os.rst:2783 msgid "" "Size of the file in bytes, if it is a regular file or a symbolic link. The " "size of a symbolic link is the length of the pathname it contains, without a " "terminating null byte." msgstr "" -#: ../../library/os.rst:2782 +#: ../../library/os.rst:2787 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:2786 +#: ../../library/os.rst:2791 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:2790 +#: ../../library/os.rst:2795 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:2794 ../../library/os.rst:2810 +#: ../../library/os.rst:2799 ../../library/os.rst:2815 msgid "Platform dependent:" msgstr "" -#: ../../library/os.rst:2796 ../../library/os.rst:2812 +#: ../../library/os.rst:2801 ../../library/os.rst:2817 msgid "the time of most recent metadata change on Unix," msgstr "" -#: ../../library/os.rst:2797 +#: ../../library/os.rst:2802 msgid "the time of creation on Windows, expressed in seconds." msgstr "" -#: ../../library/os.rst:2801 +#: ../../library/os.rst:2806 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:2805 +#: ../../library/os.rst:2810 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:2813 +#: ../../library/os.rst:2818 msgid "" "the time of creation on Windows, expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:2818 +#: ../../library/os.rst:2823 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, " "and :attr:`st_ctime` attributes depend on the operating system and the file " @@ -3091,7 +3099,7 @@ msgid "" "only 1-day resolution. See your operating system documentation for details." msgstr "" -#: ../../library/os.rst:2825 +#: ../../library/os.rst:2830 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:" "`st_ctime_ns` are always expressed in nanoseconds, many systems do not " @@ -3102,78 +3110,78 @@ msgid "" "attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns`." msgstr "" -#: ../../library/os.rst:2834 +#: ../../library/os.rst:2839 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:2839 +#: ../../library/os.rst:2844 msgid "" "Number of 512-byte blocks allocated for file. This may be smaller than :attr:" "`st_size`/512 when the file has holes." msgstr "" -#: ../../library/os.rst:2844 +#: ../../library/os.rst:2849 msgid "" "\"Preferred\" blocksize for efficient file system I/O. Writing to a file in " "smaller chunks may cause an inefficient read-modify-rewrite." msgstr "" -#: ../../library/os.rst:2849 +#: ../../library/os.rst:2854 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:2853 +#: ../../library/os.rst:2858 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:2855 +#: ../../library/os.rst:2860 msgid "" "On other Unix systems (such as FreeBSD), the following attributes may be " "available (but may be only filled out if root tries to use them):" msgstr "" -#: ../../library/os.rst:2860 +#: ../../library/os.rst:2865 msgid "File generation number." msgstr "" -#: ../../library/os.rst:2864 +#: ../../library/os.rst:2869 msgid "Time of file creation." msgstr "" -#: ../../library/os.rst:2866 +#: ../../library/os.rst:2871 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2871 +#: ../../library/os.rst:2876 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:2874 +#: ../../library/os.rst:2879 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2878 +#: ../../library/os.rst:2883 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:2882 +#: ../../library/os.rst:2887 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:2886 +#: ../../library/os.rst:2891 msgid "File type." msgstr "" -#: ../../library/os.rst:2888 +#: ../../library/os.rst:2893 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:2892 +#: ../../library/os.rst:2897 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:" @@ -3181,21 +3189,21 @@ msgid "" "mod:`stat` module." msgstr "" -#: ../../library/os.rst:2899 +#: ../../library/os.rst:2904 msgid "" "When :attr:`st_file_attributes` has the ``FILE_ATTRIBUTE_REPARSE_POINT`` " "set, this field contains the tag identifying the type of reparse point. See " "the ``IO_REPARSE_TAG_*`` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:2903 +#: ../../library/os.rst:2908 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:type:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:2907 +#: ../../library/os.rst:2912 msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " @@ -3207,35 +3215,35 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:2916 +#: ../../library/os.rst:2921 msgid "" "Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " "members." msgstr "" -#: ../../library/os.rst:2920 +#: ../../library/os.rst:2925 msgid "Added the :attr:`st_file_attributes` member on Windows." msgstr "" -#: ../../library/os.rst:2923 +#: ../../library/os.rst:2928 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:2927 +#: ../../library/os.rst:2932 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:2930 +#: ../../library/os.rst:2935 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "" -#: ../../library/os.rst:2933 +#: ../../library/os.rst:2938 msgid "" "On Windows, the :attr:`st_mode` member now identifies special files as :" "const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" -#: ../../library/os.rst:2940 +#: ../../library/os.rst:2945 msgid "" "Perform a :c:func:`statvfs` system call on the given path. The return value " "is an object whose attributes describe the filesystem on the given path, and " @@ -3245,7 +3253,7 @@ msgid "" "`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:2947 +#: ../../library/os.rst:2952 msgid "" "Two module-level constants are defined for the :attr:`f_flag` attribute's " "bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted read-" @@ -3253,7 +3261,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:2952 +#: ../../library/os.rst:2957 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3266,11 +3274,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:2965 +#: ../../library/os.rst:2970 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:2971 +#: ../../library/os.rst:2976 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3278,11 +3286,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:2980 +#: ../../library/os.rst:2985 msgid "Added :attr:`f_fsid`." msgstr "新增 :attr:`f_fsid`\\ 。" -#: ../../library/os.rst:2986 +#: ../../library/os.rst:2991 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3294,7 +3302,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:2996 +#: ../../library/os.rst:3001 msgid "" "To check whether a particular function accepts an open file descriptor for " "its *dir_fd* parameter, use the ``in`` operator on ``supports_dir_fd``. As " @@ -3302,13 +3310,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3003 +#: ../../library/os.rst:3008 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3011 +#: ../../library/os.rst:3016 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3317,19 +3325,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3017 +#: ../../library/os.rst:3022 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3022 +#: ../../library/os.rst:3027 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3030 +#: ../../library/os.rst:3035 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "permit specifying their *path* parameter as an open file descriptor on the " @@ -3338,7 +3346,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3037 +#: ../../library/os.rst:3042 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3347,7 +3355,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3050 +#: ../../library/os.rst:3055 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3360,7 +3368,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3060 +#: ../../library/os.rst:3065 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3369,11 +3377,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3073 +#: ../../library/os.rst:3078 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3075 +#: ../../library/os.rst:3080 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -3383,7 +3391,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3086 +#: ../../library/os.rst:3091 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3391,7 +3399,7 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3092 +#: ../../library/os.rst:3097 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" @@ -3402,21 +3410,21 @@ msgid "" "``src``, ``dst``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3105 +#: ../../library/os.rst:3110 msgid "" "Added the *dir_fd* argument, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3112 +#: ../../library/os.rst:3117 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3118 +#: ../../library/os.rst:3123 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3127 +#: ../../library/os.rst:3132 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." @@ -3428,46 +3436,46 @@ msgid "" "``path``, ``length``." msgstr "" -#: ../../library/os.rst:3147 +#: ../../library/os.rst:3152 msgid "" "Remove (delete) the file *path*. This function is semantically identical " "to :func:`remove`; the ``unlink`` name is its traditional Unix name. Please " "see the documentation for :func:`remove` for further information." msgstr "" -#: ../../library/os.rst:3163 +#: ../../library/os.rst:3168 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3165 +#: ../../library/os.rst:3170 msgid "" ":func:`utime` takes two optional parameters, *times* and *ns*. These specify " "the times set on *path* and are used as follows:" msgstr "" -#: ../../library/os.rst:3168 +#: ../../library/os.rst:3173 msgid "" "If *ns* is specified, it must be a 2-tuple of the form ``(atime_ns, " "mtime_ns)`` where each member is an int expressing nanoseconds." msgstr "" -#: ../../library/os.rst:3171 +#: ../../library/os.rst:3176 msgid "" "If *times* is not ``None``, it must be a 2-tuple of the form ``(atime, " "mtime)`` where each member is an int or float expressing seconds." msgstr "" -#: ../../library/os.rst:3174 +#: ../../library/os.rst:3179 msgid "" "If *times* is ``None`` and *ns* is unspecified, this is equivalent to " "specifying ``ns=(atime_ns, mtime_ns)`` where both times are the current time." msgstr "" -#: ../../library/os.rst:3178 +#: ../../library/os.rst:3183 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3180 +#: ../../library/os.rst:3185 msgid "" "Note that the exact times you set here may not be returned by a subsequent :" "func:`~os.stat` call, depending on the resolution with which your operating " @@ -3483,13 +3491,13 @@ msgid "" "``path``, ``times``, ``ns``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3193 +#: ../../library/os.rst:3198 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3207 +#: ../../library/os.rst:3212 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up. For each directory in the tree rooted at directory *top* " @@ -3497,7 +3505,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3212 +#: ../../library/os.rst:3217 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -3511,7 +3519,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3223 +#: ../../library/os.rst:3228 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -3522,7 +3530,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3231 +#: ../../library/os.rst:3236 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3535,7 +3543,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3240 +#: ../../library/os.rst:3245 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -3545,35 +3553,35 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3246 +#: ../../library/os.rst:3251 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: ../../library/os.rst:3252 +#: ../../library/os.rst:3257 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: ../../library/os.rst:3258 +#: ../../library/os.rst:3263 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3262 ../../library/os.rst:3323 +#: ../../library/os.rst:3267 ../../library/os.rst:3328 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any CVS subdirectory::" msgstr "" -#: ../../library/os.rst:3275 +#: ../../library/os.rst:3280 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " @@ -3586,25 +3594,25 @@ msgid "" "``top``, ``topdown``, ``onerror``, ``followlinks``." msgstr "" -#: ../../library/os.rst:3292 +#: ../../library/os.rst:3297 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: ../../library/os.rst:3306 +#: ../../library/os.rst:3311 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: ../../library/os.rst:3309 +#: ../../library/os.rst:3314 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: ../../library/os.rst:3312 +#: ../../library/os.rst:3317 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -3612,14 +3620,14 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3319 +#: ../../library/os.rst:3324 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: ../../library/os.rst:3336 +#: ../../library/os.rst:3341 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" @@ -3631,11 +3639,11 @@ msgid "" "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3360 +#: ../../library/os.rst:3365 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3366 +#: ../../library/os.rst:3371 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -3643,7 +3651,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3371 +#: ../../library/os.rst:3376 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -3653,24 +3661,24 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3378 +#: ../../library/os.rst:3383 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:3401 +#: ../../library/os.rst:3406 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3403 +#: ../../library/os.rst:3408 #, fuzzy msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" -#: ../../library/os.rst:3405 +#: ../../library/os.rst:3410 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: ../../library/os.rst:3412 +#: ../../library/os.rst:3417 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -3679,7 +3687,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3418 +#: ../../library/os.rst:3423 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be an 32 bit unsigned integer. Please note that the initial value is limited " @@ -3687,87 +3695,87 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3423 +#: ../../library/os.rst:3428 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3426 +#: ../../library/os.rst:3431 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: ../../library/os.rst:3429 +#: ../../library/os.rst:3434 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: ../../library/os.rst:3433 +#: ../../library/os.rst:3438 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3436 +#: ../../library/os.rst:3441 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3457 +#: ../../library/os.rst:3462 msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" -#: ../../library/os.rst:3463 +#: ../../library/os.rst:3468 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3466 ../../library/os.rst:3475 -#: ../../library/os.rst:3483 ../../library/os.rst:3492 +#: ../../library/os.rst:3471 ../../library/os.rst:3480 +#: ../../library/os.rst:3488 ../../library/os.rst:3497 msgid ":ref:`Availability `: Linux >= 2.6.27" msgstr ":ref:`適用 `:Linux 2.6.27 以上" -#: ../../library/os.rst:3472 +#: ../../library/os.rst:3477 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3481 +#: ../../library/os.rst:3486 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3489 +#: ../../library/os.rst:3494 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3498 +#: ../../library/os.rst:3503 msgid "" "Provide semaphore-like semantics for reads from a :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3501 +#: ../../library/os.rst:3506 msgid ":ref:`Availability `: Linux >= 2.6.30" msgstr ":ref:`適用 `:Linux 2.6.30 以上" -#: ../../library/os.rst:3507 +#: ../../library/os.rst:3512 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3511 +#: ../../library/os.rst:3516 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3515 +#: ../../library/os.rst:3520 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -3781,12 +3789,12 @@ msgid "" "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3525 ../../library/os.rst:3557 -#: ../../library/os.rst:3582 +#: ../../library/os.rst:3530 ../../library/os.rst:3562 +#: ../../library/os.rst:3587 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3531 +#: ../../library/os.rst:3536 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -3800,7 +3808,7 @@ msgid "" "``path``." msgstr "" -#: ../../library/os.rst:3547 +#: ../../library/os.rst:3552 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -3814,7 +3822,7 @@ msgid "" "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3563 +#: ../../library/os.rst:3568 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -3826,7 +3834,7 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3577 +#: ../../library/os.rst:3582 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." @@ -3838,33 +3846,33 @@ msgid "" "``path``, ``attribute``, ``value``, ``flags``." msgstr "" -#: ../../library/os.rst:3588 +#: ../../library/os.rst:3593 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3594 +#: ../../library/os.rst:3599 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: ../../library/os.rst:3600 +#: ../../library/os.rst:3605 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: ../../library/os.rst:3607 +#: ../../library/os.rst:3612 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3609 +#: ../../library/os.rst:3614 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3611 +#: ../../library/os.rst:3616 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -3875,7 +3883,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3622 +#: ../../library/os.rst:3627 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -3884,24 +3892,24 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3631 +#: ../../library/os.rst:3636 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3633 +#: ../../library/os.rst:3638 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through :data:`sys.path`), and also " "by :mod:`ctypes`." msgstr "" -#: ../../library/os.rst:3637 +#: ../../library/os.rst:3642 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3640 +#: ../../library/os.rst:3645 msgid "" "See the `Microsoft documentation `_ for more information about how " @@ -3914,7 +3922,7 @@ msgid "" "argument ``path``." msgstr "" -#: ../../library/os.rst:3648 +#: ../../library/os.rst:3653 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -3922,14 +3930,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3655 +#: ../../library/os.rst:3660 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:3670 +#: ../../library/os.rst:3675 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -3937,7 +3945,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3675 +#: ../../library/os.rst:3680 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -3945,7 +3953,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3681 +#: ../../library/os.rst:3686 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -3958,7 +3966,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3690 +#: ../../library/os.rst:3695 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -3971,7 +3979,7 @@ msgid "" "absolute or relative path." msgstr "" -#: ../../library/os.rst:3700 +#: ../../library/os.rst:3705 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -3981,7 +3989,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3707 +#: ../../library/os.rst:3712 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -3996,25 +4004,25 @@ msgid "" "``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:3716 +#: ../../library/os.rst:3721 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3725 +#: ../../library/os.rst:3730 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:3730 +#: ../../library/os.rst:3735 msgid "" "The standard way to exit is ``sys.exit(n)``. :func:`_exit` should normally " "only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:3733 +#: ../../library/os.rst:3738 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -4022,104 +4030,104 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:3739 +#: ../../library/os.rst:3744 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: ../../library/os.rst:3746 +#: ../../library/os.rst:3751 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: ../../library/os.rst:3754 +#: ../../library/os.rst:3759 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:3762 +#: ../../library/os.rst:3767 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:3769 +#: ../../library/os.rst:3774 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:3776 +#: ../../library/os.rst:3781 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:3783 +#: ../../library/os.rst:3788 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:3790 +#: ../../library/os.rst:3795 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:3797 +#: ../../library/os.rst:3802 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:3804 +#: ../../library/os.rst:3809 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: ../../library/os.rst:3812 +#: ../../library/os.rst:3817 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: ../../library/os.rst:3820 +#: ../../library/os.rst:3825 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:3827 +#: ../../library/os.rst:3832 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:3834 +#: ../../library/os.rst:3839 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: ../../library/os.rst:3843 +#: ../../library/os.rst:3848 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:3851 +#: ../../library/os.rst:3856 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: ../../library/os.rst:3859 +#: ../../library/os.rst:3864 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:3866 +#: ../../library/os.rst:3871 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:3873 +#: ../../library/os.rst:3878 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:3876 +#: ../../library/os.rst:3881 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." @@ -4130,17 +4138,17 @@ msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "" -#: ../../library/os.rst:3881 +#: ../../library/os.rst:3886 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3887 +#: ../../library/os.rst:3892 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:3894 +#: ../../library/os.rst:3899 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -4154,19 +4162,19 @@ msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "" -#: ../../library/os.rst:3902 +#: ../../library/os.rst:3907 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3915 +#: ../../library/os.rst:3920 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:3918 +#: ../../library/os.rst:3923 msgid "" "Windows: The :data:`signal.CTRL_C_EVENT` and :data:`signal.CTRL_BREAK_EVENT` " "signals are special signals which can only be sent to console processes " @@ -4176,7 +4184,7 @@ msgid "" "version of :func:`kill` additionally takes process handles to be killed." msgstr "" -#: ../../library/os.rst:3926 +#: ../../library/os.rst:3931 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" @@ -4186,11 +4194,11 @@ msgid "" "``pid``, ``sig``." msgstr "" -#: ../../library/os.rst:3932 +#: ../../library/os.rst:3937 msgid "Windows support." msgstr "" -#: ../../library/os.rst:3942 +#: ../../library/os.rst:3947 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" @@ -4200,12 +4208,12 @@ msgid "" "``pgid``, ``sig``." msgstr "" -#: ../../library/os.rst:3951 +#: ../../library/os.rst:3956 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:3958 +#: ../../library/os.rst:3963 msgid "" "Return a file descriptor referring to the process *pid*. This descriptor " "can be used to perform process management without races and signals. The " @@ -4213,21 +4221,21 @@ msgid "" "currently defined." msgstr "" -#: ../../library/os.rst:3963 +#: ../../library/os.rst:3968 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:3965 +#: ../../library/os.rst:3970 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:3971 +#: ../../library/os.rst:3976 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:3979 +#: ../../library/os.rst:3984 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4237,7 +4245,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:3987 +#: ../../library/os.rst:3992 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4249,60 +4257,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:3997 +#: ../../library/os.rst:4002 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:4002 +#: ../../library/os.rst:4007 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:4006 +#: ../../library/os.rst:4011 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4009 +#: ../../library/os.rst:4014 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4012 +#: ../../library/os.rst:4017 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4021 +#: ../../library/os.rst:4026 msgid "Wraps the :c:func:`posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4023 +#: ../../library/os.rst:4028 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4025 +#: ../../library/os.rst:4030 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4028 +#: ../../library/os.rst:4033 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:4032 +#: ../../library/os.rst:4037 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4311,31 +4319,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4040 +#: ../../library/os.rst:4045 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4042 +#: ../../library/os.rst:4047 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4046 +#: ../../library/os.rst:4051 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4048 +#: ../../library/os.rst:4053 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4052 +#: ../../library/os.rst:4057 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4054 +#: ../../library/os.rst:4059 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4056 +#: ../../library/os.rst:4061 msgid "" "These tuples correspond to the C library :c:func:" "`posix_spawn_file_actions_addopen`, :c:func:" @@ -4344,7 +4352,7 @@ msgid "" "`posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4062 +#: ../../library/os.rst:4067 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -4353,7 +4361,7 @@ msgid "" "corresponds to the C library :c:data:`POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4068 +#: ../../library/os.rst:4073 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4364,7 +4372,7 @@ msgid "" "library :c:data:`POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4076 +#: ../../library/os.rst:4081 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:data:`POSIX_SPAWN_SETSID` or :c:data:" @@ -4372,7 +4380,7 @@ msgid "" "raised." msgstr "" -#: ../../library/os.rst:4081 +#: ../../library/os.rst:4086 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -4380,14 +4388,14 @@ msgid "" "`POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4086 +#: ../../library/os.rst:4091 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:data:" "`POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4090 +#: ../../library/os.rst:4095 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4403,77 +4411,77 @@ msgid "" "``path``, ``argv``, ``env``." msgstr "" -#: ../../library/os.rst:4107 +#: ../../library/os.rst:4112 msgid "Wraps the :c:func:`posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4109 +#: ../../library/os.rst:4114 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4117 +#: ../../library/os.rst:4122 #, fuzzy msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" -#: ../../library/os.rst:4119 +#: ../../library/os.rst:4124 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4125 +#: ../../library/os.rst:4130 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4130 +#: ../../library/os.rst:4135 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4131 +#: ../../library/os.rst:4136 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4133 +#: ../../library/os.rst:4138 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4135 +#: ../../library/os.rst:4140 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4139 +#: ../../library/os.rst:4144 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4144 +#: ../../library/os.rst:4149 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4148 +#: ../../library/os.rst:4153 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4164 +#: ../../library/os.rst:4169 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4166 +#: ../../library/os.rst:4171 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4481,7 +4489,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4171 +#: ../../library/os.rst:4176 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4490,13 +4498,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4177 +#: ../../library/os.rst:4182 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4180 +#: ../../library/os.rst:4185 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4508,7 +4516,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4189 +#: ../../library/os.rst:4194 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4521,7 +4529,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4199 +#: ../../library/os.rst:4204 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4533,7 +4541,7 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4208 +#: ../../library/os.rst:4213 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" @@ -4545,7 +4553,7 @@ msgid "" "``mode``, ``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:4221 +#: ../../library/os.rst:4226 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4553,7 +4561,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4233 +#: ../../library/os.rst:4238 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4561,7 +4569,7 @@ msgid "" "created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4243 +#: ../../library/os.rst:4248 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -4570,7 +4578,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4255 +#: ../../library/os.rst:4260 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -4580,11 +4588,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4266 +#: ../../library/os.rst:4271 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4268 +#: ../../library/os.rst:4273 msgid "" "When *operation* is not specified or ``'open'``, this acts like double-" "clicking the file in Windows Explorer, or giving the file name as an " @@ -4593,7 +4601,7 @@ msgid "" "associated." msgstr "" -#: ../../library/os.rst:4273 +#: ../../library/os.rst:4278 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -4601,28 +4609,28 @@ msgid "" "``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4278 +#: ../../library/os.rst:4283 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4282 +#: ../../library/os.rst:4287 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4286 +#: ../../library/os.rst:4291 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`ShellExecute` function." msgstr "" -#: ../../library/os.rst:4290 +#: ../../library/os.rst:4295 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -4633,7 +4641,7 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4298 +#: ../../library/os.rst:4303 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`ShellExecute` " "function is not resolved until this function is first called. If the " @@ -4652,13 +4660,13 @@ msgid "" "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." msgstr "" -#: ../../library/os.rst:4308 +#: ../../library/os.rst:4313 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4315 +#: ../../library/os.rst:4320 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -4669,13 +4677,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4323 +#: ../../library/os.rst:4328 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4326 +#: ../../library/os.rst:4331 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -4684,7 +4692,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4332 +#: ../../library/os.rst:4337 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -4692,7 +4700,7 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4337 +#: ../../library/os.rst:4342 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " @@ -4705,40 +4713,40 @@ msgid "" "``command``." msgstr "" -#: ../../library/os.rst:4348 +#: ../../library/os.rst:4353 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4351 +#: ../../library/os.rst:4356 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4352 +#: ../../library/os.rst:4357 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4353 +#: ../../library/os.rst:4358 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4354 +#: ../../library/os.rst:4359 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4355 +#: ../../library/os.rst:4360 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4357 +#: ../../library/os.rst:4362 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: ../../library/os.rst:4361 +#: ../../library/os.rst:4366 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -4748,7 +4756,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4375 +#: ../../library/os.rst:4380 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -4757,83 +4765,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4381 +#: ../../library/os.rst:4386 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4384 ../../library/os.rst:4456 +#: ../../library/os.rst:4389 ../../library/os.rst:4461 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4391 +#: ../../library/os.rst:4396 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4398 +#: ../../library/os.rst:4403 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4400 +#: ../../library/os.rst:4405 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4403 +#: ../../library/os.rst:4408 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4407 +#: ../../library/os.rst:4412 msgid "" "The return value is an object representing the data contained in the :c:type:" "`!siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4410 +#: ../../library/os.rst:4415 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4411 +#: ../../library/os.rst:4416 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4412 +#: ../../library/os.rst:4417 msgid ":attr:`!si_signo` (always :data:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4413 +#: ../../library/os.rst:4418 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4414 +#: ../../library/os.rst:4419 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4416 +#: ../../library/os.rst:4421 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4428 +#: ../../library/os.rst:4433 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4430 +#: ../../library/os.rst:4435 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -4842,7 +4850,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4435 +#: ../../library/os.rst:4440 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -4852,7 +4860,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4442 +#: ../../library/os.rst:4447 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -4861,7 +4869,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4448 +#: ../../library/os.rst:4453 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -4873,7 +4881,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4469 +#: ../../library/os.rst:4474 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -4882,13 +4890,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4476 ../../library/os.rst:4490 +#: ../../library/os.rst:4481 ../../library/os.rst:4495 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4484 +#: ../../library/os.rst:4489 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -4897,118 +4905,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4501 +#: ../../library/os.rst:4506 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4504 +#: ../../library/os.rst:4509 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4505 +#: ../../library/os.rst:4510 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4506 +#: ../../library/os.rst:4511 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4507 +#: ../../library/os.rst:4512 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4512 +#: ../../library/os.rst:4517 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4515 +#: ../../library/os.rst:4520 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4521 +#: ../../library/os.rst:4526 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4530 +#: ../../library/os.rst:4535 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4533 +#: ../../library/os.rst:4538 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4543 +#: ../../library/os.rst:4548 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4546 ../../library/os.rst:4578 +#: ../../library/os.rst:4551 ../../library/os.rst:4583 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4555 +#: ../../library/os.rst:4560 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4559 +#: ../../library/os.rst:4564 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4566 +#: ../../library/os.rst:4571 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4575 +#: ../../library/os.rst:4580 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4590 +#: ../../library/os.rst:4595 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4597 +#: ../../library/os.rst:4602 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4603 +#: ../../library/os.rst:4608 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4605 +#: ../../library/os.rst:4610 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4607 +#: ../../library/os.rst:4612 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4610 +#: ../../library/os.rst:4615 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -5016,15 +5024,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4614 +#: ../../library/os.rst:4619 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4616 +#: ../../library/os.rst:4621 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4618 +#: ../../library/os.rst:4623 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -5032,217 +5040,217 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4625 +#: ../../library/os.rst:4630 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4633 +#: ../../library/os.rst:4638 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4639 +#: ../../library/os.rst:4644 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4642 ../../library/os.rst:4708 +#: ../../library/os.rst:4647 ../../library/os.rst:4713 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4649 +#: ../../library/os.rst:4654 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :data:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4653 +#: ../../library/os.rst:4658 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4660 +#: ../../library/os.rst:4665 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4663 +#: ../../library/os.rst:4668 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:4671 +#: ../../library/os.rst:4676 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4679 +#: ../../library/os.rst:4684 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4688 +#: ../../library/os.rst:4693 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4690 +#: ../../library/os.rst:4695 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4697 +#: ../../library/os.rst:4702 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4699 +#: ../../library/os.rst:4704 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4706 +#: ../../library/os.rst:4711 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:4714 +#: ../../library/os.rst:4719 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:4716 +#: ../../library/os.rst:4721 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:4722 +#: ../../library/os.rst:4727 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:4727 +#: ../../library/os.rst:4732 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:4731 +#: ../../library/os.rst:4736 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:4736 +#: ../../library/os.rst:4741 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:4740 +#: ../../library/os.rst:4745 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:4744 +#: ../../library/os.rst:4749 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:4748 +#: ../../library/os.rst:4753 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:4752 +#: ../../library/os.rst:4757 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:4759 +#: ../../library/os.rst:4764 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:4763 +#: ../../library/os.rst:4768 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:4767 +#: ../../library/os.rst:4772 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:4772 +#: ../../library/os.rst:4777 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4778 +#: ../../library/os.rst:4783 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4784 +#: ../../library/os.rst:4789 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:4791 +#: ../../library/os.rst:4796 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:4798 +#: ../../library/os.rst:4803 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:4804 +#: ../../library/os.rst:4809 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:4810 +#: ../../library/os.rst:4815 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:4816 +#: ../../library/os.rst:4821 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:4821 +#: ../../library/os.rst:4826 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:4828 +#: ../../library/os.rst:4833 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:4835 +#: ../../library/os.rst:4840 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:4840 +#: ../../library/os.rst:4845 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -5253,13 +5261,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:4848 +#: ../../library/os.rst:4853 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:4851 +#: ../../library/os.rst:4856 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -5267,33 +5275,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:4861 +#: ../../library/os.rst:4866 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:4870 +#: ../../library/os.rst:4875 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:4872 +#: ../../library/os.rst:4877 msgid "" "This number is not equivalent to the number of CPUs the current process can " "use. The number of usable CPUs can be obtained with ``len(os." "sched_getaffinity(0))``" msgstr "" -#: ../../library/os.rst:4882 +#: ../../library/os.rst:4887 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:4891 +#: ../../library/os.rst:4896 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5302,44 +5310,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:4901 +#: ../../library/os.rst:4906 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:4907 +#: ../../library/os.rst:4912 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:4910 +#: ../../library/os.rst:4915 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:4913 +#: ../../library/os.rst:4918 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:4919 +#: ../../library/os.rst:4924 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:4927 +#: ../../library/os.rst:4932 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:4936 +#: ../../library/os.rst:4941 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5348,7 +5356,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4946 +#: ../../library/os.rst:4951 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5356,27 +5364,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4955 +#: ../../library/os.rst:4960 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4963 +#: ../../library/os.rst:4968 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4970 +#: ../../library/os.rst:4975 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:" "`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4977 +#: ../../library/os.rst:4982 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -5385,36 +5393,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:4986 +#: ../../library/os.rst:4991 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4997 +#: ../../library/os.rst:5002 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:5005 +#: ../../library/os.rst:5010 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5010 +#: ../../library/os.rst:5015 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5013 +#: ../../library/os.rst:5018 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5016 +#: ../../library/os.rst:5021 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5422,36 +5430,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5021 +#: ../../library/os.rst:5026 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:data:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5025 +#: ../../library/os.rst:5030 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5028 +#: ../../library/os.rst:5033 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5034 +#: ../../library/os.rst:5039 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5036 +#: ../../library/os.rst:5041 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:5040 +#: ../../library/os.rst:5045 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5461,63 +5469,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5047 +#: ../../library/os.rst:5052 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:5051 +#: ../../library/os.rst:5056 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5054 +#: ../../library/os.rst:5059 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:5058 +#: ../../library/os.rst:5063 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5062 +#: ../../library/os.rst:5067 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:5066 +#: ../../library/os.rst:5071 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:5072 +#: ../../library/os.rst:5077 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5078 +#: ../../library/os.rst:5083 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:5082 +#: ../../library/os.rst:5087 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:5089 +#: ../../library/os.rst:5094 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." From 6357fca3837db25781fa40a0904cffcdfedd559f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Mar 2023 00:38:57 +0000 Subject: [PATCH 040/130] sync with cpython cda1d52a --- library/re.po | 465 +++++++++++++++++++++++++------------------------- 1 file changed, 232 insertions(+), 233 deletions(-) diff --git a/library/re.po b/library/re.po index e894fbf633..82b0c16b44 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-27 00:34+0000\n" +"POT-Creation-Date: 2023-03-05 00:37+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -146,7 +146,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1526 +#: ../../library/re.rst:104 ../../library/re.rst:1530 msgid "``.``" msgstr "``.``" @@ -531,7 +531,7 @@ msgid "" "thus fail to match." msgstr "" -#: ../../library/re.rst:422 +#: ../../library/re.rst:423 msgid "``(?P...)``" msgstr "``(?P...)``" @@ -596,54 +596,56 @@ msgid "``\\g<1>``" msgstr "``\\g<1>``" #: ../../library/re.rst:421 -msgid "Group names containing non-ASCII characters in bytes patterns." +msgid "" +"Group *name* containing characters outside the ASCII range (``b'\\x00'``-" +"``b'\\x7f'``) in :class:`bytes` patterns." msgstr "" -#: ../../library/re.rst:428 +#: ../../library/re.rst:429 msgid "``(?P=name)``" msgstr "``(?P=name)``" -#: ../../library/re.rst:427 +#: ../../library/re.rst:428 msgid "" "A backreference to a named group; it matches whatever text was matched by " "the earlier group named *name*." msgstr "" -#: ../../library/re.rst:433 +#: ../../library/re.rst:434 msgid "``(?#...)``" msgstr "``(?#...)``" -#: ../../library/re.rst:433 +#: ../../library/re.rst:434 msgid "A comment; the contents of the parentheses are simply ignored." msgstr "" -#: ../../library/re.rst:440 +#: ../../library/re.rst:441 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../library/re.rst:438 +#: ../../library/re.rst:439 msgid "" "Matches if ``...`` matches next, but doesn't consume any of the string. " "This is called a :dfn:`lookahead assertion`. For example, ``Isaac (?" "=Asimov)`` will match ``'Isaac '`` only if it's followed by ``'Asimov'``." msgstr "" -#: ../../library/re.rst:447 +#: ../../library/re.rst:448 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../library/re.rst:445 +#: ../../library/re.rst:446 msgid "" "Matches if ``...`` doesn't match next. This is a :dfn:`negative lookahead " "assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only " "if it's *not* followed by ``'Asimov'``." msgstr "" -#: ../../library/re.rst:474 +#: ../../library/re.rst:475 msgid "``(?<=...)``" msgstr "``(?<=...)``" -#: ../../library/re.rst:452 +#: ../../library/re.rst:453 msgid "" "Matches if the current position in the string is preceded by a match for " "``...`` that ends at the current position. This is called a :dfn:`positive " @@ -657,19 +659,19 @@ msgid "" "func:`match` function:" msgstr "" -#: ../../library/re.rst:467 +#: ../../library/re.rst:468 msgid "This example looks for a word following a hyphen:" msgstr "" -#: ../../library/re.rst:473 +#: ../../library/re.rst:474 msgid "Added support for group references of fixed length." msgstr "" -#: ../../library/re.rst:483 +#: ../../library/re.rst:484 msgid "``(?'``." msgstr "" -#: ../../library/re.rst:496 -msgid "Group *id* containing anything except ASCII digits." +#: ../../library/re.rst:497 ../../library/re.rst:1020 +msgid "" +"Group *id* containing anything except ASCII digits. Group *name* containing " +"characters outside the ASCII range (``b'\\x00'``-``b'\\x7f'``) in :class:" +"`bytes` replacement strings." msgstr "" -#: ../../library/re.rst:500 +#: ../../library/re.rst:503 msgid "" "The special sequences consist of ``'\\'`` and a character from the list " "below. If the ordinary character is not an ASCII digit or an ASCII letter, " @@ -704,11 +709,11 @@ msgid "" "matches the character ``'$'``." msgstr "" -#: ../../library/re.rst:515 +#: ../../library/re.rst:518 msgid "``\\number``" msgstr "``\\number``" -#: ../../library/re.rst:508 +#: ../../library/re.rst:511 msgid "" "Matches the contents of the group of the same number. Groups are numbered " "starting from 1. For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 " @@ -720,19 +725,19 @@ msgid "" "escapes are treated as characters." msgstr "" -#: ../../library/re.rst:520 +#: ../../library/re.rst:523 msgid "``\\A``" msgstr "``\\A``" -#: ../../library/re.rst:520 +#: ../../library/re.rst:523 msgid "Matches only at the start of the string." msgstr "" -#: ../../library/re.rst:536 +#: ../../library/re.rst:539 msgid "``\\b``" msgstr "``\\b``" -#: ../../library/re.rst:525 +#: ../../library/re.rst:528 msgid "" "Matches the empty string, but only at the beginning or end of a word. A word " "is defined as a sequence of word characters. Note that formally, ``\\b`` is " @@ -742,7 +747,7 @@ msgid "" "baz'`` but not ``'foobar'`` or ``'foo3'``." msgstr "" -#: ../../library/re.rst:532 +#: ../../library/re.rst:535 msgid "" "By default Unicode alphanumerics are the ones used in Unicode patterns, but " "this can be changed by using the :const:`ASCII` flag. Word boundaries are " @@ -751,11 +756,11 @@ msgid "" "compatibility with Python's string literals." msgstr "" -#: ../../library/re.rst:547 +#: ../../library/re.rst:550 msgid "``\\B``" msgstr "``\\B``" -#: ../../library/re.rst:541 +#: ../../library/re.rst:544 msgid "" "Matches the empty string, but only when it is *not* at the beginning or end " "of a word. This means that ``r'py\\B'`` matches ``'python'``, ``'py3'``, " @@ -766,15 +771,15 @@ msgid "" "the :const:`LOCALE` flag is used." msgstr "" -#: ../../library/re.rst:559 +#: ../../library/re.rst:562 msgid "``\\d``" msgstr "``\\d``" -#: ../../library/re.rst:556 ../../library/re.rst:576 ../../library/re.rst:595 +#: ../../library/re.rst:559 ../../library/re.rst:579 ../../library/re.rst:598 msgid "For Unicode (str) patterns:" msgstr "" -#: ../../library/re.rst:553 +#: ../../library/re.rst:556 msgid "" "Matches any Unicode decimal digit (that is, any character in Unicode " "character category [Nd]). This includes ``[0-9]``, and also many other " @@ -782,30 +787,30 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:559 ../../library/re.rst:580 ../../library/re.rst:601 +#: ../../library/re.rst:562 ../../library/re.rst:583 ../../library/re.rst:604 msgid "For 8-bit (bytes) patterns:" msgstr "" -#: ../../library/re.rst:559 +#: ../../library/re.rst:562 msgid "Matches any decimal digit; this is equivalent to ``[0-9]``." msgstr "" -#: ../../library/re.rst:566 +#: ../../library/re.rst:569 msgid "``\\D``" msgstr "``\\D``" -#: ../../library/re.rst:564 +#: ../../library/re.rst:567 msgid "" "Matches any character which is not a decimal digit. This is the opposite of " "``\\d``. If the :const:`ASCII` flag is used this becomes the equivalent of " "``[^0-9]``." msgstr "" -#: ../../library/re.rst:580 +#: ../../library/re.rst:583 msgid "``\\s``" msgstr "``\\s``" -#: ../../library/re.rst:572 +#: ../../library/re.rst:575 msgid "" "Matches Unicode whitespace characters (which includes " "``[ \\t\\n\\r\\f\\v]``, and also many other characters, for example the non-" @@ -813,35 +818,35 @@ msgid "" "const:`ASCII` flag is used, only ``[ \\t\\n\\r\\f\\v]`` is matched." msgstr "" -#: ../../library/re.rst:579 +#: ../../library/re.rst:582 msgid "" "Matches characters considered whitespace in the ASCII character set; this is " "equivalent to ``[ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:587 +#: ../../library/re.rst:590 msgid "``\\S``" msgstr "``\\S``" -#: ../../library/re.rst:585 +#: ../../library/re.rst:588 msgid "" "Matches any character which is not a whitespace character. This is the " "opposite of ``\\s``. If the :const:`ASCII` flag is used this becomes the " "equivalent of ``[^ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:601 +#: ../../library/re.rst:604 msgid "``\\w``" msgstr "``\\w``" -#: ../../library/re.rst:593 +#: ../../library/re.rst:596 msgid "" "Matches Unicode word characters; this includes alphanumeric characters (as " "defined by :meth:`str.isalnum`) as well as the underscore (``_``). If the :" "const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched." msgstr "" -#: ../../library/re.rst:598 +#: ../../library/re.rst:601 msgid "" "Matches characters considered alphanumeric in the ASCII character set; this " "is equivalent to ``[a-zA-Z0-9_]``. If the :const:`LOCALE` flag is used, " @@ -849,11 +854,11 @@ msgid "" "underscore." msgstr "" -#: ../../library/re.rst:610 +#: ../../library/re.rst:613 msgid "``\\W``" msgstr "``\\W``" -#: ../../library/re.rst:606 +#: ../../library/re.rst:609 msgid "" "Matches any character which is not a word character. This is the opposite of " "``\\w``. If the :const:`ASCII` flag is used this becomes the equivalent of " @@ -861,34 +866,34 @@ msgid "" "which are neither alphanumeric in the current locale nor the underscore." msgstr "" -#: ../../library/re.rst:615 +#: ../../library/re.rst:618 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../library/re.rst:615 +#: ../../library/re.rst:618 msgid "Matches only at the end of the string." msgstr "" -#: ../../library/re.rst:631 +#: ../../library/re.rst:634 msgid "" "Most of the standard escapes supported by Python string literals are also " "accepted by the regular expression parser::" msgstr "" -#: ../../library/re.rst:638 +#: ../../library/re.rst:641 msgid "" "(Note that ``\\b`` is used to represent word boundaries, and means " "\"backspace\" only inside character classes.)" msgstr "" -#: ../../library/re.rst:641 +#: ../../library/re.rst:644 msgid "" "``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in " "Unicode patterns. In bytes patterns they are errors. Unknown escapes of " "ASCII letters are reserved for future use and treated as errors." msgstr "" -#: ../../library/re.rst:645 +#: ../../library/re.rst:648 msgid "" "Octal escapes are included in a limited form. If the first digit is a 0, or " "if there are three octal digits, it is considered an octal escape. " @@ -896,26 +901,26 @@ msgid "" "are always at most three digits in length." msgstr "" -#: ../../library/re.rst:650 +#: ../../library/re.rst:653 msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added." msgstr "" -#: ../../library/re.rst:653 +#: ../../library/re.rst:656 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors." msgstr "" -#: ../../library/re.rst:656 +#: ../../library/re.rst:659 msgid "" "The ``'\\N{name}'`` escape sequence has been added. As in string literals, " "it expands to the named Unicode character (e.g. ``'\\N{EM DASH}'``)." msgstr "" -#: ../../library/re.rst:664 +#: ../../library/re.rst:667 msgid "Module Contents" msgstr "模組內容" -#: ../../library/re.rst:666 +#: ../../library/re.rst:669 msgid "" "The module defines several functions, constants, and an exception. Some of " "the functions are simplified versions of the full featured methods for " @@ -923,26 +928,26 @@ msgid "" "compiled form." msgstr "" -#: ../../library/re.rst:673 +#: ../../library/re.rst:676 msgid "Flags" msgstr "" -#: ../../library/re.rst:675 +#: ../../library/re.rst:678 msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" -#: ../../library/re.rst:682 +#: ../../library/re.rst:685 msgid "" "An :class:`enum.IntFlag` class containing the regex options listed below." msgstr "" -#: ../../library/re.rst:684 +#: ../../library/re.rst:687 msgid "- added to ``__all__``" msgstr "" -#: ../../library/re.rst:689 +#: ../../library/re.rst:692 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " "``\\S`` perform ASCII-only matching instead of full Unicode matching. This " @@ -950,7 +955,7 @@ msgid "" "Corresponds to the inline flag ``(?a)``." msgstr "" -#: ../../library/re.rst:694 +#: ../../library/re.rst:697 msgid "" "Note that for backward compatibility, the :const:`re.U` flag still exists " "(as well as its synonym :const:`re.UNICODE` and its embedded counterpart ``(?" @@ -958,13 +963,13 @@ msgid "" "default for strings (and Unicode matching isn't allowed for bytes)." msgstr "" -#: ../../library/re.rst:703 +#: ../../library/re.rst:706 msgid "" "Display debug information about compiled expression. No corresponding inline " "flag." msgstr "" -#: ../../library/re.rst:710 +#: ../../library/re.rst:713 msgid "" "Perform case-insensitive matching; expressions like ``[A-Z]`` will also " "match lowercase letters. Full Unicode matching (such as ``Ü`` matching " @@ -974,7 +979,7 @@ msgid "" "flag ``(?i)``." msgstr "" -#: ../../library/re.rst:717 +#: ../../library/re.rst:720 msgid "" "Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in " "combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " @@ -985,7 +990,7 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:728 +#: ../../library/re.rst:731 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale. This flag can be used only with bytes " @@ -996,20 +1001,20 @@ msgid "" "locales/languages. Corresponds to the inline flag ``(?L)``." msgstr "" -#: ../../library/re.rst:737 +#: ../../library/re.rst:740 msgid "" ":const:`re.LOCALE` can be used only with bytes patterns and is not " "compatible with :const:`re.ASCII`." msgstr "" -#: ../../library/re.rst:741 +#: ../../library/re.rst:744 msgid "" "Compiled regular expression objects with the :const:`re.LOCALE` flag no " "longer depend on the locale at compile time. Only the locale at matching " "time affects the result of matching." msgstr "" -#: ../../library/re.rst:750 +#: ../../library/re.rst:753 msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -1020,7 +1025,7 @@ msgid "" "the end of the string. Corresponds to the inline flag ``(?m)``." msgstr "" -#: ../../library/re.rst:760 +#: ../../library/re.rst:763 msgid "" "Indicates no flag being applied, the value is ``0``. This flag may be used " "as a default value for a function keyword argument or as a base value that " @@ -1028,14 +1033,14 @@ msgid "" "value::" msgstr "" -#: ../../library/re.rst:773 +#: ../../library/re.rst:776 msgid "" "Make the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline. " "Corresponds to the inline flag ``(?s)``." msgstr "" -#: ../../library/re.rst:783 +#: ../../library/re.rst:786 msgid "" "This flag allows you to write regular expressions that look nicer and are " "more readable by allowing you to visually separate logical sections of the " @@ -1048,53 +1053,53 @@ msgid "" "ignored." msgstr "" -#: ../../library/re.rst:793 +#: ../../library/re.rst:796 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: ../../library/re.rst:801 +#: ../../library/re.rst:804 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: ../../library/re.rst:805 +#: ../../library/re.rst:808 msgid "Functions" msgstr "" -#: ../../library/re.rst:809 +#: ../../library/re.rst:812 msgid "" "Compile a regular expression pattern into a :ref:`regular expression object " "`, which can be used for matching using its :func:`~Pattern." "match`, :func:`~Pattern.search` and other methods, described below." msgstr "" -#: ../../library/re.rst:814 +#: ../../library/re.rst:817 msgid "" "The expression's behaviour can be modified by specifying a *flags* value. " "Values can be any of the following variables, combined using bitwise OR (the " "``|`` operator)." msgstr "" -#: ../../library/re.rst:818 +#: ../../library/re.rst:821 msgid "The sequence ::" msgstr "" -#: ../../library/re.rst:823 +#: ../../library/re.rst:826 msgid "is equivalent to ::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/re.rst:827 +#: ../../library/re.rst:830 msgid "" "but using :func:`re.compile` and saving the resulting regular expression " "object for reuse is more efficient when the expression will be used several " "times in a single program." msgstr "" -#: ../../library/re.rst:833 +#: ../../library/re.rst:836 msgid "" "The compiled versions of the most recent patterns passed to :func:`re." "compile` and the module-level matching functions are cached, so programs " @@ -1102,7 +1107,7 @@ msgid "" "compiling regular expressions." msgstr "" -#: ../../library/re.rst:841 +#: ../../library/re.rst:844 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :ref:" @@ -1111,7 +1116,7 @@ msgid "" "length match at some point in the string." msgstr "" -#: ../../library/re.rst:850 +#: ../../library/re.rst:853 msgid "" "If zero or more characters at the beginning of *string* match the regular " "expression *pattern*, return a corresponding :ref:`match object `. Return ``None`` if the " @@ -1139,7 +1144,7 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:874 +#: ../../library/re.rst:877 msgid "" "Split *string* by the occurrences of *pattern*. If capturing parentheses " "are used in *pattern*, then the text of all groups in the pattern are also " @@ -1148,42 +1153,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:889 +#: ../../library/re.rst:892 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" -#: ../../library/re.rst:896 +#: ../../library/re.rst:899 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:899 +#: ../../library/re.rst:902 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:909 ../../library/re.rst:999 ../../library/re.rst:1027 +#: ../../library/re.rst:912 ../../library/re.rst:1002 ../../library/re.rst:1031 msgid "Added the optional flags argument." msgstr "" -#: ../../library/re.rst:912 +#: ../../library/re.rst:915 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:918 +#: ../../library/re.rst:921 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " "strings or tuples. The *string* is scanned left-to-right, and matches are " "returned in the order found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:922 +#: ../../library/re.rst:925 msgid "" "The result depends on the number of capturing groups in the pattern. If " "there are no groups, return a list of strings matching the whole pattern. " @@ -1193,11 +1198,11 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:934 ../../library/re.rst:945 +#: ../../library/re.rst:937 ../../library/re.rst:948 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:940 +#: ../../library/re.rst:943 msgid "" "Return an :term:`iterator` yielding :ref:`match objects ` " "over all non-overlapping matches for the RE *pattern* in *string*. The " @@ -1205,7 +1210,7 @@ msgid "" "found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:951 +#: ../../library/re.rst:954 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1219,18 +1224,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:967 +#: ../../library/re.rst:970 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :ref:`match object ` argument, and returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:979 +#: ../../library/re.rst:982 msgid "The pattern may be a string or a :ref:`pattern object `." msgstr "" -#: ../../library/re.rst:981 +#: ../../library/re.rst:984 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1239,7 +1244,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:989 +#: ../../library/re.rst:992 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1252,59 +1257,53 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:1002 ../../library/re.rst:1030 -#: ../../library/re.rst:1264 +#: ../../library/re.rst:1005 ../../library/re.rst:1034 +#: ../../library/re.rst:1268 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:1005 +#: ../../library/re.rst:1008 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:1009 +#: ../../library/re.rst:1012 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:1013 +#: ../../library/re.rst:1016 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:1017 -msgid "" -"Group *id* containing anything except ASCII digits. Group names containing " -"non-ASCII characters in bytes replacement strings." -msgstr "" - -#: ../../library/re.rst:1024 +#: ../../library/re.rst:1028 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:1036 +#: ../../library/re.rst:1040 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: ../../library/re.rst:1051 +#: ../../library/re.rst:1055 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: ../../library/re.rst:1059 +#: ../../library/re.rst:1063 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:1062 +#: ../../library/re.rst:1066 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1312,15 +1311,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:1071 +#: ../../library/re.rst:1075 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:1075 +#: ../../library/re.rst:1079 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:1079 +#: ../../library/re.rst:1083 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " @@ -1329,41 +1328,41 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:1087 +#: ../../library/re.rst:1091 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1091 +#: ../../library/re.rst:1095 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1095 +#: ../../library/re.rst:1099 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1099 +#: ../../library/re.rst:1103 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1103 +#: ../../library/re.rst:1107 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1105 +#: ../../library/re.rst:1109 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1111 +#: ../../library/re.rst:1115 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1113 +#: ../../library/re.rst:1117 msgid "" "Compiled regular expression objects support the following methods and " "attributes:" msgstr "" -#: ../../library/re.rst:1118 +#: ../../library/re.rst:1122 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :ref:`match object " @@ -1372,7 +1371,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:1124 +#: ../../library/re.rst:1128 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1381,7 +1380,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1130 +#: ../../library/re.rst:1134 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1391,7 +1390,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1145 +#: ../../library/re.rst:1149 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :ref:`match object `. " @@ -1399,19 +1398,19 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:1150 ../../library/re.rst:1168 +#: ../../library/re.rst:1154 ../../library/re.rst:1172 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1158 +#: ../../library/re.rst:1162 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:1164 +#: ../../library/re.rst:1168 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :ref:`match object `. Return ``None`` if the " @@ -1419,76 +1418,76 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:1182 +#: ../../library/re.rst:1186 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1187 +#: ../../library/re.rst:1191 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1194 +#: ../../library/re.rst:1198 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1201 +#: ../../library/re.rst:1205 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1206 +#: ../../library/re.rst:1210 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1211 +#: ../../library/re.rst:1215 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :data:`UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1218 +#: ../../library/re.rst:1222 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1223 +#: ../../library/re.rst:1227 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: ../../library/re.rst:1230 +#: ../../library/re.rst:1234 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1233 +#: ../../library/re.rst:1237 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1241 +#: ../../library/re.rst:1245 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1243 +#: ../../library/re.rst:1247 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: ../../library/re.rst:1252 +#: ../../library/re.rst:1256 msgid "Match objects support the following methods and attributes:" msgstr "" -#: ../../library/re.rst:1257 +#: ../../library/re.rst:1261 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1497,7 +1496,7 @@ msgid "" "``\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1269 +#: ../../library/re.rst:1273 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1512,7 +1511,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1291 +#: ../../library/re.rst:1295 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1520,57 +1519,57 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1296 +#: ../../library/re.rst:1300 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1304 +#: ../../library/re.rst:1308 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1311 +#: ../../library/re.rst:1315 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1320 +#: ../../library/re.rst:1324 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1331 +#: ../../library/re.rst:1335 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1344 +#: ../../library/re.rst:1348 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1348 ../../library/re.rst:1573 +#: ../../library/re.rst:1352 ../../library/re.rst:1577 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1354 +#: ../../library/re.rst:1358 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1367 +#: ../../library/re.rst:1371 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1379 +#: ../../library/re.rst:1383 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1579,7 +1578,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1387 +#: ../../library/re.rst:1391 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1587,32 +1586,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1392 +#: ../../library/re.rst:1396 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1402 +#: ../../library/re.rst:1406 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1409 +#: ../../library/re.rst:1413 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1416 +#: ../../library/re.rst:1420 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1423 +#: ../../library/re.rst:1427 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1621,43 +1620,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1432 +#: ../../library/re.rst:1436 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1438 +#: ../../library/re.rst:1442 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1444 +#: ../../library/re.rst:1448 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1447 +#: ../../library/re.rst:1451 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1455 +#: ../../library/re.rst:1459 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1459 +#: ../../library/re.rst:1463 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1461 +#: ../../library/re.rst:1465 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1469 +#: ../../library/re.rst:1473 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1665,28 +1664,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1474 +#: ../../library/re.rst:1478 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1484 +#: ../../library/re.rst:1488 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1494 +#: ../../library/re.rst:1498 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1513 +#: ../../library/re.rst:1517 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1517 +#: ../../library/re.rst:1521 msgid "" "Python does not currently have an equivalent to :c:func:`scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -1695,124 +1694,124 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1524 +#: ../../library/re.rst:1528 msgid ":c:func:`scanf` Token" msgstr "" -#: ../../library/re.rst:1524 +#: ../../library/re.rst:1528 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1526 +#: ../../library/re.rst:1530 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1528 +#: ../../library/re.rst:1532 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1528 +#: ../../library/re.rst:1532 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1530 +#: ../../library/re.rst:1534 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1530 +#: ../../library/re.rst:1534 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1536 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1536 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1538 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1538 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1540 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1540 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1538 +#: ../../library/re.rst:1542 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1538 +#: ../../library/re.rst:1542 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1540 +#: ../../library/re.rst:1544 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1540 +#: ../../library/re.rst:1544 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1542 +#: ../../library/re.rst:1546 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1542 +#: ../../library/re.rst:1546 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1545 +#: ../../library/re.rst:1549 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1549 +#: ../../library/re.rst:1553 msgid "you would use a :c:func:`scanf` format like ::" msgstr "" -#: ../../library/re.rst:1553 +#: ../../library/re.rst:1557 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1561 +#: ../../library/re.rst:1565 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1565 +#: ../../library/re.rst:1569 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1567 +#: ../../library/re.rst:1571 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1568 +#: ../../library/re.rst:1572 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1570 +#: ../../library/re.rst:1574 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1582 +#: ../../library/re.rst:1586 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1590 +#: ../../library/re.rst:1594 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1820,11 +1819,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1600 +#: ../../library/re.rst:1604 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1602 +#: ../../library/re.rst:1606 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1832,37 +1831,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1607 +#: ../../library/re.rst:1611 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1620 +#: ../../library/re.rst:1624 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1633 +#: ../../library/re.rst:1637 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1646 +#: ../../library/re.rst:1650 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1661 +#: ../../library/re.rst:1665 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1663 +#: ../../library/re.rst:1667 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1870,11 +1869,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1680 +#: ../../library/re.rst:1684 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1682 +#: ../../library/re.rst:1686 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1882,11 +1881,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1693 +#: ../../library/re.rst:1697 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1695 +#: ../../library/re.rst:1699 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :ref:`match objects " @@ -1895,11 +1894,11 @@ msgid "" "text, they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1709 +#: ../../library/re.rst:1713 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1711 +#: ../../library/re.rst:1715 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1907,7 +1906,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1721 +#: ../../library/re.rst:1725 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1915,29 +1914,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1733 +#: ../../library/re.rst:1737 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1735 +#: ../../library/re.rst:1739 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1739 +#: ../../library/re.rst:1743 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1795 +#: ../../library/re.rst:1799 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1818 +#: ../../library/re.rst:1822 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " From 4d5d87e00088f06e20e61a705c785586dca8fc0e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 6 Mar 2023 00:36:13 +0000 Subject: [PATCH 041/130] sync with cpython a7ec32e7 --- library/stdtypes.po | 1883 ++++++++++++++++++++++--------------------- 1 file changed, 944 insertions(+), 939 deletions(-) diff --git a/library/stdtypes.po b/library/stdtypes.po index 0b8ee41f65..5a494e82e1 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-22 00:30+0000\n" +"POT-Creation-Date: 2023-03-06 00:34+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -122,21 +122,21 @@ msgstr "" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:143 #: ../../library/stdtypes.rst:275 ../../library/stdtypes.rst:364 -#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:921 -#: ../../library/stdtypes.rst:1126 +#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:923 +#: ../../library/stdtypes.rst:1128 msgid "Operation" msgstr "" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 #: ../../library/stdtypes.rst:364 ../../library/stdtypes.rst:414 -#: ../../library/stdtypes.rst:921 ../../library/stdtypes.rst:1126 +#: ../../library/stdtypes.rst:923 ../../library/stdtypes.rst:1128 msgid "Result" msgstr "結果" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 -#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:921 -#: ../../library/stdtypes.rst:1126 ../../library/stdtypes.rst:2371 -#: ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:923 +#: ../../library/stdtypes.rst:1128 ../../library/stdtypes.rst:2373 +#: ../../library/stdtypes.rst:3591 msgid "Notes" msgstr "註解" @@ -149,9 +149,9 @@ msgid "if *x* is true, then *x*, else *y*" msgstr "" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 -#: ../../library/stdtypes.rst:923 ../../library/stdtypes.rst:926 -#: ../../library/stdtypes.rst:1137 ../../library/stdtypes.rst:2377 -#: ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:925 ../../library/stdtypes.rst:928 +#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:3597 msgid "\\(1)" msgstr "\\(1)" @@ -164,9 +164,9 @@ msgid "if *x* is false, then *x*, else *y*" msgstr "" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:288 -#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1165 -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:2383 -#: ../../library/stdtypes.rst:3599 ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1167 +#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:2385 +#: ../../library/stdtypes.rst:3601 ../../library/stdtypes.rst:3603 msgid "\\(2)" msgstr "\\(2)" @@ -178,19 +178,19 @@ msgstr "``not x``" msgid "if *x* is false, then ``True``, else ``False``" msgstr "" -#: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:935 -#: ../../library/stdtypes.rst:1168 ../../library/stdtypes.rst:2385 -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:2389 -#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:3603 -#: ../../library/stdtypes.rst:3605 ../../library/stdtypes.rst:3607 -#: ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:1170 ../../library/stdtypes.rst:2387 +#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:2391 +#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:3607 ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:3611 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:102 ../../library/stdtypes.rst:319 -#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:972 -#: ../../library/stdtypes.rst:1176 ../../library/stdtypes.rst:2417 -#: ../../library/stdtypes.rst:3639 +#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:974 +#: ../../library/stdtypes.rst:1178 ../../library/stdtypes.rst:2419 +#: ../../library/stdtypes.rst:3641 msgid "Notes:" msgstr "註解:" @@ -229,9 +229,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "" -#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2348 -#: ../../library/stdtypes.rst:2371 ../../library/stdtypes.rst:3566 -#: ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2350 +#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3568 +#: ../../library/stdtypes.rst:3591 msgid "Meaning" msgstr "" @@ -513,8 +513,8 @@ msgid "" "zero." msgstr "" -#: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1158 -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3626 +#: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1160 +#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3628 msgid "\\(6)" msgstr "\\(6)" @@ -551,10 +551,10 @@ msgid "*x* to the power *y*" msgstr "" #: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:312 -#: ../../library/stdtypes.rst:1147 ../../library/stdtypes.rst:1150 -#: ../../library/stdtypes.rst:2404 ../../library/stdtypes.rst:2407 -#: ../../library/stdtypes.rst:2410 ../../library/stdtypes.rst:3622 -#: ../../library/stdtypes.rst:3629 +#: ../../library/stdtypes.rst:1149 ../../library/stdtypes.rst:1152 +#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:2409 +#: ../../library/stdtypes.rst:2412 ../../library/stdtypes.rst:3624 +#: ../../library/stdtypes.rst:3631 msgid "\\(5)" msgstr "\\(5)" @@ -689,9 +689,9 @@ msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "" #: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:419 -#: ../../library/stdtypes.rst:422 ../../library/stdtypes.rst:1171 -#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:2397 -#: ../../library/stdtypes.rst:3611 ../../library/stdtypes.rst:3615 +#: ../../library/stdtypes.rst:422 ../../library/stdtypes.rst:1173 +#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:2399 +#: ../../library/stdtypes.rst:3613 ../../library/stdtypes.rst:3617 msgid "\\(4)" msgstr "\\(4)" @@ -792,7 +792,7 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:473 ../../library/stdtypes.rst:496 -#: ../../library/stdtypes.rst:539 ../../library/stdtypes.rst:583 +#: ../../library/stdtypes.rst:541 ../../library/stdtypes.rst:585 msgid "Equivalent to::" msgstr "" "等價於:\n" @@ -835,25 +835,30 @@ msgstr "" #: ../../library/stdtypes.rst:532 msgid "" "The default values can be used to conveniently turn an integer into a single " -"byte object. However, when using the default arguments, don't try to " -"convert a value greater than 255 or you'll get an :exc:`OverflowError`::" +"byte object::" +msgstr "" + +#: ../../library/stdtypes.rst:538 +msgid "" +"However, when using the default arguments, don't try to convert a value " +"greater than 255 or you'll get an :exc:`OverflowError`." msgstr "" -#: ../../library/stdtypes.rst:552 +#: ../../library/stdtypes.rst:554 msgid "Added default argument values for ``length`` and ``byteorder``." msgstr "" -#: ../../library/stdtypes.rst:557 +#: ../../library/stdtypes.rst:559 msgid "Return the integer represented by the given array of bytes." msgstr "" -#: ../../library/stdtypes.rst:570 +#: ../../library/stdtypes.rst:572 msgid "" "The argument *bytes* must either be a :term:`bytes-like object` or an " "iterable producing bytes." msgstr "" -#: ../../library/stdtypes.rst:573 +#: ../../library/stdtypes.rst:575 msgid "" "The *byteorder* argument determines the byte order used to represent the " "integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " @@ -863,17 +868,17 @@ msgid "" "byteorder` as the byte order value." msgstr "" -#: ../../library/stdtypes.rst:580 +#: ../../library/stdtypes.rst:582 msgid "" "The *signed* argument indicates whether two's complement is used to " "represent the integer." msgstr "" -#: ../../library/stdtypes.rst:600 +#: ../../library/stdtypes.rst:602 msgid "Added default argument value for ``byteorder``." msgstr "" -#: ../../library/stdtypes.rst:605 +#: ../../library/stdtypes.rst:607 msgid "" "Return a pair of integers whose ratio is exactly equal to the original " "integer and with a positive denominator. The integer ratio of integers " @@ -881,30 +886,30 @@ msgid "" "denominator." msgstr "" -#: ../../library/stdtypes.rst:613 +#: ../../library/stdtypes.rst:615 msgid "Additional Methods on Float" msgstr "" -#: ../../library/stdtypes.rst:615 +#: ../../library/stdtypes.rst:617 msgid "" "The float type implements the :class:`numbers.Real` :term:`abstract base " "class`. float also has the following additional methods." msgstr "" -#: ../../library/stdtypes.rst:620 +#: ../../library/stdtypes.rst:622 msgid "" "Return a pair of integers whose ratio is exactly equal to the original float " "and with a positive denominator. Raises :exc:`OverflowError` on infinities " "and a :exc:`ValueError` on NaNs." msgstr "" -#: ../../library/stdtypes.rst:627 +#: ../../library/stdtypes.rst:629 msgid "" "Return ``True`` if the float instance is finite with integral value, and " "``False`` otherwise::" msgstr "" -#: ../../library/stdtypes.rst:635 +#: ../../library/stdtypes.rst:637 msgid "" "Two methods support conversion to and from hexadecimal strings. Since " "Python's floats are stored internally as binary numbers, converting a float " @@ -914,30 +919,30 @@ msgid "" "numerical work." msgstr "" -#: ../../library/stdtypes.rst:646 +#: ../../library/stdtypes.rst:648 msgid "" "Return a representation of a floating-point number as a hexadecimal string. " "For finite floating-point numbers, this representation will always include a " "leading ``0x`` and a trailing ``p`` and exponent." msgstr "" -#: ../../library/stdtypes.rst:654 +#: ../../library/stdtypes.rst:656 msgid "" "Class method to return the float represented by a hexadecimal string *s*. " "The string *s* may have leading and trailing whitespace." msgstr "" -#: ../../library/stdtypes.rst:659 +#: ../../library/stdtypes.rst:661 msgid "" "Note that :meth:`float.hex` is an instance method, while :meth:`float." "fromhex` is a class method." msgstr "" -#: ../../library/stdtypes.rst:662 +#: ../../library/stdtypes.rst:664 msgid "A hexadecimal string takes the form::" msgstr "" -#: ../../library/stdtypes.rst:666 +#: ../../library/stdtypes.rst:668 msgid "" "where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and " "``fraction`` are strings of hexadecimal digits, and ``exponent`` is a " @@ -951,7 +956,7 @@ msgid "" "by :meth:`float.fromhex`." msgstr "" -#: ../../library/stdtypes.rst:679 +#: ../../library/stdtypes.rst:681 msgid "" "Note that the exponent is written in decimal rather than hexadecimal, and " "that it gives the power of 2 by which to multiply the coefficient. For " @@ -959,17 +964,17 @@ msgid "" "number ``(3 + 10./16 + 7./16**2) * 2.0**10``, or ``3740.0``::" msgstr "" -#: ../../library/stdtypes.rst:689 +#: ../../library/stdtypes.rst:691 msgid "" "Applying the reverse conversion to ``3740.0`` gives a different hexadecimal " "string representing the same number::" msgstr "" -#: ../../library/stdtypes.rst:699 +#: ../../library/stdtypes.rst:701 msgid "Hashing of numeric types" msgstr "" -#: ../../library/stdtypes.rst:701 +#: ../../library/stdtypes.rst:703 msgid "" "For numbers ``x`` and ``y``, possibly of different types, it's a requirement " "that ``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`~object." @@ -985,24 +990,24 @@ msgid "" "of :data:`sys.hash_info`." msgstr "" -#: ../../library/stdtypes.rst:716 +#: ../../library/stdtypes.rst:718 msgid "" "Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C " "longs and ``P = 2**61 - 1`` on machines with 64-bit C longs." msgstr "" -#: ../../library/stdtypes.rst:719 +#: ../../library/stdtypes.rst:721 msgid "Here are the rules in detail:" msgstr "" -#: ../../library/stdtypes.rst:721 +#: ../../library/stdtypes.rst:723 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible " "by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, " "P)`` gives the inverse of ``n`` modulo ``P``." msgstr "" -#: ../../library/stdtypes.rst:725 +#: ../../library/stdtypes.rst:727 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is divisible by " "``P`` (but ``m`` is not) then ``n`` has no inverse modulo ``P`` and the rule " @@ -1010,20 +1015,20 @@ msgid "" "value ``sys.hash_info.inf``." msgstr "" -#: ../../library/stdtypes.rst:730 +#: ../../library/stdtypes.rst:732 msgid "" "If ``x = m / n`` is a negative rational number define ``hash(x)`` as ``-" "hash(-x)``. If the resulting hash is ``-1``, replace it with ``-2``." msgstr "" -#: ../../library/stdtypes.rst:734 +#: ../../library/stdtypes.rst:736 msgid "" "The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are " "used as hash values for positive infinity or negative infinity " "(respectively)." msgstr "" -#: ../../library/stdtypes.rst:738 +#: ../../library/stdtypes.rst:740 msgid "" "For a :class:`complex` number ``z``, the hash values of the real and " "imaginary parts are combined by computing ``hash(z.real) + sys.hash_info." @@ -1032,18 +1037,18 @@ msgid "" "1))``. Again, if the result is ``-1``, it's replaced with ``-2``." msgstr "" -#: ../../library/stdtypes.rst:746 +#: ../../library/stdtypes.rst:748 msgid "" "To clarify the above rules, here's some example Python code, equivalent to " "the built-in hash, for computing the hash of a rational number, :class:" "`float`, or :class:`complex`::" msgstr "" -#: ../../library/stdtypes.rst:801 +#: ../../library/stdtypes.rst:803 msgid "Iterator Types" msgstr "" -#: ../../library/stdtypes.rst:809 +#: ../../library/stdtypes.rst:811 msgid "" "Python supports a concept of iteration over containers. This is implemented " "using two distinct methods; these are used to allow user-defined classes to " @@ -1051,13 +1056,13 @@ msgid "" "support the iteration methods." msgstr "" -#: ../../library/stdtypes.rst:814 +#: ../../library/stdtypes.rst:816 msgid "" "One method needs to be defined for container objects to provide :term:" "`iterable` support:" msgstr "" -#: ../../library/stdtypes.rst:821 +#: ../../library/stdtypes.rst:823 msgid "" "Return an :term:`iterator` object. The object is required to support the " "iterator protocol described below. If a container supports different types " @@ -1069,13 +1074,13 @@ msgid "" "in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:830 +#: ../../library/stdtypes.rst:832 msgid "" "The iterator objects themselves are required to support the following two " "methods, which together form the :dfn:`iterator protocol`:" msgstr "" -#: ../../library/stdtypes.rst:836 +#: ../../library/stdtypes.rst:838 msgid "" "Return the :term:`iterator` object itself. This is required to allow both " "containers and iterators to be used with the :keyword:`for` and :keyword:" @@ -1083,7 +1088,7 @@ msgid "" "tp_iter` slot of the type structure for Python objects in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:845 +#: ../../library/stdtypes.rst:847 msgid "" "Return the next item from the :term:`iterator`. If there are no further " "items, raise the :exc:`StopIteration` exception. This method corresponds to " @@ -1091,7 +1096,7 @@ msgid "" "Python objects in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:850 +#: ../../library/stdtypes.rst:852 msgid "" "Python defines several iterator objects to support iteration over general " "and specific sequence types, dictionaries, and other more specialized " @@ -1099,18 +1104,18 @@ msgid "" "the iterator protocol." msgstr "" -#: ../../library/stdtypes.rst:855 +#: ../../library/stdtypes.rst:857 msgid "" "Once an iterator's :meth:`~iterator.__next__` method raises :exc:" "`StopIteration`, it must continue to do so on subsequent calls. " "Implementations that do not obey this property are deemed broken." msgstr "" -#: ../../library/stdtypes.rst:863 +#: ../../library/stdtypes.rst:865 msgid "Generator Types" msgstr "" -#: ../../library/stdtypes.rst:865 +#: ../../library/stdtypes.rst:867 msgid "" "Python's :term:`generator`\\s provide a convenient way to implement the " "iterator protocol. If a container object's :meth:`__iter__` method is " @@ -1120,11 +1125,11 @@ msgid "" "found in :ref:`the documentation for the yield expression `." msgstr "" -#: ../../library/stdtypes.rst:877 +#: ../../library/stdtypes.rst:879 msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`" msgstr "" -#: ../../library/stdtypes.rst:879 +#: ../../library/stdtypes.rst:881 msgid "" "There are three basic sequence types: lists, tuples, and range objects. " "Additional sequence types tailored for processing of :ref:`binary data " @@ -1132,11 +1137,11 @@ msgid "" "sections." msgstr "" -#: ../../library/stdtypes.rst:888 +#: ../../library/stdtypes.rst:890 msgid "Common Sequence Operations" msgstr "" -#: ../../library/stdtypes.rst:892 +#: ../../library/stdtypes.rst:894 msgid "" "The operations in the following table are supported by most sequence types, " "both mutable and immutable. The :class:`collections.abc.Sequence` ABC is " @@ -1144,7 +1149,7 @@ msgid "" "sequence types." msgstr "" -#: ../../library/stdtypes.rst:897 +#: ../../library/stdtypes.rst:899 msgid "" "This table lists the sequence operations sorted in ascending priority. In " "the table, *s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* " @@ -1152,7 +1157,7 @@ msgid "" "restrictions imposed by *s*." msgstr "" -#: ../../library/stdtypes.rst:902 +#: ../../library/stdtypes.rst:904 msgid "" "The ``in`` and ``not in`` operations have the same priorities as the " "comparison operations. The ``+`` (concatenation) and ``*`` (repetition) " @@ -1160,125 +1165,125 @@ msgid "" "[3]_" msgstr "" -#: ../../library/stdtypes.rst:923 +#: ../../library/stdtypes.rst:925 msgid "``x in s``" msgstr "``x in s``" -#: ../../library/stdtypes.rst:923 +#: ../../library/stdtypes.rst:925 msgid "``True`` if an item of *s* is equal to *x*, else ``False``" msgstr "" -#: ../../library/stdtypes.rst:926 +#: ../../library/stdtypes.rst:928 msgid "``x not in s``" msgstr "``x not in s``" -#: ../../library/stdtypes.rst:926 +#: ../../library/stdtypes.rst:928 msgid "``False`` if an item of *s* is equal to *x*, else ``True``" msgstr "" -#: ../../library/stdtypes.rst:929 +#: ../../library/stdtypes.rst:931 msgid "``s + t``" msgstr "``s + t``" -#: ../../library/stdtypes.rst:929 +#: ../../library/stdtypes.rst:931 msgid "the concatenation of *s* and *t*" msgstr "" -#: ../../library/stdtypes.rst:929 +#: ../../library/stdtypes.rst:931 msgid "(6)(7)" msgstr "(6)(7)" -#: ../../library/stdtypes.rst:932 +#: ../../library/stdtypes.rst:934 msgid "``s * n`` or ``n * s``" msgstr "``s * n`` 或 ``n * s``" -#: ../../library/stdtypes.rst:932 +#: ../../library/stdtypes.rst:934 msgid "equivalent to adding *s* to itself *n* times" msgstr "" -#: ../../library/stdtypes.rst:932 +#: ../../library/stdtypes.rst:934 msgid "(2)(7)" msgstr "(2)(7)" -#: ../../library/stdtypes.rst:935 +#: ../../library/stdtypes.rst:937 msgid "``s[i]``" msgstr "``s[i]``" -#: ../../library/stdtypes.rst:935 +#: ../../library/stdtypes.rst:937 msgid "*i*\\ th item of *s*, origin 0" msgstr "" -#: ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:939 msgid "``s[i:j]``" msgstr "``s[i:j]``" -#: ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:939 msgid "slice of *s* from *i* to *j*" msgstr "" -#: ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:939 msgid "(3)(4)" msgstr "(3)(4)" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:941 msgid "``s[i:j:k]``" msgstr "``s[i:j:k]``" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:941 msgid "slice of *s* from *i* to *j* with step *k*" msgstr "" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:941 msgid "(3)(5)" msgstr "(3)(5)" -#: ../../library/stdtypes.rst:942 +#: ../../library/stdtypes.rst:944 msgid "``len(s)``" msgstr "``len(s)``" -#: ../../library/stdtypes.rst:942 +#: ../../library/stdtypes.rst:944 msgid "length of *s*" msgstr "" -#: ../../library/stdtypes.rst:944 +#: ../../library/stdtypes.rst:946 msgid "``min(s)``" msgstr "``min(s)``" -#: ../../library/stdtypes.rst:944 +#: ../../library/stdtypes.rst:946 msgid "smallest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:948 msgid "``max(s)``" msgstr "``max(s)``" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:948 msgid "largest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:948 +#: ../../library/stdtypes.rst:950 msgid "``s.index(x[, i[, j]])``" msgstr "``s.index(x[, i[, j]])``" -#: ../../library/stdtypes.rst:948 +#: ../../library/stdtypes.rst:950 msgid "" "index of the first occurrence of *x* in *s* (at or after index *i* and " "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:948 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:3599 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:952 +#: ../../library/stdtypes.rst:954 msgid "``s.count(x)``" msgstr "``s.count(x)``" -#: ../../library/stdtypes.rst:952 +#: ../../library/stdtypes.rst:954 msgid "total number of occurrences of *x* in *s*" msgstr "" -#: ../../library/stdtypes.rst:956 +#: ../../library/stdtypes.rst:958 msgid "" "Sequences of the same type also support comparisons. In particular, tuples " "and lists are compared lexicographically by comparing corresponding " @@ -1287,7 +1292,7 @@ msgid "" "(For full details see :ref:`comparisons` in the language reference.)" msgstr "" -#: ../../library/stdtypes.rst:966 +#: ../../library/stdtypes.rst:968 msgid "" "Forward and reversed iterators over mutable sequences access values using an " "index. That index will continue to march forward (or backward) even if the " @@ -1296,7 +1301,7 @@ msgid "" "drops below zero)." msgstr "" -#: ../../library/stdtypes.rst:975 +#: ../../library/stdtypes.rst:977 msgid "" "While the ``in`` and ``not in`` operations are used only for simple " "containment testing in the general case, some specialised sequences (such " @@ -1304,7 +1309,7 @@ msgid "" "subsequence testing::" msgstr "" -#: ../../library/stdtypes.rst:984 +#: ../../library/stdtypes.rst:986 msgid "" "Values of *n* less than ``0`` are treated as ``0`` (which yields an empty " "sequence of the same type as *s*). Note that items in the sequence *s* are " @@ -1312,7 +1317,7 @@ msgid "" "Python programmers; consider::" msgstr "" -#: ../../library/stdtypes.rst:996 +#: ../../library/stdtypes.rst:998 msgid "" "What has happened is that ``[[]]`` is a one-element list containing an empty " "list, so all three elements of ``[[]] * 3`` are references to this single " @@ -1320,20 +1325,20 @@ msgid "" "list. You can create a list of different lists this way::" msgstr "" -#: ../../library/stdtypes.rst:1008 +#: ../../library/stdtypes.rst:1010 msgid "" "Further explanation is available in the FAQ entry :ref:`faq-multidimensional-" "list`." msgstr "" -#: ../../library/stdtypes.rst:1012 +#: ../../library/stdtypes.rst:1014 msgid "" "If *i* or *j* is negative, the index is relative to the end of sequence *s*: " "``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is " "still ``0``." msgstr "" -#: ../../library/stdtypes.rst:1017 +#: ../../library/stdtypes.rst:1019 msgid "" "The slice of *s* from *i* to *j* is defined as the sequence of items with " "index *k* such that ``i <= k < j``. If *i* or *j* is greater than " @@ -1342,7 +1347,7 @@ msgid "" "to *j*, the slice is empty." msgstr "" -#: ../../library/stdtypes.rst:1024 +#: ../../library/stdtypes.rst:1026 msgid "" "The slice of *s* from *i* to *j* with step *k* is defined as the sequence of " "items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other " @@ -1355,7 +1360,7 @@ msgid "" "``None``, it is treated like ``1``." msgstr "" -#: ../../library/stdtypes.rst:1035 +#: ../../library/stdtypes.rst:1037 msgid "" "Concatenating immutable sequences always results in a new object. This " "means that building up a sequence by repeated concatenation will have a " @@ -1363,14 +1368,14 @@ msgid "" "runtime cost, you must switch to one of the alternatives below:" msgstr "" -#: ../../library/stdtypes.rst:1040 +#: ../../library/stdtypes.rst:1042 msgid "" "if concatenating :class:`str` objects, you can build a list and use :meth:" "`str.join` at the end or else write to an :class:`io.StringIO` instance and " "retrieve its value when complete" msgstr "" -#: ../../library/stdtypes.rst:1044 +#: ../../library/stdtypes.rst:1046 msgid "" "if concatenating :class:`bytes` objects, you can similarly use :meth:`bytes." "join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :" @@ -1378,22 +1383,22 @@ msgid "" "an efficient overallocation mechanism" msgstr "" -#: ../../library/stdtypes.rst:1049 +#: ../../library/stdtypes.rst:1051 msgid "if concatenating :class:`tuple` objects, extend a :class:`list` instead" msgstr "" -#: ../../library/stdtypes.rst:1051 +#: ../../library/stdtypes.rst:1053 msgid "for other types, investigate the relevant class documentation" msgstr "" -#: ../../library/stdtypes.rst:1055 +#: ../../library/stdtypes.rst:1057 msgid "" "Some sequence types (such as :class:`range`) only support item sequences " "that follow specific patterns, and hence don't support sequence " "concatenation or repetition." msgstr "" -#: ../../library/stdtypes.rst:1060 +#: ../../library/stdtypes.rst:1062 msgid "" "``index`` raises :exc:`ValueError` when *x* is not found in *s*. Not all " "implementations support passing the additional arguments *i* and *j*. These " @@ -1403,42 +1408,42 @@ msgid "" "start of the sequence rather than the start of the slice." msgstr "" -#: ../../library/stdtypes.rst:1071 +#: ../../library/stdtypes.rst:1073 msgid "Immutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1078 +#: ../../library/stdtypes.rst:1080 msgid "" "The only operation that immutable sequence types generally implement that is " "not also implemented by mutable sequence types is support for the :func:" "`hash` built-in." msgstr "" -#: ../../library/stdtypes.rst:1082 +#: ../../library/stdtypes.rst:1084 msgid "" "This support allows immutable sequences, such as :class:`tuple` instances, " "to be used as :class:`dict` keys and stored in :class:`set` and :class:" "`frozenset` instances." msgstr "" -#: ../../library/stdtypes.rst:1086 +#: ../../library/stdtypes.rst:1088 msgid "" "Attempting to hash an immutable sequence that contains unhashable values " "will result in :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:1093 +#: ../../library/stdtypes.rst:1095 msgid "Mutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1100 +#: ../../library/stdtypes.rst:1102 msgid "" "The operations in the following table are defined on mutable sequence types. " "The :class:`collections.abc.MutableSequence` ABC is provided to make it " "easier to correctly implement these operations on custom sequence types." msgstr "" -#: ../../library/stdtypes.rst:1104 +#: ../../library/stdtypes.rst:1106 msgid "" "In the table *s* is an instance of a mutable sequence type, *t* is any " "iterable object and *x* is an arbitrary object that meets any type and value " @@ -1446,145 +1451,145 @@ msgid "" "integers that meet the value restriction ``0 <= x <= 255``)." msgstr "" -#: ../../library/stdtypes.rst:1128 +#: ../../library/stdtypes.rst:1130 msgid "``s[i] = x``" msgstr "``s[i] = x``" -#: ../../library/stdtypes.rst:1128 +#: ../../library/stdtypes.rst:1130 msgid "item *i* of *s* is replaced by *x*" msgstr "" -#: ../../library/stdtypes.rst:1131 +#: ../../library/stdtypes.rst:1133 msgid "``s[i:j] = t``" msgstr "``s[i:j] = t``" -#: ../../library/stdtypes.rst:1131 +#: ../../library/stdtypes.rst:1133 msgid "" "slice of *s* from *i* to *j* is replaced by the contents of the iterable *t*" msgstr "" -#: ../../library/stdtypes.rst:1135 +#: ../../library/stdtypes.rst:1137 msgid "``del s[i:j]``" msgstr "``del s[i:j]``" -#: ../../library/stdtypes.rst:1135 +#: ../../library/stdtypes.rst:1137 msgid "same as ``s[i:j] = []``" msgstr "" -#: ../../library/stdtypes.rst:1137 +#: ../../library/stdtypes.rst:1139 msgid "``s[i:j:k] = t``" msgstr "``s[i:j:k] = t``" -#: ../../library/stdtypes.rst:1137 +#: ../../library/stdtypes.rst:1139 msgid "the elements of ``s[i:j:k]`` are replaced by those of *t*" msgstr "" -#: ../../library/stdtypes.rst:1140 +#: ../../library/stdtypes.rst:1142 msgid "``del s[i:j:k]``" msgstr "``del s[i:j:k]``" -#: ../../library/stdtypes.rst:1140 +#: ../../library/stdtypes.rst:1142 msgid "removes the elements of ``s[i:j:k]`` from the list" msgstr "" -#: ../../library/stdtypes.rst:1143 +#: ../../library/stdtypes.rst:1145 msgid "``s.append(x)``" msgstr "``s.append(x)``" -#: ../../library/stdtypes.rst:1143 +#: ../../library/stdtypes.rst:1145 msgid "" "appends *x* to the end of the sequence (same as ``s[len(s):len(s)] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1147 +#: ../../library/stdtypes.rst:1149 msgid "``s.clear()``" msgstr "``s.clear()``" -#: ../../library/stdtypes.rst:1147 +#: ../../library/stdtypes.rst:1149 msgid "removes all items from *s* (same as ``del s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1152 msgid "``s.copy()``" msgstr "``s.copy()``" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1152 msgid "creates a shallow copy of *s* (same as ``s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1153 +#: ../../library/stdtypes.rst:1155 msgid "``s.extend(t)`` or ``s += t``" msgstr "``s.extend(t)`` 或 ``s += t``" -#: ../../library/stdtypes.rst:1153 +#: ../../library/stdtypes.rst:1155 msgid "" "extends *s* with the contents of *t* (for the most part the same as " "``s[len(s):len(s)] = t``)" msgstr "" -#: ../../library/stdtypes.rst:1158 +#: ../../library/stdtypes.rst:1160 msgid "``s *= n``" msgstr "``s *= n``" -#: ../../library/stdtypes.rst:1158 +#: ../../library/stdtypes.rst:1160 msgid "updates *s* with its contents repeated *n* times" msgstr "" -#: ../../library/stdtypes.rst:1161 +#: ../../library/stdtypes.rst:1163 msgid "``s.insert(i, x)``" msgstr "``s.insert(i, x)``" -#: ../../library/stdtypes.rst:1161 +#: ../../library/stdtypes.rst:1163 msgid "" "inserts *x* into *s* at the index given by *i* (same as ``s[i:i] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1165 +#: ../../library/stdtypes.rst:1167 msgid "``s.pop()`` or ``s.pop(i)``" msgstr "``s.pop()`` 或 ``s.pop(i)``" -#: ../../library/stdtypes.rst:1165 +#: ../../library/stdtypes.rst:1167 msgid "retrieves the item at *i* and also removes it from *s*" msgstr "" -#: ../../library/stdtypes.rst:1168 +#: ../../library/stdtypes.rst:1170 msgid "``s.remove(x)``" msgstr "``s.remove(x)``" -#: ../../library/stdtypes.rst:1168 +#: ../../library/stdtypes.rst:1170 msgid "remove the first item from *s* where ``s[i]`` is equal to *x*" msgstr "" -#: ../../library/stdtypes.rst:1171 +#: ../../library/stdtypes.rst:1173 msgid "``s.reverse()``" msgstr "``s.reverse()``" -#: ../../library/stdtypes.rst:1171 +#: ../../library/stdtypes.rst:1173 msgid "reverses the items of *s* in place" msgstr "" -#: ../../library/stdtypes.rst:1179 +#: ../../library/stdtypes.rst:1181 msgid "*t* must have the same length as the slice it is replacing." msgstr "" -#: ../../library/stdtypes.rst:1182 +#: ../../library/stdtypes.rst:1184 msgid "" "The optional argument *i* defaults to ``-1``, so that by default the last " "item is removed and returned." msgstr "" -#: ../../library/stdtypes.rst:1186 +#: ../../library/stdtypes.rst:1188 msgid ":meth:`remove` raises :exc:`ValueError` when *x* is not found in *s*." msgstr "" -#: ../../library/stdtypes.rst:1189 +#: ../../library/stdtypes.rst:1191 msgid "" "The :meth:`reverse` method modifies the sequence in place for economy of " "space when reversing a large sequence. To remind users that it operates by " "side effect, it does not return the reversed sequence." msgstr "" -#: ../../library/stdtypes.rst:1194 +#: ../../library/stdtypes.rst:1196 msgid "" ":meth:`clear` and :meth:`!copy` are included for consistency with the " "interfaces of mutable containers that don't support slicing operations (such " @@ -1593,11 +1598,11 @@ msgid "" "classes provide it." msgstr "" -#: ../../library/stdtypes.rst:1200 +#: ../../library/stdtypes.rst:1202 msgid ":meth:`clear` and :meth:`!copy` methods." msgstr "" -#: ../../library/stdtypes.rst:1204 +#: ../../library/stdtypes.rst:1206 msgid "" "The value *n* is an integer, or an object implementing :meth:`~object." "__index__`. Zero and negative values of *n* clear the sequence. Items in " @@ -1605,39 +1610,39 @@ msgid "" "explained for ``s * n`` under :ref:`typesseq-common`." msgstr "" -#: ../../library/stdtypes.rst:1213 +#: ../../library/stdtypes.rst:1215 msgid "Lists" msgstr "List(串列)" -#: ../../library/stdtypes.rst:1217 +#: ../../library/stdtypes.rst:1219 msgid "" "Lists are mutable sequences, typically used to store collections of " "homogeneous items (where the precise degree of similarity will vary by " "application)." msgstr "" -#: ../../library/stdtypes.rst:1223 +#: ../../library/stdtypes.rst:1225 msgid "Lists may be constructed in several ways:" msgstr "" -#: ../../library/stdtypes.rst:1225 +#: ../../library/stdtypes.rst:1227 msgid "Using a pair of square brackets to denote the empty list: ``[]``" msgstr "" -#: ../../library/stdtypes.rst:1226 +#: ../../library/stdtypes.rst:1228 msgid "" "Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``" msgstr "" -#: ../../library/stdtypes.rst:1227 +#: ../../library/stdtypes.rst:1229 msgid "Using a list comprehension: ``[x for x in iterable]``" msgstr "" -#: ../../library/stdtypes.rst:1228 +#: ../../library/stdtypes.rst:1230 msgid "Using the type constructor: ``list()`` or ``list(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1230 +#: ../../library/stdtypes.rst:1232 msgid "" "The constructor builds a list whose items are the same and in the same order " "as *iterable*'s items. *iterable* may be either a sequence, a container " @@ -1648,20 +1653,20 @@ msgid "" "new empty list, ``[]``." msgstr "" -#: ../../library/stdtypes.rst:1239 +#: ../../library/stdtypes.rst:1241 msgid "" "Many other operations also produce lists, including the :func:`sorted` built-" "in." msgstr "" -#: ../../library/stdtypes.rst:1242 +#: ../../library/stdtypes.rst:1244 msgid "" "Lists implement all of the :ref:`common ` and :ref:`mutable " "` sequence operations. Lists also provide the following " "additional method:" msgstr "" -#: ../../library/stdtypes.rst:1248 +#: ../../library/stdtypes.rst:1250 msgid "" "This method sorts the list in place, using only ``<`` comparisons between " "items. Exceptions are not suppressed - if any comparison operations fail, " @@ -1669,13 +1674,13 @@ msgid "" "partially modified state)." msgstr "" -#: ../../library/stdtypes.rst:1253 +#: ../../library/stdtypes.rst:1255 msgid "" ":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:" "`keyword-only arguments `):" msgstr "" -#: ../../library/stdtypes.rst:1256 +#: ../../library/stdtypes.rst:1258 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each list element (for example, ``key=str.lower``). The " @@ -1684,19 +1689,19 @@ msgid "" "list items are sorted directly without calculating a separate key value." msgstr "" -#: ../../library/stdtypes.rst:1263 +#: ../../library/stdtypes.rst:1265 msgid "" "The :func:`functools.cmp_to_key` utility is available to convert a 2.x style " "*cmp* function to a *key* function." msgstr "" -#: ../../library/stdtypes.rst:1266 +#: ../../library/stdtypes.rst:1268 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/stdtypes.rst:1269 +#: ../../library/stdtypes.rst:1271 msgid "" "This method modifies the sequence in place for economy of space when sorting " "a large sequence. To remind users that it operates by side effect, it does " @@ -1704,7 +1709,7 @@ msgid "" "new sorted list instance)." msgstr "" -#: ../../library/stdtypes.rst:1274 +#: ../../library/stdtypes.rst:1276 msgid "" "The :meth:`sort` method is guaranteed to be stable. A sort is stable if it " "guarantees not to change the relative order of elements that compare equal " @@ -1712,12 +1717,12 @@ msgid "" "department, then by salary grade)." msgstr "" -#: ../../library/stdtypes.rst:1279 +#: ../../library/stdtypes.rst:1281 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/stdtypes.rst:1283 +#: ../../library/stdtypes.rst:1285 msgid "" "While a list is being sorted, the effect of attempting to mutate, or even " "inspect, the list is undefined. The C implementation of Python makes the " @@ -1725,11 +1730,11 @@ msgid "" "detect that the list has been mutated during a sort." msgstr "" -#: ../../library/stdtypes.rst:1292 +#: ../../library/stdtypes.rst:1294 msgid "Tuples" msgstr "" -#: ../../library/stdtypes.rst:1296 +#: ../../library/stdtypes.rst:1298 msgid "" "Tuples are immutable sequences, typically used to store collections of " "heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` " @@ -1738,27 +1743,27 @@ msgid "" "class:`dict` instance)." msgstr "" -#: ../../library/stdtypes.rst:1304 +#: ../../library/stdtypes.rst:1306 msgid "Tuples may be constructed in a number of ways:" msgstr "" -#: ../../library/stdtypes.rst:1306 +#: ../../library/stdtypes.rst:1308 msgid "Using a pair of parentheses to denote the empty tuple: ``()``" msgstr "" -#: ../../library/stdtypes.rst:1307 +#: ../../library/stdtypes.rst:1309 msgid "Using a trailing comma for a singleton tuple: ``a,`` or ``(a,)``" msgstr "" -#: ../../library/stdtypes.rst:1308 +#: ../../library/stdtypes.rst:1310 msgid "Separating items with commas: ``a, b, c`` or ``(a, b, c)``" msgstr "" -#: ../../library/stdtypes.rst:1309 +#: ../../library/stdtypes.rst:1311 msgid "Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1311 +#: ../../library/stdtypes.rst:1313 msgid "" "The constructor builds a tuple whose items are the same and in the same " "order as *iterable*'s items. *iterable* may be either a sequence, a " @@ -1769,7 +1774,7 @@ msgid "" "``()``." msgstr "" -#: ../../library/stdtypes.rst:1319 +#: ../../library/stdtypes.rst:1321 msgid "" "Note that it is actually the comma which makes a tuple, not the parentheses. " "The parentheses are optional, except in the empty tuple case, or when they " @@ -1778,30 +1783,30 @@ msgid "" "call with a 3-tuple as the sole argument." msgstr "" -#: ../../library/stdtypes.rst:1325 +#: ../../library/stdtypes.rst:1327 msgid "" "Tuples implement all of the :ref:`common ` sequence " "operations." msgstr "" -#: ../../library/stdtypes.rst:1328 +#: ../../library/stdtypes.rst:1330 msgid "" "For heterogeneous collections of data where access by name is clearer than " "access by index, :func:`collections.namedtuple` may be a more appropriate " "choice than a simple tuple object." msgstr "" -#: ../../library/stdtypes.rst:1336 +#: ../../library/stdtypes.rst:1338 msgid "Ranges" msgstr "" -#: ../../library/stdtypes.rst:1340 +#: ../../library/stdtypes.rst:1342 msgid "" "The :class:`range` type represents an immutable sequence of numbers and is " "commonly used for looping a specific number of times in :keyword:`for` loops." msgstr "" -#: ../../library/stdtypes.rst:1347 +#: ../../library/stdtypes.rst:1349 msgid "" "The arguments to the range constructor must be integers (either built-in :" "class:`int` or any object that implements the :meth:`~object.__index__` " @@ -1810,38 +1815,38 @@ msgid "" "zero, :exc:`ValueError` is raised." msgstr "" -#: ../../library/stdtypes.rst:1353 +#: ../../library/stdtypes.rst:1355 msgid "" "For a positive *step*, the contents of a range ``r`` are determined by the " "formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``." msgstr "" -#: ../../library/stdtypes.rst:1357 +#: ../../library/stdtypes.rst:1359 msgid "" "For a negative *step*, the contents of the range are still determined by the " "formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and " "``r[i] > stop``." msgstr "" -#: ../../library/stdtypes.rst:1361 +#: ../../library/stdtypes.rst:1363 msgid "" "A range object will be empty if ``r[0]`` does not meet the value constraint. " "Ranges do support negative indices, but these are interpreted as indexing " "from the end of the sequence determined by the positive indices." msgstr "" -#: ../../library/stdtypes.rst:1366 +#: ../../library/stdtypes.rst:1368 msgid "" "Ranges containing absolute values larger than :data:`sys.maxsize` are " "permitted but some features (such as :func:`len`) may raise :exc:" "`OverflowError`." msgstr "" -#: ../../library/stdtypes.rst:1370 +#: ../../library/stdtypes.rst:1372 msgid "Range examples::" msgstr "" -#: ../../library/stdtypes.rst:1387 +#: ../../library/stdtypes.rst:1389 msgid "" "Ranges implement all of the :ref:`common ` sequence " "operations except concatenation and repetition (due to the fact that range " @@ -1849,23 +1854,23 @@ msgid "" "repetition and concatenation will usually violate that pattern)." msgstr "" -#: ../../library/stdtypes.rst:1394 +#: ../../library/stdtypes.rst:1396 msgid "" "The value of the *start* parameter (or ``0`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1399 +#: ../../library/stdtypes.rst:1401 msgid "The value of the *stop* parameter" msgstr "" -#: ../../library/stdtypes.rst:1403 +#: ../../library/stdtypes.rst:1405 msgid "" "The value of the *step* parameter (or ``1`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1406 +#: ../../library/stdtypes.rst:1408 msgid "" "The advantage of the :class:`range` type over a regular :class:`list` or :" "class:`tuple` is that a :class:`range` object will always take the same " @@ -1874,14 +1879,14 @@ msgid "" "individual items and subranges as needed)." msgstr "" -#: ../../library/stdtypes.rst:1412 +#: ../../library/stdtypes.rst:1414 msgid "" "Range objects implement the :class:`collections.abc.Sequence` ABC, and " "provide features such as containment tests, element index lookup, slicing " "and support for negative indices (see :ref:`typesseq`):" msgstr "" -#: ../../library/stdtypes.rst:1432 +#: ../../library/stdtypes.rst:1434 msgid "" "Testing range objects for equality with ``==`` and ``!=`` compares them as " "sequences. That is, two range objects are considered equal if they " @@ -1891,111 +1896,111 @@ msgid "" "3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)" msgstr "" -#: ../../library/stdtypes.rst:1439 +#: ../../library/stdtypes.rst:1441 msgid "" "Implement the Sequence ABC. Support slicing and negative indices. Test :" "class:`int` objects for membership in constant time instead of iterating " "through all items." msgstr "" -#: ../../library/stdtypes.rst:1445 +#: ../../library/stdtypes.rst:1447 msgid "" "Define '==' and '!=' to compare range objects based on the sequence of " "values they define (instead of comparing based on object identity)." msgstr "" -#: ../../library/stdtypes.rst:1450 +#: ../../library/stdtypes.rst:1452 msgid "" "The :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` " "attributes." msgstr "" -#: ../../library/stdtypes.rst:1456 +#: ../../library/stdtypes.rst:1458 msgid "" "The `linspace recipe `_ shows " "how to implement a lazy version of range suitable for floating point " "applications." msgstr "" -#: ../../library/stdtypes.rst:1468 +#: ../../library/stdtypes.rst:1470 msgid "Text Sequence Type --- :class:`str`" msgstr "" -#: ../../library/stdtypes.rst:1470 +#: ../../library/stdtypes.rst:1472 msgid "" "Textual data in Python is handled with :class:`str` objects, or :dfn:" "`strings`. Strings are immutable :ref:`sequences ` of Unicode code " "points. String literals are written in a variety of ways:" msgstr "" -#: ../../library/stdtypes.rst:1475 +#: ../../library/stdtypes.rst:1477 msgid "Single quotes: ``'allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:1476 +#: ../../library/stdtypes.rst:1478 msgid "Double quotes: ``\"allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:1477 +#: ../../library/stdtypes.rst:1479 msgid "" "Triple quoted: ``'''Three single quotes'''``, ``\"\"\"Three double " "quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:1479 +#: ../../library/stdtypes.rst:1481 msgid "" "Triple quoted strings may span multiple lines - all associated whitespace " "will be included in the string literal." msgstr "" -#: ../../library/stdtypes.rst:1482 +#: ../../library/stdtypes.rst:1484 msgid "" "String literals that are part of a single expression and have only " "whitespace between them will be implicitly converted to a single string " "literal. That is, ``(\"spam \" \"eggs\") == \"spam eggs\"``." msgstr "" -#: ../../library/stdtypes.rst:1486 +#: ../../library/stdtypes.rst:1488 msgid "" "See :ref:`strings` for more about the various forms of string literal, " "including supported escape sequences, and the ``r`` (\"raw\") prefix that " "disables most escape sequence processing." msgstr "" -#: ../../library/stdtypes.rst:1490 +#: ../../library/stdtypes.rst:1492 msgid "" "Strings may also be created from other objects using the :class:`str` " "constructor." msgstr "" -#: ../../library/stdtypes.rst:1493 +#: ../../library/stdtypes.rst:1495 msgid "" "Since there is no separate \"character\" type, indexing a string produces " "strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``." msgstr "" -#: ../../library/stdtypes.rst:1499 +#: ../../library/stdtypes.rst:1501 msgid "" "There is also no mutable string type, but :meth:`str.join` or :class:`io." "StringIO` can be used to efficiently construct strings from multiple " "fragments." msgstr "" -#: ../../library/stdtypes.rst:1503 +#: ../../library/stdtypes.rst:1505 msgid "" "For backwards compatibility with the Python 2 series, the ``u`` prefix is " "once again permitted on string literals. It has no effect on the meaning of " "string literals and cannot be combined with the ``r`` prefix." msgstr "" -#: ../../library/stdtypes.rst:1515 +#: ../../library/stdtypes.rst:1517 msgid "" "Return a :ref:`string ` version of *object*. If *object* is not " "provided, returns the empty string. Otherwise, the behavior of ``str()`` " "depends on whether *encoding* or *errors* is given, as follows." msgstr "" -#: ../../library/stdtypes.rst:1519 +#: ../../library/stdtypes.rst:1521 msgid "" "If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:" "`type(object).__str__(object) `, which is the \"informal\" " @@ -2005,7 +2010,7 @@ msgid "" "`repr(object) `." msgstr "" -#: ../../library/stdtypes.rst:1531 +#: ../../library/stdtypes.rst:1533 msgid "" "If at least one of *encoding* or *errors* is given, *object* should be a :" "term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In " @@ -2017,7 +2022,7 @@ msgid "" "buffer objects." msgstr "" -#: ../../library/stdtypes.rst:1540 +#: ../../library/stdtypes.rst:1542 msgid "" "Passing a :class:`bytes` object to :func:`str` without the *encoding* or " "*errors* arguments falls under the first case of returning the informal " @@ -2025,7 +2030,7 @@ msgid "" "Python). For example::" msgstr "" -#: ../../library/stdtypes.rst:1548 +#: ../../library/stdtypes.rst:1550 msgid "" "For more information on the ``str`` class and its methods, see :ref:" "`textseq` and the :ref:`string-methods` section below. To output formatted " @@ -2033,17 +2038,17 @@ msgid "" "addition, see the :ref:`stringservices` section." msgstr "" -#: ../../library/stdtypes.rst:1560 +#: ../../library/stdtypes.rst:1562 msgid "String Methods" msgstr "" -#: ../../library/stdtypes.rst:1565 +#: ../../library/stdtypes.rst:1567 msgid "" "Strings implement all of the :ref:`common ` sequence " "operations, along with the additional methods described below." msgstr "" -#: ../../library/stdtypes.rst:1568 +#: ../../library/stdtypes.rst:1570 msgid "" "Strings also support two styles of string formatting, one providing a large " "degree of flexibility and customization (see :meth:`str.format`, :ref:" @@ -2053,33 +2058,33 @@ msgid "" "handle (:ref:`old-string-formatting`)." msgstr "" -#: ../../library/stdtypes.rst:1575 +#: ../../library/stdtypes.rst:1577 msgid "" "The :ref:`textservices` section of the standard library covers a number of " "other modules that provide various text related utilities (including regular " "expression support in the :mod:`re` module)." msgstr "" -#: ../../library/stdtypes.rst:1581 +#: ../../library/stdtypes.rst:1583 msgid "" "Return a copy of the string with its first character capitalized and the " "rest lowercased." msgstr "" -#: ../../library/stdtypes.rst:1584 +#: ../../library/stdtypes.rst:1586 msgid "" "The first character is now put into titlecase rather than uppercase. This " "means that characters like digraphs will only have their first letter " "capitalized, instead of the full character." msgstr "" -#: ../../library/stdtypes.rst:1591 +#: ../../library/stdtypes.rst:1593 msgid "" "Return a casefolded copy of the string. Casefolded strings may be used for " "caseless matching." msgstr "" -#: ../../library/stdtypes.rst:1594 +#: ../../library/stdtypes.rst:1596 msgid "" "Casefolding is similar to lowercasing but more aggressive because it is " "intended to remove all case distinctions in a string. For example, the " @@ -2088,43 +2093,43 @@ msgid "" "`casefold` converts it to ``\"ss\"``." msgstr "" -#: ../../library/stdtypes.rst:1600 +#: ../../library/stdtypes.rst:1602 msgid "" "The casefolding algorithm is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:1608 +#: ../../library/stdtypes.rst:1610 msgid "" "Return centered in a string of length *width*. Padding is done using the " "specified *fillchar* (default is an ASCII space). The original string is " "returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:1616 +#: ../../library/stdtypes.rst:1618 msgid "" "Return the number of non-overlapping occurrences of substring *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:1620 +#: ../../library/stdtypes.rst:1622 msgid "" "If *sub* is empty, returns the number of empty strings between characters " "which is the length of the string plus one." msgstr "" -#: ../../library/stdtypes.rst:1626 +#: ../../library/stdtypes.rst:1628 msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1628 ../../library/stdtypes.rst:2763 +#: ../../library/stdtypes.rst:1630 ../../library/stdtypes.rst:2765 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." msgstr "" -#: ../../library/stdtypes.rst:1631 +#: ../../library/stdtypes.rst:1633 msgid "" "*errors* controls how encoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -2133,24 +2138,24 @@ msgid "" "register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:1638 +#: ../../library/stdtypes.rst:1640 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless an encoding error actually occurs, :ref:`devmode` is enabled or a :" "ref:`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:1643 ../../library/stdtypes.rst:2782 +#: ../../library/stdtypes.rst:1645 ../../library/stdtypes.rst:2784 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1646 ../../library/stdtypes.rst:2785 +#: ../../library/stdtypes.rst:1648 ../../library/stdtypes.rst:2787 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." msgstr "" -#: ../../library/stdtypes.rst:1653 +#: ../../library/stdtypes.rst:1655 msgid "" "Return ``True`` if the string ends with the specified *suffix*, otherwise " "return ``False``. *suffix* can also be a tuple of suffixes to look for. " @@ -2158,7 +2163,7 @@ msgid "" "*end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:1661 +#: ../../library/stdtypes.rst:1663 msgid "" "Return a copy of the string where all tab characters are replaced by one or " "more spaces, depending on the current column and the given tab size. Tab " @@ -2174,21 +2179,21 @@ msgid "" "printed." msgstr "" -#: ../../library/stdtypes.rst:1682 +#: ../../library/stdtypes.rst:1684 msgid "" "Return the lowest index in the string where substring *sub* is found within " "the slice ``s[start:end]``. Optional arguments *start* and *end* are " "interpreted as in slice notation. Return ``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:1688 +#: ../../library/stdtypes.rst:1690 msgid "" "The :meth:`~str.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:1698 +#: ../../library/stdtypes.rst:1700 msgid "" "Perform a string formatting operation. The string on which this method is " "called can contain literal text or replacement fields delimited by braces " @@ -2198,13 +2203,13 @@ msgid "" "the corresponding argument." msgstr "" -#: ../../library/stdtypes.rst:1708 +#: ../../library/stdtypes.rst:1710 msgid "" "See :ref:`formatstrings` for a description of the various formatting options " "that can be specified in format strings." msgstr "" -#: ../../library/stdtypes.rst:1712 +#: ../../library/stdtypes.rst:1714 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -2215,26 +2220,26 @@ msgid "" "This temporary change affects other threads." msgstr "" -#: ../../library/stdtypes.rst:1721 +#: ../../library/stdtypes.rst:1723 msgid "" "When formatting a number with the ``n`` type, the function sets temporarily " "the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." msgstr "" -#: ../../library/stdtypes.rst:1729 +#: ../../library/stdtypes.rst:1731 msgid "" "Similar to ``str.format(**mapping)``, except that ``mapping`` is used " "directly and not copied to a :class:`dict`. This is useful if for example " "``mapping`` is a dict subclass:" msgstr "" -#: ../../library/stdtypes.rst:1745 +#: ../../library/stdtypes.rst:1747 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1751 +#: ../../library/stdtypes.rst:1753 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -2242,7 +2247,7 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:1759 +#: ../../library/stdtypes.rst:1761 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -2252,14 +2257,14 @@ msgid "" "\"Alphabetic\" property defined in the Unicode Standard." msgstr "" -#: ../../library/stdtypes.rst:1768 +#: ../../library/stdtypes.rst:1770 msgid "" "Return ``True`` if the string is empty or all characters in the string are " "ASCII, ``False`` otherwise. ASCII characters have code points in the range " "U+0000-U+007F." msgstr "" -#: ../../library/stdtypes.rst:1777 +#: ../../library/stdtypes.rst:1779 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -2268,7 +2273,7 @@ msgid "" "General Category \"Nd\"." msgstr "" -#: ../../library/stdtypes.rst:1787 +#: ../../library/stdtypes.rst:1789 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -2278,32 +2283,32 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:1797 +#: ../../library/stdtypes.rst:1799 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:1800 +#: ../../library/stdtypes.rst:1802 msgid "" "Call :func:`keyword.iskeyword` to test whether string ``s`` is a reserved " "identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" -#: ../../library/stdtypes.rst:1803 +#: ../../library/stdtypes.rst:1805 msgid "Example: ::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:1816 +#: ../../library/stdtypes.rst:1818 msgid "" "Return ``True`` if all cased characters [4]_ in the string are lowercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1822 +#: ../../library/stdtypes.rst:1824 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -2313,7 +2318,7 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric." msgstr "" -#: ../../library/stdtypes.rst:1832 +#: ../../library/stdtypes.rst:1834 msgid "" "Return ``True`` if all characters in the string are printable or the string " "is empty, ``False`` otherwise. Nonprintable characters are those characters " @@ -2324,20 +2329,20 @@ msgid "" "of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)" msgstr "" -#: ../../library/stdtypes.rst:1843 +#: ../../library/stdtypes.rst:1845 msgid "" "Return ``True`` if there are only whitespace characters in the string and " "there is at least one character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1846 +#: ../../library/stdtypes.rst:1848 msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" "`unicodedata`), either its general category is ``Zs`` (\"Separator, " "space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." msgstr "" -#: ../../library/stdtypes.rst:1854 +#: ../../library/stdtypes.rst:1856 msgid "" "Return ``True`` if the string is a titlecased string and there is at least " "one character, for example uppercase characters may only follow uncased " @@ -2345,13 +2350,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:1861 +#: ../../library/stdtypes.rst:1863 msgid "" "Return ``True`` if all cased characters [4]_ in the string are uppercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1879 +#: ../../library/stdtypes.rst:1881 msgid "" "Return a string which is the concatenation of the strings in *iterable*. A :" "exc:`TypeError` will be raised if there are any non-string values in " @@ -2359,26 +2364,26 @@ msgid "" "elements is the string providing this method." msgstr "" -#: ../../library/stdtypes.rst:1887 +#: ../../library/stdtypes.rst:1889 msgid "" "Return the string left justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:1894 +#: ../../library/stdtypes.rst:1896 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:1897 +#: ../../library/stdtypes.rst:1899 msgid "" "The lowercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:1903 +#: ../../library/stdtypes.rst:1905 msgid "" "Return a copy of the string with leading characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -2387,19 +2392,19 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:1913 +#: ../../library/stdtypes.rst:1915 msgid "" "See :meth:`str.removeprefix` for a method that will remove a single prefix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:1924 +#: ../../library/stdtypes.rst:1926 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:1926 +#: ../../library/stdtypes.rst:1928 msgid "" "If there is only one argument, it must be a dictionary mapping Unicode " "ordinals (integers) or characters (strings of length 1) to Unicode ordinals, " @@ -2407,7 +2412,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:1931 +#: ../../library/stdtypes.rst:1933 msgid "" "If there are two arguments, they must be strings of equal length, and in the " "resulting dictionary, each character in x will be mapped to the character at " @@ -2415,7 +2420,7 @@ msgid "" "whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:1939 +#: ../../library/stdtypes.rst:1941 msgid "" "Split the string at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -2423,47 +2428,47 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:1947 +#: ../../library/stdtypes.rst:1949 msgid "" "If the string starts with the *prefix* string, return " "``string[len(prefix):]``. Otherwise, return a copy of the original string::" msgstr "" -#: ../../library/stdtypes.rst:1961 +#: ../../library/stdtypes.rst:1963 msgid "" "If the string ends with the *suffix* string and that *suffix* is not empty, " "return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " "string::" msgstr "" -#: ../../library/stdtypes.rst:1975 +#: ../../library/stdtypes.rst:1977 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If the optional argument *count* is given, only the first *count* " "occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:1982 +#: ../../library/stdtypes.rst:1984 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " "and *end* are interpreted as in slice notation. Return ``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:1989 +#: ../../library/stdtypes.rst:1991 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1995 +#: ../../library/stdtypes.rst:1997 msgid "" "Return the string right justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2002 +#: ../../library/stdtypes.rst:2004 msgid "" "Split the string at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -2471,7 +2476,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2010 +#: ../../library/stdtypes.rst:2012 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " @@ -2480,7 +2485,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2019 +#: ../../library/stdtypes.rst:2021 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -2489,13 +2494,13 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2029 +#: ../../library/stdtypes.rst:2031 msgid "" "See :meth:`str.removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2039 +#: ../../library/stdtypes.rst:2041 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, " @@ -2504,7 +2509,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2045 +#: ../../library/stdtypes.rst:2047 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -2513,23 +2518,23 @@ msgid "" "Splitting an empty string with a specified separator returns ``['']``." msgstr "" -#: ../../library/stdtypes.rst:2051 ../../library/stdtypes.rst:2067 -#: ../../library/stdtypes.rst:2119 ../../library/stdtypes.rst:2187 -#: ../../library/stdtypes.rst:2254 ../../library/stdtypes.rst:3101 -#: ../../library/stdtypes.rst:3117 ../../library/stdtypes.rst:3208 -#: ../../library/stdtypes.rst:3224 ../../library/stdtypes.rst:3249 -#: ../../library/stdtypes.rst:3263 ../../library/stdtypes.rst:3291 -#: ../../library/stdtypes.rst:3305 ../../library/stdtypes.rst:3323 -#: ../../library/stdtypes.rst:3350 ../../library/stdtypes.rst:3373 -#: ../../library/stdtypes.rst:3400 ../../library/stdtypes.rst:3442 -#: ../../library/stdtypes.rst:3466 +#: ../../library/stdtypes.rst:2053 ../../library/stdtypes.rst:2069 +#: ../../library/stdtypes.rst:2121 ../../library/stdtypes.rst:2189 +#: ../../library/stdtypes.rst:2256 ../../library/stdtypes.rst:3103 +#: ../../library/stdtypes.rst:3119 ../../library/stdtypes.rst:3210 +#: ../../library/stdtypes.rst:3226 ../../library/stdtypes.rst:3251 +#: ../../library/stdtypes.rst:3265 ../../library/stdtypes.rst:3293 +#: ../../library/stdtypes.rst:3307 ../../library/stdtypes.rst:3325 +#: ../../library/stdtypes.rst:3352 ../../library/stdtypes.rst:3375 +#: ../../library/stdtypes.rst:3402 ../../library/stdtypes.rst:3444 +#: ../../library/stdtypes.rst:3468 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/stdtypes.rst:2060 +#: ../../library/stdtypes.rst:2062 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive whitespace are regarded as a single separator, " @@ -2539,131 +2544,131 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2082 +#: ../../library/stdtypes.rst:2084 msgid "" "Return a list of the lines in the string, breaking at line boundaries. Line " "breaks are not included in the resulting list unless *keepends* is given and " "true." msgstr "" -#: ../../library/stdtypes.rst:2086 +#: ../../library/stdtypes.rst:2088 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2090 +#: ../../library/stdtypes.rst:2092 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2090 +#: ../../library/stdtypes.rst:2092 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2092 +#: ../../library/stdtypes.rst:2094 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2092 +#: ../../library/stdtypes.rst:2094 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2094 +#: ../../library/stdtypes.rst:2096 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2094 +#: ../../library/stdtypes.rst:2096 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2098 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2098 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2098 +#: ../../library/stdtypes.rst:2100 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2098 +#: ../../library/stdtypes.rst:2100 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2100 +#: ../../library/stdtypes.rst:2102 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2100 +#: ../../library/stdtypes.rst:2102 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2102 +#: ../../library/stdtypes.rst:2104 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2102 +#: ../../library/stdtypes.rst:2104 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2104 +#: ../../library/stdtypes.rst:2106 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2104 +#: ../../library/stdtypes.rst:2106 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2106 +#: ../../library/stdtypes.rst:2108 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2106 +#: ../../library/stdtypes.rst:2108 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2108 +#: ../../library/stdtypes.rst:2110 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2108 +#: ../../library/stdtypes.rst:2110 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2110 +#: ../../library/stdtypes.rst:2112 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2110 +#: ../../library/stdtypes.rst:2112 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2112 +#: ../../library/stdtypes.rst:2114 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2112 +#: ../../library/stdtypes.rst:2114 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2117 +#: ../../library/stdtypes.rst:2119 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2126 +#: ../../library/stdtypes.rst:2128 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:2135 +#: ../../library/stdtypes.rst:2137 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2145 +#: ../../library/stdtypes.rst:2147 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -2671,7 +2676,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2153 +#: ../../library/stdtypes.rst:2155 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -2680,7 +2685,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2164 +#: ../../library/stdtypes.rst:2166 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -2688,20 +2693,20 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2177 +#: ../../library/stdtypes.rst:2179 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. Note that it is not necessarily true that ``s.swapcase()." "swapcase() == s``." msgstr "" -#: ../../library/stdtypes.rst:2184 +#: ../../library/stdtypes.rst:2186 msgid "" "Return a titlecased version of the string where words start with an " "uppercase character and the remaining characters are lowercase." msgstr "" -#: ../../library/stdtypes.rst:2192 ../../library/stdtypes.rst:3410 +#: ../../library/stdtypes.rst:2194 ../../library/stdtypes.rst:3412 msgid "" "The algorithm uses a simple language-independent definition of a word as " "groups of consecutive letters. The definition works in many contexts but it " @@ -2709,19 +2714,19 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2200 +#: ../../library/stdtypes.rst:2202 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2203 +#: ../../library/stdtypes.rst:2205 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2218 +#: ../../library/stdtypes.rst:2220 msgid "" "Return a copy of the string in which each character has been mapped through " "the given translation table. The table must be an object that implements " @@ -2733,19 +2738,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2227 +#: ../../library/stdtypes.rst:2229 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2230 +#: ../../library/stdtypes.rst:2232 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2236 +#: ../../library/stdtypes.rst:2238 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` " @@ -2754,13 +2759,13 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2242 +#: ../../library/stdtypes.rst:2244 msgid "" "The uppercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:2248 +#: ../../library/stdtypes.rst:2250 msgid "" "Return a copy of the string left filled with ASCII ``'0'`` digits to make a " "string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled " @@ -2768,11 +2773,11 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2266 +#: ../../library/stdtypes.rst:2268 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2279 +#: ../../library/stdtypes.rst:2281 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -2783,7 +2788,7 @@ msgid "" "or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2287 +#: ../../library/stdtypes.rst:2289 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -2793,7 +2798,7 @@ msgid "" "in the C language." msgstr "" -#: ../../library/stdtypes.rst:2293 +#: ../../library/stdtypes.rst:2295 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -2801,36 +2806,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2303 ../../library/stdtypes.rst:3521 +#: ../../library/stdtypes.rst:2305 ../../library/stdtypes.rst:3523 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2306 ../../library/stdtypes.rst:3524 +#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:3526 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:3526 +#: ../../library/stdtypes.rst:2310 ../../library/stdtypes.rst:3528 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2311 ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:2313 ../../library/stdtypes.rst:3531 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2314 ../../library/stdtypes.rst:3532 +#: ../../library/stdtypes.rst:2316 ../../library/stdtypes.rst:3534 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is read from the next element of the tuple in *values*, and the " "object to convert comes after the minimum field width and optional precision." msgstr "" -#: ../../library/stdtypes.rst:2318 ../../library/stdtypes.rst:3536 +#: ../../library/stdtypes.rst:2320 ../../library/stdtypes.rst:3538 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -2838,15 +2843,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2323 ../../library/stdtypes.rst:3541 +#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3543 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3543 +#: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:3545 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2327 +#: ../../library/stdtypes.rst:2329 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the string *must* include a parenthesised mapping key into that " @@ -2854,279 +2859,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2336 ../../library/stdtypes.rst:3554 +#: ../../library/stdtypes.rst:2338 ../../library/stdtypes.rst:3556 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2339 ../../library/stdtypes.rst:3557 +#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3559 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2348 ../../library/stdtypes.rst:3566 +#: ../../library/stdtypes.rst:2350 ../../library/stdtypes.rst:3568 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2350 ../../library/stdtypes.rst:3568 +#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3570 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2350 ../../library/stdtypes.rst:3568 +#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3570 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2353 ../../library/stdtypes.rst:3571 +#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2353 ../../library/stdtypes.rst:3571 +#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:2357 ../../library/stdtypes.rst:3575 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:2357 ../../library/stdtypes.rst:3575 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:3576 +#: ../../library/stdtypes.rst:2360 ../../library/stdtypes.rst:3578 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:3576 +#: ../../library/stdtypes.rst:2360 ../../library/stdtypes.rst:3578 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2361 ../../library/stdtypes.rst:3579 +#: ../../library/stdtypes.rst:2363 ../../library/stdtypes.rst:3581 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2361 ../../library/stdtypes.rst:3579 +#: ../../library/stdtypes.rst:2363 ../../library/stdtypes.rst:3581 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2365 ../../library/stdtypes.rst:3583 +#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3585 msgid "" "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as " "it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" -#: ../../library/stdtypes.rst:2368 ../../library/stdtypes.rst:3586 +#: ../../library/stdtypes.rst:2370 ../../library/stdtypes.rst:3588 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2371 ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3591 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3591 +#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:3593 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:2375 -#: ../../library/stdtypes.rst:3591 ../../library/stdtypes.rst:3593 +#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:2377 +#: ../../library/stdtypes.rst:3593 ../../library/stdtypes.rst:3595 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:3593 +#: ../../library/stdtypes.rst:2377 ../../library/stdtypes.rst:3595 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2377 ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2377 ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 msgid "Floating point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 msgid "Floating point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 +#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:3609 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:2391 -#: ../../library/stdtypes.rst:3607 ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:2393 +#: ../../library/stdtypes.rst:3609 ../../library/stdtypes.rst:3611 msgid "Floating point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3611 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 msgid "" "Floating point format. Uses lowercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2397 ../../library/stdtypes.rst:3615 +#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3617 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2397 ../../library/stdtypes.rst:3615 +#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3617 msgid "" "Floating point format. Uses uppercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2401 ../../library/stdtypes.rst:3619 +#: ../../library/stdtypes.rst:2403 ../../library/stdtypes.rst:3621 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2401 +#: ../../library/stdtypes.rst:2403 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2404 ../../library/stdtypes.rst:3632 +#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:3634 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2404 +#: ../../library/stdtypes.rst:2406 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2407 ../../library/stdtypes.rst:3626 +#: ../../library/stdtypes.rst:2409 ../../library/stdtypes.rst:3628 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2407 +#: ../../library/stdtypes.rst:2409 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2410 ../../library/stdtypes.rst:3629 +#: ../../library/stdtypes.rst:2412 ../../library/stdtypes.rst:3631 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2410 +#: ../../library/stdtypes.rst:2412 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2413 ../../library/stdtypes.rst:3635 +#: ../../library/stdtypes.rst:2415 ../../library/stdtypes.rst:3637 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2413 ../../library/stdtypes.rst:3635 +#: ../../library/stdtypes.rst:2415 ../../library/stdtypes.rst:3637 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2420 ../../library/stdtypes.rst:3642 +#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3644 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2424 ../../library/stdtypes.rst:3646 +#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:3648 msgid "" "The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on " "whether the ``'x'`` or ``'X'`` format was used) to be inserted before the " "first digit." msgstr "" -#: ../../library/stdtypes.rst:2428 ../../library/stdtypes.rst:3650 +#: ../../library/stdtypes.rst:2430 ../../library/stdtypes.rst:3652 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2431 ../../library/stdtypes.rst:3653 +#: ../../library/stdtypes.rst:2433 ../../library/stdtypes.rst:3655 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2435 ../../library/stdtypes.rst:3657 +#: ../../library/stdtypes.rst:2437 ../../library/stdtypes.rst:3659 msgid "" "The alternate form causes the result to always contain a decimal point, and " "trailing zeroes are not removed as they would otherwise be." msgstr "" -#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3660 +#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:3662 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:3664 +#: ../../library/stdtypes.rst:2444 ../../library/stdtypes.rst:3666 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2445 ../../library/stdtypes.rst:3673 +#: ../../library/stdtypes.rst:2447 ../../library/stdtypes.rst:3675 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`\\ 。" -#: ../../library/stdtypes.rst:2447 +#: ../../library/stdtypes.rst:2449 msgid "" "Since Python strings have an explicit length, ``%s`` conversions do not " "assume that ``'\\0'`` is the end of the string." msgstr "" -#: ../../library/stdtypes.rst:2452 +#: ../../library/stdtypes.rst:2454 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:2463 +#: ../../library/stdtypes.rst:2465 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:2471 +#: ../../library/stdtypes.rst:2473 msgid "" "The core built-in types for manipulating binary data are :class:`bytes` and :" "class:`bytearray`. They are supported by :class:`memoryview` which uses the :" @@ -3134,17 +3139,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:2476 +#: ../../library/stdtypes.rst:2478 msgid "" "The :mod:`array` module supports efficient storage of basic data types like " "32-bit integers and IEEE754 double-precision floating values." msgstr "" -#: ../../library/stdtypes.rst:2482 +#: ../../library/stdtypes.rst:2484 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:2486 +#: ../../library/stdtypes.rst:2488 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -3152,40 +3157,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:2493 +#: ../../library/stdtypes.rst:2495 msgid "" "Firstly, the syntax for bytes literals is largely the same as that for " "string literals, except that a ``b`` prefix is added:" msgstr "" -#: ../../library/stdtypes.rst:2496 +#: ../../library/stdtypes.rst:2498 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:2497 +#: ../../library/stdtypes.rst:2499 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:2498 +#: ../../library/stdtypes.rst:2500 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:2500 +#: ../../library/stdtypes.rst:2502 msgid "" "Only ASCII characters are permitted in bytes literals (regardless of the " "declared source code encoding). Any binary values over 127 must be entered " "into bytes literals using the appropriate escape sequence." msgstr "" -#: ../../library/stdtypes.rst:2504 +#: ../../library/stdtypes.rst:2506 msgid "" "As with string literals, bytes literals may also use a ``r`` prefix to " "disable processing of escape sequences. See :ref:`strings` for more about " "the various forms of bytes literal, including supported escape sequences." msgstr "" -#: ../../library/stdtypes.rst:2508 +#: ../../library/stdtypes.rst:2510 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -3198,29 +3203,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:2518 +#: ../../library/stdtypes.rst:2520 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:2521 +#: ../../library/stdtypes.rst:2523 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:2522 +#: ../../library/stdtypes.rst:2524 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2523 +#: ../../library/stdtypes.rst:2525 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:2525 +#: ../../library/stdtypes.rst:2527 msgid "Also see the :ref:`bytes ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2527 +#: ../../library/stdtypes.rst:2529 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3228,32 +3233,32 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:2533 +#: ../../library/stdtypes.rst:2535 msgid "" "This :class:`bytes` class method returns a bytes object, decoding the given " "string object. The string must contain two hexadecimal digits per byte, " "with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:2540 +#: ../../library/stdtypes.rst:2542 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:2544 +#: ../../library/stdtypes.rst:2546 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2549 ../../library/stdtypes.rst:2634 +#: ../../library/stdtypes.rst:2551 ../../library/stdtypes.rst:2636 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:2555 +#: ../../library/stdtypes.rst:2557 msgid "" "If you want to make the hex string easier to read, you can specify a single " "character separator *sep* parameter to include in the output. By default, " @@ -3262,13 +3267,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:2572 +#: ../../library/stdtypes.rst:2574 msgid "" ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters " "to insert separators between bytes in the hex output." msgstr "" -#: ../../library/stdtypes.rst:2576 +#: ../../library/stdtypes.rst:2578 msgid "" "Since bytes objects are sequences of integers (akin to a tuple), for a bytes " "object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes " @@ -3276,58 +3281,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2581 +#: ../../library/stdtypes.rst:2583 msgid "" "The representation of bytes objects uses the literal format (``b'...'``) " "since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can " "always convert a bytes object into a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2589 +#: ../../library/stdtypes.rst:2591 msgid "Bytearray Objects" msgstr "" -#: ../../library/stdtypes.rst:2593 +#: ../../library/stdtypes.rst:2595 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2598 +#: ../../library/stdtypes.rst:2600 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2601 +#: ../../library/stdtypes.rst:2603 msgid "Creating an empty instance: ``bytearray()``" msgstr "" -#: ../../library/stdtypes.rst:2602 +#: ../../library/stdtypes.rst:2604 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2603 +#: ../../library/stdtypes.rst:2605 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2604 +#: ../../library/stdtypes.rst:2606 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2606 +#: ../../library/stdtypes.rst:2608 msgid "" "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray " "operations described in :ref:`bytes-methods`." msgstr "" -#: ../../library/stdtypes.rst:2610 +#: ../../library/stdtypes.rst:2612 msgid "Also see the :ref:`bytearray ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2612 +#: ../../library/stdtypes.rst:2614 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3335,33 +3340,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2618 +#: ../../library/stdtypes.rst:2620 msgid "" "This :class:`bytearray` class method returns bytearray object, decoding the " "given string object. The string must contain two hexadecimal digits per " "byte, with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:2625 +#: ../../library/stdtypes.rst:2627 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2629 +#: ../../library/stdtypes.rst:2631 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2642 +#: ../../library/stdtypes.rst:2644 msgid "" "Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:2647 +#: ../../library/stdtypes.rst:2649 msgid "" "Since bytearray objects are sequences of integers (akin to a list), for a " "bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be " @@ -3369,7 +3374,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2652 +#: ../../library/stdtypes.rst:2654 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -3377,11 +3382,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2661 +#: ../../library/stdtypes.rst:2663 msgid "Bytes and Bytearray Operations" msgstr "" -#: ../../library/stdtypes.rst:2666 +#: ../../library/stdtypes.rst:2668 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -3390,107 +3395,107 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2674 +#: ../../library/stdtypes.rst:2676 msgid "" "The methods on bytes and bytearray objects don't accept strings as their " "arguments, just as the methods on strings don't accept bytes as their " "arguments. For example, you have to write::" msgstr "" -#: ../../library/stdtypes.rst:2681 +#: ../../library/stdtypes.rst:2683 msgid "and::" msgstr "" "和:\n" "\n" "::" -#: ../../library/stdtypes.rst:2686 +#: ../../library/stdtypes.rst:2688 msgid "" "Some bytes and bytearray operations assume the use of ASCII compatible " "binary formats, and hence should be avoided when working with arbitrary " "binary data. These restrictions are covered below." msgstr "" -#: ../../library/stdtypes.rst:2691 +#: ../../library/stdtypes.rst:2693 msgid "" "Using these ASCII based operations to manipulate binary data that is not " "stored in an ASCII based format may lead to data corruption." msgstr "" -#: ../../library/stdtypes.rst:2694 +#: ../../library/stdtypes.rst:2696 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2700 +#: ../../library/stdtypes.rst:2702 msgid "" "Return the number of non-overlapping occurrences of subsequence *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:2704 ../../library/stdtypes.rst:2809 -#: ../../library/stdtypes.rst:2831 ../../library/stdtypes.rst:2897 -#: ../../library/stdtypes.rst:2910 +#: ../../library/stdtypes.rst:2706 ../../library/stdtypes.rst:2811 +#: ../../library/stdtypes.rst:2833 ../../library/stdtypes.rst:2899 +#: ../../library/stdtypes.rst:2912 msgid "" "The subsequence to search for may be any :term:`bytes-like object` or an " "integer in the range 0 to 255." msgstr "" -#: ../../library/stdtypes.rst:2707 +#: ../../library/stdtypes.rst:2709 msgid "" "If *sub* is empty, returns the number of empty slices between characters " "which is the length of the bytes object plus one." msgstr "" -#: ../../library/stdtypes.rst:2710 ../../library/stdtypes.rst:2821 -#: ../../library/stdtypes.rst:2834 ../../library/stdtypes.rst:2900 -#: ../../library/stdtypes.rst:2913 +#: ../../library/stdtypes.rst:2712 ../../library/stdtypes.rst:2823 +#: ../../library/stdtypes.rst:2836 ../../library/stdtypes.rst:2902 +#: ../../library/stdtypes.rst:2915 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2717 +#: ../../library/stdtypes.rst:2719 msgid "" "If the binary data starts with the *prefix* string, return " "``bytes[len(prefix):]``. Otherwise, return a copy of the original binary " "data::" msgstr "" -#: ../../library/stdtypes.rst:2726 +#: ../../library/stdtypes.rst:2728 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2730 ../../library/stdtypes.rst:2752 -#: ../../library/stdtypes.rst:2885 ../../library/stdtypes.rst:2978 -#: ../../library/stdtypes.rst:2992 ../../library/stdtypes.rst:3023 -#: ../../library/stdtypes.rst:3037 ../../library/stdtypes.rst:3079 -#: ../../library/stdtypes.rst:3149 ../../library/stdtypes.rst:3167 -#: ../../library/stdtypes.rst:3195 ../../library/stdtypes.rst:3334 -#: ../../library/stdtypes.rst:3389 ../../library/stdtypes.rst:3432 -#: ../../library/stdtypes.rst:3453 ../../library/stdtypes.rst:3475 -#: ../../library/stdtypes.rst:3677 +#: ../../library/stdtypes.rst:2732 ../../library/stdtypes.rst:2754 +#: ../../library/stdtypes.rst:2887 ../../library/stdtypes.rst:2980 +#: ../../library/stdtypes.rst:2994 ../../library/stdtypes.rst:3025 +#: ../../library/stdtypes.rst:3039 ../../library/stdtypes.rst:3081 +#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:3169 +#: ../../library/stdtypes.rst:3197 ../../library/stdtypes.rst:3336 +#: ../../library/stdtypes.rst:3391 ../../library/stdtypes.rst:3434 +#: ../../library/stdtypes.rst:3455 ../../library/stdtypes.rst:3477 +#: ../../library/stdtypes.rst:3679 msgid "" "The bytearray version of this method does *not* operate in place - it always " "produces a new object, even if no changes were made." msgstr "" -#: ../../library/stdtypes.rst:2739 +#: ../../library/stdtypes.rst:2741 msgid "" "If the binary data ends with the *suffix* string and that *suffix* is not " "empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the " "original binary data::" msgstr "" -#: ../../library/stdtypes.rst:2748 +#: ../../library/stdtypes.rst:2750 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2761 +#: ../../library/stdtypes.rst:2763 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:2766 +#: ../../library/stdtypes.rst:2768 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -3498,21 +3503,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:2772 +#: ../../library/stdtypes.rst:2774 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:" "`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:2778 +#: ../../library/stdtypes.rst:2780 msgid "" "Passing the *encoding* argument to :class:`str` allows decoding any :term:" "`bytes-like object` directly, without needing to make a temporary :class:`!" "bytes` or :class:`!bytearray` object." msgstr "" -#: ../../library/stdtypes.rst:2793 +#: ../../library/stdtypes.rst:2795 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -3520,11 +3525,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2798 +#: ../../library/stdtypes.rst:2800 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2804 +#: ../../library/stdtypes.rst:2806 msgid "" "Return the lowest index in the data where the subsequence *sub* is found, " "such that *sub* is contained in the slice ``s[start:end]``. Optional " @@ -3532,20 +3537,20 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2814 +#: ../../library/stdtypes.rst:2816 msgid "" "The :meth:`~bytes.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:2828 +#: ../../library/stdtypes.rst:2830 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:2841 +#: ../../library/stdtypes.rst:2843 msgid "" "Return a bytes or bytearray object which is the concatenation of the binary " "data sequences in *iterable*. A :exc:`TypeError` will be raised if there " @@ -3555,7 +3560,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:2852 +#: ../../library/stdtypes.rst:2854 msgid "" "This static method returns a translation table usable for :meth:`bytes." "translate` that will map each character in *from* into the character at the " @@ -3563,7 +3568,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:2863 +#: ../../library/stdtypes.rst:2865 msgid "" "Split the sequence at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -3572,24 +3577,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:2870 ../../library/stdtypes.rst:2927 +#: ../../library/stdtypes.rst:2872 ../../library/stdtypes.rst:2929 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2876 +#: ../../library/stdtypes.rst:2878 msgid "" "Return a copy of the sequence with all occurrences of subsequence *old* " "replaced by *new*. If the optional argument *count* is given, only the " "first *count* occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:2880 +#: ../../library/stdtypes.rst:2882 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:2892 +#: ../../library/stdtypes.rst:2894 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -3597,13 +3602,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2907 +#: ../../library/stdtypes.rst:2909 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2920 +#: ../../library/stdtypes.rst:2922 msgid "" "Split the sequence at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -3612,7 +3617,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:2933 +#: ../../library/stdtypes.rst:2935 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -3620,11 +3625,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2938 +#: ../../library/stdtypes.rst:2940 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2944 +#: ../../library/stdtypes.rst:2946 msgid "" "Return a copy of the bytes or bytearray object where all bytes occurring in " "the optional argument *delete* are removed, and the remaining bytes have " @@ -3632,22 +3637,22 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:2949 +#: ../../library/stdtypes.rst:2951 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:2952 +#: ../../library/stdtypes.rst:2954 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:2958 +#: ../../library/stdtypes.rst:2960 msgid "*delete* is now supported as a keyword argument." msgstr "" -#: ../../library/stdtypes.rst:2962 +#: ../../library/stdtypes.rst:2964 msgid "" "The following methods on bytes and bytearray objects have default behaviours " "that assume the use of ASCII compatible binary formats, but can still be " @@ -3656,7 +3661,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:2971 +#: ../../library/stdtypes.rst:2973 msgid "" "Return a copy of the object centered in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3664,7 +3669,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2985 +#: ../../library/stdtypes.rst:2987 msgid "" "Return a copy of the object left justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3672,7 +3677,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2999 +#: ../../library/stdtypes.rst:3001 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -3682,14 +3687,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3011 +#: ../../library/stdtypes.rst:3013 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removeprefix` for a method that will remove a " "single prefix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3030 +#: ../../library/stdtypes.rst:3032 msgid "" "Return a copy of the object right justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3697,7 +3702,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3044 +#: ../../library/stdtypes.rst:3046 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are " @@ -3707,7 +3712,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3055 +#: ../../library/stdtypes.rst:3057 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -3717,14 +3722,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3067 +#: ../../library/stdtypes.rst:3069 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removesuffix` for a method that will remove a " "single suffix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3086 +#: ../../library/stdtypes.rst:3088 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given and non-negative, at most " @@ -3733,7 +3738,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3092 +#: ../../library/stdtypes.rst:3094 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " @@ -3744,7 +3749,7 @@ msgid "" "object being split. The *sep* argument may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3110 +#: ../../library/stdtypes.rst:3112 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive ASCII whitespace are regarded as a single " @@ -3754,7 +3759,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3131 +#: ../../library/stdtypes.rst:3133 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *chars* argument is a binary sequence specifying the set of " @@ -3764,13 +3769,13 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3144 +#: ../../library/stdtypes.rst:3146 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3153 +#: ../../library/stdtypes.rst:3155 msgid "" "The following methods on bytes and bytearray objects assume the use of ASCII " "compatible binary formats and should not be applied to arbitrary binary " @@ -3778,14 +3783,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3161 +#: ../../library/stdtypes.rst:3163 msgid "" "Return a copy of the sequence with each byte interpreted as an ASCII " "character, and the first byte capitalized and the rest lowercased. Non-ASCII " "byte values are passed through unchanged." msgstr "" -#: ../../library/stdtypes.rst:3174 +#: ../../library/stdtypes.rst:3176 msgid "" "Return a copy of the sequence where all ASCII tab characters are replaced by " "one or more ASCII spaces, depending on the current column and the given tab " @@ -3801,7 +3806,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3202 +#: ../../library/stdtypes.rst:3204 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -3810,7 +3815,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3219 +#: ../../library/stdtypes.rst:3221 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -3818,35 +3823,35 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3235 +#: ../../library/stdtypes.rst:3237 msgid "" "Return ``True`` if the sequence is empty or all bytes in the sequence are " "ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." msgstr "" -#: ../../library/stdtypes.rst:3245 +#: ../../library/stdtypes.rst:3247 msgid "" "Return ``True`` if all bytes in the sequence are ASCII decimal digits and " "the sequence is not empty, ``False`` otherwise. ASCII decimal digits are " "those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3260 +#: ../../library/stdtypes.rst:3262 msgid "" "Return ``True`` if there is at least one lowercase ASCII character in the " "sequence and no uppercase ASCII characters, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:3270 ../../library/stdtypes.rst:3312 -#: ../../library/stdtypes.rst:3328 ../../library/stdtypes.rst:3378 -#: ../../library/stdtypes.rst:3447 +#: ../../library/stdtypes.rst:3272 ../../library/stdtypes.rst:3314 +#: ../../library/stdtypes.rst:3330 ../../library/stdtypes.rst:3380 +#: ../../library/stdtypes.rst:3449 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " "values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3278 +#: ../../library/stdtypes.rst:3280 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -3854,27 +3859,27 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3287 +#: ../../library/stdtypes.rst:3289 msgid "" "Return ``True`` if the sequence is ASCII titlecase and the sequence is not " "empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the " "definition of \"titlecase\"." msgstr "" -#: ../../library/stdtypes.rst:3302 +#: ../../library/stdtypes.rst:3304 msgid "" "Return ``True`` if there is at least one uppercase alphabetic ASCII " "character in the sequence and no lowercase ASCII characters, ``False`` " "otherwise." msgstr "" -#: ../../library/stdtypes.rst:3320 +#: ../../library/stdtypes.rst:3322 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3345 +#: ../../library/stdtypes.rst:3347 msgid "" "Return a list of the lines in the binary sequence, breaking at ASCII line " "boundaries. This method uses the :term:`universal newlines` approach to " @@ -3882,20 +3887,20 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3357 +#: ../../library/stdtypes.rst:3359 msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:3370 +#: ../../library/stdtypes.rst:3372 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart and vice-versa." msgstr "" -#: ../../library/stdtypes.rst:3382 +#: ../../library/stdtypes.rst:3384 msgid "" "Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -3903,14 +3908,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3396 +#: ../../library/stdtypes.rst:3398 msgid "" "Return a titlecased version of the binary sequence where words start with an " "uppercase ASCII character and the remaining characters are lowercase. " "Uncased byte values are left unmodified." msgstr "" -#: ../../library/stdtypes.rst:3405 +#: ../../library/stdtypes.rst:3407 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -3918,18 +3923,18 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3418 +#: ../../library/stdtypes.rst:3420 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3439 +#: ../../library/stdtypes.rst:3441 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3460 +#: ../../library/stdtypes.rst:3462 msgid "" "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make " "a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is " @@ -3938,11 +3943,11 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3482 +#: ../../library/stdtypes.rst:3484 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3499 +#: ../../library/stdtypes.rst:3501 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -3950,7 +3955,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3504 +#: ../../library/stdtypes.rst:3506 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -3960,7 +3965,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3511 +#: ../../library/stdtypes.rst:3513 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -3968,7 +3973,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3545 +#: ../../library/stdtypes.rst:3547 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the bytes object *must* include a parenthesised mapping key into " @@ -3976,73 +3981,73 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3619 +#: ../../library/stdtypes.rst:3621 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3622 +#: ../../library/stdtypes.rst:3624 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3622 +#: ../../library/stdtypes.rst:3624 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3626 +#: ../../library/stdtypes.rst:3628 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3629 +#: ../../library/stdtypes.rst:3631 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:3632 +#: ../../library/stdtypes.rst:3634 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3632 +#: ../../library/stdtypes.rst:3634 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3667 +#: ../../library/stdtypes.rst:3669 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3670 +#: ../../library/stdtypes.rst:3672 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3682 +#: ../../library/stdtypes.rst:3684 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3689 +#: ../../library/stdtypes.rst:3691 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3691 +#: ../../library/stdtypes.rst:3693 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " "copying." msgstr "" -#: ../../library/stdtypes.rst:3697 +#: ../../library/stdtypes.rst:3699 msgid "" "Create a :class:`memoryview` that references *object*. *object* must " "support the buffer protocol. Built-in objects that support the buffer " "protocol include :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/stdtypes.rst:3701 +#: ../../library/stdtypes.rst:3703 msgid "" "A :class:`memoryview` has the notion of an *element*, which is the atomic " "memory unit handled by the originating *object*. For many simple types such " @@ -4050,7 +4055,7 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:3706 +#: ../../library/stdtypes.rst:3708 msgid "" "``len(view)`` is equal to the length of :class:`~memoryview.tolist`. If " "``view.ndim = 0``, the length is 1. If ``view.ndim = 1``, the length is " @@ -4060,13 +4065,13 @@ msgid "" "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:3713 +#: ../../library/stdtypes.rst:3715 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:3726 +#: ../../library/stdtypes.rst:3728 msgid "" "If :class:`~memoryview.format` is one of the native format specifiers from " "the :mod:`struct` module, indexing with an integer or a tuple of integers is " @@ -4077,82 +4082,82 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:3735 +#: ../../library/stdtypes.rst:3737 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:3747 +#: ../../library/stdtypes.rst:3749 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:3768 +#: ../../library/stdtypes.rst:3770 msgid "" "One-dimensional memoryviews of :term:`hashable` (read-only) types with " "formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) " "== hash(m.tobytes())``::" msgstr "" -#: ../../library/stdtypes.rst:3780 +#: ../../library/stdtypes.rst:3782 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:3784 +#: ../../library/stdtypes.rst:3786 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:3788 +#: ../../library/stdtypes.rst:3790 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:3791 +#: ../../library/stdtypes.rst:3793 msgid ":class:`memoryview` has several methods:" msgstr "" -#: ../../library/stdtypes.rst:3795 +#: ../../library/stdtypes.rst:3797 msgid "" "A memoryview and a :pep:`3118` exporter are equal if their shapes are " "equivalent and if all corresponding values are equal when the operands' " "respective format codes are interpreted using :mod:`struct` syntax." msgstr "" -#: ../../library/stdtypes.rst:3799 +#: ../../library/stdtypes.rst:3801 msgid "" "For the subset of :mod:`struct` format strings currently supported by :meth:" "`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" msgstr "" -#: ../../library/stdtypes.rst:3818 +#: ../../library/stdtypes.rst:3820 msgid "" "If either format string is not supported by the :mod:`struct` module, then " "the objects will always compare as unequal (even if the format strings and " "buffer contents are identical)::" msgstr "" -#: ../../library/stdtypes.rst:3834 +#: ../../library/stdtypes.rst:3836 msgid "" "Note that, as with floating point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:3837 +#: ../../library/stdtypes.rst:3839 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:3843 +#: ../../library/stdtypes.rst:3845 msgid "" "Return the data in the buffer as a bytestring. This is equivalent to " "calling the :class:`bytes` constructor on the memoryview. ::" msgstr "" -#: ../../library/stdtypes.rst:3852 +#: ../../library/stdtypes.rst:3854 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -4160,7 +4165,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:3857 +#: ../../library/stdtypes.rst:3859 msgid "" "*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the " "original array is converted to C or Fortran order. For contiguous views, 'A' " @@ -4169,36 +4174,36 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:3866 +#: ../../library/stdtypes.rst:3868 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:3875 +#: ../../library/stdtypes.rst:3877 msgid "" "Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:3882 +#: ../../library/stdtypes.rst:3884 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:3892 +#: ../../library/stdtypes.rst:3894 msgid "" ":meth:`tolist` now supports all single character native formats in :mod:" "`struct` module syntax as well as multi-dimensional representations." msgstr "" -#: ../../library/stdtypes.rst:3899 +#: ../../library/stdtypes.rst:3901 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:3918 +#: ../../library/stdtypes.rst:3920 msgid "" "Release the underlying buffer exposed by the memoryview object. Many " "objects take special actions when a view is held on them (for example, a :" @@ -4207,20 +4212,20 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:3924 +#: ../../library/stdtypes.rst:3926 msgid "" "After this method has been called, any further operation on the view raises " "a :class:`ValueError` (except :meth:`release()` itself which can be called " "multiple times)::" msgstr "" -#: ../../library/stdtypes.rst:3935 +#: ../../library/stdtypes.rst:3937 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:3951 +#: ../../library/stdtypes.rst:3953 msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " "``[byte_length//new_itemsize]``, which means that the result view will be " @@ -4229,57 +4234,57 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:3957 +#: ../../library/stdtypes.rst:3959 msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " "'c'). The byte length of the result must be the same as the original length." msgstr "" -#: ../../library/stdtypes.rst:3962 +#: ../../library/stdtypes.rst:3964 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:3985 +#: ../../library/stdtypes.rst:3987 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:3998 +#: ../../library/stdtypes.rst:4000 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4024 +#: ../../library/stdtypes.rst:4026 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4038 +#: ../../library/stdtypes.rst:4040 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4041 +#: ../../library/stdtypes.rst:4043 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4045 +#: ../../library/stdtypes.rst:4047 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4056 +#: ../../library/stdtypes.rst:4058 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " "representation. It is not necessarily equal to ``len(m)``::" msgstr "" -#: ../../library/stdtypes.rst:4075 +#: ../../library/stdtypes.rst:4077 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4092 +#: ../../library/stdtypes.rst:4094 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4096 +#: ../../library/stdtypes.rst:4098 msgid "" "A string containing the format (in :mod:`struct` module style) for each " "element in the view. A memoryview can be created from exporters with " @@ -4287,59 +4292,59 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4101 +#: ../../library/stdtypes.rst:4103 msgid "" "format ``'B'`` is now handled according to the struct module syntax. This " "means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgstr "" -#: ../../library/stdtypes.rst:4107 +#: ../../library/stdtypes.rst:4109 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4120 +#: ../../library/stdtypes.rst:4122 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4125 +#: ../../library/stdtypes.rst:4127 msgid "" "A tuple of integers the length of :attr:`ndim` giving the shape of the " "memory as an N-dimensional array." msgstr "" -#: ../../library/stdtypes.rst:4128 ../../library/stdtypes.rst:4136 +#: ../../library/stdtypes.rst:4130 ../../library/stdtypes.rst:4138 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4133 +#: ../../library/stdtypes.rst:4135 msgid "" "A tuple of integers the length of :attr:`ndim` giving the size in bytes to " "access each element for each dimension of the array." msgstr "" -#: ../../library/stdtypes.rst:4141 +#: ../../library/stdtypes.rst:4143 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4145 +#: ../../library/stdtypes.rst:4147 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4151 +#: ../../library/stdtypes.rst:4153 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4157 +#: ../../library/stdtypes.rst:4159 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4165 +#: ../../library/stdtypes.rst:4167 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4169 +#: ../../library/stdtypes.rst:4171 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -4349,7 +4354,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4176 +#: ../../library/stdtypes.rst:4178 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " @@ -4357,7 +4362,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4181 +#: ../../library/stdtypes.rst:4183 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -4369,18 +4374,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4189 +#: ../../library/stdtypes.rst:4191 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -#: ../../library/stdtypes.rst:4193 +#: ../../library/stdtypes.rst:4195 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4198 +#: ../../library/stdtypes.rst:4200 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -4388,92 +4393,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4204 +#: ../../library/stdtypes.rst:4206 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4206 +#: ../../library/stdtypes.rst:4208 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4207 +#: ../../library/stdtypes.rst:4209 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4208 +#: ../../library/stdtypes.rst:4210 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4210 +#: ../../library/stdtypes.rst:4212 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4215 +#: ../../library/stdtypes.rst:4217 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4219 +#: ../../library/stdtypes.rst:4221 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4223 +#: ../../library/stdtypes.rst:4225 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4227 +#: ../../library/stdtypes.rst:4229 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." msgstr "" -#: ../../library/stdtypes.rst:4233 +#: ../../library/stdtypes.rst:4235 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4237 +#: ../../library/stdtypes.rst:4239 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4243 +#: ../../library/stdtypes.rst:4245 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4247 +#: ../../library/stdtypes.rst:4249 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4253 +#: ../../library/stdtypes.rst:4255 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4258 +#: ../../library/stdtypes.rst:4260 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4263 +#: ../../library/stdtypes.rst:4265 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4268 +#: ../../library/stdtypes.rst:4270 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4272 +#: ../../library/stdtypes.rst:4274 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4275 +#: ../../library/stdtypes.rst:4277 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -4483,7 +4488,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4282 +#: ../../library/stdtypes.rst:4284 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -4493,14 +4498,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4289 +#: ../../library/stdtypes.rst:4291 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " "returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." msgstr "" -#: ../../library/stdtypes.rst:4293 +#: ../../library/stdtypes.rst:4295 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -4508,71 +4513,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4298 +#: ../../library/stdtypes.rst:4300 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." msgstr "" -#: ../../library/stdtypes.rst:4301 +#: ../../library/stdtypes.rst:4303 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4303 +#: ../../library/stdtypes.rst:4305 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -#: ../../library/stdtypes.rst:4307 +#: ../../library/stdtypes.rst:4309 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4313 +#: ../../library/stdtypes.rst:4315 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4318 +#: ../../library/stdtypes.rst:4320 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4323 +#: ../../library/stdtypes.rst:4325 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4328 +#: ../../library/stdtypes.rst:4330 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4332 +#: ../../library/stdtypes.rst:4334 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4336 +#: ../../library/stdtypes.rst:4338 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4341 +#: ../../library/stdtypes.rst:4343 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4345 +#: ../../library/stdtypes.rst:4347 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4350 +#: ../../library/stdtypes.rst:4352 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4353 +#: ../../library/stdtypes.rst:4355 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4580,18 +4585,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4358 +#: ../../library/stdtypes.rst:4360 msgid "" "Note, the *elem* argument to the :meth:`__contains__`, :meth:`remove`, and :" "meth:`discard` methods may be a set. To support searching for an equivalent " "frozenset, a temporary one is created from *elem*." msgstr "" -#: ../../library/stdtypes.rst:4366 +#: ../../library/stdtypes.rst:4368 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4376 +#: ../../library/stdtypes.rst:4378 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4600,7 +4605,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4382 +#: ../../library/stdtypes.rst:4384 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4609,33 +4614,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4393 +#: ../../library/stdtypes.rst:4395 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4396 +#: ../../library/stdtypes.rst:4398 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4398 +#: ../../library/stdtypes.rst:4400 msgid "" "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " "4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4400 +#: ../../library/stdtypes.rst:4402 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4401 +#: ../../library/stdtypes.rst:4403 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4404 +#: ../../library/stdtypes.rst:4406 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it is a mapping object, a dictionary is " @@ -4647,7 +4652,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4414 +#: ../../library/stdtypes.rst:4416 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -4655,39 +4660,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4419 +#: ../../library/stdtypes.rst:4421 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4431 +#: ../../library/stdtypes.rst:4433 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." msgstr "" -#: ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:4437 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4440 +#: ../../library/stdtypes.rst:4442 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4444 +#: ../../library/stdtypes.rst:4446 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4448 +#: ../../library/stdtypes.rst:4450 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4453 +#: ../../library/stdtypes.rst:4455 msgid "" "If a subclass of dict defines a method :meth:`__missing__` and *key* is not " "present, the ``d[key]`` operation calls that method with the key *key* as " @@ -4698,51 +4703,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4471 +#: ../../library/stdtypes.rst:4473 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different ``__missing__`` method is used by :class:`collections." "defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:4477 +#: ../../library/stdtypes.rst:4479 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4481 +#: ../../library/stdtypes.rst:4483 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4486 +#: ../../library/stdtypes.rst:4488 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4490 +#: ../../library/stdtypes.rst:4492 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4494 +#: ../../library/stdtypes.rst:4496 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4499 +#: ../../library/stdtypes.rst:4501 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4503 +#: ../../library/stdtypes.rst:4505 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4507 +#: ../../library/stdtypes.rst:4509 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4509 +#: ../../library/stdtypes.rst:4511 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -4751,70 +4756,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4517 +#: ../../library/stdtypes.rst:4519 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " "raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4523 +#: ../../library/stdtypes.rst:4525 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4528 +#: ../../library/stdtypes.rst:4530 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4533 +#: ../../library/stdtypes.rst:4535 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " "*default*. If *default* is not given and *key* is not in the dictionary, a :" "exc:`KeyError` is raised." msgstr "" -#: ../../library/stdtypes.rst:4539 +#: ../../library/stdtypes.rst:4541 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -#: ../../library/stdtypes.rst:4542 +#: ../../library/stdtypes.rst:4544 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " "often used in set algorithms. If the dictionary is empty, calling :meth:" "`popitem` raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4546 +#: ../../library/stdtypes.rst:4548 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4552 +#: ../../library/stdtypes.rst:4554 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4559 +#: ../../library/stdtypes.rst:4561 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." msgstr "" -#: ../../library/stdtypes.rst:4565 +#: ../../library/stdtypes.rst:4567 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4568 +#: ../../library/stdtypes.rst:4570 msgid "" ":meth:`update` accepts either another dictionary object or an iterable of " "key/value pairs (as tuples or other iterables of length two). If keyword " @@ -4822,71 +4827,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4575 +#: ../../library/stdtypes.rst:4577 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4578 +#: ../../library/stdtypes.rst:4580 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" -#: ../../library/stdtypes.rst:4588 +#: ../../library/stdtypes.rst:4590 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4596 +#: ../../library/stdtypes.rst:4598 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4602 +#: ../../library/stdtypes.rst:4604 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " "'>') raise :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:4606 +#: ../../library/stdtypes.rst:4608 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" -#: ../../library/stdtypes.rst:4624 +#: ../../library/stdtypes.rst:4626 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4628 +#: ../../library/stdtypes.rst:4630 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4640 +#: ../../library/stdtypes.rst:4642 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4645 +#: ../../library/stdtypes.rst:4647 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4652 +#: ../../library/stdtypes.rst:4654 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4654 +#: ../../library/stdtypes.rst:4656 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -4894,23 +4899,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4659 +#: ../../library/stdtypes.rst:4661 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4664 +#: ../../library/stdtypes.rst:4666 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4668 +#: ../../library/stdtypes.rst:4670 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4671 +#: ../../library/stdtypes.rst:4673 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -4918,39 +4923,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4676 +#: ../../library/stdtypes.rst:4678 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" -#: ../../library/stdtypes.rst:4679 +#: ../../library/stdtypes.rst:4681 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4684 +#: ../../library/stdtypes.rst:4686 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" -#: ../../library/stdtypes.rst:4689 +#: ../../library/stdtypes.rst:4691 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -#: ../../library/stdtypes.rst:4692 +#: ../../library/stdtypes.rst:4694 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4697 +#: ../../library/stdtypes.rst:4699 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4702 +#: ../../library/stdtypes.rst:4704 msgid "" "Keys views are set-like since their entries are unique and :term:" "`hashable`. If all values are hashable, so that ``(key, value)`` pairs are " @@ -4961,15 +4966,15 @@ msgid "" "``<``, or ``^``)." msgstr "" -#: ../../library/stdtypes.rst:4709 +#: ../../library/stdtypes.rst:4711 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4750 +#: ../../library/stdtypes.rst:4752 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4757 +#: ../../library/stdtypes.rst:4759 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -4977,7 +4982,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4765 +#: ../../library/stdtypes.rst:4767 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -4985,14 +4990,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4770 +#: ../../library/stdtypes.rst:4772 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" "`open` to be used as the context expression in a :keyword:`with` statement." msgstr "" -#: ../../library/stdtypes.rst:4774 +#: ../../library/stdtypes.rst:4776 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -5002,7 +5007,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4784 +#: ../../library/stdtypes.rst:4786 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -5011,7 +5016,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4789 +#: ../../library/stdtypes.rst:4791 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -5022,7 +5027,7 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4796 +#: ../../library/stdtypes.rst:4798 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -5031,7 +5036,7 @@ msgid "" "method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4802 +#: ../../library/stdtypes.rst:4804 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -5040,7 +5045,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4808 +#: ../../library/stdtypes.rst:4810 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -5050,7 +5055,7 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4815 +#: ../../library/stdtypes.rst:4817 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -5059,23 +5064,23 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4823 +#: ../../library/stdtypes.rst:4825 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" msgstr "" -#: ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:4830 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." msgstr "" -#: ../../library/stdtypes.rst:4835 +#: ../../library/stdtypes.rst:4837 msgid "Generic Alias Type" msgstr "" -#: ../../library/stdtypes.rst:4841 +#: ../../library/stdtypes.rst:4843 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -5085,19 +5090,19 @@ msgid "" "are intended primarily for use with :term:`type annotations `." msgstr "" -#: ../../library/stdtypes.rst:4851 +#: ../../library/stdtypes.rst:4853 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:4854 +#: ../../library/stdtypes.rst:4856 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." msgstr "" -#: ../../library/stdtypes.rst:4857 +#: ../../library/stdtypes.rst:4859 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -5106,7 +5111,7 @@ msgid "" "`bytes`." msgstr "" -#: ../../library/stdtypes.rst:4863 +#: ../../library/stdtypes.rst:4865 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -5115,7 +5120,7 @@ msgid "" "the :class:`str` data type and the :class:`bytes` data type:" msgstr "" -#: ../../library/stdtypes.rst:4869 +#: ../../library/stdtypes.rst:4871 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -5123,7 +5128,7 @@ msgid "" "annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" -#: ../../library/stdtypes.rst:4875 +#: ../../library/stdtypes.rst:4877 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -5132,21 +5137,21 @@ msgid "" "objects>` objects with ``re.Match[bytes]``." msgstr "" -#: ../../library/stdtypes.rst:4881 +#: ../../library/stdtypes.rst:4883 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " "directly." msgstr "" -#: ../../library/stdtypes.rst:4887 +#: ../../library/stdtypes.rst:4889 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " "expecting a :class:`list` containing :class:`float` elements::" msgstr "" -#: ../../library/stdtypes.rst:4895 +#: ../../library/stdtypes.rst:4897 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " @@ -5154,13 +5159,13 @@ msgid "" "of type :class:`str` and values of type :class:`int`::" msgstr "" -#: ../../library/stdtypes.rst:4903 +#: ../../library/stdtypes.rst:4905 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" msgstr "" -#: ../../library/stdtypes.rst:4911 +#: ../../library/stdtypes.rst:4913 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -5169,331 +5174,331 @@ msgid "" "discouraged, but will run without errors::" msgstr "" -#: ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:4923 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "" -#: ../../library/stdtypes.rst:4932 +#: ../../library/stdtypes.rst:4934 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -#: ../../library/stdtypes.rst:4940 +#: ../../library/stdtypes.rst:4942 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -#: ../../library/stdtypes.rst:4948 +#: ../../library/stdtypes.rst:4950 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " "items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" msgstr "" -#: ../../library/stdtypes.rst:4959 +#: ../../library/stdtypes.rst:4961 msgid "Standard Generic Classes" msgstr "" -#: ../../library/stdtypes.rst:4961 +#: ../../library/stdtypes.rst:4963 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -#: ../../library/stdtypes.rst:4964 +#: ../../library/stdtypes.rst:4966 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:4965 +#: ../../library/stdtypes.rst:4967 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4968 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:4967 +#: ../../library/stdtypes.rst:4969 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:4970 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:4971 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:4970 +#: ../../library/stdtypes.rst:4972 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4973 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:4974 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:4973 +#: ../../library/stdtypes.rst:4975 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4976 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:4977 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4978 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:4979 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:4978 +#: ../../library/stdtypes.rst:4980 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4981 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:4980 +#: ../../library/stdtypes.rst:4982 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:4983 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:4984 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:4985 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:4984 +#: ../../library/stdtypes.rst:4986 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:4985 +#: ../../library/stdtypes.rst:4987 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:4986 +#: ../../library/stdtypes.rst:4988 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4989 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:4988 +#: ../../library/stdtypes.rst:4990 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:4991 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:4990 +#: ../../library/stdtypes.rst:4992 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:4993 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:4992 +#: ../../library/stdtypes.rst:4994 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:4995 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:4994 +#: ../../library/stdtypes.rst:4996 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:4997 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:4998 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:4999 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:4998 +#: ../../library/stdtypes.rst:5000 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:4999 +#: ../../library/stdtypes.rst:5001 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5000 +#: ../../library/stdtypes.rst:5002 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5001 +#: ../../library/stdtypes.rst:5003 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:5004 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5003 +#: ../../library/stdtypes.rst:5005 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5004 +#: ../../library/stdtypes.rst:5006 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5005 +#: ../../library/stdtypes.rst:5007 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5006 +#: ../../library/stdtypes.rst:5008 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5007 +#: ../../library/stdtypes.rst:5009 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5008 +#: ../../library/stdtypes.rst:5010 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5009 +#: ../../library/stdtypes.rst:5011 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5012 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5013 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5012 +#: ../../library/stdtypes.rst:5014 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5015 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5014 +#: ../../library/stdtypes.rst:5016 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5015 +#: ../../library/stdtypes.rst:5017 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5018 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5017 +#: ../../library/stdtypes.rst:5019 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5022 +#: ../../library/stdtypes.rst:5024 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "" -#: ../../library/stdtypes.rst:5024 +#: ../../library/stdtypes.rst:5026 msgid "All parameterized generics implement special read-only attributes." msgstr "" -#: ../../library/stdtypes.rst:5028 +#: ../../library/stdtypes.rst:5030 msgid "This attribute points at the non-parameterized generic class::" msgstr "" -#: ../../library/stdtypes.rst:5036 +#: ../../library/stdtypes.rst:5038 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " "class::" msgstr "" -#: ../../library/stdtypes.rst:5046 +#: ../../library/stdtypes.rst:5048 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -#: ../../library/stdtypes.rst:5057 +#: ../../library/stdtypes.rst:5059 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." "ParamSpec` is intended primarily for static type checking." msgstr "" -#: ../../library/stdtypes.rst:5064 +#: ../../library/stdtypes.rst:5066 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." msgstr "" -#: ../../library/stdtypes.rst:5073 +#: ../../library/stdtypes.rst:5075 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../library/stdtypes.rst:5073 +#: ../../library/stdtypes.rst:5075 msgid "Introducing Python's framework for type annotations." msgstr "" -#: ../../library/stdtypes.rst:5078 +#: ../../library/stdtypes.rst:5080 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/stdtypes.rst:5076 +#: ../../library/stdtypes.rst:5078 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." "__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:5081 +#: ../../library/stdtypes.rst:5083 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" msgstr "" -#: ../../library/stdtypes.rst:5081 +#: ../../library/stdtypes.rst:5083 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../library/stdtypes.rst:5090 +#: ../../library/stdtypes.rst:5092 msgid "Union Type" msgstr "" -#: ../../library/stdtypes.rst:5096 +#: ../../library/stdtypes.rst:5098 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -5502,7 +5507,7 @@ msgid "" "Union`." msgstr "" -#: ../../library/stdtypes.rst:5103 +#: ../../library/stdtypes.rst:5105 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -5510,76 +5515,76 @@ msgid "" "class:`float`::" msgstr "" -#: ../../library/stdtypes.rst:5113 +#: ../../library/stdtypes.rst:5115 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5115 +#: ../../library/stdtypes.rst:5117 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5119 +#: ../../library/stdtypes.rst:5121 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5123 +#: ../../library/stdtypes.rst:5125 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5127 +#: ../../library/stdtypes.rst:5129 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5131 +#: ../../library/stdtypes.rst:5133 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5138 +#: ../../library/stdtypes.rst:5140 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5144 +#: ../../library/stdtypes.rst:5146 msgid "" "However, union objects containing :ref:`parameterized generics ` cannot be used::" msgstr "" -#: ../../library/stdtypes.rst:5152 +#: ../../library/stdtypes.rst:5154 msgid "" "The user-exposed type for the union object can be accessed from :data:`types." "UnionType` and used for :func:`isinstance` checks. An object cannot be " "instantiated from the type::" msgstr "" -#: ../../library/stdtypes.rst:5165 +#: ../../library/stdtypes.rst:5167 msgid "" "The :meth:`__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`__or__`, the Union may override " "it::" msgstr "" -#: ../../library/stdtypes.rst:5183 +#: ../../library/stdtypes.rst:5185 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5191 +#: ../../library/stdtypes.rst:5193 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5193 +#: ../../library/stdtypes.rst:5195 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5200 +#: ../../library/stdtypes.rst:5202 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5202 +#: ../../library/stdtypes.rst:5204 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -5590,7 +5595,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5209 +#: ../../library/stdtypes.rst:5211 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5601,32 +5606,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5217 +#: ../../library/stdtypes.rst:5219 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5225 +#: ../../library/stdtypes.rst:5227 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5227 +#: ../../library/stdtypes.rst:5229 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5233 +#: ../../library/stdtypes.rst:5235 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5235 +#: ../../library/stdtypes.rst:5237 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:5238 +#: ../../library/stdtypes.rst:5240 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5634,15 +5639,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5242 +#: ../../library/stdtypes.rst:5244 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`\\ 。" -#: ../../library/stdtypes.rst:5248 +#: ../../library/stdtypes.rst:5250 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5252 +#: ../../library/stdtypes.rst:5254 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: built-in methods (such as :meth:`append` on lists) and " @@ -5650,7 +5655,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:5257 +#: ../../library/stdtypes.rst:5259 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :dfn:" @@ -5662,7 +5667,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5266 +#: ../../library/stdtypes.rst:5268 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5672,15 +5677,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5286 ../../library/stdtypes.rst:5317 +#: ../../library/stdtypes.rst:5288 ../../library/stdtypes.rst:5319 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`\\ 。" -#: ../../library/stdtypes.rst:5294 +#: ../../library/stdtypes.rst:5296 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5300 +#: ../../library/stdtypes.rst:5302 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5690,23 +5695,23 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5307 +#: ../../library/stdtypes.rst:5309 msgid "" "Accessing ``__code__`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"__code__\"``." msgstr "" -#: ../../library/stdtypes.rst:5314 +#: ../../library/stdtypes.rst:5316 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:5323 +#: ../../library/stdtypes.rst:5325 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5329 +#: ../../library/stdtypes.rst:5331 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -5714,30 +5719,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:5336 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5340 +#: ../../library/stdtypes.rst:5342 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5342 +#: ../../library/stdtypes.rst:5344 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:5346 +#: ../../library/stdtypes.rst:5348 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5353 +#: ../../library/stdtypes.rst:5355 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5355 +#: ../../library/stdtypes.rst:5357 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5745,15 +5750,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5360 +#: ../../library/stdtypes.rst:5362 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5366 +#: ../../library/stdtypes.rst:5368 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5368 +#: ../../library/stdtypes.rst:5370 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -5761,15 +5766,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5373 +#: ../../library/stdtypes.rst:5375 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5379 +#: ../../library/stdtypes.rst:5381 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5381 +#: ../../library/stdtypes.rst:5383 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5780,81 +5785,81 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5394 +#: ../../library/stdtypes.rst:5396 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5400 +#: ../../library/stdtypes.rst:5402 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5402 +#: ../../library/stdtypes.rst:5404 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5409 +#: ../../library/stdtypes.rst:5411 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5411 +#: ../../library/stdtypes.rst:5413 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:5420 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5424 +#: ../../library/stdtypes.rst:5426 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5429 +#: ../../library/stdtypes.rst:5431 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5434 +#: ../../library/stdtypes.rst:5436 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5440 +#: ../../library/stdtypes.rst:5442 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5448 +#: ../../library/stdtypes.rst:5450 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5454 +#: ../../library/stdtypes.rst:5456 msgid "" "This method can be overridden by a metaclass to customize the method " "resolution order for its instances. It is called at class instantiation, " "and its result is stored in :attr:`~class.__mro__`." msgstr "" -#: ../../library/stdtypes.rst:5461 +#: ../../library/stdtypes.rst:5463 msgid "" "Each class keeps a list of weak references to its immediate subclasses. " "This method returns a list of all those references still alive. The list is " "in definition order. Example::" msgstr "" -#: ../../library/stdtypes.rst:5472 +#: ../../library/stdtypes.rst:5474 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5476 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -5862,7 +5867,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5479 +#: ../../library/stdtypes.rst:5481 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -5872,25 +5877,25 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5486 +#: ../../library/stdtypes.rst:5488 msgid "" "Limiting conversion size offers a practical way to avoid `CVE-2020-10735 " "`_." msgstr "" -#: ../../library/stdtypes.rst:5489 +#: ../../library/stdtypes.rst:5491 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " "Underscores and the sign are not counted towards the limit." msgstr "" -#: ../../library/stdtypes.rst:5493 +#: ../../library/stdtypes.rst:5495 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5515 +#: ../../library/stdtypes.rst:5517 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -5898,94 +5903,94 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5520 +#: ../../library/stdtypes.rst:5522 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5535 +#: ../../library/stdtypes.rst:5537 msgid "Affected APIs" msgstr "" -#: ../../library/stdtypes.rst:5537 +#: ../../library/stdtypes.rst:5539 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5540 +#: ../../library/stdtypes.rst:5542 msgid "``int(string)`` with default base 10." msgstr "" -#: ../../library/stdtypes.rst:5541 +#: ../../library/stdtypes.rst:5543 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5542 +#: ../../library/stdtypes.rst:5544 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5543 +#: ../../library/stdtypes.rst:5545 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5546 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5547 +#: ../../library/stdtypes.rst:5549 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5551 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5550 +#: ../../library/stdtypes.rst:5552 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr "" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5553 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr "" -#: ../../library/stdtypes.rst:5552 +#: ../../library/stdtypes.rst:5554 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5553 +#: ../../library/stdtypes.rst:5555 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5554 +#: ../../library/stdtypes.rst:5556 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5557 +#: ../../library/stdtypes.rst:5559 msgid "Configuring the limit" msgstr "" -#: ../../library/stdtypes.rst:5559 +#: ../../library/stdtypes.rst:5561 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" msgstr "" -#: ../../library/stdtypes.rst:5562 +#: ../../library/stdtypes.rst:5564 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " "the limitation." msgstr "" -#: ../../library/stdtypes.rst:5565 +#: ../../library/stdtypes.rst:5567 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" msgstr "" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5569 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -5994,38 +5999,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5573 +#: ../../library/stdtypes.rst:5575 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5578 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " "their own limit." msgstr "" -#: ../../library/stdtypes.rst:5580 +#: ../../library/stdtypes.rst:5582 msgid "" "Information about the default and minimum can be found in :attr:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5582 +#: ../../library/stdtypes.rst:5584 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5584 +#: ../../library/stdtypes.rst:5586 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:5591 +#: ../../library/stdtypes.rst:5593 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -6037,7 +6042,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5600 +#: ../../library/stdtypes.rst:5602 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -6045,11 +6050,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5606 +#: ../../library/stdtypes.rst:5608 msgid "Recommended configuration" msgstr "" -#: ../../library/stdtypes.rst:5608 +#: ../../library/stdtypes.rst:5610 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -6057,45 +6062,45 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.11." msgstr "" -#: ../../library/stdtypes.rst:5613 +#: ../../library/stdtypes.rst:5615 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:5625 +#: ../../library/stdtypes.rst:5627 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5629 +#: ../../library/stdtypes.rst:5631 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5630 +#: ../../library/stdtypes.rst:5632 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5633 +#: ../../library/stdtypes.rst:5635 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5636 +#: ../../library/stdtypes.rst:5638 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5638 +#: ../../library/stdtypes.rst:5640 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:5641 +#: ../../library/stdtypes.rst:5643 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." From a4750a5a26b87039de27b46c6910b5edf9dbb1fc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 7 Mar 2023 00:38:39 +0000 Subject: [PATCH 042/130] sync with cpython 280b975c --- sphinx.po | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sphinx.po b/sphinx.po index 09e7f94057..c4aa043ae5 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-03-07 00:36+0000\n" "PO-Revision-Date: 2022-06-27 11:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,23 +46,35 @@ msgstr "自從版本 {deprecated} 後不推薦使用,將會自版本 {removed} msgid "Deprecated since version {deprecated}, removed in version {removed}" msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} 中移除。" +#: ../../tools/templates/dummy.html:12 +msgid "Return value: Always NULL." +msgstr "" + #: ../../tools/templates/dummy.html:13 +msgid "Return value: New reference." +msgstr "" + +#: ../../tools/templates/dummy.html:14 +msgid "Return value: Borrowed reference." +msgstr "" + +#: ../../tools/templates/dummy.html:18 msgid "in development" msgstr "開發中" -#: ../../tools/templates/dummy.html:14 +#: ../../tools/templates/dummy.html:19 msgid "pre-release" msgstr "預發行" -#: ../../tools/templates/dummy.html:15 +#: ../../tools/templates/dummy.html:20 msgid "stable" msgstr "穩定版本" -#: ../../tools/templates/dummy.html:16 +#: ../../tools/templates/dummy.html:21 msgid "security-fixes" msgstr "安全性修護" -#: ../../tools/templates/dummy.html:17 +#: ../../tools/templates/dummy.html:22 msgid "EOL" msgstr "停止維護" From fdd0f753947237743d238f28e17edde1f3e6cde5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 8 Mar 2023 00:36:32 +0000 Subject: [PATCH 043/130] sync with cpython df3ed54e --- whatsnew/3.11.po | 1135 ++++++++++++++++++++++++---------------------- 1 file changed, 592 insertions(+), 543 deletions(-) diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 3aa85054ce..2a3f7ba79a 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-03-08 00:34+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -152,7 +152,7 @@ msgid "" "pep670>`" msgstr "" -#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2175 +#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2207 msgid "New Features" msgstr "" @@ -1531,8 +1531,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:1272 msgid "" "The compiler now optimizes simple :ref:`printf-style % formatting ` on string literals containing only the format codes ``" -"%s``, ``%r`` and ``%a`` and makes it as fast as a corresponding :term:`f-" +"string-formatting>` on string literals containing only the format codes " +"``%s``, ``%r`` and ``%a`` and makes it as fast as a corresponding :term:`f-" "string` expression. (Contributed by Serhiy Storchaka in :issue:`28307`.)" msgstr "" @@ -1600,477 +1600,511 @@ msgstr "" #: ../../whatsnew/3.11.rst:1322 msgid "" -"CPython 3.11 is on average `25% faster `_ than CPython 3.10 when measured with the " +"CPython 3.11 is an average of `25% faster `_ than CPython 3.10 as measured with the " "`pyperformance `_ benchmark suite, " -"and compiled with GCC on Ubuntu Linux. Depending on your workload, the " -"speedup could be up to 10-60% faster." +"when compiled with GCC on Ubuntu Linux. Depending on your workload, the " +"overall speedup could be 10-60%." msgstr "" -#: ../../whatsnew/3.11.rst:1328 +#: ../../whatsnew/3.11.rst:1329 msgid "" -"This project focuses on two major areas in Python: faster startup and faster " -"runtime. Other optimizations not under this project are listed in " -"`Optimizations`_." +"This project focuses on two major areas in Python: :ref:`whatsnew311-faster-" +"startup` and :ref:`whatsnew311-faster-runtime`. Optimizations not covered by " +"this project are listed separately under :ref:`whatsnew311-optimizations`." msgstr "" -#: ../../whatsnew/3.11.rst:1335 +#: ../../whatsnew/3.11.rst:1338 msgid "Faster Startup" msgstr "" -#: ../../whatsnew/3.11.rst:1340 +#: ../../whatsnew/3.11.rst:1343 msgid "Frozen imports / Static code objects" msgstr "" -#: ../../whatsnew/3.11.rst:1342 +#: ../../whatsnew/3.11.rst:1345 msgid "" -"Python caches bytecode in the :ref:`__pycache__` directory to " -"speed up module loading." +"Python caches :term:`bytecode` in the :ref:`__pycache__ ` " +"directory to speed up module loading." msgstr "" -#: ../../whatsnew/3.11.rst:1345 +#: ../../whatsnew/3.11.rst:1348 msgid "Previously in 3.10, Python module execution looked like this:" msgstr "" -#: ../../whatsnew/3.11.rst:1351 +#: ../../whatsnew/3.11.rst:1354 msgid "" -"In Python 3.11, the core modules essential for Python startup are \"frozen" -"\". This means that their code objects (and bytecode) are statically " -"allocated by the interpreter. This reduces the steps in module execution " -"process to this:" +"In Python 3.11, the core modules essential for Python startup are " +"\"frozen\". This means that their :ref:`codeobjects` (and bytecode) are " +"statically allocated by the interpreter. This reduces the steps in module " +"execution process to:" msgstr "" -#: ../../whatsnew/3.11.rst:1359 +#: ../../whatsnew/3.11.rst:1363 msgid "" "Interpreter startup is now 10-15% faster in Python 3.11. This has a big " "impact for short-running programs using Python." msgstr "" -#: ../../whatsnew/3.11.rst:1362 +#: ../../whatsnew/3.11.rst:1366 msgid "" -"(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in numerous " -"issues.)" +"(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in many issues.)" msgstr "" -#: ../../whatsnew/3.11.rst:1368 +#: ../../whatsnew/3.11.rst:1372 msgid "Faster Runtime" msgstr "" -#: ../../whatsnew/3.11.rst:1373 +#: ../../whatsnew/3.11.rst:1377 msgid "Cheaper, lazy Python frames" msgstr "" -#: ../../whatsnew/3.11.rst:1375 +#: ../../whatsnew/3.11.rst:1379 msgid "" -"Python frames are created whenever Python calls a Python function. This " -"frame holds execution information. The following are new frame optimizations:" +"Python frames, holding execution information, are created whenever Python " +"calls a Python function. The following are new frame optimizations:" msgstr "" -#: ../../whatsnew/3.11.rst:1378 +#: ../../whatsnew/3.11.rst:1383 msgid "Streamlined the frame creation process." msgstr "" -#: ../../whatsnew/3.11.rst:1379 +#: ../../whatsnew/3.11.rst:1384 msgid "" "Avoided memory allocation by generously re-using frame space on the C stack." msgstr "" -#: ../../whatsnew/3.11.rst:1380 +#: ../../whatsnew/3.11.rst:1385 msgid "" "Streamlined the internal frame struct to contain only essential information. " "Frames previously held extra debugging and memory management information." msgstr "" -#: ../../whatsnew/3.11.rst:1383 +#: ../../whatsnew/3.11.rst:1388 msgid "" -"Old-style frame objects are now created only when requested by debuggers or " -"by Python introspection functions such as ``sys._getframe`` or ``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." +"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 " +"pyperformance." msgstr "" -#: ../../whatsnew/3.11.rst:1389 +#: ../../whatsnew/3.11.rst:1395 msgid "(Contributed by Mark Shannon in :issue:`44590`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1396 +#: ../../whatsnew/3.11.rst:1402 msgid "Inlined Python function calls" msgstr "" -#: ../../whatsnew/3.11.rst:1398 +#: ../../whatsnew/3.11.rst:1404 msgid "" "During a Python function call, Python will call an evaluating C function to " "interpret that function's code. This effectively limits pure Python " "recursion to what's safe for the C stack." msgstr "" -#: ../../whatsnew/3.11.rst:1402 +#: ../../whatsnew/3.11.rst:1408 msgid "" "In 3.11, when CPython detects Python code calling another Python function, " "it sets up a new frame, and \"jumps\" to the new code inside the new frame. " "This avoids calling the C interpreting function altogether." msgstr "" -#: ../../whatsnew/3.11.rst:1406 +#: ../../whatsnew/3.11.rst:1412 msgid "" -"Most Python function calls now consume no C stack space. This speeds up most " -"of such calls. In simple recursive functions like fibonacci or factorial, a " -"1.7x speedup was observed. This also means recursive functions can recurse " -"significantly deeper (if the user increases the recursion limit). We " -"measured a 1-3% improvement in pyperformance." +"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." msgstr "" -#: ../../whatsnew/3.11.rst:1412 +#: ../../whatsnew/3.11.rst:1419 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1418 +#: ../../whatsnew/3.11.rst:1425 msgid "PEP 659: Specializing Adaptive Interpreter" msgstr "" -#: ../../whatsnew/3.11.rst:1420 +#: ../../whatsnew/3.11.rst:1427 msgid "" -":pep:`659` is one of the key parts of the faster CPython project. The " +":pep:`659` is one of the key parts of the Faster CPython project. The " "general idea is that while Python is a dynamic language, most code has " "regions where objects and types rarely change. This concept is known as " "*type stability*." msgstr "" -#: ../../whatsnew/3.11.rst:1424 +#: ../../whatsnew/3.11.rst:1431 msgid "" "At runtime, Python will try to look for common patterns and type stability " "in the executing code. Python will then replace the current operation with a " "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 " -"bytecode." +"where Python caches the results of expensive operations directly in the :" +"term:`bytecode`." msgstr "" -#: ../../whatsnew/3.11.rst:1431 +#: ../../whatsnew/3.11.rst:1439 msgid "" "The specializer will also combine certain common instruction pairs into one " -"superinstruction. This reduces the overhead during execution." +"superinstruction, reducing the overhead during execution." msgstr "" -#: ../../whatsnew/3.11.rst:1434 +#: ../../whatsnew/3.11.rst:1442 msgid "" "Python will only specialize when it sees code that is \"hot\" (executed " -"multiple times). This prevents Python from wasting time for run-once code. " +"multiple times). This prevents Python from wasting time on run-once code. " "Python can also de-specialize when code is too dynamic or when the use " "changes. Specialization is attempted periodically, and specialization " -"attempts are not too expensive. This allows specialization to adapt to new " +"attempts are not too expensive, allowing specialization to adapt to new " "circumstances." msgstr "" -#: ../../whatsnew/3.11.rst:1441 +#: ../../whatsnew/3.11.rst:1449 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.)" msgstr "" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1457 msgid "Operation" msgstr "" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1457 msgid "Form" msgstr "" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1457 msgid "Specialization" msgstr "" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1457 msgid "Operation speedup (up to)" msgstr "" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1457 msgid "Contributor(s)" msgstr "" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1460 msgid "Binary operations" msgstr "" -#: ../../whatsnew/3.11.rst:1452 -msgid "``x+x; x*x; x-x;``" -msgstr "``x+x; x*x; x-x;``" +#: ../../whatsnew/3.11.rst:1460 +msgid "``x + x``" +msgstr "" + +#: ../../whatsnew/3.11.rst:1462 +msgid "``x - x``" +msgstr "" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1464 +msgid "``x * x``" +msgstr "" + +#: ../../whatsnew/3.11.rst:1460 msgid "" -"Binary add, multiply and subtract for common types such as ``int``, " -"``float``, and ``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 "" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1460 msgid "10%" msgstr "10%" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1460 msgid "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" msgstr "" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1466 msgid "Subscript" msgstr "" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1466 msgid "``a[i]``" msgstr "``a[i]``" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1466 msgid "" -"Subscripting container types such as ``list``, ``tuple`` and ``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 "" -#: ../../whatsnew/3.11.rst:1461 +#: ../../whatsnew/3.11.rst:1470 msgid "" -"Subscripting custom ``__getitem__`` is also inlined similar to :ref:`inline-" -"calls`." +"Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" +"ref:`inline-calls`." msgstr "" -#: ../../whatsnew/3.11.rst:1457 ../../whatsnew/3.11.rst:1464 +#: ../../whatsnew/3.11.rst:1466 ../../whatsnew/3.11.rst:1473 msgid "10-25%" msgstr "10-25%" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1466 msgid "Irit Katriel, Mark Shannon" msgstr "Irit Katriel, Mark Shannon" -#: ../../whatsnew/3.11.rst:1464 +#: ../../whatsnew/3.11.rst:1473 msgid "Store subscript" msgstr "" -#: ../../whatsnew/3.11.rst:1464 +#: ../../whatsnew/3.11.rst:1473 msgid "``a[i] = z``" msgstr "``a[i] = z``" -#: ../../whatsnew/3.11.rst:1464 +#: ../../whatsnew/3.11.rst:1473 msgid "Similar to subscripting specialization above." msgstr "" -#: ../../whatsnew/3.11.rst:1464 +#: ../../whatsnew/3.11.rst:1473 msgid "Dennis Sweeney" msgstr "Dennis Sweeney" -#: ../../whatsnew/3.11.rst:1467 +#: ../../whatsnew/3.11.rst:1476 msgid "Calls" msgstr "" -#: ../../whatsnew/3.11.rst:1467 -msgid "``f(arg)`` ``C(arg)``" -msgstr "``f(arg)`` ``C(arg)``" +#: ../../whatsnew/3.11.rst:1476 +msgid "``f(arg)``" +msgstr "" + +#: ../../whatsnew/3.11.rst:1478 +msgid "``C(arg)``" +msgstr "" -#: ../../whatsnew/3.11.rst:1467 +#: ../../whatsnew/3.11.rst:1476 msgid "" -"Calls to common builtin (C) functions and types such as ``len`` and ``str`` " -"directly call their underlying C version. This avoids going through the " -"internal calling convention." +"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 "" -#: ../../whatsnew/3.11.rst:1467 +#: ../../whatsnew/3.11.rst:1476 msgid "20%" msgstr "20%" -#: ../../whatsnew/3.11.rst:1467 +#: ../../whatsnew/3.11.rst:1476 msgid "Mark Shannon, Ken Jin" msgstr "Mark Shannon, Ken Jin" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1481 msgid "Load global variable" msgstr "" -#: ../../whatsnew/3.11.rst:1473 -msgid "``print`` ``len``" -msgstr "``print`` ``len``" +#: ../../whatsnew/3.11.rst:1481 +msgid "``print``" +msgstr "" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1483 +msgid "``len``" +msgstr "" + +#: ../../whatsnew/3.11.rst:1481 msgid "" "The object's index in the globals/builtins namespace is cached. Loading " "globals and builtins require zero namespace lookups." msgstr "" -#: ../../whatsnew/3.11.rst:1473 -msgid "[1]_" -msgstr "[1]_" +#: ../../whatsnew/3.11.rst:1481 +msgid "[#load-global]_" +msgstr "" -#: ../../whatsnew/3.11.rst:1473 ../../whatsnew/3.11.rst:1477 -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1481 ../../whatsnew/3.11.rst:1485 +#: ../../whatsnew/3.11.rst:1494 msgid "Mark Shannon" msgstr "Mark Shannon" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1485 msgid "Load attribute" msgstr "" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1485 msgid "``o.attr``" msgstr "``o.attr``" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1485 msgid "" "Similar to loading global variables. The attribute's index inside the class/" "object's namespace is cached. In most cases, attribute loading will require " "zero namespace lookups." msgstr "" -#: ../../whatsnew/3.11.rst:1477 -msgid "[2]_" -msgstr "[2]_" +#: ../../whatsnew/3.11.rst:1485 +msgid "[#load-attr]_" +msgstr "" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1490 msgid "Load methods for call" msgstr "" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1490 msgid "``o.meth()``" msgstr "``o.meth()``" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1490 msgid "" "The actual address of the method is cached. Method loading now has no " "namespace lookups -- even for classes with long inheritance chains." msgstr "" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1490 msgid "10-20%" msgstr "10-20%" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1490 msgid "Ken Jin, Mark Shannon" msgstr "Ken Jin, Mark Shannon" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1494 msgid "Store attribute" msgstr "" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1494 msgid "``o.attr = z``" msgstr "``o.attr = z``" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1494 msgid "Similar to load attribute optimization." msgstr "" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1494 msgid "2% in pyperformance" msgstr "" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1497 msgid "Unpack Sequence" msgstr "" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1497 msgid "``*seq``" msgstr "``*seq``" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1497 msgid "" -"Specialized for common containers such as ``list`` and ``tuple``. Avoids " -"internal calling convention." +"Specialized for common containers such as :class:`list` and :class:`tuple`. " +"Avoids internal calling convention." msgstr "" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1497 msgid "8%" msgstr "8%" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1497 msgid "Brandt Bucher" msgstr "" -#: ../../whatsnew/3.11.rst:1493 +#: ../../whatsnew/3.11.rst:1502 msgid "" -"A similar optimization already existed since Python 3.8. 3.11 specializes " +"A similar optimization already existed since Python 3.8. 3.11 specializes " "for more forms and reduces some overhead." msgstr "" -#: ../../whatsnew/3.11.rst:1496 +#: ../../whatsnew/3.11.rst:1505 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`." msgstr "" -#: ../../whatsnew/3.11.rst:1504 +#: ../../whatsnew/3.11.rst:1513 msgid "Misc" msgstr "" -#: ../../whatsnew/3.11.rst:1506 +#: ../../whatsnew/3.11.rst:1515 msgid "" "Objects now require less memory due to lazily created object namespaces. " "Their namespace dictionaries now also share keys more freely. (Contributed " "Mark Shannon in :issue:`45340` and :issue:`40116`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1510 +#: ../../whatsnew/3.11.rst:1519 +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`.)" +msgstr "" + +#: ../../whatsnew/3.11.rst:1523 msgid "" "A more concise representation of exceptions in the interpreter reduced the " "time required for catching an exception by about 10%. (Contributed by Irit " "Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1518 +#: ../../whatsnew/3.11.rst:1527 +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`.)" +msgstr "" + +#: ../../whatsnew/3.11.rst:1538 msgid "FAQ" msgstr "" -#: ../../whatsnew/3.11.rst:1520 -msgid "Q: How should I write my code to utilize these speedups?" +#: ../../whatsnew/3.11.rst:1543 +msgid "How should I write my code to utilize these speedups?" msgstr "" -#: ../../whatsnew/3.11.rst:1524 +#: ../../whatsnew/3.11.rst:1545 msgid "" -"A: You don't have to change your code. Write Pythonic code that follows " -"common best practices. The Faster CPython project optimizes for common code " +"Write Pythonic code that follows common best practices; you don't have to " +"change your code. The Faster CPython project optimizes for common code " "patterns we observe." msgstr "" -#: ../../whatsnew/3.11.rst:1527 -msgid "Q: Will CPython 3.11 use more memory?" +#: ../../whatsnew/3.11.rst:1553 +msgid "Will CPython 3.11 use more memory?" msgstr "" -#: ../../whatsnew/3.11.rst:1531 +#: ../../whatsnew/3.11.rst:1555 msgid "" -"A: Maybe not. We don't expect memory use to exceed 20% more than 3.10. This " +"Maybe not; we don't expect memory use to exceed 20% higher than 3.10. This " "is offset by memory optimizations for frame objects and object dictionaries " "as mentioned above." msgstr "" -#: ../../whatsnew/3.11.rst:1534 -msgid "Q: I don't see any speedups in my workload. Why?" +#: ../../whatsnew/3.11.rst:1563 +msgid "I don't see any speedups in my workload. Why?" msgstr "" -#: ../../whatsnew/3.11.rst:1539 +#: ../../whatsnew/3.11.rst:1565 msgid "" -"A: Certain code won't have noticeable benefits. If your code spends most of " -"its time on I/O operations, or already does most of its computation in a C " -"extension library like numpy, there won't be significant speedup. This " +"Certain code won't have noticeable benefits. If your code spends most of its " +"time on I/O operations, or already does most of its computation in a C " +"extension library like NumPy, there won't be significant speedups. This " "project currently benefits pure-Python workloads the most." msgstr "" -#: ../../whatsnew/3.11.rst:1543 +#: ../../whatsnew/3.11.rst:1570 msgid "" "Furthermore, the pyperformance figures are a geometric mean. Even within the " "pyperformance benchmarks, certain benchmarks have slowed down slightly, " "while others have sped up by nearly 2x!" msgstr "" -#: ../../whatsnew/3.11.rst:1546 -msgid "Q: Is there a JIT compiler?" +#: ../../whatsnew/3.11.rst:1578 +msgid "Is there a JIT compiler?" msgstr "" -#: ../../whatsnew/3.11.rst:1548 -msgid "A: No. We're still exploring other optimizations." +#: ../../whatsnew/3.11.rst:1580 +msgid "No. We're still exploring other optimizations." msgstr "" -#: ../../whatsnew/3.11.rst:1554 +#: ../../whatsnew/3.11.rst:1586 msgid "About" msgstr "" -#: ../../whatsnew/3.11.rst:1556 +#: ../../whatsnew/3.11.rst:1588 msgid "" "Faster CPython explores optimizations for :term:`CPython`. The main team is " "funded by Microsoft to work on this full-time. Pablo Galindo Salgado is also " @@ -2078,11 +2112,11 @@ msgid "" "contributors are volunteers from the community." msgstr "" -#: ../../whatsnew/3.11.rst:1565 +#: ../../whatsnew/3.11.rst:1597 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.11.rst:1567 +#: ../../whatsnew/3.11.rst:1599 msgid "" "The bytecode now contains inline cache entries, which take the form of the " "newly-added :opcode:`CACHE` instructions. Many opcodes expect to be followed " @@ -2092,62 +2126,62 @@ msgid "" "containing quickened data." msgstr "" -#: ../../whatsnew/3.11.rst:1579 +#: ../../whatsnew/3.11.rst:1611 msgid "New opcodes" msgstr "" -#: ../../whatsnew/3.11.rst:1581 +#: ../../whatsnew/3.11.rst:1613 msgid "" ":opcode:`ASYNC_GEN_WRAP`, :opcode:`RETURN_GENERATOR` and :opcode:`SEND`, " "used in generators and co-routines." msgstr "" -#: ../../whatsnew/3.11.rst:1584 +#: ../../whatsnew/3.11.rst:1616 msgid "" ":opcode:`COPY_FREE_VARS`, which avoids needing special caller-side code for " "closures." msgstr "" -#: ../../whatsnew/3.11.rst:1587 +#: ../../whatsnew/3.11.rst:1619 msgid "" ":opcode:`JUMP_BACKWARD_NO_INTERRUPT`, for use in certain loops where " "handling interrupts is undesirable." msgstr "" -#: ../../whatsnew/3.11.rst:1590 +#: ../../whatsnew/3.11.rst:1622 msgid ":opcode:`MAKE_CELL`, to create :ref:`cell-objects`." msgstr "" -#: ../../whatsnew/3.11.rst:1592 +#: ../../whatsnew/3.11.rst:1624 msgid "" ":opcode:`CHECK_EG_MATCH` and :opcode:`PREP_RERAISE_STAR`, to handle the :" "ref:`new exception groups and except* ` added in :pep:" "`654`." msgstr "" -#: ../../whatsnew/3.11.rst:1596 +#: ../../whatsnew/3.11.rst:1628 msgid ":opcode:`PUSH_EXC_INFO`, for use in exception handlers." msgstr "" -#: ../../whatsnew/3.11.rst:1598 +#: ../../whatsnew/3.11.rst:1630 msgid "" ":opcode:`RESUME`, a no-op, for internal tracing, debugging and optimization " "checks." msgstr "" -#: ../../whatsnew/3.11.rst:1605 +#: ../../whatsnew/3.11.rst:1637 msgid "Replaced opcodes" msgstr "" -#: ../../whatsnew/3.11.rst:1608 +#: ../../whatsnew/3.11.rst:1640 msgid "Replaced Opcode(s)" msgstr "" -#: ../../whatsnew/3.11.rst:1608 +#: ../../whatsnew/3.11.rst:1640 msgid "New Opcode(s)" msgstr "" -#: ../../whatsnew/3.11.rst:1608 +#: ../../whatsnew/3.11.rst:1640 msgid "Notes" msgstr "" @@ -2159,11 +2193,11 @@ msgstr "" msgid ":opcode:`!INPLACE_*`" msgstr "" -#: ../../whatsnew/3.11.rst:1610 +#: ../../whatsnew/3.11.rst:1642 msgid ":opcode:`BINARY_OP`" msgstr "" -#: ../../whatsnew/3.11.rst:1610 +#: ../../whatsnew/3.11.rst:1642 msgid "Replaced all numeric binary/in-place opcodes with a single opcode" msgstr "" @@ -2195,7 +2229,7 @@ msgstr "" msgid ":opcode:`PUSH_NULL`" msgstr "" -#: ../../whatsnew/3.11.rst:1613 +#: ../../whatsnew/3.11.rst:1645 msgid "" "Decouples argument shifting for methods from handling of keyword arguments; " "allows better specialization of calls" @@ -2233,7 +2267,7 @@ msgstr "" msgid ":opcode:`SWAP`" msgstr "" -#: ../../whatsnew/3.11.rst:1618 +#: ../../whatsnew/3.11.rst:1650 msgid "Stack manipulation instructions" msgstr "" @@ -2245,7 +2279,7 @@ msgstr "" msgid ":opcode:`CHECK_EXC_MATCH`" msgstr "" -#: ../../whatsnew/3.11.rst:1625 +#: ../../whatsnew/3.11.rst:1657 msgid "Now performs check but doesn't jump" msgstr "" @@ -2273,7 +2307,7 @@ msgstr "" msgid ":opcode:`POP_JUMP_FORWARD_IF_* `" msgstr "" -#: ../../whatsnew/3.11.rst:1627 +#: ../../whatsnew/3.11.rst:1659 msgid "" "See [#bytecode-jump]_; ``TRUE``, ``FALSE``, ``NONE`` and ``NOT_NONE`` " "variants for each direction" @@ -2287,64 +2321,64 @@ msgstr "" msgid ":opcode:`!SETUP_ASYNC_WITH`" msgstr "" -#: ../../whatsnew/3.11.rst:1633 +#: ../../whatsnew/3.11.rst:1665 msgid ":opcode:`BEFORE_WITH`" msgstr "" -#: ../../whatsnew/3.11.rst:1633 +#: ../../whatsnew/3.11.rst:1665 msgid ":keyword:`with` block setup" msgstr "" -#: ../../whatsnew/3.11.rst:1637 +#: ../../whatsnew/3.11.rst:1669 msgid "" "All jump opcodes are now relative, including the existing :opcode:" "`JUMP_IF_TRUE_OR_POP` and :opcode:`JUMP_IF_FALSE_OR_POP`. The argument is " "now an offset from the current instruction rather than an absolute location." msgstr "" -#: ../../whatsnew/3.11.rst:1648 +#: ../../whatsnew/3.11.rst:1680 msgid "Changed/removed opcodes" msgstr "" -#: ../../whatsnew/3.11.rst:1650 +#: ../../whatsnew/3.11.rst:1682 msgid "" "Changed :opcode:`MATCH_CLASS` and :opcode:`MATCH_KEYS` to no longer push an " "additional boolean value to indicate success/failure. Instead, ``None`` is " "pushed on failure in place of the tuple of extracted values." msgstr "" -#: ../../whatsnew/3.11.rst:1655 +#: ../../whatsnew/3.11.rst:1687 msgid "" "Changed opcodes that work with exceptions to reflect them now being " "represented as one item on the stack instead of three (see :gh:`89874`)." msgstr "" -#: ../../whatsnew/3.11.rst:1659 +#: ../../whatsnew/3.11.rst:1691 msgid "" "Removed :opcode:`!COPY_DICT_WITHOUT_KEYS`, :opcode:`!GEN_START`, :opcode:`!" "POP_BLOCK`, :opcode:`!SETUP_FINALLY` and :opcode:`!YIELD_FROM`." msgstr "" -#: ../../whatsnew/3.11.rst:1667 ../../whatsnew/3.11.rst:2543 +#: ../../whatsnew/3.11.rst:1699 ../../whatsnew/3.11.rst:2575 msgid "Deprecated" msgstr "" -#: ../../whatsnew/3.11.rst:1669 +#: ../../whatsnew/3.11.rst:1701 msgid "" "This section lists Python APIs that have been deprecated in Python 3.11." msgstr "" -#: ../../whatsnew/3.11.rst:1671 +#: ../../whatsnew/3.11.rst:1703 msgid "" "Deprecated C APIs are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:1678 +#: ../../whatsnew/3.11.rst:1710 msgid "Language/Builtins" msgstr "" -#: ../../whatsnew/3.11.rst:1680 +#: ../../whatsnew/3.11.rst:1712 msgid "" "Chaining :class:`classmethod` descriptors (introduced in :issue:`19072`) is " "now deprecated. It can no longer be used to wrap other descriptors such as :" @@ -2354,7 +2388,7 @@ msgid "" "3.10. (Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1688 +#: ../../whatsnew/3.11.rst:1720 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 " @@ -2362,7 +2396,7 @@ msgid "" "`SyntaxError`. (Contributed by Serhiy Storchaka in :gh:`81548`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1694 +#: ../../whatsnew/3.11.rst:1726 msgid "" "The delegation of :func:`int` to :meth:`~object.__trunc__` is now " "deprecated. Calling ``int(a)`` when ``type(a)`` implements :meth:`!" @@ -2371,99 +2405,99 @@ msgid "" "`44977`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1704 +#: ../../whatsnew/3.11.rst:1736 msgid "Modules" msgstr "" -#: ../../whatsnew/3.11.rst:1708 +#: ../../whatsnew/3.11.rst:1740 msgid "" ":pep:`594` led to the deprecations of the following modules slated for " "removal in Python 3.13:" msgstr "" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.11.rst:1714 +#: ../../whatsnew/3.11.rst:1746 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.11.rst:1714 +#: ../../whatsnew/3.11.rst:1746 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.11.rst:1714 +#: ../../whatsnew/3.11.rst:1746 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.11.rst:1714 +#: ../../whatsnew/3.11.rst:1746 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.11.rst:1714 +#: ../../whatsnew/3.11.rst:1746 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1748 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1748 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1748 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1748 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1748 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.11.rst:1718 +#: ../../whatsnew/3.11.rst:1750 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.11.rst:1718 +#: ../../whatsnew/3.11.rst:1750 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.11.rst:1718 +#: ../../whatsnew/3.11.rst:1750 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.11.rst:1718 +#: ../../whatsnew/3.11.rst:1750 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.11.rst:1721 +#: ../../whatsnew/3.11.rst:1753 msgid "" "(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:" "`68966`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1724 +#: ../../whatsnew/3.11.rst:1756 msgid "" "The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been " "deprecated since at least Python 3.6. Their documentation and deprecation " @@ -2471,7 +2505,7 @@ msgid "" "(Contributed by Hugo van Kemenade in :issue:`47022`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1729 +#: ../../whatsnew/3.11.rst:1761 msgid "" "The :mod:`lib2to3` package and :ref:`2to3 <2to3-reference>` tool are now " "deprecated and may not be able to parse Python 3.10 or newer. See :pep:" @@ -2479,41 +2513,41 @@ msgid "" "Stinner in :issue:`40360`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1766 msgid "" "Undocumented modules :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!" "sre_parse` are now deprecated. (Contributed by Serhiy Storchaka in :issue:" "`47152`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1742 +#: ../../whatsnew/3.11.rst:1774 msgid "Standard Library" msgstr "" -#: ../../whatsnew/3.11.rst:1744 +#: ../../whatsnew/3.11.rst:1776 msgid "" "The following have been deprecated in :mod:`configparser` since Python 3.2. " "Their deprecation warnings have now been updated to note they will be " "removed in Python 3.12:" msgstr "" -#: ../../whatsnew/3.11.rst:1748 +#: ../../whatsnew/3.11.rst:1780 msgid "the :class:`!configparser.SafeConfigParser` class" msgstr "" -#: ../../whatsnew/3.11.rst:1749 +#: ../../whatsnew/3.11.rst:1781 msgid "the :attr:`!configparser.ParsingError.filename` property" msgstr "" -#: ../../whatsnew/3.11.rst:1750 +#: ../../whatsnew/3.11.rst:1782 msgid "the :meth:`configparser.RawConfigParser.readfp` method" msgstr ":meth:`configparser.RawConfigParser.readfp` 方法" -#: ../../whatsnew/3.11.rst:1752 +#: ../../whatsnew/3.11.rst:1784 msgid "(Contributed by Hugo van Kemenade in :issue:`45173`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1754 +#: ../../whatsnew/3.11.rst:1786 msgid "" ":class:`!configparser.LegacyInterpolation` has been deprecated in the " "docstring since Python 3.2, and is not listed in the :mod:`configparser` " @@ -2523,7 +2557,7 @@ msgid "" "Kemenade in :issue:`46607`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1761 +#: ../../whatsnew/3.11.rst:1793 msgid "" "The older set of :mod:`importlib.resources` functions were deprecated in " "favor of the replacements added in Python 3.9 and will be removed in a " @@ -2531,35 +2565,35 @@ msgid "" "package subdirectories:" msgstr "" -#: ../../whatsnew/3.11.rst:1766 +#: ../../whatsnew/3.11.rst:1798 msgid ":func:`importlib.resources.contents`" msgstr "" -#: ../../whatsnew/3.11.rst:1767 +#: ../../whatsnew/3.11.rst:1799 msgid ":func:`importlib.resources.is_resource`" msgstr "" -#: ../../whatsnew/3.11.rst:1768 +#: ../../whatsnew/3.11.rst:1800 msgid ":func:`importlib.resources.open_binary`" msgstr "" -#: ../../whatsnew/3.11.rst:1769 +#: ../../whatsnew/3.11.rst:1801 msgid ":func:`importlib.resources.open_text`" msgstr "" -#: ../../whatsnew/3.11.rst:1770 +#: ../../whatsnew/3.11.rst:1802 msgid ":func:`importlib.resources.read_binary`" msgstr "" -#: ../../whatsnew/3.11.rst:1771 +#: ../../whatsnew/3.11.rst:1803 msgid ":func:`importlib.resources.read_text`" msgstr "" -#: ../../whatsnew/3.11.rst:1772 +#: ../../whatsnew/3.11.rst:1804 msgid ":func:`importlib.resources.path`" msgstr "" -#: ../../whatsnew/3.11.rst:1774 +#: ../../whatsnew/3.11.rst:1806 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " "removed in Python 3.13. Use :func:`locale.setlocale`, :func:`locale." @@ -2567,14 +2601,14 @@ msgid "" "getlocale` functions instead. (Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1780 +#: ../../whatsnew/3.11.rst:1812 msgid "" "The :func:`locale.resetlocale` function is deprecated and will be removed in " "Python 3.13. Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. " "(Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1784 +#: ../../whatsnew/3.11.rst:1816 msgid "" "Stricter rules will now be applied for numerical group references and group " "names in :ref:`regular expressions `. Only sequences of ASCII " @@ -2585,7 +2619,7 @@ msgid "" "`91760`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1792 +#: ../../whatsnew/3.11.rst:1824 msgid "" "In the :mod:`re` module, the :func:`!re.template` function and the " "corresponding :data:`!re.TEMPLATE` and :data:`!re.T` flags are deprecated, " @@ -2594,7 +2628,7 @@ msgid "" "in :gh:`92728`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1798 +#: ../../whatsnew/3.11.rst:1830 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:" @@ -2603,7 +2637,7 @@ msgid "" "issue:`45837`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1804 +#: ../../whatsnew/3.11.rst:1836 msgid "" ":class:`typing.Text`, which exists solely to provide compatibility support " "between Python 2 and Python 3 code, is now deprecated. Its removal is " @@ -2611,345 +2645,345 @@ msgid "" "wherever possible. (Contributed by Alex Waygood in :gh:`92332`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1810 +#: ../../whatsnew/3.11.rst:1842 msgid "" "The keyword argument syntax for constructing :data:`typing.TypedDict` types " "is now deprecated. Support will be removed in Python 3.13. (Contributed by " "Jingchen Ye in :gh:`90224`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1814 +#: ../../whatsnew/3.11.rst:1846 msgid "" ":class:`!webbrowser.MacOSX` is deprecated and will be removed in Python " "3.13. It is untested, undocumented, and not used by :mod:`webbrowser` " "itself. (Contributed by Dong-hee Na in :issue:`42255`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1818 +#: ../../whatsnew/3.11.rst:1850 msgid "" "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 "" -#: ../../whatsnew/3.11.rst:1822 +#: ../../whatsnew/3.11.rst:1854 msgid "" "Deprecated the following not-formally-documented :mod:`unittest` functions, " "scheduled for removal in Python 3.13:" msgstr "" -#: ../../whatsnew/3.11.rst:1825 +#: ../../whatsnew/3.11.rst:1857 msgid ":func:`!unittest.findTestCases`" msgstr "" -#: ../../whatsnew/3.11.rst:1826 +#: ../../whatsnew/3.11.rst:1858 msgid ":func:`!unittest.makeSuite`" msgstr "" -#: ../../whatsnew/3.11.rst:1827 +#: ../../whatsnew/3.11.rst:1859 msgid ":func:`!unittest.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.11.rst:1829 +#: ../../whatsnew/3.11.rst:1861 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.11.rst:1831 +#: ../../whatsnew/3.11.rst:1863 msgid ":meth:`unittest.TestLoader.loadTestsFromModule`" msgstr ":meth:`unittest.TestLoader.loadTestsFromModule`" -#: ../../whatsnew/3.11.rst:1832 +#: ../../whatsnew/3.11.rst:1864 msgid ":meth:`unittest.TestLoader.loadTestsFromTestCase`" msgstr ":meth:`unittest.TestLoader.loadTestsFromTestCase`" -#: ../../whatsnew/3.11.rst:1833 +#: ../../whatsnew/3.11.rst:1865 msgid ":meth:`unittest.TestLoader.getTestCaseNames`" msgstr ":meth:`unittest.TestLoader.getTestCaseNames`" -#: ../../whatsnew/3.11.rst:1835 +#: ../../whatsnew/3.11.rst:1867 msgid "(Contributed by Erlend E. Aasland in :issue:`5846`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1842 ../../whatsnew/3.11.rst:2571 +#: ../../whatsnew/3.11.rst:1874 ../../whatsnew/3.11.rst:2603 msgid "Pending Removal in Python 3.12" msgstr "" -#: ../../whatsnew/3.11.rst:1844 +#: ../../whatsnew/3.11.rst:1876 msgid "" "The following Python APIs have been deprecated in earlier Python releases, " "and will be removed in Python 3.12." msgstr "" -#: ../../whatsnew/3.11.rst:1847 +#: ../../whatsnew/3.11.rst:1879 msgid "" "C APIs pending removal are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:1850 +#: ../../whatsnew/3.11.rst:1882 msgid "The :mod:`asynchat` module" msgstr "" -#: ../../whatsnew/3.11.rst:1851 +#: ../../whatsnew/3.11.rst:1883 msgid "The :mod:`asyncore` module" msgstr "" -#: ../../whatsnew/3.11.rst:1852 +#: ../../whatsnew/3.11.rst:1884 msgid "The :ref:`entire distutils package `" msgstr "" -#: ../../whatsnew/3.11.rst:1853 +#: ../../whatsnew/3.11.rst:1885 msgid "The :mod:`imp` module" msgstr "" -#: ../../whatsnew/3.11.rst:1854 +#: ../../whatsnew/3.11.rst:1886 msgid "The :class:`typing.io ` namespace" msgstr "" -#: ../../whatsnew/3.11.rst:1855 +#: ../../whatsnew/3.11.rst:1887 msgid "The :class:`typing.re ` namespace" msgstr "" -#: ../../whatsnew/3.11.rst:1856 +#: ../../whatsnew/3.11.rst:1888 msgid ":func:`!cgi.log`" msgstr "" -#: ../../whatsnew/3.11.rst:1857 +#: ../../whatsnew/3.11.rst:1889 msgid ":func:`importlib.find_loader`" msgstr ":func:`importlib.find_loader`" -#: ../../whatsnew/3.11.rst:1858 +#: ../../whatsnew/3.11.rst:1890 msgid ":meth:`importlib.abc.Loader.module_repr`" msgstr ":meth:`importlib.abc.Loader.module_repr`" -#: ../../whatsnew/3.11.rst:1859 +#: ../../whatsnew/3.11.rst:1891 msgid ":meth:`importlib.abc.MetaPathFinder.find_module`" msgstr ":meth:`importlib.abc.MetaPathFinder.find_module`" -#: ../../whatsnew/3.11.rst:1860 +#: ../../whatsnew/3.11.rst:1892 msgid ":meth:`importlib.abc.PathEntryFinder.find_loader`" msgstr ":meth:`importlib.abc.PathEntryFinder.find_loader`" -#: ../../whatsnew/3.11.rst:1861 +#: ../../whatsnew/3.11.rst:1893 msgid ":meth:`importlib.abc.PathEntryFinder.find_module`" msgstr ":meth:`importlib.abc.PathEntryFinder.find_module`" -#: ../../whatsnew/3.11.rst:1862 +#: ../../whatsnew/3.11.rst:1894 msgid ":meth:`!importlib.machinery.BuiltinImporter.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1863 +#: ../../whatsnew/3.11.rst:1895 msgid ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" msgstr "" -#: ../../whatsnew/3.11.rst:1864 +#: ../../whatsnew/3.11.rst:1896 msgid ":meth:`!importlib.machinery.FileFinder.find_loader`" msgstr "" -#: ../../whatsnew/3.11.rst:1865 +#: ../../whatsnew/3.11.rst:1897 msgid ":meth:`!importlib.machinery.FileFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1866 +#: ../../whatsnew/3.11.rst:1898 msgid ":meth:`!importlib.machinery.FrozenImporter.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1867 +#: ../../whatsnew/3.11.rst:1899 msgid ":meth:`!importlib.machinery.FrozenLoader.module_repr`" msgstr "" -#: ../../whatsnew/3.11.rst:1868 +#: ../../whatsnew/3.11.rst:1900 msgid ":meth:`importlib.machinery.PathFinder.find_module`" msgstr ":meth:`importlib.machinery.PathFinder.find_module`" -#: ../../whatsnew/3.11.rst:1869 +#: ../../whatsnew/3.11.rst:1901 msgid ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1870 +#: ../../whatsnew/3.11.rst:1902 msgid ":func:`importlib.util.module_for_loader`" msgstr ":func:`importlib.util.module_for_loader`" -#: ../../whatsnew/3.11.rst:1871 +#: ../../whatsnew/3.11.rst:1903 msgid ":func:`!importlib.util.set_loader_wrapper`" msgstr "" -#: ../../whatsnew/3.11.rst:1872 +#: ../../whatsnew/3.11.rst:1904 msgid ":func:`!importlib.util.set_package_wrapper`" msgstr "" -#: ../../whatsnew/3.11.rst:1873 +#: ../../whatsnew/3.11.rst:1905 msgid ":class:`pkgutil.ImpImporter`" msgstr ":class:`pkgutil.ImpImporter`" -#: ../../whatsnew/3.11.rst:1874 +#: ../../whatsnew/3.11.rst:1906 msgid ":class:`pkgutil.ImpLoader`" msgstr ":class:`pkgutil.ImpLoader`" -#: ../../whatsnew/3.11.rst:1875 +#: ../../whatsnew/3.11.rst:1907 msgid ":meth:`pathlib.Path.link_to`" msgstr ":meth:`pathlib.Path.link_to`" -#: ../../whatsnew/3.11.rst:1876 +#: ../../whatsnew/3.11.rst:1908 msgid ":func:`!sqlite3.enable_shared_cache`" msgstr "" -#: ../../whatsnew/3.11.rst:1877 +#: ../../whatsnew/3.11.rst:1909 msgid ":func:`!sqlite3.OptimizedUnicode`" msgstr "" -#: ../../whatsnew/3.11.rst:1878 +#: ../../whatsnew/3.11.rst:1910 msgid ":envvar:`PYTHONTHREADDEBUG` environment variable" msgstr "" -#: ../../whatsnew/3.11.rst:1879 +#: ../../whatsnew/3.11.rst:1911 msgid "The following deprecated aliases in :mod:`unittest`:" msgstr "" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1914 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1914 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1914 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.11.rst:1884 +#: ../../whatsnew/3.11.rst:1916 msgid "``failUnless``" msgstr "" -#: ../../whatsnew/3.11.rst:1884 ../../whatsnew/3.11.rst:1891 +#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1923 msgid ":meth:`.assertTrue`" msgstr "" -#: ../../whatsnew/3.11.rst:1884 ../../whatsnew/3.11.rst:1885 -#: ../../whatsnew/3.11.rst:1886 ../../whatsnew/3.11.rst:1887 -#: ../../whatsnew/3.11.rst:1888 ../../whatsnew/3.11.rst:1889 -#: ../../whatsnew/3.11.rst:1890 +#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1918 ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1920 ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1922 msgid "3.1" msgstr "" -#: ../../whatsnew/3.11.rst:1885 +#: ../../whatsnew/3.11.rst:1917 msgid "``failIf``" msgstr "" -#: ../../whatsnew/3.11.rst:1885 +#: ../../whatsnew/3.11.rst:1917 msgid ":meth:`.assertFalse`" msgstr "" -#: ../../whatsnew/3.11.rst:1886 +#: ../../whatsnew/3.11.rst:1918 msgid "``failUnlessEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1886 ../../whatsnew/3.11.rst:1892 +#: ../../whatsnew/3.11.rst:1918 ../../whatsnew/3.11.rst:1924 msgid ":meth:`.assertEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1887 +#: ../../whatsnew/3.11.rst:1919 msgid "``failIfEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1887 ../../whatsnew/3.11.rst:1893 +#: ../../whatsnew/3.11.rst:1919 ../../whatsnew/3.11.rst:1925 msgid ":meth:`.assertNotEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1888 +#: ../../whatsnew/3.11.rst:1920 msgid "``failUnlessAlmostEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1888 ../../whatsnew/3.11.rst:1894 +#: ../../whatsnew/3.11.rst:1920 ../../whatsnew/3.11.rst:1926 msgid ":meth:`.assertAlmostEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1889 +#: ../../whatsnew/3.11.rst:1921 msgid "``failIfAlmostEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1889 ../../whatsnew/3.11.rst:1895 +#: ../../whatsnew/3.11.rst:1921 ../../whatsnew/3.11.rst:1927 msgid ":meth:`.assertNotAlmostEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1890 +#: ../../whatsnew/3.11.rst:1922 msgid "``failUnlessRaises``" msgstr "" -#: ../../whatsnew/3.11.rst:1890 +#: ../../whatsnew/3.11.rst:1922 msgid ":meth:`.assertRaises`" msgstr "" -#: ../../whatsnew/3.11.rst:1891 +#: ../../whatsnew/3.11.rst:1923 msgid "``assert_``" msgstr "" -#: ../../whatsnew/3.11.rst:1891 ../../whatsnew/3.11.rst:1892 -#: ../../whatsnew/3.11.rst:1893 ../../whatsnew/3.11.rst:1894 -#: ../../whatsnew/3.11.rst:1895 ../../whatsnew/3.11.rst:1896 -#: ../../whatsnew/3.11.rst:1897 +#: ../../whatsnew/3.11.rst:1923 ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1925 ../../whatsnew/3.11.rst:1926 +#: ../../whatsnew/3.11.rst:1927 ../../whatsnew/3.11.rst:1928 +#: ../../whatsnew/3.11.rst:1929 msgid "3.2" msgstr "" -#: ../../whatsnew/3.11.rst:1892 +#: ../../whatsnew/3.11.rst:1924 msgid "``assertEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1893 +#: ../../whatsnew/3.11.rst:1925 msgid "``assertNotEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1894 +#: ../../whatsnew/3.11.rst:1926 msgid "``assertAlmostEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1895 +#: ../../whatsnew/3.11.rst:1927 msgid "``assertNotAlmostEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1896 +#: ../../whatsnew/3.11.rst:1928 msgid "``assertRegexpMatches``" msgstr "" -#: ../../whatsnew/3.11.rst:1896 +#: ../../whatsnew/3.11.rst:1928 msgid ":meth:`.assertRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1897 +#: ../../whatsnew/3.11.rst:1929 msgid "``assertRaisesRegexp``" msgstr "" -#: ../../whatsnew/3.11.rst:1897 +#: ../../whatsnew/3.11.rst:1929 msgid ":meth:`.assertRaisesRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1898 +#: ../../whatsnew/3.11.rst:1930 msgid "``assertNotRegexpMatches``" msgstr "" -#: ../../whatsnew/3.11.rst:1898 +#: ../../whatsnew/3.11.rst:1930 msgid ":meth:`.assertNotRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1898 +#: ../../whatsnew/3.11.rst:1930 msgid "3.5" msgstr "" -#: ../../whatsnew/3.11.rst:1905 ../../whatsnew/3.11.rst:2597 +#: ../../whatsnew/3.11.rst:1937 ../../whatsnew/3.11.rst:2629 msgid "Removed" msgstr "" -#: ../../whatsnew/3.11.rst:1907 +#: ../../whatsnew/3.11.rst:1939 msgid "This section lists Python APIs that have been removed in Python 3.11." msgstr "" -#: ../../whatsnew/3.11.rst:1909 +#: ../../whatsnew/3.11.rst:1941 msgid "" "Removed C APIs are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:1911 +#: ../../whatsnew/3.11.rst:1943 msgid "" "Removed the :func:`!@asyncio.coroutine` :term:`decorator` enabling legacy " "generator-based coroutines to be compatible with :keyword:`async` / :keyword:" @@ -2958,14 +2992,14 @@ msgid "" "instead. (Contributed by Illia Volochii in :issue:`43216`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1950 msgid "" "Removed :class:`!asyncio.coroutines.CoroWrapper` used for wrapping legacy " "generator-based coroutine objects in the debug mode. (Contributed by Illia " "Volochii in :issue:`43216`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1954 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is now " @@ -2974,44 +3008,44 @@ msgid "" "`45129`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1928 +#: ../../whatsnew/3.11.rst:1960 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" msgstr "" -#: ../../whatsnew/3.11.rst:1931 +#: ../../whatsnew/3.11.rst:1963 msgid ":func:`!binascii.a2b_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1932 +#: ../../whatsnew/3.11.rst:1964 msgid ":func:`!binascii.b2a_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1933 +#: ../../whatsnew/3.11.rst:1965 msgid ":func:`!binascii.rlecode_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1934 +#: ../../whatsnew/3.11.rst:1966 msgid ":func:`!binascii.rldecode_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1936 +#: ../../whatsnew/3.11.rst:1968 msgid "The :func:`binascii.crc_hqx` function remains available." msgstr "" -#: ../../whatsnew/3.11.rst:1938 +#: ../../whatsnew/3.11.rst:1970 msgid "(Contributed by Victor Stinner in :issue:`45085`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1940 +#: ../../whatsnew/3.11.rst:1972 msgid "" "Removed the :mod:`distutils` ``bdist_msi`` command deprecated in Python 3.9. " "Use ``bdist_wheel`` (wheel packages) instead. (Contributed by Hugo van " "Kemenade in :issue:`45124`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1944 +#: ../../whatsnew/3.11.rst:1976 msgid "" "Removed the :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." "DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." @@ -3019,7 +3053,7 @@ msgid "" "in :issue:`45132`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1949 +#: ../../whatsnew/3.11.rst:1981 msgid "" "Removed the deprecated :mod:`gettext` functions :func:`!lgettext`, :func:`!" "ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed the :" @@ -3030,62 +3064,62 @@ msgid "" "by Dong-hee Na and Serhiy Storchaka in :issue:`44235`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1959 +#: ../../whatsnew/3.11.rst:1991 msgid "Removed from the :mod:`inspect` module:" msgstr "" -#: ../../whatsnew/3.11.rst:1961 +#: ../../whatsnew/3.11.rst:1993 msgid "" "The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" "`inspect.signature` or :func:`inspect.getfullargspec` instead." msgstr "" -#: ../../whatsnew/3.11.rst:1964 +#: ../../whatsnew/3.11.rst:1996 msgid "" "The :func:`!formatargspec` function, deprecated since Python 3.5; use the :" "func:`inspect.signature` function or the :class:`inspect.Signature` object " "directly." msgstr "" -#: ../../whatsnew/3.11.rst:1968 +#: ../../whatsnew/3.11.rst:2000 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." msgstr "" -#: ../../whatsnew/3.11.rst:1973 +#: ../../whatsnew/3.11.rst:2005 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1975 +#: ../../whatsnew/3.11.rst:2007 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1980 +#: ../../whatsnew/3.11.rst:2012 msgid "" "Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " "Dong-hee Na in :issue:`35800`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1984 +#: ../../whatsnew/3.11.rst:2016 msgid "" "Removed the deprecated :meth:`!split` method of :class:`!_tkinter." "TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1987 +#: ../../whatsnew/3.11.rst:2019 msgid "" "Removed namespace package support from :mod:`unittest` discovery. It was " "introduced in Python 3.4 but has been broken since Python 3.7. (Contributed " "by Inada Naoki in :issue:`23882`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1991 +#: ../../whatsnew/3.11.rst:2023 msgid "" "Removed the undocumented private :meth:`!float.__set_format__()` method, " "previously known as :meth:`!float.__setformat__()` in Python 3.7. Its " @@ -3094,14 +3128,14 @@ msgid "" "in :issue:`46852`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1997 +#: ../../whatsnew/3.11.rst:2029 msgid "" "The :option:`!--experimental-isolated-subinterpreters` configure flag (and " "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " "been removed." msgstr "" -#: ../../whatsnew/3.11.rst:2001 +#: ../../whatsnew/3.11.rst:2033 msgid "" "`Pynche `_ --- The Pythonically Natural " "Color and Hue Editor --- has been moved out of ``Tools/scripts`` and is " @@ -3109,23 +3143,23 @@ msgid "" "main>`_ from the Python source tree." msgstr "" -#: ../../whatsnew/3.11.rst:2011 ../../whatsnew/3.11.rst:2241 +#: ../../whatsnew/3.11.rst:2043 ../../whatsnew/3.11.rst:2273 msgid "Porting to Python 3.11" msgstr "" -#: ../../whatsnew/3.11.rst:2013 +#: ../../whatsnew/3.11.rst:2045 msgid "" "This section lists previously described changes and other bugfixes in the " "Python API that may require changes to your Python code." msgstr "" -#: ../../whatsnew/3.11.rst:2016 +#: ../../whatsnew/3.11.rst:2048 msgid "" "Porting notes for the C API are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:2019 +#: ../../whatsnew/3.11.rst:2051 msgid "" ":func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput." "FileInput` no longer accept ``'U'`` (\"universal newline\") in the file " @@ -3136,7 +3170,7 @@ msgid "" "Stinner in :issue:`37330`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2028 +#: ../../whatsnew/3.11.rst:2060 msgid "" ":class:`ast.AST` node positions are now validated when provided to :func:" "`compile` and other related functions. If invalid positions are detected, a :" @@ -3144,14 +3178,14 @@ msgid "" "`93351`)" msgstr "" -#: ../../whatsnew/3.11.rst:2032 +#: ../../whatsnew/3.11.rst:2064 msgid "" "Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor` " "executors to :meth:`asyncio.loop.set_default_executor` following a " "deprecation in Python 3.8. (Contributed by Illia Volochii in :issue:`43234`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2037 +#: ../../whatsnew/3.11.rst:2069 msgid "" ":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:" "`calendar.LocaleHTMLCalendar` classes now use :func:`locale.getlocale`, " @@ -3159,14 +3193,14 @@ msgid "" "(Contributed by Victor Stinner in :issue:`46659`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2043 +#: ../../whatsnew/3.11.rst:2075 msgid "" "The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with " "the ``'UTF-8'`` encoding. (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ " "రెడ్డి తాటిపర్తి) in :issue:`41137`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2047 +#: ../../whatsnew/3.11.rst:2079 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 " @@ -3175,14 +3209,14 @@ msgid "" "`40465`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2053 +#: ../../whatsnew/3.11.rst:2085 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." msgstr "" -#: ../../whatsnew/3.11.rst:2057 +#: ../../whatsnew/3.11.rst:2089 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 " @@ -3190,7 +3224,7 @@ msgid "" "`47066`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2062 +#: ../../whatsnew/3.11.rst:2094 msgid "" "In the :mod:`re` module, several long-standing bugs where fixed that, in " "rare cases, could cause capture groups to get the wrong result. Therefore, " @@ -3198,11 +3232,11 @@ msgid "" "in :issue:`35859`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2071 +#: ../../whatsnew/3.11.rst:2103 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.11.rst:2073 +#: ../../whatsnew/3.11.rst:2105 msgid "" "CPython now has :pep:`11` :pep:`Tier 3 support <11#tier-3>` for cross " "compiling to the `WebAssembly `_ platforms " @@ -3217,11 +3251,11 @@ msgid "" "gh:`90473`; platforms promoted in :gh:`95085`)" msgstr "" -#: ../../whatsnew/3.11.rst:2087 +#: ../../whatsnew/3.11.rst:2119 msgid "Building Python now requires:" msgstr "" -#: ../../whatsnew/3.11.rst:2089 +#: ../../whatsnew/3.11.rst:2121 msgid "" "A `C11 `_ compiler. `Optional C11 " "features `_ floating " "point numbers. (Contributed by Victor Stinner in :issue:`46917`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2099 +#: ../../whatsnew/3.11.rst:2131 msgid "" "Support for `floating point Not-a-Number (NaN) `_, as the :c:macro:`!Py_NO_NAN` macro has been " "removed. (Contributed by Victor Stinner in :issue:`46656`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2104 +#: ../../whatsnew/3.11.rst:2136 msgid "" "A `C99 `_ ```` header file " "providing the :c:func:`!copysign`, :c:func:`!hypot`, :c:func:`!isfinite`, :c:" @@ -3252,13 +3286,13 @@ msgid "" "`46640`)." msgstr "" -#: ../../whatsnew/3.11.rst:2112 +#: ../../whatsnew/3.11.rst:2144 msgid "" "The :mod:`tkinter` package now requires `Tcl/Tk `_ " "version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2116 +#: ../../whatsnew/3.11.rst:2148 msgid "" "Build dependencies, compiler flags, and linker flags for most stdlib " "extension modules are now detected by :program:`configure`. libffi, libnsl, " @@ -3270,13 +3304,13 @@ msgid "" "`45847`, :issue:`45747`, and :issue:`45763`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2126 +#: ../../whatsnew/3.11.rst:2158 msgid "" "libpython is no longer linked against libcrypt. (Contributed by Mike Gilbert " "in :issue:`45433`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2129 +#: ../../whatsnew/3.11.rst:2161 msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " @@ -3284,7 +3318,7 @@ msgid "" "`44340`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2134 +#: ../../whatsnew/3.11.rst:2166 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " "option :option:`!--without-freelists` can be used to disable all freelists " @@ -3292,7 +3326,7 @@ msgid "" "`45522`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2139 +#: ../../whatsnew/3.11.rst:2171 msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " @@ -3301,7 +3335,7 @@ msgid "" "`45570`, :issue:`45571`, and :issue:`43974`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2146 +#: ../../whatsnew/3.11.rst:2178 msgid "" "Use the environment variables :envvar:`!TCLTK_CFLAGS` and :envvar:`!" "TCLTK_LIBS` to manually specify the location of Tcl/Tk headers and " @@ -3309,7 +3343,7 @@ msgid "" "and :option:`!--with-tcltk-libs` have been removed." msgstr "" -#: ../../whatsnew/3.11.rst:2152 +#: ../../whatsnew/3.11.rst:2184 msgid "" "On RHEL 7 and CentOS 7 the development packages do not provide ``tcl.pc`` " "and ``tk.pc``; use ``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``. The " @@ -3317,7 +3351,7 @@ msgid "" "build Python with RHEL 7's and CentOS 7's Tcl/Tk and OpenSSL." msgstr "" -#: ../../whatsnew/3.11.rst:2157 +#: ../../whatsnew/3.11.rst:2189 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 " @@ -3329,23 +3363,23 @@ msgid "" "in :issue:`45569`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2170 +#: ../../whatsnew/3.11.rst:2202 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.11.rst:2177 +#: ../../whatsnew/3.11.rst:2209 msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2180 +#: ../../whatsnew/3.11.rst:2212 msgid "" "Add a new :c:func:`PyType_GetQualName` function to get type's qualified " "name. (Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2183 +#: ../../whatsnew/3.11.rst:2215 msgid "" "Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " @@ -3353,78 +3387,78 @@ msgid "" "`43760`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2188 +#: ../../whatsnew/3.11.rst:2220 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2192 +#: ../../whatsnew/3.11.rst:2224 msgid "" ":c:type:`Py_buffer` and APIs are now part of the limited API and the stable " "ABI:" msgstr "" -#: ../../whatsnew/3.11.rst:2195 +#: ../../whatsnew/3.11.rst:2227 msgid ":c:func:`PyObject_CheckBuffer`" msgstr ":c:func:`PyObject_CheckBuffer`" -#: ../../whatsnew/3.11.rst:2196 +#: ../../whatsnew/3.11.rst:2228 msgid ":c:func:`PyObject_GetBuffer`" msgstr ":c:func:`PyObject_GetBuffer`" -#: ../../whatsnew/3.11.rst:2197 +#: ../../whatsnew/3.11.rst:2229 msgid ":c:func:`PyBuffer_GetPointer`" msgstr ":c:func:`PyBuffer_GetPointer`" -#: ../../whatsnew/3.11.rst:2198 +#: ../../whatsnew/3.11.rst:2230 msgid ":c:func:`PyBuffer_SizeFromFormat`" msgstr ":c:func:`PyBuffer_SizeFromFormat`" -#: ../../whatsnew/3.11.rst:2199 +#: ../../whatsnew/3.11.rst:2231 msgid ":c:func:`PyBuffer_ToContiguous`" msgstr ":c:func:`PyBuffer_ToContiguous`" -#: ../../whatsnew/3.11.rst:2200 +#: ../../whatsnew/3.11.rst:2232 msgid ":c:func:`PyBuffer_FromContiguous`" msgstr ":c:func:`PyBuffer_FromContiguous`" -#: ../../whatsnew/3.11.rst:2201 +#: ../../whatsnew/3.11.rst:2233 msgid ":c:func:`PyBuffer_CopyData`" msgstr ":c:func:`PyBuffer_CopyData`" -#: ../../whatsnew/3.11.rst:2202 +#: ../../whatsnew/3.11.rst:2234 msgid ":c:func:`PyBuffer_IsContiguous`" msgstr ":c:func:`PyBuffer_IsContiguous`" -#: ../../whatsnew/3.11.rst:2203 +#: ../../whatsnew/3.11.rst:2235 msgid ":c:func:`PyBuffer_FillContiguousStrides`" msgstr ":c:func:`PyBuffer_FillContiguousStrides`" -#: ../../whatsnew/3.11.rst:2204 +#: ../../whatsnew/3.11.rst:2236 msgid ":c:func:`PyBuffer_FillInfo`" msgstr ":c:func:`PyBuffer_FillInfo`" -#: ../../whatsnew/3.11.rst:2205 +#: ../../whatsnew/3.11.rst:2237 msgid ":c:func:`PyBuffer_Release`" msgstr ":c:func:`PyBuffer_Release`" -#: ../../whatsnew/3.11.rst:2206 +#: ../../whatsnew/3.11.rst:2238 msgid ":c:func:`PyMemoryView_FromBuffer`" msgstr ":c:func:`PyMemoryView_FromBuffer`" -#: ../../whatsnew/3.11.rst:2207 +#: ../../whatsnew/3.11.rst:2239 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` type slots" msgstr "" -#: ../../whatsnew/3.11.rst:2210 +#: ../../whatsnew/3.11.rst:2242 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2212 +#: ../../whatsnew/3.11.rst:2244 msgid "" "Added the :c:data:`PyType_GetModuleByDef` function, used to get the module " "in which a method was defined, in cases where this information is not " @@ -3432,7 +3466,7 @@ msgid "" "in :issue:`46613`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2217 +#: ../../whatsnew/3.11.rst:2249 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:" @@ -3440,14 +3474,14 @@ msgid "" "`PyFloat_Unpack8`. (Contributed by Victor Stinner in :issue:`46906`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2223 +#: ../../whatsnew/3.11.rst:2255 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`." msgstr "" -#: ../../whatsnew/3.11.rst:2227 +#: ../../whatsnew/3.11.rst:2259 msgid "" "Added two new functions to get and set the active exception instance: :c:" "func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " @@ -3456,13 +3490,13 @@ msgid "" "exceptions. (Contributed by Irit Katriel in :issue:`46343`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2234 +#: ../../whatsnew/3.11.rst:2266 msgid "" "Added the :c:member:`PyConfig.safe_path` member. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2245 +#: ../../whatsnew/3.11.rst:2277 msgid "" "Some macros have been converted to static inline functions to avoid `macro " "pitfalls `_. The " @@ -3474,7 +3508,7 @@ msgid "" "Stinner and Erlend E. Aasland in :gh:`89653`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2256 +#: ../../whatsnew/3.11.rst:2288 msgid "" ":c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback`` " "arguments, the interpreter now derives those values from the exception " @@ -3482,14 +3516,14 @@ msgid "" "all three arguments. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2262 +#: ../../whatsnew/3.11.rst:2294 msgid "" ":c:func:`PyErr_GetExcInfo()` now derives the ``type`` and ``traceback`` " "fields of the result from the exception instance (the ``value`` field). " "(Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2266 +#: ../../whatsnew/3.11.rst:2298 msgid "" ":c:struct:`_frozen` has a new ``is_package`` field to indicate whether or " "not the frozen module is a package. Previously, a negative value in the " @@ -3497,14 +3531,14 @@ msgid "" "``size``. (Contributed by Kumar Aditya in :issue:`46608`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2272 +#: ../../whatsnew/3.11.rst:2304 msgid "" ":c:func:`_PyFrameEvalFunction` now takes ``_PyInterpreterFrame*`` as its " "second parameter, instead of ``PyFrameObject*``. See :pep:`523` for more " "details of how to use this function pointer type." msgstr "" -#: ../../whatsnew/3.11.rst:2276 +#: ../../whatsnew/3.11.rst:2308 msgid "" ":c:func:`PyCode_New` and :c:func:`PyCode_NewWithPosOnlyArgs` now take an " "additional ``exception_table`` argument. Using these functions should be " @@ -3513,7 +3547,7 @@ msgid "" "method." msgstr "" -#: ../../whatsnew/3.11.rst:2282 +#: ../../whatsnew/3.11.rst:2314 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " "``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" @@ -3523,35 +3557,35 @@ msgid "" "and :gh:`94936`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2290 +#: ../../whatsnew/3.11.rst:2322 msgid "" "The old trashcan macros (``Py_TRASHCAN_SAFE_BEGIN``/" "``Py_TRASHCAN_SAFE_END``) are now deprecated. They should be replaced by the " "new macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.11.rst:2294 +#: ../../whatsnew/3.11.rst:2326 msgid "A tp_dealloc function that has the old macros, such as::" msgstr "" -#: ../../whatsnew/3.11.rst:2305 +#: ../../whatsnew/3.11.rst:2337 msgid "should migrate to the new macros as follows::" msgstr "" -#: ../../whatsnew/3.11.rst:2316 +#: ../../whatsnew/3.11.rst:2348 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in." msgstr "" -#: ../../whatsnew/3.11.rst:2319 +#: ../../whatsnew/3.11.rst:2351 msgid "" "To support older Python versions in the same codebase, you can define the " "following macros and use them throughout the code (credit: these were copied " "from the ``mypy`` codebase)::" msgstr "" -#: ../../whatsnew/3.11.rst:2331 +#: ../../whatsnew/3.11.rst:2363 msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " "with the :const:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function (:" @@ -3559,7 +3593,7 @@ msgid "" "issue:`44263`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2336 +#: ../../whatsnew/3.11.rst:2368 msgid "" "Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " "the :pep:`590` vectorcall protocol. Previously, this was only possible for :" @@ -3567,7 +3601,7 @@ msgid "" "issue:`43908`)" msgstr "" -#: ../../whatsnew/3.11.rst:2341 +#: ../../whatsnew/3.11.rst:2373 msgid "" "Since :c:func:`Py_TYPE()` is changed to a inline static function, " "``Py_TYPE(obj) = new_type`` must be replaced with ``Py_SET_TYPE(obj, " @@ -3575,11 +3609,11 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.11.rst:2353 ../../whatsnew/3.11.rst:2367 +#: ../../whatsnew/3.11.rst:2385 ../../whatsnew/3.11.rst:2399 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2355 +#: ../../whatsnew/3.11.rst:2387 msgid "" "Since :c:func:`Py_SIZE()` is changed to a inline static function, " "``Py_SIZE(obj) = new_size`` must be replaced with ``Py_SET_SIZE(obj, " @@ -3587,7 +3621,7 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.11.rst:2369 +#: ../../whatsnew/3.11.rst:2401 msgid "" "```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " @@ -3596,7 +3630,7 @@ msgid "" "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2375 +#: ../../whatsnew/3.11.rst:2407 msgid "" "The non-limited API files ``cellobject.h``, ``classobject.h``, ``code.h``, " "``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have " @@ -3607,7 +3641,7 @@ msgid "" "instead. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2383 +#: ../../whatsnew/3.11.rst:2415 msgid "" "The :c:func:`PyUnicode_CHECK_INTERNED` macro has been excluded from the " "limited C API. It was never usable there, because it used internal " @@ -3615,149 +3649,149 @@ msgid "" "Victor Stinner in :issue:`46007`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2388 +#: ../../whatsnew/3.11.rst:2420 msgid "" "The following frame functions and type are now directly available with " "``#include ``, it's no longer needed to add ``#include " "``:" msgstr "" -#: ../../whatsnew/3.11.rst:2392 +#: ../../whatsnew/3.11.rst:2424 msgid ":c:func:`PyFrame_Check`" msgstr ":c:func:`PyFrame_Check`" -#: ../../whatsnew/3.11.rst:2393 +#: ../../whatsnew/3.11.rst:2425 msgid ":c:func:`PyFrame_GetBack`" msgstr ":c:func:`PyFrame_GetBack`" -#: ../../whatsnew/3.11.rst:2394 +#: ../../whatsnew/3.11.rst:2426 msgid ":c:func:`PyFrame_GetBuiltins`" msgstr ":c:func:`PyFrame_GetBuiltins`" -#: ../../whatsnew/3.11.rst:2395 +#: ../../whatsnew/3.11.rst:2427 msgid ":c:func:`PyFrame_GetGenerator`" msgstr ":c:func:`PyFrame_GetGenerator`" -#: ../../whatsnew/3.11.rst:2396 +#: ../../whatsnew/3.11.rst:2428 msgid ":c:func:`PyFrame_GetGlobals`" msgstr ":c:func:`PyFrame_GetGlobals`" -#: ../../whatsnew/3.11.rst:2397 +#: ../../whatsnew/3.11.rst:2429 msgid ":c:func:`PyFrame_GetLasti`" msgstr ":c:func:`PyFrame_GetLasti`" -#: ../../whatsnew/3.11.rst:2398 +#: ../../whatsnew/3.11.rst:2430 msgid ":c:func:`PyFrame_GetLocals`" msgstr ":c:func:`PyFrame_GetLocals`" -#: ../../whatsnew/3.11.rst:2399 +#: ../../whatsnew/3.11.rst:2431 msgid ":c:type:`PyFrame_Type`" msgstr ":c:type:`PyFrame_Type`" -#: ../../whatsnew/3.11.rst:2401 +#: ../../whatsnew/3.11.rst:2433 msgid "(Contributed by Victor Stinner in :gh:`93937`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2405 +#: ../../whatsnew/3.11.rst:2437 msgid "" "The :c:type:`PyFrameObject` structure members have been removed from the " "public C API." msgstr "" -#: ../../whatsnew/3.11.rst:2408 +#: ../../whatsnew/3.11.rst:2440 msgid "" "While the documentation notes that the :c:type:`PyFrameObject` fields are " "subject to change at any time, they have been stable for a long time and " "were used in several popular extensions." msgstr "" -#: ../../whatsnew/3.11.rst:2412 +#: ../../whatsnew/3.11.rst:2444 msgid "" "In Python 3.11, the frame struct was reorganized to allow performance " "optimizations. Some fields were removed entirely, as they were details of " "the old implementation." msgstr "" -#: ../../whatsnew/3.11.rst:2416 +#: ../../whatsnew/3.11.rst:2448 msgid ":c:type:`PyFrameObject` fields:" msgstr "" -#: ../../whatsnew/3.11.rst:2418 +#: ../../whatsnew/3.11.rst:2450 msgid "``f_back``: use :c:func:`PyFrame_GetBack`." msgstr "" -#: ../../whatsnew/3.11.rst:2419 +#: ../../whatsnew/3.11.rst:2451 msgid "``f_blockstack``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2420 +#: ../../whatsnew/3.11.rst:2452 msgid "``f_builtins``: use :c:func:`PyFrame_GetBuiltins`." msgstr "" -#: ../../whatsnew/3.11.rst:2421 +#: ../../whatsnew/3.11.rst:2453 msgid "``f_code``: use :c:func:`PyFrame_GetCode`." msgstr "" -#: ../../whatsnew/3.11.rst:2422 +#: ../../whatsnew/3.11.rst:2454 msgid "``f_gen``: use :c:func:`PyFrame_GetGenerator`." msgstr "" -#: ../../whatsnew/3.11.rst:2423 +#: ../../whatsnew/3.11.rst:2455 msgid "``f_globals``: use :c:func:`PyFrame_GetGlobals`." msgstr "" -#: ../../whatsnew/3.11.rst:2424 +#: ../../whatsnew/3.11.rst:2456 msgid "``f_iblock``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2425 +#: ../../whatsnew/3.11.rst:2457 msgid "" "``f_lasti``: use :c:func:`PyFrame_GetLasti`. Code using ``f_lasti`` with " "``PyCode_Addr2Line()`` should use :c:func:`PyFrame_GetLineNumber` instead; " "it may be faster." msgstr "" -#: ../../whatsnew/3.11.rst:2428 +#: ../../whatsnew/3.11.rst:2460 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" msgstr "" -#: ../../whatsnew/3.11.rst:2429 +#: ../../whatsnew/3.11.rst:2461 msgid "``f_locals``: use :c:func:`PyFrame_GetLocals`." msgstr "" -#: ../../whatsnew/3.11.rst:2430 +#: ../../whatsnew/3.11.rst:2462 msgid "``f_stackdepth``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2431 +#: ../../whatsnew/3.11.rst:2463 msgid "``f_state``: no public API (renamed to ``f_frame.f_state``)." msgstr "" -#: ../../whatsnew/3.11.rst:2432 +#: ../../whatsnew/3.11.rst:2464 msgid "``f_trace``: no public API." msgstr "" -#: ../../whatsnew/3.11.rst:2433 +#: ../../whatsnew/3.11.rst:2465 msgid "" "``f_trace_lines``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_lines\")``." msgstr "" -#: ../../whatsnew/3.11.rst:2434 +#: ../../whatsnew/3.11.rst:2466 msgid "" "``f_trace_opcodes``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_opcodes\")``." msgstr "" -#: ../../whatsnew/3.11.rst:2435 +#: ../../whatsnew/3.11.rst:2467 msgid "``f_localsplus``: no public API (renamed to ``f_frame.localsplus``)." msgstr "" -#: ../../whatsnew/3.11.rst:2436 +#: ../../whatsnew/3.11.rst:2468 msgid "``f_valuestack``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2438 +#: ../../whatsnew/3.11.rst:2470 msgid "" "The Python frame object is now created lazily. A side effect is that the " "``f_back`` member must not be accessed directly, since its value is now also " @@ -3765,7 +3799,7 @@ msgid "" "instead." msgstr "" -#: ../../whatsnew/3.11.rst:2443 +#: ../../whatsnew/3.11.rst:2475 msgid "" "Debuggers that accessed the ``f_locals`` directly *must* call :c:func:" "`PyFrame_GetLocals` instead. They no longer need to call :c:func:" @@ -3774,71 +3808,71 @@ msgid "" "now managed by the virtual machine." msgstr "" -#: ../../whatsnew/3.11.rst:2449 +#: ../../whatsnew/3.11.rst:2481 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2459 +#: ../../whatsnew/3.11.rst:2491 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2469 +#: ../../whatsnew/3.11.rst:2501 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." msgstr "" -#: ../../whatsnew/3.11.rst:2473 +#: ../../whatsnew/3.11.rst:2505 msgid "Changes of the :c:type:`PyThreadState` structure members:" msgstr "" -#: ../../whatsnew/3.11.rst:2475 +#: ../../whatsnew/3.11.rst:2507 msgid "" "``frame``: removed, use :c:func:`PyThreadState_GetFrame` (function added to " "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " "reference`, need to call :c:func:`Py_XDECREF`." msgstr "" -#: ../../whatsnew/3.11.rst:2479 +#: ../../whatsnew/3.11.rst:2511 msgid "" "``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" "`43760`)." msgstr "" -#: ../../whatsnew/3.11.rst:2482 +#: ../../whatsnew/3.11.rst:2514 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." msgstr "" -#: ../../whatsnew/3.11.rst:2484 +#: ../../whatsnew/3.11.rst:2516 msgid "``stackcheck_counter``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2486 +#: ../../whatsnew/3.11.rst:2518 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2496 +#: ../../whatsnew/3.11.rst:2528 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2522 +#: ../../whatsnew/3.11.rst:2554 msgid "" "Or use `the pythoncapi_compat project `__ to get these functions on old Python functions." msgstr "" -#: ../../whatsnew/3.11.rst:2526 +#: ../../whatsnew/3.11.rst:2558 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." msgstr "" -#: ../../whatsnew/3.11.rst:2529 +#: ../../whatsnew/3.11.rst:2561 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to 1 " "for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -3846,7 +3880,7 @@ msgid "" "path and replace any values added to ``module_search_paths``." msgstr "" -#: ../../whatsnew/3.11.rst:2534 +#: ../../whatsnew/3.11.rst:2566 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 " @@ -3855,177 +3889,177 @@ msgid "" "object and modify it directly." msgstr "" -#: ../../whatsnew/3.11.rst:2545 +#: ../../whatsnew/3.11.rst:2577 msgid "" "Deprecate the following functions to configure the Python initialization:" msgstr "" -#: ../../whatsnew/3.11.rst:2547 +#: ../../whatsnew/3.11.rst:2579 msgid ":c:func:`PySys_AddWarnOptionUnicode`" msgstr ":c:func:`PySys_AddWarnOptionUnicode`" -#: ../../whatsnew/3.11.rst:2548 +#: ../../whatsnew/3.11.rst:2580 msgid ":c:func:`PySys_AddWarnOption`" msgstr ":c:func:`PySys_AddWarnOption`" -#: ../../whatsnew/3.11.rst:2549 +#: ../../whatsnew/3.11.rst:2581 msgid ":c:func:`PySys_AddXOption`" msgstr ":c:func:`PySys_AddXOption`" -#: ../../whatsnew/3.11.rst:2550 +#: ../../whatsnew/3.11.rst:2582 msgid ":c:func:`PySys_HasWarnOptions`" msgstr ":c:func:`PySys_HasWarnOptions`" -#: ../../whatsnew/3.11.rst:2551 +#: ../../whatsnew/3.11.rst:2583 msgid ":c:func:`PySys_SetArgvEx`" msgstr ":c:func:`PySys_SetArgvEx`" -#: ../../whatsnew/3.11.rst:2552 +#: ../../whatsnew/3.11.rst:2584 msgid ":c:func:`PySys_SetArgv`" msgstr ":c:func:`PySys_SetArgv`" -#: ../../whatsnew/3.11.rst:2553 +#: ../../whatsnew/3.11.rst:2585 msgid ":c:func:`PySys_SetPath`" msgstr ":c:func:`PySys_SetPath`" -#: ../../whatsnew/3.11.rst:2554 +#: ../../whatsnew/3.11.rst:2586 msgid ":c:func:`Py_SetPath`" msgstr ":c:func:`Py_SetPath`" -#: ../../whatsnew/3.11.rst:2555 +#: ../../whatsnew/3.11.rst:2587 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../whatsnew/3.11.rst:2556 +#: ../../whatsnew/3.11.rst:2588 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../whatsnew/3.11.rst:2557 +#: ../../whatsnew/3.11.rst:2589 msgid ":c:func:`Py_SetStandardStreamEncoding`" msgstr ":c:func:`Py_SetStandardStreamEncoding`" -#: ../../whatsnew/3.11.rst:2558 +#: ../../whatsnew/3.11.rst:2590 msgid ":c:func:`_Py_SetProgramFullPath`" msgstr ":c:func:`_Py_SetProgramFullPath`" -#: ../../whatsnew/3.11.rst:2560 +#: ../../whatsnew/3.11.rst:2592 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`). (Contributed by Victor " "Stinner in :gh:`88279`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2564 +#: ../../whatsnew/3.11.rst:2596 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2573 +#: ../../whatsnew/3.11.rst:2605 msgid "" "The following C APIs have been deprecated in earlier Python releases, and " "will be removed in Python 3.12." msgstr "" -#: ../../whatsnew/3.11.rst:2576 +#: ../../whatsnew/3.11.rst:2608 msgid ":c:func:`PyUnicode_AS_DATA`" msgstr ":c:func:`PyUnicode_AS_DATA`" -#: ../../whatsnew/3.11.rst:2577 +#: ../../whatsnew/3.11.rst:2609 msgid ":c:func:`PyUnicode_AS_UNICODE`" msgstr ":c:func:`PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.11.rst:2578 +#: ../../whatsnew/3.11.rst:2610 msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.11.rst:2579 +#: ../../whatsnew/3.11.rst:2611 msgid ":c:func:`PyUnicode_AsUnicode`" msgstr ":c:func:`PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2580 +#: ../../whatsnew/3.11.rst:2612 msgid ":c:func:`PyUnicode_FromUnicode`" msgstr ":c:func:`PyUnicode_FromUnicode`" -#: ../../whatsnew/3.11.rst:2581 +#: ../../whatsnew/3.11.rst:2613 msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.11.rst:2582 +#: ../../whatsnew/3.11.rst:2614 msgid ":c:func:`PyUnicode_GET_SIZE`" msgstr ":c:func:`PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.11.rst:2583 +#: ../../whatsnew/3.11.rst:2615 msgid ":c:func:`PyUnicode_GetSize`" msgstr ":c:func:`PyUnicode_GetSize`" -#: ../../whatsnew/3.11.rst:2584 +#: ../../whatsnew/3.11.rst:2616 msgid ":c:func:`PyUnicode_IS_COMPACT`" msgstr ":c:func:`PyUnicode_IS_COMPACT`" -#: ../../whatsnew/3.11.rst:2585 +#: ../../whatsnew/3.11.rst:2617 msgid ":c:func:`PyUnicode_IS_READY`" msgstr ":c:func:`PyUnicode_IS_READY`" -#: ../../whatsnew/3.11.rst:2586 +#: ../../whatsnew/3.11.rst:2618 msgid ":c:func:`PyUnicode_READY`" msgstr ":c:func:`PyUnicode_READY`" -#: ../../whatsnew/3.11.rst:2587 +#: ../../whatsnew/3.11.rst:2619 msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" -#: ../../whatsnew/3.11.rst:2588 +#: ../../whatsnew/3.11.rst:2620 msgid ":c:func:`_PyUnicode_AsUnicode`" msgstr ":c:func:`_PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2589 +#: ../../whatsnew/3.11.rst:2621 msgid ":c:macro:`PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.11.rst:2590 +#: ../../whatsnew/3.11.rst:2622 msgid ":c:type:`PyUnicodeObject`" msgstr ":c:type:`PyUnicodeObject`" -#: ../../whatsnew/3.11.rst:2591 +#: ../../whatsnew/3.11.rst:2623 msgid ":c:func:`PyUnicode_InternImmortal()`" msgstr ":c:func:`PyUnicode_InternImmortal()`" -#: ../../whatsnew/3.11.rst:2599 +#: ../../whatsnew/3.11.rst:2631 msgid "" ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2603 +#: ../../whatsnew/3.11.rst:2635 msgid "Remove the following math macros using the ``errno`` variable:" msgstr "" -#: ../../whatsnew/3.11.rst:2605 +#: ../../whatsnew/3.11.rst:2637 msgid "``Py_ADJUST_ERANGE1()``" msgstr "``Py_ADJUST_ERANGE1()``" -#: ../../whatsnew/3.11.rst:2606 +#: ../../whatsnew/3.11.rst:2638 msgid "``Py_ADJUST_ERANGE2()``" msgstr "``Py_ADJUST_ERANGE2()``" -#: ../../whatsnew/3.11.rst:2607 +#: ../../whatsnew/3.11.rst:2639 msgid "``Py_OVERFLOWED()``" msgstr "``Py_OVERFLOWED()``" -#: ../../whatsnew/3.11.rst:2608 +#: ../../whatsnew/3.11.rst:2640 msgid "``Py_SET_ERANGE_IF_OVERFLOW()``" msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" -#: ../../whatsnew/3.11.rst:2609 +#: ../../whatsnew/3.11.rst:2641 msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2611 +#: ../../whatsnew/3.11.rst:2643 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2613 +#: ../../whatsnew/3.11.rst:2645 msgid "" "Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated " "since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()`` " @@ -4033,62 +4067,62 @@ msgid "" "(Contributed by Victor Stinner in :issue:`41123`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2618 +#: ../../whatsnew/3.11.rst:2650 msgid "" "Remove the ``pystrhex.h`` header file. It only contains private functions. C " "extensions should only include the main ```` header file. " "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2622 +#: ../../whatsnew/3.11.rst:2654 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" "`45440`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2626 +#: ../../whatsnew/3.11.rst:2658 msgid "" "The following items are no longer available when :c:macro:`Py_LIMITED_API` " "is defined:" msgstr "" -#: ../../whatsnew/3.11.rst:2629 +#: ../../whatsnew/3.11.rst:2661 msgid ":c:func:`PyMarshal_WriteLongToFile`" msgstr ":c:func:`PyMarshal_WriteLongToFile`" -#: ../../whatsnew/3.11.rst:2630 +#: ../../whatsnew/3.11.rst:2662 msgid ":c:func:`PyMarshal_WriteObjectToFile`" msgstr ":c:func:`PyMarshal_WriteObjectToFile`" -#: ../../whatsnew/3.11.rst:2631 +#: ../../whatsnew/3.11.rst:2663 msgid ":c:func:`PyMarshal_ReadObjectFromString`" msgstr ":c:func:`PyMarshal_ReadObjectFromString`" -#: ../../whatsnew/3.11.rst:2632 +#: ../../whatsnew/3.11.rst:2664 msgid ":c:func:`PyMarshal_WriteObjectToString`" msgstr ":c:func:`PyMarshal_WriteObjectToString`" -#: ../../whatsnew/3.11.rst:2633 +#: ../../whatsnew/3.11.rst:2665 msgid "the ``Py_MARSHAL_VERSION`` macro" msgstr "``Py_MARSHAL_VERSION`` 巨集" -#: ../../whatsnew/3.11.rst:2635 +#: ../../whatsnew/3.11.rst:2667 msgid "These are not part of the :ref:`limited API `." msgstr "" -#: ../../whatsnew/3.11.rst:2637 +#: ../../whatsnew/3.11.rst:2669 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2639 +#: ../../whatsnew/3.11.rst:2671 msgid "" "Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API. It never " "worked since the :c:type:`PyWeakReference` structure is opaque in the " "limited C API. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2644 +#: ../../whatsnew/3.11.rst:2676 msgid "" "Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed in the public " "C API by mistake, it must only be used by Python internally. Use the " @@ -4096,81 +4130,96 @@ msgid "" "in :issue:`40170`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2649 +#: ../../whatsnew/3.11.rst:2681 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2655 +#: ../../whatsnew/3.11.rst:2687 msgid "" "Remove the :c:type:`Py_UNICODE` encoder APIs, as they have been deprecated " "since Python 3.3, are little used and are inefficient relative to the " "recommended alternatives." msgstr "" -#: ../../whatsnew/3.11.rst:2660 +#: ../../whatsnew/3.11.rst:2692 msgid "The removed functions are:" msgstr "" -#: ../../whatsnew/3.11.rst:2662 +#: ../../whatsnew/3.11.rst:2694 msgid ":func:`!PyUnicode_Encode`" msgstr ":func:`!PyUnicode_Encode`" -#: ../../whatsnew/3.11.rst:2663 +#: ../../whatsnew/3.11.rst:2695 msgid ":func:`!PyUnicode_EncodeASCII`" msgstr ":func:`!PyUnicode_EncodeASCII`" -#: ../../whatsnew/3.11.rst:2664 +#: ../../whatsnew/3.11.rst:2696 msgid ":func:`!PyUnicode_EncodeLatin1`" msgstr ":func:`!PyUnicode_EncodeLatin1`" -#: ../../whatsnew/3.11.rst:2665 +#: ../../whatsnew/3.11.rst:2697 msgid ":func:`!PyUnicode_EncodeUTF7`" msgstr ":func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.11.rst:2666 +#: ../../whatsnew/3.11.rst:2698 msgid ":func:`!PyUnicode_EncodeUTF8`" msgstr ":func:`!PyUnicode_EncodeUTF8`" -#: ../../whatsnew/3.11.rst:2667 +#: ../../whatsnew/3.11.rst:2699 msgid ":func:`!PyUnicode_EncodeUTF16`" msgstr ":func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.11.rst:2668 +#: ../../whatsnew/3.11.rst:2700 msgid ":func:`!PyUnicode_EncodeUTF32`" msgstr ":func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.11.rst:2669 +#: ../../whatsnew/3.11.rst:2701 msgid ":func:`!PyUnicode_EncodeUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2670 +#: ../../whatsnew/3.11.rst:2702 msgid ":func:`!PyUnicode_EncodeRawUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeRawUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2671 +#: ../../whatsnew/3.11.rst:2703 msgid ":func:`!PyUnicode_EncodeCharmap`" msgstr ":func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.11.rst:2672 +#: ../../whatsnew/3.11.rst:2704 msgid ":func:`!PyUnicode_TranslateCharmap`" msgstr ":func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.11.rst:2673 +#: ../../whatsnew/3.11.rst:2705 msgid ":func:`!PyUnicode_EncodeDecimal`" msgstr ":func:`!PyUnicode_EncodeDecimal`" -#: ../../whatsnew/3.11.rst:2674 +#: ../../whatsnew/3.11.rst:2706 msgid ":func:`!PyUnicode_TransformDecimalToASCII`" msgstr ":func:`!PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.11.rst:2676 +#: ../../whatsnew/3.11.rst:2708 msgid "" "See :pep:`624` for details and :pep:`migration guidance <624#alternative-" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" msgstr "" +#~ msgid "``x+x; x*x; x-x;``" +#~ msgstr "``x+x; x*x; x-x;``" + +#~ msgid "``f(arg)`` ``C(arg)``" +#~ msgstr "``f(arg)`` ``C(arg)``" + +#~ msgid "``print`` ``len``" +#~ msgstr "``print`` ``len``" + +#~ msgid "[1]_" +#~ msgstr "[1]_" + +#~ msgid "[2]_" +#~ msgstr "[2]_" + #~ msgid ":func:`unittest.findTestCases`" #~ msgstr ":func:`unittest.findTestCases`" From bb2174f35d017ccbec6159fbcd94ce538d78dcea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Mar 2023 00:37:10 +0000 Subject: [PATCH 044/130] sync with cpython ffb41eaa --- library/zipapp.po | 12 ++++++------ library/zipfile.po | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/library/zipapp.po b/library/zipapp.po index b30a5a31c6..266101774a 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-19 17:24+0800\n" +"POT-Creation-Date: 2023-03-09 00:34+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -272,11 +272,11 @@ msgstr "" #: ../../library/zipapp.rst:218 msgid "" "To update the file in place, do the replacement in memory using a :class:" -"`BytesIO` object, and then overwrite the source afterwards. Note that there " -"is a risk when overwriting a file in place that an error will result in the " -"loss of the original file. This code does not protect against such errors, " -"but production code should do so. Also, this method will only work if the " -"archive fits in memory::" +"`~io.BytesIO` object, and then overwrite the source afterwards. Note that " +"there is a risk when overwriting a file in place that an error will result " +"in the loss of the original file. This code does not protect against such " +"errors, but production code should do so. Also, this method will only work " +"if the archive fits in memory::" msgstr "" #: ../../library/zipapp.rst:236 diff --git a/library/zipfile.po b/library/zipfile.po index c1a4f14ae2..8cb1c81a74 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-26 00:38+0000\n" +"POT-Creation-Date: 2023-03-09 00:34+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -337,8 +337,8 @@ msgid "" "With *mode* ``'r'`` the file-like object (``ZipExtFile``) is read-only and " "provides the following methods: :meth:`~io.BufferedIOBase.read`, :meth:`~io." "IOBase.readline`, :meth:`~io.IOBase.readlines`, :meth:`~io.IOBase.seek`, :" -"meth:`~io.IOBase.tell`, :meth:`__iter__`, :meth:`~iterator.__next__`. These " -"objects can operate independently of the ZipFile." +"meth:`~io.IOBase.tell`, :meth:`~container.__iter__`, :meth:`~iterator." +"__next__`. These objects can operate independently of the ZipFile." msgstr "" #: ../../library/zipfile.rst:294 From c8261cead239d8c088d0c9d8f5f556026298e81d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 11 Mar 2023 00:31:43 +0000 Subject: [PATCH 045/130] sync with cpython 123119ff --- library/threading.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/threading.po b/library/threading.po index 55d4c47359..b7c667f8fe 100644 --- a/library/threading.po +++ b/library/threading.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-03-11 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -320,7 +320,7 @@ msgstr "" #: ../../library/threading.rst:256 msgid "" "For more details and extensive examples, see the documentation string of " -"the :mod:`_threading_local` module." +"the :mod:`_threading_local` module: :source:`Lib/_threading_local.py`." msgstr "" #: ../../library/threading.rst:263 From ad9aa5c4b708b46f8d5bc85e8210760a5009761e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 13 Mar 2023 00:35:19 +0000 Subject: [PATCH 046/130] sync with cpython 78560261 --- library/subprocess.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/subprocess.po b/library/subprocess.po index 54573719b5..410e8fa7fa 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-03-13 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1799,7 +1799,7 @@ msgid "" "It is safe to set these to false on any Python version. They will have no " "effect on older versions when unsupported. Do not assume the attributes are " "available to read. Despite their names, a true value does not indicate that " -"the corresponding function will be used, only that that it may be." +"the corresponding function will be used, only that it may be." msgstr "" #: ../../library/subprocess.rst:1629 From 4212930756c9ff3ff618288d42b971e84129a64d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 14 Mar 2023 00:31:58 +0000 Subject: [PATCH 047/130] sync with cpython 43f8082b --- library/base64.po | 4 +- library/turtle.po | 260 ++++++++++++++++++------------------ reference/compound_stmts.po | 4 +- 3 files changed, 135 insertions(+), 133 deletions(-) diff --git a/library/base64.po b/library/base64.po index 7f43e98b63..fb3c220252 100644 --- a/library/base64.po +++ b/library/base64.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-30 00:19+0000\n" +"POT-Creation-Date: 2023-03-14 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -102,7 +102,7 @@ msgstr "" #: ../../library/base64.rst:61 msgid "" -"May assert or raise a a :exc:`ValueError` if the length of *altchars* is not " +"May assert or raise a :exc:`ValueError` if the length of *altchars* is not " "2. Raises a :exc:`TypeError` if *altchars* is not a :term:`bytes-like " "object`." msgstr "" diff --git a/library/turtle.po b/library/turtle.po index 122f31a7fc..6e5245d7fc 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-23 00:32+0000\n" +"POT-Creation-Date: 2023-03-14 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -209,7 +209,7 @@ msgstr ":func:`setheading` | :func:`seth`" msgid ":func:`home`" msgstr ":func:`home`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2463 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2467 msgid ":func:`circle`" msgstr ":func:`circle`" @@ -217,7 +217,7 @@ msgstr ":func:`circle`" msgid ":func:`dot`" msgstr ":func:`dot`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2445 msgid ":func:`stamp`" msgstr ":func:`stamp`" @@ -417,7 +417,7 @@ msgstr ":func:`get_shapepoly`" msgid "Using events" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2439 msgid ":func:`onclick`" msgstr ":func:`onclick`" @@ -425,7 +425,7 @@ msgstr ":func:`onclick`" msgid ":func:`onrelease`" msgstr ":func:`onrelease`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2418 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2422 msgid ":func:`ondrag`" msgstr ":func:`ondrag`" @@ -445,7 +445,7 @@ msgstr ":func:`end_poly`" msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2461 msgid ":func:`clone`" msgstr ":func:`clone`" @@ -1291,7 +1291,7 @@ msgid "" "turtle will be displayed stretched according to its stretchfactors: " "*stretch_wid* is stretchfactor perpendicular to its orientation, " "*stretch_len* is stretchfactor in direction of its orientation, *outline* " -"determines the width of the shapes's outline." +"determines the width of the shape's outline." msgstr "" #: ../../library/turtle.rst:1235 ../../library/turtle.rst:1894 @@ -1474,8 +1474,8 @@ msgstr "" #: ../../library/turtle.rst:1547 msgid "" -"Add as many components to this object as desired, using the :meth:" -"`addcomponent` method." +"Add as many components to this object as desired, using the :meth:`~Shape." +"addcomponent` method." msgstr "" #: ../../library/turtle.rst:1550 @@ -1940,8 +1940,8 @@ msgstr "" #: ../../library/turtle.rst:2128 msgid "" -"Provides screen oriented methods like :func:`setbg` etc. that are described " -"above." +"Provides screen oriented methods like :func:`bgcolor` etc. that are " +"described above." msgstr "" #: ../../library/turtle.rst:2133 @@ -2162,52 +2162,52 @@ msgstr "" #: ../../library/turtle.rst:2318 msgid "" -"The built in configuration would correspond to the following turtle.cfg::" +"The built in configuration would correspond to the following ``turtle.cfg``:" msgstr "" -#: ../../library/turtle.rst:2341 +#: ../../library/turtle.rst:2343 msgid "Short explanation of selected entries:" msgstr "" -#: ../../library/turtle.rst:2343 +#: ../../library/turtle.rst:2345 msgid "" -"The first four lines correspond to the arguments of the :meth:`Screen.setup` " -"method." +"The first four lines correspond to the arguments of the :func:`Screen.setup " +"` method." msgstr "" -#: ../../library/turtle.rst:2345 +#: ../../library/turtle.rst:2347 msgid "" -"Line 5 and 6 correspond to the arguments of the method :meth:`Screen." -"screensize`." +"Line 5 and 6 correspond to the arguments of the method :func:`Screen." +"screensize `." msgstr "" -#: ../../library/turtle.rst:2347 +#: ../../library/turtle.rst:2349 msgid "" "*shape* can be any of the built-in shapes, e.g: arrow, turtle, etc. For " "more info try ``help(shape)``." msgstr "" -#: ../../library/turtle.rst:2349 +#: ../../library/turtle.rst:2351 msgid "" -"If you want to use no fillcolor (i.e. make the turtle transparent), you have " -"to write ``fillcolor = \"\"`` (but all nonempty strings must not have quotes " -"in the cfg-file)." +"If you want to use no fill color (i.e. make the turtle transparent), you " +"have to write ``fillcolor = \"\"`` (but all nonempty strings must not have " +"quotes in the cfg file)." msgstr "" -#: ../../library/turtle.rst:2352 +#: ../../library/turtle.rst:2354 msgid "" "If you want to reflect the turtle its state, you have to use ``resizemode = " "auto``." msgstr "" -#: ../../library/turtle.rst:2354 +#: ../../library/turtle.rst:2356 msgid "" "If you set e.g. ``language = italian`` the docstringdict :file:" "`turtle_docstringdict_italian.py` will be loaded at import time (if present " "on the import path, e.g. in the same directory as :mod:`turtle`)." msgstr "" -#: ../../library/turtle.rst:2357 +#: ../../library/turtle.rst:2359 msgid "" "The entries *exampleturtle* and *examplescreen* define the names of these " "objects as they occur in the docstrings. The transformation of method-" @@ -2215,360 +2215,362 @@ msgid "" "docstrings." msgstr "" -#: ../../library/turtle.rst:2361 +#: ../../library/turtle.rst:2363 msgid "" "*using_IDLE*: Set this to ``True`` if you regularly work with IDLE and its " "``-n`` switch (\"no subprocess\"). This will prevent :func:`exitonclick` to " "enter the mainloop." msgstr "" -#: ../../library/turtle.rst:2365 +#: ../../library/turtle.rst:2367 msgid "" "There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` " "is stored and an additional one in the current working directory. The " "latter will override the settings of the first one." msgstr "" -#: ../../library/turtle.rst:2369 +#: ../../library/turtle.rst:2371 msgid "" "The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. " "You can study it as an example and see its effects when running the demos " "(preferably not from within the demo-viewer)." msgstr "" -#: ../../library/turtle.rst:2375 +#: ../../library/turtle.rst:2377 msgid ":mod:`turtledemo` --- Demo scripts" msgstr "" -#: ../../library/turtle.rst:2380 +#: ../../library/turtle.rst:2382 msgid "" "The :mod:`turtledemo` package includes a set of demo scripts. These scripts " "can be run and viewed using the supplied demo viewer as follows::" msgstr "" -#: ../../library/turtle.rst:2385 +#: ../../library/turtle.rst:2387 msgid "" "Alternatively, you can run the demo scripts individually. For example, ::" msgstr "" -#: ../../library/turtle.rst:2389 +#: ../../library/turtle.rst:2391 msgid "The :mod:`turtledemo` package directory contains:" msgstr "" -#: ../../library/turtle.rst:2391 +#: ../../library/turtle.rst:2393 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" -#: ../../library/turtle.rst:2393 +#: ../../library/turtle.rst:2395 msgid "" "Multiple scripts demonstrating different features of the :mod:`turtle` " "module. Examples can be accessed via the Examples menu. They can also be " "run standalone." msgstr "" -#: ../../library/turtle.rst:2396 +#: ../../library/turtle.rst:2398 msgid "" "A :file:`turtle.cfg` file which serves as an example of how to write and use " "such files." msgstr "" -#: ../../library/turtle.rst:2399 +#: ../../library/turtle.rst:2401 msgid "The demo scripts are:" msgstr "" -#: ../../library/turtle.rst:2404 +#: ../../library/turtle.rst:2408 msgid "Name" msgstr "" -#: ../../library/turtle.rst:2404 +#: ../../library/turtle.rst:2408 msgid "Description" msgstr "描述" -#: ../../library/turtle.rst:2404 +#: ../../library/turtle.rst:2408 msgid "Features" msgstr "" -#: ../../library/turtle.rst:2406 +#: ../../library/turtle.rst:2410 msgid "bytedesign" msgstr "" -#: ../../library/turtle.rst:2406 +#: ../../library/turtle.rst:2410 msgid "complex classical turtle graphics pattern" msgstr "" -#: ../../library/turtle.rst:2406 +#: ../../library/turtle.rst:2410 msgid ":func:`tracer`, delay, :func:`update`" msgstr "" -#: ../../library/turtle.rst:2409 +#: ../../library/turtle.rst:2413 msgid "chaos" msgstr "" -#: ../../library/turtle.rst:2409 +#: ../../library/turtle.rst:2413 msgid "" "graphs Verhulst dynamics, shows that computer's computations can generate " "results sometimes against the common sense expectations" msgstr "" -#: ../../library/turtle.rst:2409 +#: ../../library/turtle.rst:2413 msgid "world coordinates" msgstr "" -#: ../../library/turtle.rst:2415 +#: ../../library/turtle.rst:2419 msgid "clock" msgstr "" -#: ../../library/turtle.rst:2415 +#: ../../library/turtle.rst:2419 msgid "analog clock showing time of your computer" msgstr "" -#: ../../library/turtle.rst:2415 +#: ../../library/turtle.rst:2419 msgid "turtles as clock's hands, ontimer" msgstr "" -#: ../../library/turtle.rst:2418 +#: ../../library/turtle.rst:2422 msgid "colormixer" msgstr "" -#: ../../library/turtle.rst:2418 +#: ../../library/turtle.rst:2422 msgid "experiment with r, g, b" msgstr "" -#: ../../library/turtle.rst:2420 +#: ../../library/turtle.rst:2424 msgid "forest" msgstr "" -#: ../../library/turtle.rst:2420 +#: ../../library/turtle.rst:2424 msgid "3 breadth-first trees" msgstr "" -#: ../../library/turtle.rst:2420 +#: ../../library/turtle.rst:2424 msgid "randomization" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2426 msgid "fractalcurves" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2426 msgid "Hilbert & Koch curves" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2426 msgid "recursion" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2428 msgid "lindenmayer" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2428 msgid "ethnomathematics (indian kolams)" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2428 msgid "L-System" msgstr "" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2431 msgid "minimal_hanoi" msgstr "minimal_hanoi" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2431 msgid "Towers of Hanoi" msgstr "" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2431 msgid "Rectangular Turtles as Hanoi discs (shape, shapesize)" msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2435 msgid "nim" msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2435 msgid "" "play the classical nim game with three heaps of sticks against the computer." msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2435 msgid "turtles as nimsticks, event driven (mouse, keyboard)" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2439 msgid "paint" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2439 msgid "super minimalistic drawing program" msgstr "" -#: ../../library/turtle.rst:2438 +#: ../../library/turtle.rst:2442 msgid "peace" msgstr "" -#: ../../library/turtle.rst:2438 +#: ../../library/turtle.rst:2442 msgid "elementary" msgstr "" -#: ../../library/turtle.rst:2438 +#: ../../library/turtle.rst:2442 msgid "turtle: appearance and animation" msgstr "" -#: ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:2445 msgid "penrose" msgstr "" -#: ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:2445 msgid "aperiodic tiling with kites and darts" msgstr "" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2448 msgid "planet_and_moon" msgstr "planet_and_moon" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2448 msgid "simulation of gravitational system" msgstr "" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2448 msgid "compound shapes, :class:`Vec2D`" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2451 msgid "rosette" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2451 msgid "a pattern from the wikipedia article on turtle graphics" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2451 msgid ":func:`clone`, :func:`undo`" msgstr ":func:`clone`, :func:`undo`" -#: ../../library/turtle.rst:2450 +#: ../../library/turtle.rst:2454 msgid "round_dance" msgstr "round_dance" -#: ../../library/turtle.rst:2450 +#: ../../library/turtle.rst:2454 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2450 +#: ../../library/turtle.rst:2454 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2458 msgid "sorting_animate" msgstr "sorting_animate" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2458 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2458 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2461 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2461 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2464 msgid "two_canvases" msgstr "two_canvases" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2464 msgid "simple design" msgstr "" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2464 msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2463 +#: ../../library/turtle.rst:2467 msgid "yinyang" msgstr "" -#: ../../library/turtle.rst:2463 +#: ../../library/turtle.rst:2467 msgid "another elementary example" msgstr "" -#: ../../library/turtle.rst:2466 +#: ../../library/turtle.rst:2470 msgid "Have fun!" msgstr "" -#: ../../library/turtle.rst:2470 +#: ../../library/turtle.rst:2474 msgid "Changes since Python 2.6" msgstr "" -#: ../../library/turtle.rst:2472 +#: ../../library/turtle.rst:2476 msgid "" -"The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and :meth:" -"`Turtle.window_height` have been eliminated. Methods with these names and " -"functionality are now available only as methods of :class:`Screen`. The " -"functions derived from these remain available. (In fact already in Python " -"2.6 these methods were merely duplications of the corresponding :class:" -"`TurtleScreen`/:class:`Screen`-methods.)" +"The methods :func:`Turtle.tracer `, :func:`Turtle.window_width " +"` and :func:`Turtle.window_height ` have been " +"eliminated. Methods with these names and functionality are now available " +"only as methods of :class:`Screen`. The functions derived from these remain " +"available. (In fact already in Python 2.6 these methods were merely " +"duplications of the corresponding :class:`TurtleScreen`/:class:`Screen` " +"methods.)" msgstr "" -#: ../../library/turtle.rst:2480 +#: ../../library/turtle.rst:2484 msgid "" -"The method :meth:`Turtle.fill` has been eliminated. The behaviour of :meth:" -"`begin_fill` and :meth:`end_fill` have changed slightly: now every filling-" +"The method :func:`!Turtle.fill` has been eliminated. The behaviour of :func:" +"`begin_fill` and :func:`end_fill` have changed slightly: now every filling " "process must be completed with an ``end_fill()`` call." msgstr "" -#: ../../library/turtle.rst:2485 +#: ../../library/turtle.rst:2489 msgid "" -"A method :meth:`Turtle.filling` has been added. It returns a boolean value: " -"``True`` if a filling process is under way, ``False`` otherwise. This " -"behaviour corresponds to a ``fill()`` call without arguments in Python 2.6." +"A method :func:`Turtle.filling ` has been added. It returns a " +"boolean value: ``True`` if a filling process is under way, ``False`` " +"otherwise. This behaviour corresponds to a ``fill()`` call without arguments " +"in Python 2.6." msgstr "" -#: ../../library/turtle.rst:2491 +#: ../../library/turtle.rst:2495 msgid "Changes since Python 3.0" msgstr "" -#: ../../library/turtle.rst:2493 +#: ../../library/turtle.rst:2497 msgid "" -"The methods :meth:`Turtle.shearfactor`, :meth:`Turtle.shapetransform` and :" -"meth:`Turtle.get_shapepoly` have been added. Thus the full range of regular " -"linear transforms is now available for transforming turtle shapes. :meth:" -"`Turtle.tiltangle` has been enhanced in functionality: it now can be used to " -"get or set the tiltangle. :meth:`Turtle.settiltangle` has been deprecated." -msgstr "" - -#: ../../library/turtle.rst:2500 -msgid "" -"The method :meth:`Screen.onkeypress` has been added as a complement to :meth:" -"`Screen.onkey` which in fact binds actions to the keyrelease event. " -"Accordingly the latter has got an alias: :meth:`Screen.onkeyrelease`." +"The :class:`Turtle` methods :func:`shearfactor`, :func:`shapetransform` and :" +"func:`get_shapepoly` have been added. Thus the full range of regular linear " +"transforms is now available for transforming turtle shapes. :func:" +"`tiltangle` has been enhanced in functionality: it now can be used to get or " +"set the tilt angle. :func:`settiltangle` has been deprecated." msgstr "" #: ../../library/turtle.rst:2504 msgid "" -"The method :meth:`Screen.mainloop` has been added. So when working only " -"with Screen and Turtle objects one must not additionally import :func:" -"`mainloop` anymore." +"The :class:`Screen` method :func:`onkeypress` has been added as a complement " +"to :func:`onkey`. As the latter binds actions to the key release event, an " +"alias: :func:`onkeyrelease` was also added for it." msgstr "" #: ../../library/turtle.rst:2508 msgid "" -"Two input methods has been added :meth:`Screen.textinput` and :meth:`Screen." -"numinput`. These popup input dialogs and return strings and numbers " -"respectively." +"The method :func:`Screen.mainloop ` has been added, so there is no " +"longer a need to use the standalone :func:`mainloop` function when working " +"with :class:`Screen` and :class:`Turtle` objects." msgstr "" #: ../../library/turtle.rst:2512 msgid "" +"Two input methods have been added: :func:`Screen.textinput ` and :" +"func:`Screen.numinput `. These pop up input dialogs and return " +"strings and numbers respectively." +msgstr "" + +#: ../../library/turtle.rst:2516 +msgid "" "Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` " "have been added to the :file:`Lib/turtledemo` directory." msgstr "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index b2165348b6..cef2f2177c 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-22 00:30+0000\n" +"POT-Creation-Date: 2023-03-14 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -772,7 +772,7 @@ msgstr "" msgid "" "If the OR pattern fails, the AS pattern fails. Otherwise, the AS pattern " "binds the subject to the name on the right of the as keyword and succeeds. " -"``capture_pattern`` cannot be a a ``_``." +"``capture_pattern`` cannot be a ``_``." msgstr "" #: ../../reference/compound_stmts.rst:821 From 29578bcfde800e41fb744750ad523e56ab912edd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 15 Mar 2023 00:34:42 +0000 Subject: [PATCH 048/130] sync with cpython a166cb41 --- library/__main__.po | 4 +- library/asyncio-task.po | 160 +++++++++--------- library/pdb.po | 4 +- reference/datamodel.po | 365 ++++++++++++++++++++-------------------- tutorial/modules.po | 33 ++-- 5 files changed, 284 insertions(+), 282 deletions(-) diff --git a/library/__main__.po b/library/__main__.po index a4760fda74..bf7eace40b 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-15 00:10+0000\n" +"POT-Creation-Date: 2023-03-15 00:32+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -278,7 +278,7 @@ msgstr "" msgid "" "See :mod:`venv` for an example of a package with a minimal ``__main__.py`` " "in the standard library. It doesn't contain a ``if __name__ == '__main__'`` " -"block. You can invoke it with ``python3 -m venv [directory]``." +"block. You can invoke it with ``python -m venv [directory]``." msgstr "" #: ../../library/__main__.rst:264 diff --git a/library/asyncio-task.po b/library/asyncio-task.po index ac78e90add..fcb5f09b4f 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-09 00:33+0000\n" +"POT-Creation-Date: 2023-03-15 00:32+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -241,7 +241,7 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1009 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1006 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" @@ -302,7 +302,7 @@ msgstr "" #: ../../library/asyncio-task.rst:333 ../../library/asyncio-task.rst:463 #: ../../library/asyncio-task.rst:591 ../../library/asyncio-task.rst:655 #: ../../library/asyncio-task.rst:681 ../../library/asyncio-task.rst:724 -#: ../../library/asyncio-task.rst:820 +#: ../../library/asyncio-task.rst:817 msgid "Example::" msgstr "" "範例:\n" @@ -393,7 +393,7 @@ msgstr "" #: ../../library/asyncio-task.rst:421 ../../library/asyncio-task.rst:512 #: ../../library/asyncio-task.rst:566 ../../library/asyncio-task.rst:719 #: ../../library/asyncio-task.rst:749 ../../library/asyncio-task.rst:801 -#: ../../library/asyncio-task.rst:817 ../../library/asyncio-task.rst:826 +#: ../../library/asyncio-task.rst:823 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" @@ -777,21 +777,21 @@ msgid "" "Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." msgstr "" -#: ../../library/asyncio-task.rst:829 +#: ../../library/asyncio-task.rst:826 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:835 +#: ../../library/asyncio-task.rst:832 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:839 +#: ../../library/asyncio-task.rst:836 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:841 +#: ../../library/asyncio-task.rst:838 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -799,19 +799,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:846 +#: ../../library/asyncio-task.rst:843 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:848 +#: ../../library/asyncio-task.rst:845 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were run in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:878 +#: ../../library/asyncio-task.rst:875 msgid "" "Directly calling ``blocking_io()`` in any coroutine would block the event " "loop for its duration, resulting in an additional 1 second of run time. " @@ -819,7 +819,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:885 +#: ../../library/asyncio-task.rst:882 msgid "" "Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used " "to make IO-bound functions non-blocking. However, for extension modules that " @@ -827,81 +827,81 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:894 +#: ../../library/asyncio-task.rst:891 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:898 +#: ../../library/asyncio-task.rst:895 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:900 +#: ../../library/asyncio-task.rst:897 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:903 +#: ../../library/asyncio-task.rst:900 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: ../../library/asyncio-task.rst:915 +#: ../../library/asyncio-task.rst:912 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: ../../library/asyncio-task.rst:929 +#: ../../library/asyncio-task.rst:926 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:932 +#: ../../library/asyncio-task.rst:929 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:939 +#: ../../library/asyncio-task.rst:936 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:944 +#: ../../library/asyncio-task.rst:941 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:947 +#: ../../library/asyncio-task.rst:944 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:955 +#: ../../library/asyncio-task.rst:952 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:958 +#: ../../library/asyncio-task.rst:955 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:965 +#: ../../library/asyncio-task.rst:962 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:969 +#: ../../library/asyncio-task.rst:966 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:972 +#: ../../library/asyncio-task.rst:969 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -909,21 +909,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:978 +#: ../../library/asyncio-task.rst:975 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:983 +#: ../../library/asyncio-task.rst:980 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:988 +#: ../../library/asyncio-task.rst:985 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -931,112 +931,112 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:993 +#: ../../library/asyncio-task.rst:990 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:998 +#: ../../library/asyncio-task.rst:995 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:1002 +#: ../../library/asyncio-task.rst:999 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:1006 +#: ../../library/asyncio-task.rst:1003 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1012 +#: ../../library/asyncio-task.rst:1009 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1018 +#: ../../library/asyncio-task.rst:1015 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1020 +#: ../../library/asyncio-task.rst:1017 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1025 +#: ../../library/asyncio-task.rst:1022 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1027 +#: ../../library/asyncio-task.rst:1024 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:1031 ../../library/asyncio-task.rst:1045 +#: ../../library/asyncio-task.rst:1028 ../../library/asyncio-task.rst:1042 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1034 +#: ../../library/asyncio-task.rst:1031 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1039 +#: ../../library/asyncio-task.rst:1036 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1041 +#: ../../library/asyncio-task.rst:1038 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1048 +#: ../../library/asyncio-task.rst:1045 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1053 +#: ../../library/asyncio-task.rst:1050 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1055 ../../library/asyncio-task.rst:1064 +#: ../../library/asyncio-task.rst:1052 ../../library/asyncio-task.rst:1061 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1057 +#: ../../library/asyncio-task.rst:1054 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1062 +#: ../../library/asyncio-task.rst:1059 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1066 +#: ../../library/asyncio-task.rst:1063 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1071 +#: ../../library/asyncio-task.rst:1068 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1073 +#: ../../library/asyncio-task.rst:1070 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1044,15 +1044,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1079 +#: ../../library/asyncio-task.rst:1076 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1081 +#: ../../library/asyncio-task.rst:1078 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1083 +#: ../../library/asyncio-task.rst:1080 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1061,66 +1061,66 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1092 +#: ../../library/asyncio-task.rst:1089 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1094 +#: ../../library/asyncio-task.rst:1091 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1097 +#: ../../library/asyncio-task.rst:1094 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1099 +#: ../../library/asyncio-task.rst:1096 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" -#: ../../library/asyncio-task.rst:1104 +#: ../../library/asyncio-task.rst:1101 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1110 +#: ../../library/asyncio-task.rst:1107 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1112 +#: ../../library/asyncio-task.rst:1109 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:1120 +#: ../../library/asyncio-task.rst:1117 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1122 +#: ../../library/asyncio-task.rst:1119 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1125 +#: ../../library/asyncio-task.rst:1122 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1132 +#: ../../library/asyncio-task.rst:1129 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1134 +#: ../../library/asyncio-task.rst:1131 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1137 +#: ../../library/asyncio-task.rst:1134 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1130,46 +1130,46 @@ msgid "" "is actively discouraged." msgstr "" -#: ../../library/asyncio-task.rst:1145 +#: ../../library/asyncio-task.rst:1142 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1148 +#: ../../library/asyncio-task.rst:1145 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1153 +#: ../../library/asyncio-task.rst:1150 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1192 +#: ../../library/asyncio-task.rst:1189 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1194 +#: ../../library/asyncio-task.rst:1191 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:1200 +#: ../../library/asyncio-task.rst:1197 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1202 +#: ../../library/asyncio-task.rst:1199 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1204 +#: ../../library/asyncio-task.rst:1201 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1209 +#: ../../library/asyncio-task.rst:1206 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1178,7 +1178,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1227 +#: ../../library/asyncio-task.rst:1224 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1187,13 +1187,13 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1235 +#: ../../library/asyncio-task.rst:1232 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: ../../library/asyncio-task.rst:1239 +#: ../../library/asyncio-task.rst:1236 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1202,7 +1202,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1245 +#: ../../library/asyncio-task.rst:1242 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." diff --git a/library/pdb.po b/library/pdb.po index f9e17244d3..582a33bc48 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-05 00:35+0000\n" +"POT-Creation-Date: 2023-03-15 00:32+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -100,7 +100,7 @@ msgstr "" #: ../../library/pdb.rst:73 msgid "" ":file:`pdb.py` now accepts a ``-m`` option that execute modules similar to " -"the way ``python3 -m`` does. As with a script, the debugger will pause " +"the way ``python -m`` does. As with a script, the debugger will pause " "execution just before the first line of the module." msgstr "" diff --git a/reference/datamodel.po b/reference/datamodel.po index 3b27fb52c7..8cb0086e2b 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-22 00:30+0000\n" +"POT-Creation-Date: 2023-03-15 00:32+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2319,16 +2319,17 @@ msgstr "" #: ../../reference/datamodel.rst:1947 msgid "" -"Nonempty *__slots__* does not work for classes derived from \"variable-" -"length\" built-in types such as :class:`int`, :class:`bytes` and :class:" +":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " +"class derived from a :c:member:`\"variable-length\" built-in type " +"` such as :class:`int`, :class:`bytes`, and :class:" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:1950 +#: ../../reference/datamodel.rst:1952 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1952 +#: ../../reference/datamodel.rst:1954 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2336,13 +2337,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:1957 +#: ../../reference/datamodel.rst:1959 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1960 +#: ../../reference/datamodel.rst:1962 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2350,18 +2351,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:1966 +#: ../../reference/datamodel.rst:1968 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:1974 +#: ../../reference/datamodel.rst:1976 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:1976 +#: ../../reference/datamodel.rst:1978 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2371,14 +2372,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:1985 +#: ../../reference/datamodel.rst:1987 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:1989 +#: ../../reference/datamodel.rst:1991 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2386,13 +2387,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2003 +#: ../../reference/datamodel.rst:2005 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2008 +#: ../../reference/datamodel.rst:2010 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2400,41 +2401,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2016 +#: ../../reference/datamodel.rst:2018 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2021 +#: ../../reference/datamodel.rst:2023 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2027 +#: ../../reference/datamodel.rst:2029 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2038 +#: ../../reference/datamodel.rst:2040 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2046 +#: ../../reference/datamodel.rst:2048 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2053 +#: ../../reference/datamodel.rst:2055 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2057 +#: ../../reference/datamodel.rst:2059 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2442,41 +2443,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2071 +#: ../../reference/datamodel.rst:2073 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2074 +#: ../../reference/datamodel.rst:2076 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2076 +#: ../../reference/datamodel.rst:2078 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2077 +#: ../../reference/datamodel.rst:2079 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2078 +#: ../../reference/datamodel.rst:2080 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2079 +#: ../../reference/datamodel.rst:2081 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2080 +#: ../../reference/datamodel.rst:2082 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2084 +#: ../../reference/datamodel.rst:2086 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2086 +#: ../../reference/datamodel.rst:2088 msgid "" "If a base that appears in class definition is not an instance of :class:" "`type`, then an ``__mro_entries__`` method is searched on it. If found, it " @@ -2485,37 +2486,37 @@ msgid "" "such case the original base is ignored." msgstr "" -#: ../../reference/datamodel.rst:2094 +#: ../../reference/datamodel.rst:2096 msgid ":pep:`560` - Core support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2098 +#: ../../reference/datamodel.rst:2100 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2102 +#: ../../reference/datamodel.rst:2104 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2104 +#: ../../reference/datamodel.rst:2106 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2105 +#: ../../reference/datamodel.rst:2107 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2107 +#: ../../reference/datamodel.rst:2109 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2110 +#: ../../reference/datamodel.rst:2112 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2524,11 +2525,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2120 +#: ../../reference/datamodel.rst:2122 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2125 +#: ../../reference/datamodel.rst:2127 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2540,25 +2541,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2134 +#: ../../reference/datamodel.rst:2136 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2139 +#: ../../reference/datamodel.rst:2141 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2140 +#: ../../reference/datamodel.rst:2142 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2144 +#: ../../reference/datamodel.rst:2146 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2149 +#: ../../reference/datamodel.rst:2151 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2567,7 +2568,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2155 +#: ../../reference/datamodel.rst:2157 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2576,11 +2577,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2164 +#: ../../reference/datamodel.rst:2166 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2171 +#: ../../reference/datamodel.rst:2173 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2588,7 +2589,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2176 +#: ../../reference/datamodel.rst:2178 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2599,7 +2600,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2186 +#: ../../reference/datamodel.rst:2188 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2608,39 +2609,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2192 +#: ../../reference/datamodel.rst:2194 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2196 +#: ../../reference/datamodel.rst:2198 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2198 +#: ../../reference/datamodel.rst:2200 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2200 +#: ../../reference/datamodel.rst:2202 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2203 +#: ../../reference/datamodel.rst:2205 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2207 +#: ../../reference/datamodel.rst:2209 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2648,19 +2649,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2214 +#: ../../reference/datamodel.rst:2216 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2215 +#: ../../reference/datamodel.rst:2217 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2219 +#: ../../reference/datamodel.rst:2221 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2221 +#: ../../reference/datamodel.rst:2223 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2668,17 +2669,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2228 +#: ../../reference/datamodel.rst:2230 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2230 +#: ../../reference/datamodel.rst:2232 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2233 +#: ../../reference/datamodel.rst:2235 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2686,21 +2687,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2240 +#: ../../reference/datamodel.rst:2242 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2247 +#: ../../reference/datamodel.rst:2249 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2252 +#: ../../reference/datamodel.rst:2254 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2708,11 +2709,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2263 +#: ../../reference/datamodel.rst:2265 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2260 +#: ../../reference/datamodel.rst:2262 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2721,11 +2722,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2268 +#: ../../reference/datamodel.rst:2270 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2270 +#: ../../reference/datamodel.rst:2272 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2733,65 +2734,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2278 +#: ../../reference/datamodel.rst:2280 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2278 +#: ../../reference/datamodel.rst:2280 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2281 +#: ../../reference/datamodel.rst:2283 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2281 +#: ../../reference/datamodel.rst:2283 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2286 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2286 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2287 +#: ../../reference/datamodel.rst:2289 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2292 +#: ../../reference/datamodel.rst:2294 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2295 +#: ../../reference/datamodel.rst:2297 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2301 +#: ../../reference/datamodel.rst:2303 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2303 +#: ../../reference/datamodel.rst:2305 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2307 +#: ../../reference/datamodel.rst:2309 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2800,7 +2801,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2313 +#: ../../reference/datamodel.rst:2315 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2808,11 +2809,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2323 +#: ../../reference/datamodel.rst:2325 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2325 +#: ../../reference/datamodel.rst:2327 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2822,14 +2823,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2332 +#: ../../reference/datamodel.rst:2334 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2360 +#: ../../reference/datamodel.rst:2362 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2839,40 +2840,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2379 +#: ../../reference/datamodel.rst:2381 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2404 +#: ../../reference/datamodel.rst:2406 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2403 +#: ../../reference/datamodel.rst:2405 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2411 +#: ../../reference/datamodel.rst:2413 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2418 +#: ../../reference/datamodel.rst:2420 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2425 +#: ../../reference/datamodel.rst:2427 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2427 +#: ../../reference/datamodel.rst:2429 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2908,7 +2909,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2467 +#: ../../reference/datamodel.rst:2469 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2916,7 +2917,7 @@ msgid "" "zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2474 +#: ../../reference/datamodel.rst:2476 msgid "" "In CPython, the length is required to be at most :attr:`sys.maxsize`. If the " "length is larger than :attr:`!sys.maxsize` some features (such as :func:" @@ -2925,7 +2926,7 @@ msgid "" "`__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2483 +#: ../../reference/datamodel.rst:2485 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2935,20 +2936,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2497 +#: ../../reference/datamodel.rst:2499 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2501 +#: ../../reference/datamodel.rst:2503 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2505 +#: ../../reference/datamodel.rst:2507 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2510 +#: ../../reference/datamodel.rst:2512 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -2961,20 +2962,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2522 +#: ../../reference/datamodel.rst:2524 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2527 +#: ../../reference/datamodel.rst:2529 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2535 +#: ../../reference/datamodel.rst:2537 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2983,7 +2984,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2544 +#: ../../reference/datamodel.rst:2546 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2992,13 +2993,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2553 +#: ../../reference/datamodel.rst:2555 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2559 +#: ../../reference/datamodel.rst:2561 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3006,14 +3007,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2567 +#: ../../reference/datamodel.rst:2569 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2571 +#: ../../reference/datamodel.rst:2573 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3022,7 +3023,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2578 +#: ../../reference/datamodel.rst:2580 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3030,14 +3031,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2585 +#: ../../reference/datamodel.rst:2587 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2589 +#: ../../reference/datamodel.rst:2591 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3045,11 +3046,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2598 +#: ../../reference/datamodel.rst:2600 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2600 +#: ../../reference/datamodel.rst:2602 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3057,7 +3058,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2626 +#: ../../reference/datamodel.rst:2628 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3071,13 +3072,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2637 +#: ../../reference/datamodel.rst:2639 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2660 +#: ../../reference/datamodel.rst:2662 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3090,13 +3091,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2672 +#: ../../reference/datamodel.rst:2674 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2677 +#: ../../reference/datamodel.rst:2679 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3105,7 +3106,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2698 +#: ../../reference/datamodel.rst:2700 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3121,19 +3122,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2719 +#: ../../reference/datamodel.rst:2721 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2732 +#: ../../reference/datamodel.rst:2734 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2739 +#: ../../reference/datamodel.rst:2741 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3142,14 +3143,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2745 +#: ../../reference/datamodel.rst:2747 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2757 +#: ../../reference/datamodel.rst:2759 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3158,21 +3159,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2763 +#: ../../reference/datamodel.rst:2765 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2766 +#: ../../reference/datamodel.rst:2768 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2773 +#: ../../reference/datamodel.rst:2775 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2775 +#: ../../reference/datamodel.rst:2777 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3182,32 +3183,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2786 +#: ../../reference/datamodel.rst:2788 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2789 +#: ../../reference/datamodel.rst:2791 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2794 +#: ../../reference/datamodel.rst:2796 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:2803 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2805 +#: ../../reference/datamodel.rst:2807 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3215,27 +3216,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2809 +#: ../../reference/datamodel.rst:2811 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2816 +#: ../../reference/datamodel.rst:2818 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2816 +#: ../../reference/datamodel.rst:2818 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2823 +#: ../../reference/datamodel.rst:2825 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2825 +#: ../../reference/datamodel.rst:2827 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3243,7 +3244,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2832 +#: ../../reference/datamodel.rst:2834 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3252,7 +3253,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2838 +#: ../../reference/datamodel.rst:2840 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3262,19 +3263,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2848 +#: ../../reference/datamodel.rst:2850 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2849 +#: ../../reference/datamodel.rst:2851 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2855 +#: ../../reference/datamodel.rst:2857 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2857 +#: ../../reference/datamodel.rst:2859 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3282,7 +3283,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2872 +#: ../../reference/datamodel.rst:2874 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3291,21 +3292,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2886 +#: ../../reference/datamodel.rst:2888 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:2895 +#: ../../reference/datamodel.rst:2897 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:2921 +#: ../../reference/datamodel.rst:2923 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3314,36 +3315,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:2932 +#: ../../reference/datamodel.rst:2934 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:2936 +#: ../../reference/datamodel.rst:2938 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:2938 +#: ../../reference/datamodel.rst:2940 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:2944 +#: ../../reference/datamodel.rst:2946 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:2950 +#: ../../reference/datamodel.rst:2952 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:2956 +#: ../../reference/datamodel.rst:2958 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3351,15 +3352,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:2964 +#: ../../reference/datamodel.rst:2966 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:2970 +#: ../../reference/datamodel.rst:2972 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:2972 +#: ../../reference/datamodel.rst:2974 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3370,18 +3371,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:2980 +#: ../../reference/datamodel.rst:2982 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:2984 +#: ../../reference/datamodel.rst:2986 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:2990 +#: ../../reference/datamodel.rst:2992 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3392,7 +3393,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3001 +#: ../../reference/datamodel.rst:3003 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3403,7 +3404,7 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3012 +#: ../../reference/datamodel.rst:3014 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3413,99 +3414,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3020 +#: ../../reference/datamodel.rst:3022 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3026 +#: ../../reference/datamodel.rst:3028 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3028 +#: ../../reference/datamodel.rst:3030 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3031 +#: ../../reference/datamodel.rst:3033 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3035 +#: ../../reference/datamodel.rst:3037 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3039 +#: ../../reference/datamodel.rst:3041 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3042 +#: ../../reference/datamodel.rst:3044 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3059 +#: ../../reference/datamodel.rst:3061 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3064 +#: ../../reference/datamodel.rst:3066 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3072 +#: ../../reference/datamodel.rst:3074 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3074 +#: ../../reference/datamodel.rst:3076 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3077 +#: ../../reference/datamodel.rst:3079 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3081 +#: ../../reference/datamodel.rst:3083 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3086 +#: ../../reference/datamodel.rst:3088 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3089 +#: ../../reference/datamodel.rst:3091 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3102 +#: ../../reference/datamodel.rst:3104 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3103 +#: ../../reference/datamodel.rst:3105 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3107 +#: ../../reference/datamodel.rst:3109 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3513,7 +3514,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3113 +#: ../../reference/datamodel.rst:3115 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3521,7 +3522,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3119 +#: ../../reference/datamodel.rst:3121 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " diff --git a/tutorial/modules.po b/tutorial/modules.po index 26591da087..c1f2011426 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-03-15 00:32+0000\n" "PO-Revision-Date: 2022-10-23 20:30+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -244,8 +244,8 @@ msgid "" "with the ``__name__`` set to ``\"__main__\"``. That means that by adding " "this code at the end of your module::" msgstr "" -"如同使用 import 指令,模組中的程式碼會被執行,但 ``__name__`` 被設為 ``" -"\"__main__\"``\\ 。這意味著,透過在模組的末尾添加以下程式碼:\n" +"如同使用 import 指令,模組中的程式碼會被執行,但 ``__name__`` 被設為 " +"``\"__main__\"``\\ 。這意味著,透過在模組的末尾添加以下程式碼:\n" "\n" "::" @@ -547,12 +547,12 @@ msgid "" "terms of a hierarchical filesystem):" msgstr "" "假設你想設計一個能統一處理音訊檔案及音訊數據的模組集(「套件」)。因為音訊檔" -"案有很多的不同的格式(通常以它們的副檔名來辨識,例如:\\ :file:`.wav`" -"\\ ,\\ :file:`.aiff`\\ ,\\ :file:`.au`\\ ),因此,為了不同檔案格式之間的轉" -"換,你會需要建立和維護一個不斷增長的模組集合。為了要達成對音訊數據的許多不同" -"作業(例如,音訊混合、增加回聲、套用等化器功能、創造人工立體音效),你將編寫" -"一系列無止盡的模組來執行這些作業。以下是你的套件可能的架構(以階層式檔案系統" -"的方式表示):" +"案有很多的不同的格式(通常以它們的副檔名來辨識,例如:\\ :file:`." +"wav`\\ ,\\ :file:`.aiff`\\ ,\\ :file:`.au`\\ ),因此,為了不同檔案格式之間" +"的轉換,你會需要建立和維護一個不斷增長的模組集合。為了要達成對音訊數據的許多" +"不同作業(例如,音訊混合、增加回聲、套用等化器功能、創造人工立體音效),你將" +"編寫一系列無止盡的模組來執行這些作業。以下是你的套件可能的架構(以階層式檔案" +"系統的方式表示):" #: ../../tutorial/modules.rst:436 msgid "" @@ -561,13 +561,14 @@ msgid "" msgstr "Import 套件時,Python 會搜尋 ``sys.path`` 裡的目錄,尋找套件的子目錄。" #: ../../tutorial/modules.rst:439 +#, fuzzy msgid "" "The :file:`__init__.py` files are required to make Python treat directories " "containing the file as packages. This prevents directories with a common " -"name, such as ``string``, unintentionally hiding valid modules that occur " -"later on the module search path. In the simplest case, :file:`__init__.py` " -"can just be an empty file, but it can also execute initialization code for " -"the package or set the ``__all__`` variable, described later." +"name, such as ``string``, from unintentionally hiding valid modules that " +"occur later on the module search path. In the simplest case, :file:`__init__." +"py` can just be an empty file, but it can also execute initialization code " +"for the package or set the ``__all__`` variable, described later." msgstr "" "目錄中必須含有 :file:`__init__.py` 檔案,才會被 Pyhon 當成套件;這樣可以避免" "一些以常用名稱命名(例如 ``string``\\ )的目錄,無意中隱藏了較晚出現在模組搜" @@ -787,9 +788,9 @@ msgid "" "intended for use as the main module of a Python application must always use " "absolute imports." msgstr "" -"請注意,相對 import 的運作是以目前的模組名稱為依據。因為主模組的名稱永遠是 ``" -"\"__main__\"``\\ ,所以如果一個模組預期被用作 Python 應用程式的主模組,那它必" -"須永遠使用絕對 import。" +"請注意,相對 import 的運作是以目前的模組名稱為依據。因為主模組的名稱永遠是 " +"``\"__main__\"``\\ ,所以如果一個模組預期被用作 Python 應用程式的主模組,那它" +"必須永遠使用絕對 import。" #: ../../tutorial/modules.rst:569 msgid "Packages in Multiple Directories" From 14fb3534c9dcc7a74a0c342f04298736d09fc308 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Mar 2023 00:37:22 +0000 Subject: [PATCH 049/130] sync with cpython 3ddf3972 --- c-api/init.po | 10 +- c-api/intro.po | 16 +- library/sys.po | 10 +- library/venv.po | 6 +- using/configure.po | 448 ++++++++++++++++++++++++--------------------- using/unix.po | 15 +- 6 files changed, 266 insertions(+), 239 deletions(-) diff --git a/c-api/init.po b/c-api/init.po index 1c86953113..bc1e22e9c4 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-03-16 00:34+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -579,10 +579,10 @@ msgid "" "example, if the program name is ``'/usr/local/bin/python'``, the prefix is " "``'/usr/local'``. The returned string points into static storage; the caller " "should not modify its value. This corresponds to the :makevar:`prefix` " -"variable in the top-level :file:`Makefile` and the ``--prefix`` argument to " -"the :program:`configure` script at build time. The value is available to " -"Python code as ``sys.prefix``. It is only useful on Unix. See also the next " -"function." +"variable in the top-level :file:`Makefile` and the :option:`--prefix` " +"argument to the :program:`configure` script at build time. The value is " +"available to Python code as ``sys.prefix``. It is only useful on Unix. See " +"also the next function." msgstr "" #: ../../c-api/init.rst:420 diff --git a/c-api/intro.po b/c-api/intro.po index 48b53d27da..8e64c0c45b 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-03-16 00:34+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -117,11 +117,11 @@ msgstr "" msgid "" "The header files are typically installed with Python. On Unix, these are " "located in the directories :file:`{prefix}/include/pythonversion/` and :file:" -"`{exec_prefix}/include/pythonversion/`, where :envvar:`prefix` and :envvar:" -"`exec_prefix` are defined by the corresponding parameters to Python's :" -"program:`configure` script and *version* is ``'%d.%d' % sys." -"version_info[:2]``. On Windows, the headers are installed in :file:" -"`{prefix}/include`, where :envvar:`prefix` is the installation directory " +"`{exec_prefix}/include/pythonversion/`, where :option:`prefix <--prefix>` " +"and :option:`exec_prefix <--exec-prefix>` are defined by the corresponding " +"parameters to Python's :program:`configure` script and *version* is ``'%d." +"%d' % sys.version_info[:2]``. On Windows, the headers are installed in :" +"file:`{prefix}/include`, where ``prefix`` is the installation directory " "specified to the installer." msgstr "" @@ -131,8 +131,8 @@ msgid "" "compiler's search path for includes. Do *not* place the parent directories " "on the search path and then use ``#include ``; this will " "break on multi-platform builds since the platform independent headers under :" -"envvar:`prefix` include the platform specific headers from :envvar:" -"`exec_prefix`." +"option:`prefix <--prefix>` include the platform specific headers from :" +"option:`exec_prefix <--exec-prefix>`." msgstr "" #: ../../c-api/intro.rst:95 diff --git a/library/sys.po b/library/sys.po index 2cac7f261a..b6e22cdf0b 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-03 02:28+0000\n" +"POT-Creation-Date: 2023-03-16 00:34+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1909,10 +1909,10 @@ msgstr "" #: ../../library/sys.rst:1308 msgid "" "A string giving the site-specific directory prefix where the platform " -"independent Python files are installed; on Unix, the default is ``'/usr/" -"local'``. This can be set at build time with the ``--prefix`` argument to " -"the :program:`configure` script. See :ref:`installation_paths` for derived " -"paths." +"independent Python files are installed; on Unix, the default is :file:`/usr/" +"local`. This can be set at build time with the :option:`--prefix` argument " +"to the :program:`configure` script. See :ref:`installation_paths` for " +"derived paths." msgstr "" #: ../../library/sys.rst:1314 diff --git a/library/venv.po b/library/venv.po index a5bc922f14..8d4886e141 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-03-16 00:34+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -196,7 +196,7 @@ msgstr "" msgid "" "A virtual environment may be \"activated\" using a script in its binary " "directory (``bin`` on POSIX; ``Scripts`` on Windows). This will prepend that " -"directory to your :envvar:`!PATH`, so that running :program:`!python` will " +"directory to your :envvar:`!PATH`, so that running :program:`python` will " "invoke the environment's Python interpreter and you can run installed " "scripts without having to use their full path. The invocation of the " "activation script is platform-specific (:samp:`{}` must be replaced by " @@ -268,7 +268,7 @@ msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" #: ../../library/venv.rst:86 -msgid ":program:`!fish` and :program:`!csh` activation scripts." +msgid ":program:`fish` and :program:`csh` activation scripts." msgstr "" #: ../../library/venv.rst:89 diff --git a/using/configure.po b/using/configure.po index 2ccd28c09c..87bf5fe58a 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-03-16 00:34+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-" @@ -252,172 +252,198 @@ msgstr "" #: ../../using/configure.rst:179 msgid "" +"Install architecture-independent files in PREFIX. On Unix, it defaults to :" +"file:`/usr/local`." +msgstr "" + +#: ../../using/configure.rst:182 +msgid "This value can be retrived at runtime using :data:`sys.prefix`." +msgstr "" + +#: ../../using/configure.rst:184 +msgid "" +"As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " +"Python in its home directory." +msgstr "" + +#: ../../using/configure.rst:189 +msgid "" +"Install architecture-dependent files in EPREFIX, defaults to :option:`--" +"prefix`." +msgstr "" + +#: ../../using/configure.rst:191 +msgid "This value can be retrived at runtime using :data:`sys.exec_prefix`." +msgstr "" + +#: ../../using/configure.rst:195 +msgid "" "Don't build nor install test modules, like the :mod:`test` package or the :" "mod:`_testcapi` extension module (built and installed by default)." msgstr "" -#: ../../using/configure.rst:186 +#: ../../using/configure.rst:202 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "" -#: ../../using/configure.rst:188 +#: ../../using/configure.rst:204 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." msgstr "" -#: ../../using/configure.rst:190 +#: ../../using/configure.rst:206 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "" -#: ../../using/configure.rst:191 +#: ../../using/configure.rst:207 msgid "``no``: don't run ensurepip;" msgstr "" -#: ../../using/configure.rst:197 +#: ../../using/configure.rst:213 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:199 +#: ../../using/configure.rst:215 msgid "" "Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) " "is recommended for best performance." msgstr "" -#: ../../using/configure.rst:204 +#: ../../using/configure.rst:220 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:207 +#: ../../using/configure.rst:223 msgid "" "The C compiler Clang requires ``llvm-profdata`` program for PGO. On macOS, " "GCC also requires it: GCC is just an alias to Clang on macOS." msgstr "" -#: ../../using/configure.rst:210 +#: ../../using/configure.rst:226 msgid "" "Disable also semantic interposition in libpython if ``--enable-shared`` and " "GCC is used: add ``-fno-semantic-interposition`` to the compiler and linker " "flags." msgstr "" -#: ../../using/configure.rst:216 +#: ../../using/configure.rst:232 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "" -#: ../../using/configure.rst:221 +#: ../../using/configure.rst:237 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:224 +#: ../../using/configure.rst:240 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "" -#: ../../using/configure.rst:230 +#: ../../using/configure.rst:246 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:232 +#: ../../using/configure.rst:248 msgid "" "The C compiler Clang requires ``llvm-ar`` for LTO (``ar`` on macOS), as well " "as an LTO-aware linker (``ld.gold`` or ``lld``)." msgstr "" -#: ../../using/configure.rst:237 +#: ../../using/configure.rst:253 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:242 +#: ../../using/configure.rst:258 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:247 +#: ../../using/configure.rst:263 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:250 +#: ../../using/configure.rst:266 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:254 +#: ../../using/configure.rst:270 msgid "" "Disable static documentation strings to reduce the memory footprint (enabled " "by default). Documentation strings defined in Python are not affected." msgstr "" -#: ../../using/configure.rst:257 +#: ../../using/configure.rst:273 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "" -#: ../../using/configure.rst:259 +#: ../../using/configure.rst:275 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "" -#: ../../using/configure.rst:263 +#: ../../using/configure.rst:279 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:269 +#: ../../using/configure.rst:285 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:271 +#: ../../using/configure.rst:287 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:274 +#: ../../using/configure.rst:290 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:276 +#: ../../using/configure.rst:292 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:278 +#: ../../using/configure.rst:294 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "" -#: ../../using/configure.rst:279 +#: ../../using/configure.rst:295 msgid "Add :func:`sys.gettotalrefcount` function." msgstr "" -#: ../../using/configure.rst:280 +#: ../../using/configure.rst:296 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "" -#: ../../using/configure.rst:281 +#: ../../using/configure.rst:297 msgid "Add :envvar:`PYTHONTHREADDEBUG` environment variable." msgstr "" -#: ../../using/configure.rst:282 +#: ../../using/configure.rst:298 msgid "" "Add support for the ``__lltrace__`` variable: enable low-level tracing in " "the bytecode evaluation loop if the variable is defined." msgstr "" -#: ../../using/configure.rst:284 +#: ../../using/configure.rst:300 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:286 +#: ../../using/configure.rst:302 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "" -#: ../../using/configure.rst:287 +#: ../../using/configure.rst:303 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -425,45 +451,45 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:292 +#: ../../using/configure.rst:308 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:293 +#: ../../using/configure.rst:309 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:295 +#: ../../using/configure.rst:311 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:297 +#: ../../using/configure.rst:313 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:298 +#: ../../using/configure.rst:314 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:300 +#: ../../using/configure.rst:316 msgid "" "The :c:macro:`Py_SAFE_DOWNCAST()` macro checks for integer underflow and " "overflow when downcasting from wide types to narrow types." msgstr "" -#: ../../using/configure.rst:303 +#: ../../using/configure.rst:319 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:306 +#: ../../using/configure.rst:322 msgid "" "Release builds and debug builds are now ABI compatible: defining the " "``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see the :" @@ -471,326 +497,326 @@ msgid "" "incompatibility." msgstr "" -#: ../../using/configure.rst:314 +#: ../../using/configure.rst:330 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:318 +#: ../../using/configure.rst:334 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:323 +#: ../../using/configure.rst:339 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:325 +#: ../../using/configure.rst:341 msgid "Effects:" msgstr "" -#: ../../using/configure.rst:327 +#: ../../using/configure.rst:343 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "" -#: ../../using/configure.rst:328 +#: ../../using/configure.rst:344 msgid "Add :func:`sys.getobjects` function." msgstr "" -#: ../../using/configure.rst:329 +#: ../../using/configure.rst:345 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "" -#: ../../using/configure.rst:331 +#: ../../using/configure.rst:347 msgid "" "This build is not ABI compatible with release build (default build) or debug " "build (``Py_DEBUG`` and ``Py_REF_DEBUG`` macros)." msgstr "" -#: ../../using/configure.rst:338 +#: ../../using/configure.rst:354 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:341 +#: ../../using/configure.rst:357 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:344 +#: ../../using/configure.rst:360 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." msgstr "" -#: ../../using/configure.rst:351 +#: ../../using/configure.rst:367 msgid "Enable Valgrind support (default is no)." msgstr "" -#: ../../using/configure.rst:355 +#: ../../using/configure.rst:371 msgid "Enable DTrace support (default is no)." msgstr "" -#: ../../using/configure.rst:357 +#: ../../using/configure.rst:373 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" -#: ../../using/configure.rst:364 +#: ../../using/configure.rst:380 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:370 +#: ../../using/configure.rst:386 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:376 +#: ../../using/configure.rst:392 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:383 +#: ../../using/configure.rst:399 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:387 +#: ../../using/configure.rst:403 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:391 +#: ../../using/configure.rst:407 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:398 +#: ../../using/configure.rst:414 msgid "Libraries options" msgstr "" -#: ../../using/configure.rst:402 +#: ../../using/configure.rst:418 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:406 +#: ../../using/configure.rst:422 msgid "" "Build the :mod:`pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:411 +#: ../../using/configure.rst:427 msgid "" "Build the :mod:`_ctypes` extension module using an installed ``ffi`` " "library, see the :mod:`ctypes` module (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:416 +#: ../../using/configure.rst:432 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdec`` " "library, see the :mod:`decimal` module (default is no)." msgstr "" -#: ../../using/configure.rst:423 +#: ../../using/configure.rst:439 msgid "Use ``editline`` library for backend of the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:425 +#: ../../using/configure.rst:441 msgid "Define the ``WITH_EDITLINE`` macro." msgstr "" -#: ../../using/configure.rst:431 +#: ../../using/configure.rst:447 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" -#: ../../using/configure.rst:433 +#: ../../using/configure.rst:449 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "" -#: ../../using/configure.rst:439 +#: ../../using/configure.rst:455 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:443 +#: ../../using/configure.rst:459 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:447 +#: ../../using/configure.rst:463 msgid "Root of the OpenSSL directory." msgstr "" -#: ../../using/configure.rst:453 +#: ../../using/configure.rst:469 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:455 +#: ../../using/configure.rst:471 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:456 +#: ../../using/configure.rst:472 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:458 +#: ../../using/configure.rst:474 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:464 +#: ../../using/configure.rst:480 msgid "Security Options" msgstr "" -#: ../../using/configure.rst:468 +#: ../../using/configure.rst:484 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:470 +#: ../../using/configure.rst:486 msgid "``siphash13`` (default);" msgstr "" -#: ../../using/configure.rst:471 +#: ../../using/configure.rst:487 msgid "``siphash24``;" msgstr "" -#: ../../using/configure.rst:472 +#: ../../using/configure.rst:488 msgid "``fnv``." msgstr "" -#: ../../using/configure.rst:476 +#: ../../using/configure.rst:492 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:481 +#: ../../using/configure.rst:497 msgid "Built-in hash modules:" msgstr "" -#: ../../using/configure.rst:483 +#: ../../using/configure.rst:499 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:484 +#: ../../using/configure.rst:500 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:485 +#: ../../using/configure.rst:501 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:486 +#: ../../using/configure.rst:502 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:487 +#: ../../using/configure.rst:503 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:488 +#: ../../using/configure.rst:504 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:494 +#: ../../using/configure.rst:510 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:496 +#: ../../using/configure.rst:512 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:497 +#: ../../using/configure.rst:513 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:498 +#: ../../using/configure.rst:514 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:500 +#: ../../using/configure.rst:516 msgid "See the :mod:`ssl` module." msgstr "" -#: ../../using/configure.rst:506 +#: ../../using/configure.rst:522 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:510 +#: ../../using/configure.rst:526 msgid "macOS Options" msgstr "" -#: ../../using/configure.rst:512 +#: ../../using/configure.rst:528 msgid "See ``Mac/README.rst``." msgstr "參閱 ``Mac/README.rst``\\ 。" -#: ../../using/configure.rst:517 +#: ../../using/configure.rst:533 msgid "" "Create a universal binary build. *SDKDIR* specifies which macOS SDK should " "be used to perform the build (default is no)." msgstr "" -#: ../../using/configure.rst:523 +#: ../../using/configure.rst:539 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:528 +#: ../../using/configure.rst:544 msgid "" "Specify the kind of universal binary that should be created. This option is " "only valid when :option:`--enable-universalsdk` is set." msgstr "" -#: ../../using/configure.rst:531 +#: ../../using/configure.rst:547 msgid "Options:" msgstr "" -#: ../../using/configure.rst:533 +#: ../../using/configure.rst:549 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:534 +#: ../../using/configure.rst:550 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:535 +#: ../../using/configure.rst:551 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:536 +#: ../../using/configure.rst:552 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:537 +#: ../../using/configure.rst:553 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:538 +#: ../../using/configure.rst:554 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:539 +#: ../../using/configure.rst:555 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:540 +#: ../../using/configure.rst:556 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:544 +#: ../../using/configure.rst:560 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:549 +#: ../../using/configure.rst:565 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:551 +#: ../../using/configure.rst:567 msgid "" "Cross compiling, also known as cross building, can be used to build Python " "for another CPU architecture or platform. Cross compiling requires a Python " @@ -798,101 +824,101 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:558 +#: ../../using/configure.rst:574 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:562 +#: ../../using/configure.rst:578 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:566 +#: ../../using/configure.rst:582 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:572 +#: ../../using/configure.rst:588 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:574 +#: ../../using/configure.rst:590 msgid "Example *config.site* file::" msgstr "" -#: ../../using/configure.rst:582 +#: ../../using/configure.rst:598 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:591 +#: ../../using/configure.rst:607 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:594 +#: ../../using/configure.rst:610 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:596 +#: ../../using/configure.rst:612 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:597 +#: ../../using/configure.rst:613 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:598 +#: ../../using/configure.rst:614 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:599 +#: ../../using/configure.rst:615 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:601 +#: ../../using/configure.rst:617 msgid ":file:`setup.py`: C extensions built using the :mod:`distutils` module." msgstr "" -#: ../../using/configure.rst:604 +#: ../../using/configure.rst:620 msgid "Main build steps" msgstr "" -#: ../../using/configure.rst:606 +#: ../../using/configure.rst:622 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:607 +#: ../../using/configure.rst:623 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:608 +#: ../../using/configure.rst:624 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:610 +#: ../../using/configure.rst:626 msgid "" "C extensions are built by the Makefile (see :file:`Modules/Setup`) and " "``python setup.py build``." msgstr "" -#: ../../using/configure.rst:614 +#: ../../using/configure.rst:630 msgid "Main Makefile targets" msgstr "" -#: ../../using/configure.rst:616 +#: ../../using/configure.rst:632 msgid "``make``: Build Python with the standard library." msgstr "" -#: ../../using/configure.rst:617 +#: ../../using/configure.rst:633 msgid "" "``make platform:``: build the ``python`` program, but don't build the " "standard library extension modules." msgstr "" -#: ../../using/configure.rst:619 +#: ../../using/configure.rst:635 msgid "" "``make profile-opt``: build Python using Profile Guided Optimization (PGO). " "You can use the configure :option:`--enable-optimizations` option to make " @@ -900,53 +926,53 @@ msgid "" "``make``)." msgstr "" -#: ../../using/configure.rst:623 +#: ../../using/configure.rst:639 msgid "" "``make buildbottest``: Build Python and run the Python test suite, the same " "way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds) to " "change the test timeout (1200 by default: 20 minutes)." msgstr "" -#: ../../using/configure.rst:626 +#: ../../using/configure.rst:642 msgid "``make install``: Build and install Python." msgstr "" -#: ../../using/configure.rst:627 +#: ../../using/configure.rst:643 msgid "" "``make regen-all``: Regenerate (almost) all generated files; ``make regen-" "stdlib-module-names`` and ``autoconf`` must be run separately for the " "remaining generated files." msgstr "" -#: ../../using/configure.rst:630 +#: ../../using/configure.rst:646 msgid "``make clean``: Remove built files." msgstr "" -#: ../../using/configure.rst:631 +#: ../../using/configure.rst:647 msgid "" "``make distclean``: Same than ``make clean``, but remove also files created " "by the configure script." msgstr "" -#: ../../using/configure.rst:635 +#: ../../using/configure.rst:651 msgid "C extensions" msgstr "" -#: ../../using/configure.rst:637 +#: ../../using/configure.rst:653 msgid "" "Some C extensions are built as built-in modules, like the ``sys`` module. " "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute::" msgstr "" -#: ../../using/configure.rst:649 +#: ../../using/configure.rst:665 msgid "" "Other C extensions are built as dynamic libraries, like the ``_asyncio`` " "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64::" msgstr "" -#: ../../using/configure.rst:659 +#: ../../using/configure.rst:675 msgid "" ":file:`Modules/Setup` is used to generate Makefile targets to build C " "extensions. At the beginning of the files, C extensions are built as built-" @@ -954,322 +980,322 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:663 +#: ../../using/configure.rst:679 msgid "" "The :file:`setup.py` script only builds C extensions as shared libraries " "using the :mod:`distutils` module." msgstr "" -#: ../../using/configure.rst:666 +#: ../../using/configure.rst:682 msgid "" "The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_API()` and :c:macro:" "`PyMODINIT_FUNC()` macros of :file:`Include/pyport.h` are defined " "differently depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:670 +#: ../../using/configure.rst:686 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "" -#: ../../using/configure.rst:671 +#: ../../using/configure.rst:687 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "" -#: ../../using/configure.rst:673 +#: ../../using/configure.rst:689 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its ``PyInit_xxx()`` function is not exported, " "causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:679 +#: ../../using/configure.rst:695 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:681 +#: ../../using/configure.rst:697 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:685 +#: ../../using/configure.rst:701 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:689 +#: ../../using/configure.rst:705 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:695 +#: ../../using/configure.rst:711 msgid "" "(Objective) C/C++ preprocessor flags, e.g. ``-I`` if you have " "headers in a nonstandard directory ````." msgstr "" -#: ../../using/configure.rst:698 ../../using/configure.rst:893 +#: ../../using/configure.rst:714 ../../using/configure.rst:909 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value for setup.py to be able to build extension modules using the " "directories specified in the environment variables." msgstr "" -#: ../../using/configure.rst:708 +#: ../../using/configure.rst:724 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:710 +#: ../../using/configure.rst:726 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:715 +#: ../../using/configure.rst:731 msgid "Compiler flags" msgstr "" -#: ../../using/configure.rst:719 +#: ../../using/configure.rst:735 msgid "C compiler command." msgstr "" -#: ../../using/configure.rst:721 +#: ../../using/configure.rst:737 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:725 +#: ../../using/configure.rst:741 msgid "" "C compiler command used to build the ``main()`` function of programs like " "``python``." msgstr "" -#: ../../using/configure.rst:728 +#: ../../using/configure.rst:744 msgid "" "Variable set by the :option:`--with-cxx-main` option of the configure script." msgstr "" -#: ../../using/configure.rst:731 +#: ../../using/configure.rst:747 msgid "Default: ``$(CC)``." msgstr "" -#: ../../using/configure.rst:735 +#: ../../using/configure.rst:751 msgid "C++ compiler command." msgstr "" -#: ../../using/configure.rst:737 +#: ../../using/configure.rst:753 msgid "Used if the :option:`--with-cxx-main` option is used." msgstr "" -#: ../../using/configure.rst:739 +#: ../../using/configure.rst:755 msgid "Example: ``g++ -pthread``." msgstr "" -#: ../../using/configure.rst:743 +#: ../../using/configure.rst:759 msgid "C compiler flags." msgstr "" -#: ../../using/configure.rst:747 +#: ../../using/configure.rst:763 msgid "" ":envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C " "extensions. Use it when a compiler flag should *not* be part of the " "distutils :envvar:`CFLAGS` once Python is installed (:issue:`21121`)." msgstr "" -#: ../../using/configure.rst:751 +#: ../../using/configure.rst:767 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:753 +#: ../../using/configure.rst:769 msgid "" "the compiler flag ``-I`` (for setting the search path for include files). " "The ``-I`` flags are processed from left to right, and any flags in :envvar:" "`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." msgstr "" -#: ../../using/configure.rst:758 +#: ../../using/configure.rst:774 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:766 +#: ../../using/configure.rst:782 msgid "Extra C compiler flags." msgstr "" -#: ../../using/configure.rst:770 +#: ../../using/configure.rst:786 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:777 +#: ../../using/configure.rst:793 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:784 +#: ../../using/configure.rst:800 msgid "Base compiler flags." msgstr "" -#: ../../using/configure.rst:788 +#: ../../using/configure.rst:804 msgid "Optimization flags." msgstr "" -#: ../../using/configure.rst:792 +#: ../../using/configure.rst:808 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:798 +#: ../../using/configure.rst:814 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:800 +#: ../../using/configure.rst:816 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:804 +#: ../../using/configure.rst:820 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:806 +#: ../../using/configure.rst:822 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:811 +#: ../../using/configure.rst:827 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:815 +#: ../../using/configure.rst:831 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:821 +#: ../../using/configure.rst:837 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:823 +#: ../../using/configure.rst:839 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:829 +#: ../../using/configure.rst:845 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:835 +#: ../../using/configure.rst:851 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:838 +#: ../../using/configure.rst:854 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:844 +#: ../../using/configure.rst:860 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:846 +#: ../../using/configure.rst:862 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:850 +#: ../../using/configure.rst:866 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:854 +#: ../../using/configure.rst:870 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:856 +#: ../../using/configure.rst:872 msgid "Default: ``$(PURIFY) $(MAINCC)``." msgstr "" -#: ../../using/configure.rst:860 +#: ../../using/configure.rst:876 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:862 +#: ../../using/configure.rst:878 msgid "" "Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use " "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" -#: ../../using/configure.rst:870 +#: ../../using/configure.rst:886 msgid "" ":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" "`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of the " "distutils :envvar:`LDFLAGS` once Python is installed (:issue:`35257`)." msgstr "" -#: ../../using/configure.rst:874 +#: ../../using/configure.rst:890 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:876 +#: ../../using/configure.rst:892 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" -#: ../../using/configure.rst:883 +#: ../../using/configure.rst:899 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:890 +#: ../../using/configure.rst:906 msgid "" "Linker flags, e.g. ``-L`` if you have libraries in a nonstandard " "directory ````." msgstr "" -#: ../../using/configure.rst:899 +#: ../../using/configure.rst:915 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:902 +#: ../../using/configure.rst:918 msgid "Example: ``-lrt``." msgstr "" -#: ../../using/configure.rst:906 +#: ../../using/configure.rst:922 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:908 +#: ../../using/configure.rst:924 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "" -#: ../../using/configure.rst:912 +#: ../../using/configure.rst:928 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:914 +#: ../../using/configure.rst:930 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "" -#: ../../using/configure.rst:918 +#: ../../using/configure.rst:934 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "" -#: ../../using/configure.rst:922 +#: ../../using/configure.rst:938 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "" -#: ../../using/configure.rst:928 +#: ../../using/configure.rst:944 msgid "Linker flags used for building the interpreter object files." msgstr "" diff --git a/using/unix.po b/using/unix.po index 12fdee43c8..bab453d660 100644 --- a/using/unix.po +++ b/using/unix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-03-16 00:34+0000\n" "PO-Revision-Date: 2022-10-31 16:31+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -138,9 +138,9 @@ msgid "" "contribute patches, you will need a clone.)" msgstr "" "如果你想自己編譯 CPython,首先要做的是獲取\\ `原始碼 `_。你可以下載最新版本的原始碼,也可以直接提取最新的 " -"`clone(克隆) `_。(如果你想要貢獻修補程式碼,也會需要一份 clone。)" +"downloads/source/>`_。你可以下載最新版本的原始碼,也可以直接提取最新的 `clone" +"(克隆) `_。(如" +"果你想要貢獻修補程式碼,也會需要一份 clone。)" #: ../../using/unix.rst:75 msgid "The build process consists of the usual commands::" @@ -174,11 +174,12 @@ msgid "Python-related paths and files" msgstr "與 Python 相關的路徑和檔案" #: ../../using/unix.rst:95 +#, fuzzy msgid "" "These are subject to difference depending on local installation " -"conventions; :envvar:`prefix` (``${prefix}``) and :envvar:`exec_prefix` (``" -"${exec_prefix}``) are installation-dependent and should be interpreted as " -"for GNU software; they may be the same." +"conventions; :option:`prefix <--prefix>` and :option:`exec_prefix <--exec-" +"prefix>` are installation-dependent and should be interpreted as for GNU " +"software; they may be the same." msgstr "" "這取決於本地安裝慣例;:envvar:`prefix` (``${prefix}``) 和 :envvar:" "`exec_prefix` (``${exec_prefix}``) 相依於安裝方式,應被直譯來讓 GNU 軟體使" From 9f8b007b1d1d1a61f047104cbaa3e5ba4885fe33 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 17 Mar 2023 00:34:42 +0000 Subject: [PATCH 050/130] sync with cpython df399a35 --- library/random.po | 12 +- library/stdtypes.po | 1984 +++++++++++++++++++++---------------------- 2 files changed, 998 insertions(+), 998 deletions(-) diff --git a/library/random.po b/library/random.po index 86c00f1fd2..c8295612e6 100644 --- a/library/random.po +++ b/library/random.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-23 00:16+0000\n" +"POT-Creation-Date: 2023-03-17 00:32+0000\n" "PO-Revision-Date: 2023-01-23 22:47+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -775,7 +775,7 @@ msgid "" "combinatoric iterators in the :mod:`itertools` module:" msgstr "" -#: ../../library/random.rst:598 +#: ../../library/random.rst:599 msgid "" "The default :func:`.random` returns multiples of 2⁻⁵³ in the range *0.0 ≤ x " "< 1.0*. All such numbers are evenly spaced and are exactly representable as " @@ -787,7 +787,7 @@ msgstr "" "均勻分佈的,並且可以完全表示為 Python float。但是,該間隔中的許多其他可表示" "的 float 不是可能的選擇。 例如 ``0.05954861408025609`` 不是 2⁻⁵³ 的整數倍。" -#: ../../library/random.rst:604 +#: ../../library/random.rst:605 msgid "" "The following recipe takes a different approach. All floats in the interval " "are possible selections. The mantissa comes from a uniform distribution of " @@ -799,7 +799,7 @@ msgstr "" "數 < 2⁵³* 範圍內的整數均勻分佈。指數來自幾何分佈,其中小於 *-53* 的指數的出現" "頻率是下一個較大指數的一半。" -#: ../../library/random.rst:626 +#: ../../library/random.rst:627 msgid "" "All :ref:`real valued distributions ` in the " "class will use the new method::" @@ -809,7 +809,7 @@ msgstr "" "\n" "::" -#: ../../library/random.rst:635 +#: ../../library/random.rst:636 msgid "" "The recipe is conceptually equivalent to an algorithm that chooses from all " "the multiples of 2⁻¹⁰⁷⁴ in the range *0.0 ≤ x < 1.0*. All such numbers are " @@ -822,7 +822,7 @@ msgstr "" "示的 Python float。(2⁻¹⁰⁷⁴ 是最小為正的非正規化 float,等於 ``math." "ulp(0.0)``)" -#: ../../library/random.rst:644 +#: ../../library/random.rst:645 msgid "" "`Generating Pseudo-random Floating-Point Values `_ a paper by Allen B. Downey describing " diff --git a/library/stdtypes.po b/library/stdtypes.po index 5a494e82e1..b31973a7f8 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-06 00:34+0000\n" +"POT-Creation-Date: 2023-03-17 00:32+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -121,22 +121,22 @@ msgid "These are the Boolean operations, ordered by ascending priority:" msgstr "" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:143 -#: ../../library/stdtypes.rst:275 ../../library/stdtypes.rst:364 -#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:923 -#: ../../library/stdtypes.rst:1128 +#: ../../library/stdtypes.rst:275 ../../library/stdtypes.rst:363 +#: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:922 +#: ../../library/stdtypes.rst:1127 msgid "Operation" msgstr "" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 -#: ../../library/stdtypes.rst:364 ../../library/stdtypes.rst:414 -#: ../../library/stdtypes.rst:923 ../../library/stdtypes.rst:1128 +#: ../../library/stdtypes.rst:363 ../../library/stdtypes.rst:413 +#: ../../library/stdtypes.rst:922 ../../library/stdtypes.rst:1127 msgid "Result" msgstr "結果" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 -#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:923 -#: ../../library/stdtypes.rst:1128 ../../library/stdtypes.rst:2373 -#: ../../library/stdtypes.rst:3591 +#: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:922 +#: ../../library/stdtypes.rst:1127 ../../library/stdtypes.rst:2372 +#: ../../library/stdtypes.rst:3590 msgid "Notes" msgstr "註解" @@ -149,9 +149,9 @@ msgid "if *x* is true, then *x*, else *y*" msgstr "" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 -#: ../../library/stdtypes.rst:925 ../../library/stdtypes.rst:928 -#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:2379 -#: ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:924 ../../library/stdtypes.rst:927 +#: ../../library/stdtypes.rst:1138 ../../library/stdtypes.rst:2378 +#: ../../library/stdtypes.rst:3596 msgid "\\(1)" msgstr "\\(1)" @@ -164,9 +164,9 @@ msgid "if *x* is false, then *x*, else *y*" msgstr "" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:288 -#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1167 -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:2385 -#: ../../library/stdtypes.rst:3601 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1166 +#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:2384 +#: ../../library/stdtypes.rst:3600 ../../library/stdtypes.rst:3602 msgid "\\(2)" msgstr "\\(2)" @@ -178,19 +178,19 @@ msgstr "``not x``" msgid "if *x* is false, then ``True``, else ``False``" msgstr "" -#: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:937 -#: ../../library/stdtypes.rst:1170 ../../library/stdtypes.rst:2387 -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:2391 -#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3605 -#: ../../library/stdtypes.rst:3607 ../../library/stdtypes.rst:3609 -#: ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:936 +#: ../../library/stdtypes.rst:1169 ../../library/stdtypes.rst:2386 +#: ../../library/stdtypes.rst:2388 ../../library/stdtypes.rst:2390 +#: ../../library/stdtypes.rst:2392 ../../library/stdtypes.rst:3604 +#: ../../library/stdtypes.rst:3606 ../../library/stdtypes.rst:3608 +#: ../../library/stdtypes.rst:3610 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:102 ../../library/stdtypes.rst:319 -#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:974 -#: ../../library/stdtypes.rst:1178 ../../library/stdtypes.rst:2419 -#: ../../library/stdtypes.rst:3641 +#: ../../library/stdtypes.rst:431 ../../library/stdtypes.rst:973 +#: ../../library/stdtypes.rst:1177 ../../library/stdtypes.rst:2418 +#: ../../library/stdtypes.rst:3640 msgid "Notes:" msgstr "註解:" @@ -229,9 +229,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "" -#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2350 -#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3568 -#: ../../library/stdtypes.rst:3591 +#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2349 +#: ../../library/stdtypes.rst:2372 ../../library/stdtypes.rst:3567 +#: ../../library/stdtypes.rst:3590 msgid "Meaning" msgstr "" @@ -513,8 +513,8 @@ msgid "" "zero." msgstr "" -#: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1160 -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3628 +#: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1159 +#: ../../library/stdtypes.rst:2380 ../../library/stdtypes.rst:3627 msgid "\\(6)" msgstr "\\(6)" @@ -551,10 +551,10 @@ msgid "*x* to the power *y*" msgstr "" #: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:312 -#: ../../library/stdtypes.rst:1149 ../../library/stdtypes.rst:1152 -#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:2409 -#: ../../library/stdtypes.rst:2412 ../../library/stdtypes.rst:3624 -#: ../../library/stdtypes.rst:3631 +#: ../../library/stdtypes.rst:1148 ../../library/stdtypes.rst:1151 +#: ../../library/stdtypes.rst:2405 ../../library/stdtypes.rst:2408 +#: ../../library/stdtypes.rst:2411 ../../library/stdtypes.rst:3623 +#: ../../library/stdtypes.rst:3630 msgid "\\(5)" msgstr "\\(5)" @@ -580,95 +580,95 @@ msgid "" "appropriate." msgstr "" -#: ../../library/stdtypes.rst:340 +#: ../../library/stdtypes.rst:339 msgid "" -"Conversion from floating point to integer may round or truncate as in C; see " -"functions :func:`math.floor` and :func:`math.ceil` for well-defined " -"conversions." +"Conversion from :class:`float` to :class:`int` truncates, discarding the " +"fractional part. See functions :func:`math.floor` and :func:`math.ceil` for " +"alternative conversions." msgstr "" -#: ../../library/stdtypes.rst:345 +#: ../../library/stdtypes.rst:344 msgid "" "float also accepts the strings \"nan\" and \"inf\" with an optional prefix " "\"+\" or \"-\" for Not a Number (NaN) and positive or negative infinity." msgstr "" -#: ../../library/stdtypes.rst:349 +#: ../../library/stdtypes.rst:348 msgid "" "Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for " "programming languages." msgstr "" -#: ../../library/stdtypes.rst:353 +#: ../../library/stdtypes.rst:352 msgid "" "The numeric literals accepted include the digits ``0`` to ``9`` or any " "Unicode equivalent (code points with the ``Nd`` property)." msgstr "" -#: ../../library/stdtypes.rst:356 +#: ../../library/stdtypes.rst:355 msgid "" "See https://www.unicode.org/Public/14.0.0/ucd/extracted/DerivedNumericType." "txt for a complete list of code points with the ``Nd`` property." msgstr "" -#: ../../library/stdtypes.rst:360 +#: ../../library/stdtypes.rst:359 msgid "" "All :class:`numbers.Real` types (:class:`int` and :class:`float`) also " "include the following operations:" msgstr "" -#: ../../library/stdtypes.rst:366 +#: ../../library/stdtypes.rst:365 msgid ":func:`math.trunc(\\ x) `" msgstr ":func:`math.trunc(\\ x) `" -#: ../../library/stdtypes.rst:366 +#: ../../library/stdtypes.rst:365 msgid "*x* truncated to :class:`~numbers.Integral`" msgstr "" -#: ../../library/stdtypes.rst:369 +#: ../../library/stdtypes.rst:368 msgid ":func:`round(x[, n]) `" msgstr ":func:`round(x[, n]) `" -#: ../../library/stdtypes.rst:369 +#: ../../library/stdtypes.rst:368 msgid "" "*x* rounded to *n* digits, rounding half to even. If *n* is omitted, it " "defaults to 0." msgstr "" -#: ../../library/stdtypes.rst:373 +#: ../../library/stdtypes.rst:372 msgid ":func:`math.floor(\\ x) `" msgstr ":func:`math.floor(\\ x) `" -#: ../../library/stdtypes.rst:373 +#: ../../library/stdtypes.rst:372 msgid "the greatest :class:`~numbers.Integral` <= *x*" msgstr "" -#: ../../library/stdtypes.rst:376 +#: ../../library/stdtypes.rst:375 msgid ":func:`math.ceil(x) `" msgstr ":func:`math.ceil(x) `" -#: ../../library/stdtypes.rst:376 +#: ../../library/stdtypes.rst:375 msgid "the least :class:`~numbers.Integral` >= *x*" msgstr "" -#: ../../library/stdtypes.rst:380 +#: ../../library/stdtypes.rst:379 msgid "" "For additional numeric operations see the :mod:`math` and :mod:`cmath` " "modules." msgstr "" -#: ../../library/stdtypes.rst:389 +#: ../../library/stdtypes.rst:388 msgid "Bitwise Operations on Integer Types" msgstr "" -#: ../../library/stdtypes.rst:403 +#: ../../library/stdtypes.rst:402 msgid "" "Bitwise operations only make sense for integers. The result of bitwise " "operations is calculated as though carried out in two's complement with an " "infinite number of sign bits." msgstr "" -#: ../../library/stdtypes.rst:407 +#: ../../library/stdtypes.rst:406 msgid "" "The priorities of the binary bitwise operations are all lower than the " "numeric operations and higher than the comparisons; the unary operation " @@ -676,89 +676,89 @@ msgid "" "``-``)." msgstr "" -#: ../../library/stdtypes.rst:411 +#: ../../library/stdtypes.rst:410 msgid "This table lists the bitwise operations sorted in ascending priority:" msgstr "" -#: ../../library/stdtypes.rst:416 +#: ../../library/stdtypes.rst:415 msgid "``x | y``" msgstr "``x | y``" -#: ../../library/stdtypes.rst:416 +#: ../../library/stdtypes.rst:415 msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "" -#: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:419 -#: ../../library/stdtypes.rst:422 ../../library/stdtypes.rst:1173 -#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:2399 -#: ../../library/stdtypes.rst:3613 ../../library/stdtypes.rst:3617 +#: ../../library/stdtypes.rst:415 ../../library/stdtypes.rst:418 +#: ../../library/stdtypes.rst:421 ../../library/stdtypes.rst:1172 +#: ../../library/stdtypes.rst:2394 ../../library/stdtypes.rst:2398 +#: ../../library/stdtypes.rst:3612 ../../library/stdtypes.rst:3616 msgid "\\(4)" msgstr "\\(4)" -#: ../../library/stdtypes.rst:419 +#: ../../library/stdtypes.rst:418 msgid "``x ^ y``" msgstr "``x ^ y``" -#: ../../library/stdtypes.rst:419 +#: ../../library/stdtypes.rst:418 msgid "bitwise :dfn:`exclusive or` of *x* and *y*" msgstr "" -#: ../../library/stdtypes.rst:422 +#: ../../library/stdtypes.rst:421 msgid "``x & y``" msgstr "``x & y``" -#: ../../library/stdtypes.rst:422 +#: ../../library/stdtypes.rst:421 msgid "bitwise :dfn:`and` of *x* and *y*" msgstr "" -#: ../../library/stdtypes.rst:425 +#: ../../library/stdtypes.rst:424 msgid "``x << n``" msgstr "``x << n``" -#: ../../library/stdtypes.rst:425 +#: ../../library/stdtypes.rst:424 msgid "*x* shifted left by *n* bits" msgstr "" -#: ../../library/stdtypes.rst:425 +#: ../../library/stdtypes.rst:424 msgid "(1)(2)" msgstr "(1)(2)" -#: ../../library/stdtypes.rst:427 +#: ../../library/stdtypes.rst:426 msgid "``x >> n``" msgstr "``x >> n``" -#: ../../library/stdtypes.rst:427 +#: ../../library/stdtypes.rst:426 msgid "*x* shifted right by *n* bits" msgstr "" -#: ../../library/stdtypes.rst:427 +#: ../../library/stdtypes.rst:426 msgid "(1)(3)" msgstr "(1)(3)" -#: ../../library/stdtypes.rst:429 +#: ../../library/stdtypes.rst:428 msgid "``~x``" msgstr "``~x``" -#: ../../library/stdtypes.rst:429 +#: ../../library/stdtypes.rst:428 msgid "the bits of *x* inverted" msgstr "" -#: ../../library/stdtypes.rst:435 +#: ../../library/stdtypes.rst:434 msgid "" "Negative shift counts are illegal and cause a :exc:`ValueError` to be raised." msgstr "" -#: ../../library/stdtypes.rst:438 +#: ../../library/stdtypes.rst:437 msgid "" "A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``." msgstr "" -#: ../../library/stdtypes.rst:441 +#: ../../library/stdtypes.rst:440 msgid "" "A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``." msgstr "" -#: ../../library/stdtypes.rst:444 +#: ../../library/stdtypes.rst:443 msgid "" "Performing these calculations with at least one extra sign extension bit in " "a finite two's complement representation (a working bit-width of ``1 + max(x." @@ -766,23 +766,23 @@ msgid "" "result as if there were an infinite number of sign bits." msgstr "" -#: ../../library/stdtypes.rst:451 +#: ../../library/stdtypes.rst:450 msgid "Additional Methods on Integer Types" msgstr "" -#: ../../library/stdtypes.rst:453 +#: ../../library/stdtypes.rst:452 msgid "" "The int type implements the :class:`numbers.Integral` :term:`abstract base " "class`. In addition, it provides a few more methods:" msgstr "" -#: ../../library/stdtypes.rst:458 +#: ../../library/stdtypes.rst:457 msgid "" "Return the number of bits necessary to represent an integer in binary, " "excluding the sign and leading zeros::" msgstr "" -#: ../../library/stdtypes.rst:467 +#: ../../library/stdtypes.rst:466 msgid "" "More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the unique " "positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. " @@ -791,32 +791,32 @@ msgid "" "bit_length()`` returns ``0``." msgstr "" -#: ../../library/stdtypes.rst:473 ../../library/stdtypes.rst:496 -#: ../../library/stdtypes.rst:541 ../../library/stdtypes.rst:585 +#: ../../library/stdtypes.rst:472 ../../library/stdtypes.rst:495 +#: ../../library/stdtypes.rst:540 ../../library/stdtypes.rst:584 msgid "Equivalent to::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/stdtypes.rst:484 +#: ../../library/stdtypes.rst:483 msgid "" "Return the number of ones in the binary representation of the absolute value " "of the integer. This is also known as the population count. Example::" msgstr "" -#: ../../library/stdtypes.rst:505 +#: ../../library/stdtypes.rst:504 msgid "Return an array of bytes representing an integer." msgstr "" -#: ../../library/stdtypes.rst:517 +#: ../../library/stdtypes.rst:516 msgid "" "The integer is represented using *length* bytes, and defaults to 1. An :exc:" "`OverflowError` is raised if the integer is not representable with the given " "number of bytes." msgstr "" -#: ../../library/stdtypes.rst:521 +#: ../../library/stdtypes.rst:520 msgid "" "The *byteorder* argument determines the byte order used to represent the " "integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " @@ -824,7 +824,7 @@ msgid "" "is ``\"little\"``, the most significant byte is at the end of the byte array." msgstr "" -#: ../../library/stdtypes.rst:527 +#: ../../library/stdtypes.rst:526 msgid "" "The *signed* argument determines whether two's complement is used to " "represent the integer. If *signed* is ``False`` and a negative integer is " @@ -832,33 +832,33 @@ msgid "" "``False``." msgstr "" -#: ../../library/stdtypes.rst:532 +#: ../../library/stdtypes.rst:531 msgid "" "The default values can be used to conveniently turn an integer into a single " "byte object::" msgstr "" -#: ../../library/stdtypes.rst:538 +#: ../../library/stdtypes.rst:537 msgid "" "However, when using the default arguments, don't try to convert a value " "greater than 255 or you'll get an :exc:`OverflowError`." msgstr "" -#: ../../library/stdtypes.rst:554 +#: ../../library/stdtypes.rst:553 msgid "Added default argument values for ``length`` and ``byteorder``." msgstr "" -#: ../../library/stdtypes.rst:559 +#: ../../library/stdtypes.rst:558 msgid "Return the integer represented by the given array of bytes." msgstr "" -#: ../../library/stdtypes.rst:572 +#: ../../library/stdtypes.rst:571 msgid "" "The argument *bytes* must either be a :term:`bytes-like object` or an " "iterable producing bytes." msgstr "" -#: ../../library/stdtypes.rst:575 +#: ../../library/stdtypes.rst:574 msgid "" "The *byteorder* argument determines the byte order used to represent the " "integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " @@ -868,17 +868,17 @@ msgid "" "byteorder` as the byte order value." msgstr "" -#: ../../library/stdtypes.rst:582 +#: ../../library/stdtypes.rst:581 msgid "" "The *signed* argument indicates whether two's complement is used to " "represent the integer." msgstr "" -#: ../../library/stdtypes.rst:602 +#: ../../library/stdtypes.rst:601 msgid "Added default argument value for ``byteorder``." msgstr "" -#: ../../library/stdtypes.rst:607 +#: ../../library/stdtypes.rst:606 msgid "" "Return a pair of integers whose ratio is exactly equal to the original " "integer and with a positive denominator. The integer ratio of integers " @@ -886,30 +886,30 @@ msgid "" "denominator." msgstr "" -#: ../../library/stdtypes.rst:615 +#: ../../library/stdtypes.rst:614 msgid "Additional Methods on Float" msgstr "" -#: ../../library/stdtypes.rst:617 +#: ../../library/stdtypes.rst:616 msgid "" "The float type implements the :class:`numbers.Real` :term:`abstract base " "class`. float also has the following additional methods." msgstr "" -#: ../../library/stdtypes.rst:622 +#: ../../library/stdtypes.rst:621 msgid "" "Return a pair of integers whose ratio is exactly equal to the original float " "and with a positive denominator. Raises :exc:`OverflowError` on infinities " "and a :exc:`ValueError` on NaNs." msgstr "" -#: ../../library/stdtypes.rst:629 +#: ../../library/stdtypes.rst:628 msgid "" "Return ``True`` if the float instance is finite with integral value, and " "``False`` otherwise::" msgstr "" -#: ../../library/stdtypes.rst:637 +#: ../../library/stdtypes.rst:636 msgid "" "Two methods support conversion to and from hexadecimal strings. Since " "Python's floats are stored internally as binary numbers, converting a float " @@ -919,30 +919,30 @@ msgid "" "numerical work." msgstr "" -#: ../../library/stdtypes.rst:648 +#: ../../library/stdtypes.rst:647 msgid "" "Return a representation of a floating-point number as a hexadecimal string. " "For finite floating-point numbers, this representation will always include a " "leading ``0x`` and a trailing ``p`` and exponent." msgstr "" -#: ../../library/stdtypes.rst:656 +#: ../../library/stdtypes.rst:655 msgid "" "Class method to return the float represented by a hexadecimal string *s*. " "The string *s* may have leading and trailing whitespace." msgstr "" -#: ../../library/stdtypes.rst:661 +#: ../../library/stdtypes.rst:660 msgid "" "Note that :meth:`float.hex` is an instance method, while :meth:`float." "fromhex` is a class method." msgstr "" -#: ../../library/stdtypes.rst:664 +#: ../../library/stdtypes.rst:663 msgid "A hexadecimal string takes the form::" msgstr "" -#: ../../library/stdtypes.rst:668 +#: ../../library/stdtypes.rst:667 msgid "" "where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and " "``fraction`` are strings of hexadecimal digits, and ``exponent`` is a " @@ -956,7 +956,7 @@ msgid "" "by :meth:`float.fromhex`." msgstr "" -#: ../../library/stdtypes.rst:681 +#: ../../library/stdtypes.rst:680 msgid "" "Note that the exponent is written in decimal rather than hexadecimal, and " "that it gives the power of 2 by which to multiply the coefficient. For " @@ -964,17 +964,17 @@ msgid "" "number ``(3 + 10./16 + 7./16**2) * 2.0**10``, or ``3740.0``::" msgstr "" -#: ../../library/stdtypes.rst:691 +#: ../../library/stdtypes.rst:690 msgid "" "Applying the reverse conversion to ``3740.0`` gives a different hexadecimal " "string representing the same number::" msgstr "" -#: ../../library/stdtypes.rst:701 +#: ../../library/stdtypes.rst:700 msgid "Hashing of numeric types" msgstr "" -#: ../../library/stdtypes.rst:703 +#: ../../library/stdtypes.rst:702 msgid "" "For numbers ``x`` and ``y``, possibly of different types, it's a requirement " "that ``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`~object." @@ -990,24 +990,24 @@ msgid "" "of :data:`sys.hash_info`." msgstr "" -#: ../../library/stdtypes.rst:718 +#: ../../library/stdtypes.rst:717 msgid "" "Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C " "longs and ``P = 2**61 - 1`` on machines with 64-bit C longs." msgstr "" -#: ../../library/stdtypes.rst:721 +#: ../../library/stdtypes.rst:720 msgid "Here are the rules in detail:" msgstr "" -#: ../../library/stdtypes.rst:723 +#: ../../library/stdtypes.rst:722 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible " "by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, " "P)`` gives the inverse of ``n`` modulo ``P``." msgstr "" -#: ../../library/stdtypes.rst:727 +#: ../../library/stdtypes.rst:726 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is divisible by " "``P`` (but ``m`` is not) then ``n`` has no inverse modulo ``P`` and the rule " @@ -1015,20 +1015,20 @@ msgid "" "value ``sys.hash_info.inf``." msgstr "" -#: ../../library/stdtypes.rst:732 +#: ../../library/stdtypes.rst:731 msgid "" "If ``x = m / n`` is a negative rational number define ``hash(x)`` as ``-" "hash(-x)``. If the resulting hash is ``-1``, replace it with ``-2``." msgstr "" -#: ../../library/stdtypes.rst:736 +#: ../../library/stdtypes.rst:735 msgid "" "The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are " "used as hash values for positive infinity or negative infinity " "(respectively)." msgstr "" -#: ../../library/stdtypes.rst:740 +#: ../../library/stdtypes.rst:739 msgid "" "For a :class:`complex` number ``z``, the hash values of the real and " "imaginary parts are combined by computing ``hash(z.real) + sys.hash_info." @@ -1037,18 +1037,18 @@ msgid "" "1))``. Again, if the result is ``-1``, it's replaced with ``-2``." msgstr "" -#: ../../library/stdtypes.rst:748 +#: ../../library/stdtypes.rst:747 msgid "" "To clarify the above rules, here's some example Python code, equivalent to " "the built-in hash, for computing the hash of a rational number, :class:" "`float`, or :class:`complex`::" msgstr "" -#: ../../library/stdtypes.rst:803 +#: ../../library/stdtypes.rst:802 msgid "Iterator Types" msgstr "" -#: ../../library/stdtypes.rst:811 +#: ../../library/stdtypes.rst:810 msgid "" "Python supports a concept of iteration over containers. This is implemented " "using two distinct methods; these are used to allow user-defined classes to " @@ -1056,13 +1056,13 @@ msgid "" "support the iteration methods." msgstr "" -#: ../../library/stdtypes.rst:816 +#: ../../library/stdtypes.rst:815 msgid "" "One method needs to be defined for container objects to provide :term:" "`iterable` support:" msgstr "" -#: ../../library/stdtypes.rst:823 +#: ../../library/stdtypes.rst:822 msgid "" "Return an :term:`iterator` object. The object is required to support the " "iterator protocol described below. If a container supports different types " @@ -1074,13 +1074,13 @@ msgid "" "in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:832 +#: ../../library/stdtypes.rst:831 msgid "" "The iterator objects themselves are required to support the following two " "methods, which together form the :dfn:`iterator protocol`:" msgstr "" -#: ../../library/stdtypes.rst:838 +#: ../../library/stdtypes.rst:837 msgid "" "Return the :term:`iterator` object itself. This is required to allow both " "containers and iterators to be used with the :keyword:`for` and :keyword:" @@ -1088,7 +1088,7 @@ msgid "" "tp_iter` slot of the type structure for Python objects in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:847 +#: ../../library/stdtypes.rst:846 msgid "" "Return the next item from the :term:`iterator`. If there are no further " "items, raise the :exc:`StopIteration` exception. This method corresponds to " @@ -1096,7 +1096,7 @@ msgid "" "Python objects in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:852 +#: ../../library/stdtypes.rst:851 msgid "" "Python defines several iterator objects to support iteration over general " "and specific sequence types, dictionaries, and other more specialized " @@ -1104,18 +1104,18 @@ msgid "" "the iterator protocol." msgstr "" -#: ../../library/stdtypes.rst:857 +#: ../../library/stdtypes.rst:856 msgid "" "Once an iterator's :meth:`~iterator.__next__` method raises :exc:" "`StopIteration`, it must continue to do so on subsequent calls. " "Implementations that do not obey this property are deemed broken." msgstr "" -#: ../../library/stdtypes.rst:865 +#: ../../library/stdtypes.rst:864 msgid "Generator Types" msgstr "" -#: ../../library/stdtypes.rst:867 +#: ../../library/stdtypes.rst:866 msgid "" "Python's :term:`generator`\\s provide a convenient way to implement the " "iterator protocol. If a container object's :meth:`__iter__` method is " @@ -1125,11 +1125,11 @@ msgid "" "found in :ref:`the documentation for the yield expression `." msgstr "" -#: ../../library/stdtypes.rst:879 +#: ../../library/stdtypes.rst:878 msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`" msgstr "" -#: ../../library/stdtypes.rst:881 +#: ../../library/stdtypes.rst:880 msgid "" "There are three basic sequence types: lists, tuples, and range objects. " "Additional sequence types tailored for processing of :ref:`binary data " @@ -1137,11 +1137,11 @@ msgid "" "sections." msgstr "" -#: ../../library/stdtypes.rst:890 +#: ../../library/stdtypes.rst:889 msgid "Common Sequence Operations" msgstr "" -#: ../../library/stdtypes.rst:894 +#: ../../library/stdtypes.rst:893 msgid "" "The operations in the following table are supported by most sequence types, " "both mutable and immutable. The :class:`collections.abc.Sequence` ABC is " @@ -1149,7 +1149,7 @@ msgid "" "sequence types." msgstr "" -#: ../../library/stdtypes.rst:899 +#: ../../library/stdtypes.rst:898 msgid "" "This table lists the sequence operations sorted in ascending priority. In " "the table, *s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* " @@ -1157,7 +1157,7 @@ msgid "" "restrictions imposed by *s*." msgstr "" -#: ../../library/stdtypes.rst:904 +#: ../../library/stdtypes.rst:903 msgid "" "The ``in`` and ``not in`` operations have the same priorities as the " "comparison operations. The ``+`` (concatenation) and ``*`` (repetition) " @@ -1165,125 +1165,125 @@ msgid "" "[3]_" msgstr "" -#: ../../library/stdtypes.rst:925 +#: ../../library/stdtypes.rst:924 msgid "``x in s``" msgstr "``x in s``" -#: ../../library/stdtypes.rst:925 +#: ../../library/stdtypes.rst:924 msgid "``True`` if an item of *s* is equal to *x*, else ``False``" msgstr "" -#: ../../library/stdtypes.rst:928 +#: ../../library/stdtypes.rst:927 msgid "``x not in s``" msgstr "``x not in s``" -#: ../../library/stdtypes.rst:928 +#: ../../library/stdtypes.rst:927 msgid "``False`` if an item of *s* is equal to *x*, else ``True``" msgstr "" -#: ../../library/stdtypes.rst:931 +#: ../../library/stdtypes.rst:930 msgid "``s + t``" msgstr "``s + t``" -#: ../../library/stdtypes.rst:931 +#: ../../library/stdtypes.rst:930 msgid "the concatenation of *s* and *t*" msgstr "" -#: ../../library/stdtypes.rst:931 +#: ../../library/stdtypes.rst:930 msgid "(6)(7)" msgstr "(6)(7)" -#: ../../library/stdtypes.rst:934 +#: ../../library/stdtypes.rst:933 msgid "``s * n`` or ``n * s``" msgstr "``s * n`` 或 ``n * s``" -#: ../../library/stdtypes.rst:934 +#: ../../library/stdtypes.rst:933 msgid "equivalent to adding *s* to itself *n* times" msgstr "" -#: ../../library/stdtypes.rst:934 +#: ../../library/stdtypes.rst:933 msgid "(2)(7)" msgstr "(2)(7)" -#: ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:936 msgid "``s[i]``" msgstr "``s[i]``" -#: ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:936 msgid "*i*\\ th item of *s*, origin 0" msgstr "" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:938 msgid "``s[i:j]``" msgstr "``s[i:j]``" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:938 msgid "slice of *s* from *i* to *j*" msgstr "" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:938 msgid "(3)(4)" msgstr "(3)(4)" -#: ../../library/stdtypes.rst:941 +#: ../../library/stdtypes.rst:940 msgid "``s[i:j:k]``" msgstr "``s[i:j:k]``" -#: ../../library/stdtypes.rst:941 +#: ../../library/stdtypes.rst:940 msgid "slice of *s* from *i* to *j* with step *k*" msgstr "" -#: ../../library/stdtypes.rst:941 +#: ../../library/stdtypes.rst:940 msgid "(3)(5)" msgstr "(3)(5)" -#: ../../library/stdtypes.rst:944 +#: ../../library/stdtypes.rst:943 msgid "``len(s)``" msgstr "``len(s)``" -#: ../../library/stdtypes.rst:944 +#: ../../library/stdtypes.rst:943 msgid "length of *s*" msgstr "" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:945 msgid "``min(s)``" msgstr "``min(s)``" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:945 msgid "smallest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:948 +#: ../../library/stdtypes.rst:947 msgid "``max(s)``" msgstr "``max(s)``" -#: ../../library/stdtypes.rst:948 +#: ../../library/stdtypes.rst:947 msgid "largest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:950 +#: ../../library/stdtypes.rst:949 msgid "``s.index(x[, i[, j]])``" msgstr "``s.index(x[, i[, j]])``" -#: ../../library/stdtypes.rst:950 +#: ../../library/stdtypes.rst:949 msgid "" "index of the first occurrence of *x* in *s* (at or after index *i* and " "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:949 ../../library/stdtypes.rst:3598 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:954 +#: ../../library/stdtypes.rst:953 msgid "``s.count(x)``" msgstr "``s.count(x)``" -#: ../../library/stdtypes.rst:954 +#: ../../library/stdtypes.rst:953 msgid "total number of occurrences of *x* in *s*" msgstr "" -#: ../../library/stdtypes.rst:958 +#: ../../library/stdtypes.rst:957 msgid "" "Sequences of the same type also support comparisons. In particular, tuples " "and lists are compared lexicographically by comparing corresponding " @@ -1292,7 +1292,7 @@ msgid "" "(For full details see :ref:`comparisons` in the language reference.)" msgstr "" -#: ../../library/stdtypes.rst:968 +#: ../../library/stdtypes.rst:967 msgid "" "Forward and reversed iterators over mutable sequences access values using an " "index. That index will continue to march forward (or backward) even if the " @@ -1301,7 +1301,7 @@ msgid "" "drops below zero)." msgstr "" -#: ../../library/stdtypes.rst:977 +#: ../../library/stdtypes.rst:976 msgid "" "While the ``in`` and ``not in`` operations are used only for simple " "containment testing in the general case, some specialised sequences (such " @@ -1309,7 +1309,7 @@ msgid "" "subsequence testing::" msgstr "" -#: ../../library/stdtypes.rst:986 +#: ../../library/stdtypes.rst:985 msgid "" "Values of *n* less than ``0`` are treated as ``0`` (which yields an empty " "sequence of the same type as *s*). Note that items in the sequence *s* are " @@ -1317,7 +1317,7 @@ msgid "" "Python programmers; consider::" msgstr "" -#: ../../library/stdtypes.rst:998 +#: ../../library/stdtypes.rst:997 msgid "" "What has happened is that ``[[]]`` is a one-element list containing an empty " "list, so all three elements of ``[[]] * 3`` are references to this single " @@ -1325,20 +1325,20 @@ msgid "" "list. You can create a list of different lists this way::" msgstr "" -#: ../../library/stdtypes.rst:1010 +#: ../../library/stdtypes.rst:1009 msgid "" "Further explanation is available in the FAQ entry :ref:`faq-multidimensional-" "list`." msgstr "" -#: ../../library/stdtypes.rst:1014 +#: ../../library/stdtypes.rst:1013 msgid "" "If *i* or *j* is negative, the index is relative to the end of sequence *s*: " "``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is " "still ``0``." msgstr "" -#: ../../library/stdtypes.rst:1019 +#: ../../library/stdtypes.rst:1018 msgid "" "The slice of *s* from *i* to *j* is defined as the sequence of items with " "index *k* such that ``i <= k < j``. If *i* or *j* is greater than " @@ -1347,7 +1347,7 @@ msgid "" "to *j*, the slice is empty." msgstr "" -#: ../../library/stdtypes.rst:1026 +#: ../../library/stdtypes.rst:1025 msgid "" "The slice of *s* from *i* to *j* with step *k* is defined as the sequence of " "items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other " @@ -1360,7 +1360,7 @@ msgid "" "``None``, it is treated like ``1``." msgstr "" -#: ../../library/stdtypes.rst:1037 +#: ../../library/stdtypes.rst:1036 msgid "" "Concatenating immutable sequences always results in a new object. This " "means that building up a sequence by repeated concatenation will have a " @@ -1368,14 +1368,14 @@ msgid "" "runtime cost, you must switch to one of the alternatives below:" msgstr "" -#: ../../library/stdtypes.rst:1042 +#: ../../library/stdtypes.rst:1041 msgid "" "if concatenating :class:`str` objects, you can build a list and use :meth:" "`str.join` at the end or else write to an :class:`io.StringIO` instance and " "retrieve its value when complete" msgstr "" -#: ../../library/stdtypes.rst:1046 +#: ../../library/stdtypes.rst:1045 msgid "" "if concatenating :class:`bytes` objects, you can similarly use :meth:`bytes." "join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :" @@ -1383,22 +1383,22 @@ msgid "" "an efficient overallocation mechanism" msgstr "" -#: ../../library/stdtypes.rst:1051 +#: ../../library/stdtypes.rst:1050 msgid "if concatenating :class:`tuple` objects, extend a :class:`list` instead" msgstr "" -#: ../../library/stdtypes.rst:1053 +#: ../../library/stdtypes.rst:1052 msgid "for other types, investigate the relevant class documentation" msgstr "" -#: ../../library/stdtypes.rst:1057 +#: ../../library/stdtypes.rst:1056 msgid "" "Some sequence types (such as :class:`range`) only support item sequences " "that follow specific patterns, and hence don't support sequence " "concatenation or repetition." msgstr "" -#: ../../library/stdtypes.rst:1062 +#: ../../library/stdtypes.rst:1061 msgid "" "``index`` raises :exc:`ValueError` when *x* is not found in *s*. Not all " "implementations support passing the additional arguments *i* and *j*. These " @@ -1408,42 +1408,42 @@ msgid "" "start of the sequence rather than the start of the slice." msgstr "" -#: ../../library/stdtypes.rst:1073 +#: ../../library/stdtypes.rst:1072 msgid "Immutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1080 +#: ../../library/stdtypes.rst:1079 msgid "" "The only operation that immutable sequence types generally implement that is " "not also implemented by mutable sequence types is support for the :func:" "`hash` built-in." msgstr "" -#: ../../library/stdtypes.rst:1084 +#: ../../library/stdtypes.rst:1083 msgid "" "This support allows immutable sequences, such as :class:`tuple` instances, " "to be used as :class:`dict` keys and stored in :class:`set` and :class:" "`frozenset` instances." msgstr "" -#: ../../library/stdtypes.rst:1088 +#: ../../library/stdtypes.rst:1087 msgid "" "Attempting to hash an immutable sequence that contains unhashable values " "will result in :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:1095 +#: ../../library/stdtypes.rst:1094 msgid "Mutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1102 +#: ../../library/stdtypes.rst:1101 msgid "" "The operations in the following table are defined on mutable sequence types. " "The :class:`collections.abc.MutableSequence` ABC is provided to make it " "easier to correctly implement these operations on custom sequence types." msgstr "" -#: ../../library/stdtypes.rst:1106 +#: ../../library/stdtypes.rst:1105 msgid "" "In the table *s* is an instance of a mutable sequence type, *t* is any " "iterable object and *x* is an arbitrary object that meets any type and value " @@ -1451,145 +1451,145 @@ msgid "" "integers that meet the value restriction ``0 <= x <= 255``)." msgstr "" -#: ../../library/stdtypes.rst:1130 +#: ../../library/stdtypes.rst:1129 msgid "``s[i] = x``" msgstr "``s[i] = x``" -#: ../../library/stdtypes.rst:1130 +#: ../../library/stdtypes.rst:1129 msgid "item *i* of *s* is replaced by *x*" msgstr "" -#: ../../library/stdtypes.rst:1133 +#: ../../library/stdtypes.rst:1132 msgid "``s[i:j] = t``" msgstr "``s[i:j] = t``" -#: ../../library/stdtypes.rst:1133 +#: ../../library/stdtypes.rst:1132 msgid "" "slice of *s* from *i* to *j* is replaced by the contents of the iterable *t*" msgstr "" -#: ../../library/stdtypes.rst:1137 +#: ../../library/stdtypes.rst:1136 msgid "``del s[i:j]``" msgstr "``del s[i:j]``" -#: ../../library/stdtypes.rst:1137 +#: ../../library/stdtypes.rst:1136 msgid "same as ``s[i:j] = []``" msgstr "" -#: ../../library/stdtypes.rst:1139 +#: ../../library/stdtypes.rst:1138 msgid "``s[i:j:k] = t``" msgstr "``s[i:j:k] = t``" -#: ../../library/stdtypes.rst:1139 +#: ../../library/stdtypes.rst:1138 msgid "the elements of ``s[i:j:k]`` are replaced by those of *t*" msgstr "" -#: ../../library/stdtypes.rst:1142 +#: ../../library/stdtypes.rst:1141 msgid "``del s[i:j:k]``" msgstr "``del s[i:j:k]``" -#: ../../library/stdtypes.rst:1142 +#: ../../library/stdtypes.rst:1141 msgid "removes the elements of ``s[i:j:k]`` from the list" msgstr "" -#: ../../library/stdtypes.rst:1145 +#: ../../library/stdtypes.rst:1144 msgid "``s.append(x)``" msgstr "``s.append(x)``" -#: ../../library/stdtypes.rst:1145 +#: ../../library/stdtypes.rst:1144 msgid "" "appends *x* to the end of the sequence (same as ``s[len(s):len(s)] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1149 +#: ../../library/stdtypes.rst:1148 msgid "``s.clear()``" msgstr "``s.clear()``" -#: ../../library/stdtypes.rst:1149 +#: ../../library/stdtypes.rst:1148 msgid "removes all items from *s* (same as ``del s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1152 +#: ../../library/stdtypes.rst:1151 msgid "``s.copy()``" msgstr "``s.copy()``" -#: ../../library/stdtypes.rst:1152 +#: ../../library/stdtypes.rst:1151 msgid "creates a shallow copy of *s* (same as ``s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1155 +#: ../../library/stdtypes.rst:1154 msgid "``s.extend(t)`` or ``s += t``" msgstr "``s.extend(t)`` 或 ``s += t``" -#: ../../library/stdtypes.rst:1155 +#: ../../library/stdtypes.rst:1154 msgid "" "extends *s* with the contents of *t* (for the most part the same as " "``s[len(s):len(s)] = t``)" msgstr "" -#: ../../library/stdtypes.rst:1160 +#: ../../library/stdtypes.rst:1159 msgid "``s *= n``" msgstr "``s *= n``" -#: ../../library/stdtypes.rst:1160 +#: ../../library/stdtypes.rst:1159 msgid "updates *s* with its contents repeated *n* times" msgstr "" -#: ../../library/stdtypes.rst:1163 +#: ../../library/stdtypes.rst:1162 msgid "``s.insert(i, x)``" msgstr "``s.insert(i, x)``" -#: ../../library/stdtypes.rst:1163 +#: ../../library/stdtypes.rst:1162 msgid "" "inserts *x* into *s* at the index given by *i* (same as ``s[i:i] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1167 +#: ../../library/stdtypes.rst:1166 msgid "``s.pop()`` or ``s.pop(i)``" msgstr "``s.pop()`` 或 ``s.pop(i)``" -#: ../../library/stdtypes.rst:1167 +#: ../../library/stdtypes.rst:1166 msgid "retrieves the item at *i* and also removes it from *s*" msgstr "" -#: ../../library/stdtypes.rst:1170 +#: ../../library/stdtypes.rst:1169 msgid "``s.remove(x)``" msgstr "``s.remove(x)``" -#: ../../library/stdtypes.rst:1170 +#: ../../library/stdtypes.rst:1169 msgid "remove the first item from *s* where ``s[i]`` is equal to *x*" msgstr "" -#: ../../library/stdtypes.rst:1173 +#: ../../library/stdtypes.rst:1172 msgid "``s.reverse()``" msgstr "``s.reverse()``" -#: ../../library/stdtypes.rst:1173 +#: ../../library/stdtypes.rst:1172 msgid "reverses the items of *s* in place" msgstr "" -#: ../../library/stdtypes.rst:1181 +#: ../../library/stdtypes.rst:1180 msgid "*t* must have the same length as the slice it is replacing." msgstr "" -#: ../../library/stdtypes.rst:1184 +#: ../../library/stdtypes.rst:1183 msgid "" "The optional argument *i* defaults to ``-1``, so that by default the last " "item is removed and returned." msgstr "" -#: ../../library/stdtypes.rst:1188 +#: ../../library/stdtypes.rst:1187 msgid ":meth:`remove` raises :exc:`ValueError` when *x* is not found in *s*." msgstr "" -#: ../../library/stdtypes.rst:1191 +#: ../../library/stdtypes.rst:1190 msgid "" "The :meth:`reverse` method modifies the sequence in place for economy of " "space when reversing a large sequence. To remind users that it operates by " "side effect, it does not return the reversed sequence." msgstr "" -#: ../../library/stdtypes.rst:1196 +#: ../../library/stdtypes.rst:1195 msgid "" ":meth:`clear` and :meth:`!copy` are included for consistency with the " "interfaces of mutable containers that don't support slicing operations (such " @@ -1598,11 +1598,11 @@ msgid "" "classes provide it." msgstr "" -#: ../../library/stdtypes.rst:1202 +#: ../../library/stdtypes.rst:1201 msgid ":meth:`clear` and :meth:`!copy` methods." msgstr "" -#: ../../library/stdtypes.rst:1206 +#: ../../library/stdtypes.rst:1205 msgid "" "The value *n* is an integer, or an object implementing :meth:`~object." "__index__`. Zero and negative values of *n* clear the sequence. Items in " @@ -1610,39 +1610,39 @@ msgid "" "explained for ``s * n`` under :ref:`typesseq-common`." msgstr "" -#: ../../library/stdtypes.rst:1215 +#: ../../library/stdtypes.rst:1214 msgid "Lists" msgstr "List(串列)" -#: ../../library/stdtypes.rst:1219 +#: ../../library/stdtypes.rst:1218 msgid "" "Lists are mutable sequences, typically used to store collections of " "homogeneous items (where the precise degree of similarity will vary by " "application)." msgstr "" -#: ../../library/stdtypes.rst:1225 +#: ../../library/stdtypes.rst:1224 msgid "Lists may be constructed in several ways:" msgstr "" -#: ../../library/stdtypes.rst:1227 +#: ../../library/stdtypes.rst:1226 msgid "Using a pair of square brackets to denote the empty list: ``[]``" msgstr "" -#: ../../library/stdtypes.rst:1228 +#: ../../library/stdtypes.rst:1227 msgid "" "Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``" msgstr "" -#: ../../library/stdtypes.rst:1229 +#: ../../library/stdtypes.rst:1228 msgid "Using a list comprehension: ``[x for x in iterable]``" msgstr "" -#: ../../library/stdtypes.rst:1230 +#: ../../library/stdtypes.rst:1229 msgid "Using the type constructor: ``list()`` or ``list(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1232 +#: ../../library/stdtypes.rst:1231 msgid "" "The constructor builds a list whose items are the same and in the same order " "as *iterable*'s items. *iterable* may be either a sequence, a container " @@ -1653,20 +1653,20 @@ msgid "" "new empty list, ``[]``." msgstr "" -#: ../../library/stdtypes.rst:1241 +#: ../../library/stdtypes.rst:1240 msgid "" "Many other operations also produce lists, including the :func:`sorted` built-" "in." msgstr "" -#: ../../library/stdtypes.rst:1244 +#: ../../library/stdtypes.rst:1243 msgid "" "Lists implement all of the :ref:`common ` and :ref:`mutable " "` sequence operations. Lists also provide the following " "additional method:" msgstr "" -#: ../../library/stdtypes.rst:1250 +#: ../../library/stdtypes.rst:1249 msgid "" "This method sorts the list in place, using only ``<`` comparisons between " "items. Exceptions are not suppressed - if any comparison operations fail, " @@ -1674,13 +1674,13 @@ msgid "" "partially modified state)." msgstr "" -#: ../../library/stdtypes.rst:1255 +#: ../../library/stdtypes.rst:1254 msgid "" ":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:" "`keyword-only arguments `):" msgstr "" -#: ../../library/stdtypes.rst:1258 +#: ../../library/stdtypes.rst:1257 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each list element (for example, ``key=str.lower``). The " @@ -1689,19 +1689,19 @@ msgid "" "list items are sorted directly without calculating a separate key value." msgstr "" -#: ../../library/stdtypes.rst:1265 +#: ../../library/stdtypes.rst:1264 msgid "" "The :func:`functools.cmp_to_key` utility is available to convert a 2.x style " "*cmp* function to a *key* function." msgstr "" -#: ../../library/stdtypes.rst:1268 +#: ../../library/stdtypes.rst:1267 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/stdtypes.rst:1271 +#: ../../library/stdtypes.rst:1270 msgid "" "This method modifies the sequence in place for economy of space when sorting " "a large sequence. To remind users that it operates by side effect, it does " @@ -1709,7 +1709,7 @@ msgid "" "new sorted list instance)." msgstr "" -#: ../../library/stdtypes.rst:1276 +#: ../../library/stdtypes.rst:1275 msgid "" "The :meth:`sort` method is guaranteed to be stable. A sort is stable if it " "guarantees not to change the relative order of elements that compare equal " @@ -1717,12 +1717,12 @@ msgid "" "department, then by salary grade)." msgstr "" -#: ../../library/stdtypes.rst:1281 +#: ../../library/stdtypes.rst:1280 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/stdtypes.rst:1285 +#: ../../library/stdtypes.rst:1284 msgid "" "While a list is being sorted, the effect of attempting to mutate, or even " "inspect, the list is undefined. The C implementation of Python makes the " @@ -1730,11 +1730,11 @@ msgid "" "detect that the list has been mutated during a sort." msgstr "" -#: ../../library/stdtypes.rst:1294 +#: ../../library/stdtypes.rst:1293 msgid "Tuples" msgstr "" -#: ../../library/stdtypes.rst:1298 +#: ../../library/stdtypes.rst:1297 msgid "" "Tuples are immutable sequences, typically used to store collections of " "heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` " @@ -1743,27 +1743,27 @@ msgid "" "class:`dict` instance)." msgstr "" -#: ../../library/stdtypes.rst:1306 +#: ../../library/stdtypes.rst:1305 msgid "Tuples may be constructed in a number of ways:" msgstr "" -#: ../../library/stdtypes.rst:1308 +#: ../../library/stdtypes.rst:1307 msgid "Using a pair of parentheses to denote the empty tuple: ``()``" msgstr "" -#: ../../library/stdtypes.rst:1309 +#: ../../library/stdtypes.rst:1308 msgid "Using a trailing comma for a singleton tuple: ``a,`` or ``(a,)``" msgstr "" -#: ../../library/stdtypes.rst:1310 +#: ../../library/stdtypes.rst:1309 msgid "Separating items with commas: ``a, b, c`` or ``(a, b, c)``" msgstr "" -#: ../../library/stdtypes.rst:1311 +#: ../../library/stdtypes.rst:1310 msgid "Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1313 +#: ../../library/stdtypes.rst:1312 msgid "" "The constructor builds a tuple whose items are the same and in the same " "order as *iterable*'s items. *iterable* may be either a sequence, a " @@ -1774,7 +1774,7 @@ msgid "" "``()``." msgstr "" -#: ../../library/stdtypes.rst:1321 +#: ../../library/stdtypes.rst:1320 msgid "" "Note that it is actually the comma which makes a tuple, not the parentheses. " "The parentheses are optional, except in the empty tuple case, or when they " @@ -1783,30 +1783,30 @@ msgid "" "call with a 3-tuple as the sole argument." msgstr "" -#: ../../library/stdtypes.rst:1327 +#: ../../library/stdtypes.rst:1326 msgid "" "Tuples implement all of the :ref:`common ` sequence " "operations." msgstr "" -#: ../../library/stdtypes.rst:1330 +#: ../../library/stdtypes.rst:1329 msgid "" "For heterogeneous collections of data where access by name is clearer than " "access by index, :func:`collections.namedtuple` may be a more appropriate " "choice than a simple tuple object." msgstr "" -#: ../../library/stdtypes.rst:1338 +#: ../../library/stdtypes.rst:1337 msgid "Ranges" msgstr "" -#: ../../library/stdtypes.rst:1342 +#: ../../library/stdtypes.rst:1341 msgid "" "The :class:`range` type represents an immutable sequence of numbers and is " "commonly used for looping a specific number of times in :keyword:`for` loops." msgstr "" -#: ../../library/stdtypes.rst:1349 +#: ../../library/stdtypes.rst:1348 msgid "" "The arguments to the range constructor must be integers (either built-in :" "class:`int` or any object that implements the :meth:`~object.__index__` " @@ -1815,38 +1815,38 @@ msgid "" "zero, :exc:`ValueError` is raised." msgstr "" -#: ../../library/stdtypes.rst:1355 +#: ../../library/stdtypes.rst:1354 msgid "" "For a positive *step*, the contents of a range ``r`` are determined by the " "formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``." msgstr "" -#: ../../library/stdtypes.rst:1359 +#: ../../library/stdtypes.rst:1358 msgid "" "For a negative *step*, the contents of the range are still determined by the " "formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and " "``r[i] > stop``." msgstr "" -#: ../../library/stdtypes.rst:1363 +#: ../../library/stdtypes.rst:1362 msgid "" "A range object will be empty if ``r[0]`` does not meet the value constraint. " "Ranges do support negative indices, but these are interpreted as indexing " "from the end of the sequence determined by the positive indices." msgstr "" -#: ../../library/stdtypes.rst:1368 +#: ../../library/stdtypes.rst:1367 msgid "" "Ranges containing absolute values larger than :data:`sys.maxsize` are " "permitted but some features (such as :func:`len`) may raise :exc:" "`OverflowError`." msgstr "" -#: ../../library/stdtypes.rst:1372 +#: ../../library/stdtypes.rst:1371 msgid "Range examples::" msgstr "" -#: ../../library/stdtypes.rst:1389 +#: ../../library/stdtypes.rst:1388 msgid "" "Ranges implement all of the :ref:`common ` sequence " "operations except concatenation and repetition (due to the fact that range " @@ -1854,23 +1854,23 @@ msgid "" "repetition and concatenation will usually violate that pattern)." msgstr "" -#: ../../library/stdtypes.rst:1396 +#: ../../library/stdtypes.rst:1395 msgid "" "The value of the *start* parameter (or ``0`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1401 +#: ../../library/stdtypes.rst:1400 msgid "The value of the *stop* parameter" msgstr "" -#: ../../library/stdtypes.rst:1405 +#: ../../library/stdtypes.rst:1404 msgid "" "The value of the *step* parameter (or ``1`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1408 +#: ../../library/stdtypes.rst:1407 msgid "" "The advantage of the :class:`range` type over a regular :class:`list` or :" "class:`tuple` is that a :class:`range` object will always take the same " @@ -1879,14 +1879,14 @@ msgid "" "individual items and subranges as needed)." msgstr "" -#: ../../library/stdtypes.rst:1414 +#: ../../library/stdtypes.rst:1413 msgid "" "Range objects implement the :class:`collections.abc.Sequence` ABC, and " "provide features such as containment tests, element index lookup, slicing " "and support for negative indices (see :ref:`typesseq`):" msgstr "" -#: ../../library/stdtypes.rst:1434 +#: ../../library/stdtypes.rst:1433 msgid "" "Testing range objects for equality with ``==`` and ``!=`` compares them as " "sequences. That is, two range objects are considered equal if they " @@ -1896,111 +1896,111 @@ msgid "" "3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)" msgstr "" -#: ../../library/stdtypes.rst:1441 +#: ../../library/stdtypes.rst:1440 msgid "" "Implement the Sequence ABC. Support slicing and negative indices. Test :" "class:`int` objects for membership in constant time instead of iterating " "through all items." msgstr "" -#: ../../library/stdtypes.rst:1447 +#: ../../library/stdtypes.rst:1446 msgid "" "Define '==' and '!=' to compare range objects based on the sequence of " "values they define (instead of comparing based on object identity)." msgstr "" -#: ../../library/stdtypes.rst:1452 +#: ../../library/stdtypes.rst:1451 msgid "" "The :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` " "attributes." msgstr "" -#: ../../library/stdtypes.rst:1458 +#: ../../library/stdtypes.rst:1457 msgid "" "The `linspace recipe `_ shows " "how to implement a lazy version of range suitable for floating point " "applications." msgstr "" -#: ../../library/stdtypes.rst:1470 +#: ../../library/stdtypes.rst:1469 msgid "Text Sequence Type --- :class:`str`" msgstr "" -#: ../../library/stdtypes.rst:1472 +#: ../../library/stdtypes.rst:1471 msgid "" "Textual data in Python is handled with :class:`str` objects, or :dfn:" "`strings`. Strings are immutable :ref:`sequences ` of Unicode code " "points. String literals are written in a variety of ways:" msgstr "" -#: ../../library/stdtypes.rst:1477 +#: ../../library/stdtypes.rst:1476 msgid "Single quotes: ``'allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:1478 +#: ../../library/stdtypes.rst:1477 msgid "Double quotes: ``\"allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:1479 +#: ../../library/stdtypes.rst:1478 msgid "" "Triple quoted: ``'''Three single quotes'''``, ``\"\"\"Three double " "quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:1481 +#: ../../library/stdtypes.rst:1480 msgid "" "Triple quoted strings may span multiple lines - all associated whitespace " "will be included in the string literal." msgstr "" -#: ../../library/stdtypes.rst:1484 +#: ../../library/stdtypes.rst:1483 msgid "" "String literals that are part of a single expression and have only " "whitespace between them will be implicitly converted to a single string " "literal. That is, ``(\"spam \" \"eggs\") == \"spam eggs\"``." msgstr "" -#: ../../library/stdtypes.rst:1488 +#: ../../library/stdtypes.rst:1487 msgid "" "See :ref:`strings` for more about the various forms of string literal, " "including supported escape sequences, and the ``r`` (\"raw\") prefix that " "disables most escape sequence processing." msgstr "" -#: ../../library/stdtypes.rst:1492 +#: ../../library/stdtypes.rst:1491 msgid "" "Strings may also be created from other objects using the :class:`str` " "constructor." msgstr "" -#: ../../library/stdtypes.rst:1495 +#: ../../library/stdtypes.rst:1494 msgid "" "Since there is no separate \"character\" type, indexing a string produces " "strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``." msgstr "" -#: ../../library/stdtypes.rst:1501 +#: ../../library/stdtypes.rst:1500 msgid "" "There is also no mutable string type, but :meth:`str.join` or :class:`io." "StringIO` can be used to efficiently construct strings from multiple " "fragments." msgstr "" -#: ../../library/stdtypes.rst:1505 +#: ../../library/stdtypes.rst:1504 msgid "" "For backwards compatibility with the Python 2 series, the ``u`` prefix is " "once again permitted on string literals. It has no effect on the meaning of " "string literals and cannot be combined with the ``r`` prefix." msgstr "" -#: ../../library/stdtypes.rst:1517 +#: ../../library/stdtypes.rst:1516 msgid "" "Return a :ref:`string ` version of *object*. If *object* is not " "provided, returns the empty string. Otherwise, the behavior of ``str()`` " "depends on whether *encoding* or *errors* is given, as follows." msgstr "" -#: ../../library/stdtypes.rst:1521 +#: ../../library/stdtypes.rst:1520 msgid "" "If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:" "`type(object).__str__(object) `, which is the \"informal\" " @@ -2010,7 +2010,7 @@ msgid "" "`repr(object) `." msgstr "" -#: ../../library/stdtypes.rst:1533 +#: ../../library/stdtypes.rst:1532 msgid "" "If at least one of *encoding* or *errors* is given, *object* should be a :" "term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In " @@ -2022,7 +2022,7 @@ msgid "" "buffer objects." msgstr "" -#: ../../library/stdtypes.rst:1542 +#: ../../library/stdtypes.rst:1541 msgid "" "Passing a :class:`bytes` object to :func:`str` without the *encoding* or " "*errors* arguments falls under the first case of returning the informal " @@ -2030,7 +2030,7 @@ msgid "" "Python). For example::" msgstr "" -#: ../../library/stdtypes.rst:1550 +#: ../../library/stdtypes.rst:1549 msgid "" "For more information on the ``str`` class and its methods, see :ref:" "`textseq` and the :ref:`string-methods` section below. To output formatted " @@ -2038,17 +2038,17 @@ msgid "" "addition, see the :ref:`stringservices` section." msgstr "" -#: ../../library/stdtypes.rst:1562 +#: ../../library/stdtypes.rst:1561 msgid "String Methods" msgstr "" -#: ../../library/stdtypes.rst:1567 +#: ../../library/stdtypes.rst:1566 msgid "" "Strings implement all of the :ref:`common ` sequence " "operations, along with the additional methods described below." msgstr "" -#: ../../library/stdtypes.rst:1570 +#: ../../library/stdtypes.rst:1569 msgid "" "Strings also support two styles of string formatting, one providing a large " "degree of flexibility and customization (see :meth:`str.format`, :ref:" @@ -2058,33 +2058,33 @@ msgid "" "handle (:ref:`old-string-formatting`)." msgstr "" -#: ../../library/stdtypes.rst:1577 +#: ../../library/stdtypes.rst:1576 msgid "" "The :ref:`textservices` section of the standard library covers a number of " "other modules that provide various text related utilities (including regular " "expression support in the :mod:`re` module)." msgstr "" -#: ../../library/stdtypes.rst:1583 +#: ../../library/stdtypes.rst:1582 msgid "" "Return a copy of the string with its first character capitalized and the " "rest lowercased." msgstr "" -#: ../../library/stdtypes.rst:1586 +#: ../../library/stdtypes.rst:1585 msgid "" "The first character is now put into titlecase rather than uppercase. This " "means that characters like digraphs will only have their first letter " "capitalized, instead of the full character." msgstr "" -#: ../../library/stdtypes.rst:1593 +#: ../../library/stdtypes.rst:1592 msgid "" "Return a casefolded copy of the string. Casefolded strings may be used for " "caseless matching." msgstr "" -#: ../../library/stdtypes.rst:1596 +#: ../../library/stdtypes.rst:1595 msgid "" "Casefolding is similar to lowercasing but more aggressive because it is " "intended to remove all case distinctions in a string. For example, the " @@ -2093,43 +2093,43 @@ msgid "" "`casefold` converts it to ``\"ss\"``." msgstr "" -#: ../../library/stdtypes.rst:1602 +#: ../../library/stdtypes.rst:1601 msgid "" "The casefolding algorithm is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:1610 +#: ../../library/stdtypes.rst:1609 msgid "" "Return centered in a string of length *width*. Padding is done using the " "specified *fillchar* (default is an ASCII space). The original string is " "returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:1618 +#: ../../library/stdtypes.rst:1617 msgid "" "Return the number of non-overlapping occurrences of substring *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:1622 +#: ../../library/stdtypes.rst:1621 msgid "" "If *sub* is empty, returns the number of empty strings between characters " "which is the length of the string plus one." msgstr "" -#: ../../library/stdtypes.rst:1628 +#: ../../library/stdtypes.rst:1627 msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1630 ../../library/stdtypes.rst:2765 +#: ../../library/stdtypes.rst:1629 ../../library/stdtypes.rst:2764 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." msgstr "" -#: ../../library/stdtypes.rst:1633 +#: ../../library/stdtypes.rst:1632 msgid "" "*errors* controls how encoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -2138,24 +2138,24 @@ msgid "" "register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:1640 +#: ../../library/stdtypes.rst:1639 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless an encoding error actually occurs, :ref:`devmode` is enabled or a :" "ref:`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:1645 ../../library/stdtypes.rst:2784 +#: ../../library/stdtypes.rst:1644 ../../library/stdtypes.rst:2783 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1648 ../../library/stdtypes.rst:2787 +#: ../../library/stdtypes.rst:1647 ../../library/stdtypes.rst:2786 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." msgstr "" -#: ../../library/stdtypes.rst:1655 +#: ../../library/stdtypes.rst:1654 msgid "" "Return ``True`` if the string ends with the specified *suffix*, otherwise " "return ``False``. *suffix* can also be a tuple of suffixes to look for. " @@ -2163,7 +2163,7 @@ msgid "" "*end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:1663 +#: ../../library/stdtypes.rst:1662 msgid "" "Return a copy of the string where all tab characters are replaced by one or " "more spaces, depending on the current column and the given tab size. Tab " @@ -2179,21 +2179,21 @@ msgid "" "printed." msgstr "" -#: ../../library/stdtypes.rst:1684 +#: ../../library/stdtypes.rst:1683 msgid "" "Return the lowest index in the string where substring *sub* is found within " "the slice ``s[start:end]``. Optional arguments *start* and *end* are " "interpreted as in slice notation. Return ``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:1690 +#: ../../library/stdtypes.rst:1689 msgid "" "The :meth:`~str.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:1700 +#: ../../library/stdtypes.rst:1699 msgid "" "Perform a string formatting operation. The string on which this method is " "called can contain literal text or replacement fields delimited by braces " @@ -2203,13 +2203,13 @@ msgid "" "the corresponding argument." msgstr "" -#: ../../library/stdtypes.rst:1710 +#: ../../library/stdtypes.rst:1709 msgid "" "See :ref:`formatstrings` for a description of the various formatting options " "that can be specified in format strings." msgstr "" -#: ../../library/stdtypes.rst:1714 +#: ../../library/stdtypes.rst:1713 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -2220,26 +2220,26 @@ msgid "" "This temporary change affects other threads." msgstr "" -#: ../../library/stdtypes.rst:1723 +#: ../../library/stdtypes.rst:1722 msgid "" "When formatting a number with the ``n`` type, the function sets temporarily " "the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." msgstr "" -#: ../../library/stdtypes.rst:1731 +#: ../../library/stdtypes.rst:1730 msgid "" "Similar to ``str.format(**mapping)``, except that ``mapping`` is used " "directly and not copied to a :class:`dict`. This is useful if for example " "``mapping`` is a dict subclass:" msgstr "" -#: ../../library/stdtypes.rst:1747 +#: ../../library/stdtypes.rst:1746 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1753 +#: ../../library/stdtypes.rst:1752 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -2247,7 +2247,7 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:1761 +#: ../../library/stdtypes.rst:1760 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -2257,14 +2257,14 @@ msgid "" "\"Alphabetic\" property defined in the Unicode Standard." msgstr "" -#: ../../library/stdtypes.rst:1770 +#: ../../library/stdtypes.rst:1769 msgid "" "Return ``True`` if the string is empty or all characters in the string are " "ASCII, ``False`` otherwise. ASCII characters have code points in the range " "U+0000-U+007F." msgstr "" -#: ../../library/stdtypes.rst:1779 +#: ../../library/stdtypes.rst:1778 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -2273,7 +2273,7 @@ msgid "" "General Category \"Nd\"." msgstr "" -#: ../../library/stdtypes.rst:1789 +#: ../../library/stdtypes.rst:1788 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -2283,32 +2283,32 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:1799 +#: ../../library/stdtypes.rst:1798 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:1802 +#: ../../library/stdtypes.rst:1801 msgid "" "Call :func:`keyword.iskeyword` to test whether string ``s`` is a reserved " "identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" -#: ../../library/stdtypes.rst:1805 +#: ../../library/stdtypes.rst:1804 msgid "Example: ::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:1818 +#: ../../library/stdtypes.rst:1817 msgid "" "Return ``True`` if all cased characters [4]_ in the string are lowercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1824 +#: ../../library/stdtypes.rst:1823 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -2318,7 +2318,7 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric." msgstr "" -#: ../../library/stdtypes.rst:1834 +#: ../../library/stdtypes.rst:1833 msgid "" "Return ``True`` if all characters in the string are printable or the string " "is empty, ``False`` otherwise. Nonprintable characters are those characters " @@ -2329,20 +2329,20 @@ msgid "" "of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)" msgstr "" -#: ../../library/stdtypes.rst:1845 +#: ../../library/stdtypes.rst:1844 msgid "" "Return ``True`` if there are only whitespace characters in the string and " "there is at least one character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1848 +#: ../../library/stdtypes.rst:1847 msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" "`unicodedata`), either its general category is ``Zs`` (\"Separator, " "space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." msgstr "" -#: ../../library/stdtypes.rst:1856 +#: ../../library/stdtypes.rst:1855 msgid "" "Return ``True`` if the string is a titlecased string and there is at least " "one character, for example uppercase characters may only follow uncased " @@ -2350,13 +2350,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:1863 +#: ../../library/stdtypes.rst:1862 msgid "" "Return ``True`` if all cased characters [4]_ in the string are uppercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1881 +#: ../../library/stdtypes.rst:1880 msgid "" "Return a string which is the concatenation of the strings in *iterable*. A :" "exc:`TypeError` will be raised if there are any non-string values in " @@ -2364,26 +2364,26 @@ msgid "" "elements is the string providing this method." msgstr "" -#: ../../library/stdtypes.rst:1889 +#: ../../library/stdtypes.rst:1888 msgid "" "Return the string left justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:1896 +#: ../../library/stdtypes.rst:1895 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:1899 +#: ../../library/stdtypes.rst:1898 msgid "" "The lowercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:1905 +#: ../../library/stdtypes.rst:1904 msgid "" "Return a copy of the string with leading characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -2392,19 +2392,19 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:1915 +#: ../../library/stdtypes.rst:1914 msgid "" "See :meth:`str.removeprefix` for a method that will remove a single prefix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:1926 +#: ../../library/stdtypes.rst:1925 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:1928 +#: ../../library/stdtypes.rst:1927 msgid "" "If there is only one argument, it must be a dictionary mapping Unicode " "ordinals (integers) or characters (strings of length 1) to Unicode ordinals, " @@ -2412,7 +2412,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:1933 +#: ../../library/stdtypes.rst:1932 msgid "" "If there are two arguments, they must be strings of equal length, and in the " "resulting dictionary, each character in x will be mapped to the character at " @@ -2420,7 +2420,7 @@ msgid "" "whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:1941 +#: ../../library/stdtypes.rst:1940 msgid "" "Split the string at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -2428,47 +2428,47 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:1949 +#: ../../library/stdtypes.rst:1948 msgid "" "If the string starts with the *prefix* string, return " "``string[len(prefix):]``. Otherwise, return a copy of the original string::" msgstr "" -#: ../../library/stdtypes.rst:1963 +#: ../../library/stdtypes.rst:1962 msgid "" "If the string ends with the *suffix* string and that *suffix* is not empty, " "return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " "string::" msgstr "" -#: ../../library/stdtypes.rst:1977 +#: ../../library/stdtypes.rst:1976 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If the optional argument *count* is given, only the first *count* " "occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:1984 +#: ../../library/stdtypes.rst:1983 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " "and *end* are interpreted as in slice notation. Return ``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:1991 +#: ../../library/stdtypes.rst:1990 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1997 +#: ../../library/stdtypes.rst:1996 msgid "" "Return the string right justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2004 +#: ../../library/stdtypes.rst:2003 msgid "" "Split the string at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -2476,7 +2476,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2012 +#: ../../library/stdtypes.rst:2011 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " @@ -2485,7 +2485,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2021 +#: ../../library/stdtypes.rst:2020 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -2494,13 +2494,13 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2031 +#: ../../library/stdtypes.rst:2030 msgid "" "See :meth:`str.removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2041 +#: ../../library/stdtypes.rst:2040 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, " @@ -2509,7 +2509,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2047 +#: ../../library/stdtypes.rst:2046 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -2518,23 +2518,23 @@ msgid "" "Splitting an empty string with a specified separator returns ``['']``." msgstr "" -#: ../../library/stdtypes.rst:2053 ../../library/stdtypes.rst:2069 -#: ../../library/stdtypes.rst:2121 ../../library/stdtypes.rst:2189 -#: ../../library/stdtypes.rst:2256 ../../library/stdtypes.rst:3103 -#: ../../library/stdtypes.rst:3119 ../../library/stdtypes.rst:3210 -#: ../../library/stdtypes.rst:3226 ../../library/stdtypes.rst:3251 -#: ../../library/stdtypes.rst:3265 ../../library/stdtypes.rst:3293 -#: ../../library/stdtypes.rst:3307 ../../library/stdtypes.rst:3325 -#: ../../library/stdtypes.rst:3352 ../../library/stdtypes.rst:3375 -#: ../../library/stdtypes.rst:3402 ../../library/stdtypes.rst:3444 -#: ../../library/stdtypes.rst:3468 +#: ../../library/stdtypes.rst:2052 ../../library/stdtypes.rst:2068 +#: ../../library/stdtypes.rst:2120 ../../library/stdtypes.rst:2188 +#: ../../library/stdtypes.rst:2255 ../../library/stdtypes.rst:3102 +#: ../../library/stdtypes.rst:3118 ../../library/stdtypes.rst:3209 +#: ../../library/stdtypes.rst:3225 ../../library/stdtypes.rst:3250 +#: ../../library/stdtypes.rst:3264 ../../library/stdtypes.rst:3292 +#: ../../library/stdtypes.rst:3306 ../../library/stdtypes.rst:3324 +#: ../../library/stdtypes.rst:3351 ../../library/stdtypes.rst:3374 +#: ../../library/stdtypes.rst:3401 ../../library/stdtypes.rst:3443 +#: ../../library/stdtypes.rst:3467 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/stdtypes.rst:2062 +#: ../../library/stdtypes.rst:2061 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive whitespace are regarded as a single separator, " @@ -2544,131 +2544,131 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2084 +#: ../../library/stdtypes.rst:2083 msgid "" "Return a list of the lines in the string, breaking at line boundaries. Line " "breaks are not included in the resulting list unless *keepends* is given and " "true." msgstr "" -#: ../../library/stdtypes.rst:2088 +#: ../../library/stdtypes.rst:2087 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2092 +#: ../../library/stdtypes.rst:2091 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2092 +#: ../../library/stdtypes.rst:2091 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2094 +#: ../../library/stdtypes.rst:2093 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2094 +#: ../../library/stdtypes.rst:2093 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2095 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2095 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2098 +#: ../../library/stdtypes.rst:2097 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2098 +#: ../../library/stdtypes.rst:2097 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2100 +#: ../../library/stdtypes.rst:2099 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2100 +#: ../../library/stdtypes.rst:2099 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2102 +#: ../../library/stdtypes.rst:2101 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2102 +#: ../../library/stdtypes.rst:2101 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2104 +#: ../../library/stdtypes.rst:2103 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2104 +#: ../../library/stdtypes.rst:2103 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2106 +#: ../../library/stdtypes.rst:2105 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2106 +#: ../../library/stdtypes.rst:2105 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2108 +#: ../../library/stdtypes.rst:2107 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2108 +#: ../../library/stdtypes.rst:2107 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2110 +#: ../../library/stdtypes.rst:2109 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2110 +#: ../../library/stdtypes.rst:2109 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2112 +#: ../../library/stdtypes.rst:2111 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2112 +#: ../../library/stdtypes.rst:2111 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2114 +#: ../../library/stdtypes.rst:2113 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2114 +#: ../../library/stdtypes.rst:2113 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2119 +#: ../../library/stdtypes.rst:2118 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2128 +#: ../../library/stdtypes.rst:2127 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:2137 +#: ../../library/stdtypes.rst:2136 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2147 +#: ../../library/stdtypes.rst:2146 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -2676,7 +2676,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2155 +#: ../../library/stdtypes.rst:2154 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -2685,7 +2685,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2166 +#: ../../library/stdtypes.rst:2165 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -2693,20 +2693,20 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2179 +#: ../../library/stdtypes.rst:2178 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. Note that it is not necessarily true that ``s.swapcase()." "swapcase() == s``." msgstr "" -#: ../../library/stdtypes.rst:2186 +#: ../../library/stdtypes.rst:2185 msgid "" "Return a titlecased version of the string where words start with an " "uppercase character and the remaining characters are lowercase." msgstr "" -#: ../../library/stdtypes.rst:2194 ../../library/stdtypes.rst:3412 +#: ../../library/stdtypes.rst:2193 ../../library/stdtypes.rst:3411 msgid "" "The algorithm uses a simple language-independent definition of a word as " "groups of consecutive letters. The definition works in many contexts but it " @@ -2714,19 +2714,19 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2202 +#: ../../library/stdtypes.rst:2201 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2205 +#: ../../library/stdtypes.rst:2204 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2220 +#: ../../library/stdtypes.rst:2219 msgid "" "Return a copy of the string in which each character has been mapped through " "the given translation table. The table must be an object that implements " @@ -2738,19 +2738,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2229 +#: ../../library/stdtypes.rst:2228 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2232 +#: ../../library/stdtypes.rst:2231 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2238 +#: ../../library/stdtypes.rst:2237 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` " @@ -2759,13 +2759,13 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2244 +#: ../../library/stdtypes.rst:2243 msgid "" "The uppercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:2250 +#: ../../library/stdtypes.rst:2249 msgid "" "Return a copy of the string left filled with ASCII ``'0'`` digits to make a " "string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled " @@ -2773,11 +2773,11 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2268 +#: ../../library/stdtypes.rst:2267 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2281 +#: ../../library/stdtypes.rst:2280 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -2788,7 +2788,7 @@ msgid "" "or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2289 +#: ../../library/stdtypes.rst:2288 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -2798,7 +2798,7 @@ msgid "" "in the C language." msgstr "" -#: ../../library/stdtypes.rst:2295 +#: ../../library/stdtypes.rst:2294 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -2806,36 +2806,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2305 ../../library/stdtypes.rst:3523 +#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3522 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:3526 +#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3525 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2310 ../../library/stdtypes.rst:3528 +#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3527 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2313 ../../library/stdtypes.rst:3531 +#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3530 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2316 ../../library/stdtypes.rst:3534 +#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3533 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is read from the next element of the tuple in *values*, and the " "object to convert comes after the minimum field width and optional precision." msgstr "" -#: ../../library/stdtypes.rst:2320 ../../library/stdtypes.rst:3538 +#: ../../library/stdtypes.rst:2319 ../../library/stdtypes.rst:3537 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -2843,15 +2843,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3543 +#: ../../library/stdtypes.rst:2324 ../../library/stdtypes.rst:3542 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:3545 +#: ../../library/stdtypes.rst:2326 ../../library/stdtypes.rst:3544 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2329 +#: ../../library/stdtypes.rst:2328 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the string *must* include a parenthesised mapping key into that " @@ -2859,279 +2859,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2338 ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:2337 ../../library/stdtypes.rst:3555 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3559 +#: ../../library/stdtypes.rst:2340 ../../library/stdtypes.rst:3558 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2350 ../../library/stdtypes.rst:3568 +#: ../../library/stdtypes.rst:2349 ../../library/stdtypes.rst:3567 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3570 +#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3569 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3570 +#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3569 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:2354 ../../library/stdtypes.rst:3572 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:2354 ../../library/stdtypes.rst:3572 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2357 ../../library/stdtypes.rst:3575 +#: ../../library/stdtypes.rst:2356 ../../library/stdtypes.rst:3574 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2357 ../../library/stdtypes.rst:3575 +#: ../../library/stdtypes.rst:2356 ../../library/stdtypes.rst:3574 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2360 ../../library/stdtypes.rst:3578 +#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3577 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2360 ../../library/stdtypes.rst:3578 +#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3577 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2363 ../../library/stdtypes.rst:3581 +#: ../../library/stdtypes.rst:2362 ../../library/stdtypes.rst:3580 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2363 ../../library/stdtypes.rst:3581 +#: ../../library/stdtypes.rst:2362 ../../library/stdtypes.rst:3580 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3585 +#: ../../library/stdtypes.rst:2366 ../../library/stdtypes.rst:3584 msgid "" "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as " "it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" -#: ../../library/stdtypes.rst:2370 ../../library/stdtypes.rst:3588 +#: ../../library/stdtypes.rst:2369 ../../library/stdtypes.rst:3587 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3591 +#: ../../library/stdtypes.rst:2372 ../../library/stdtypes.rst:3590 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:3593 +#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:3592 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:2377 -#: ../../library/stdtypes.rst:3593 ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:2376 +#: ../../library/stdtypes.rst:3592 ../../library/stdtypes.rst:3594 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2377 ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:2376 ../../library/stdtypes.rst:3594 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3596 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3596 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2380 ../../library/stdtypes.rst:3598 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2380 ../../library/stdtypes.rst:3598 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:3600 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:3600 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3602 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3602 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3604 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3604 msgid "Floating point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 +#: ../../library/stdtypes.rst:2388 ../../library/stdtypes.rst:3606 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 +#: ../../library/stdtypes.rst:2388 ../../library/stdtypes.rst:3606 msgid "Floating point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:2390 ../../library/stdtypes.rst:3608 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:2393 -#: ../../library/stdtypes.rst:3609 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:2390 ../../library/stdtypes.rst:2392 +#: ../../library/stdtypes.rst:3608 ../../library/stdtypes.rst:3610 msgid "Floating point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:2392 ../../library/stdtypes.rst:3610 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 +#: ../../library/stdtypes.rst:2394 ../../library/stdtypes.rst:3612 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 +#: ../../library/stdtypes.rst:2394 ../../library/stdtypes.rst:3612 msgid "" "Floating point format. Uses lowercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3617 +#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3616 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3617 +#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3616 msgid "" "Floating point format. Uses uppercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2403 ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:2402 ../../library/stdtypes.rst:3620 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2403 +#: ../../library/stdtypes.rst:2402 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:2405 ../../library/stdtypes.rst:3633 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2406 +#: ../../library/stdtypes.rst:2405 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2409 ../../library/stdtypes.rst:3628 +#: ../../library/stdtypes.rst:2408 ../../library/stdtypes.rst:3627 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2409 +#: ../../library/stdtypes.rst:2408 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2412 ../../library/stdtypes.rst:3631 +#: ../../library/stdtypes.rst:2411 ../../library/stdtypes.rst:3630 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2412 +#: ../../library/stdtypes.rst:2411 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2415 ../../library/stdtypes.rst:3637 +#: ../../library/stdtypes.rst:2414 ../../library/stdtypes.rst:3636 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2415 ../../library/stdtypes.rst:3637 +#: ../../library/stdtypes.rst:2414 ../../library/stdtypes.rst:3636 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3644 +#: ../../library/stdtypes.rst:2421 ../../library/stdtypes.rst:3643 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:3648 +#: ../../library/stdtypes.rst:2425 ../../library/stdtypes.rst:3647 msgid "" "The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on " "whether the ``'x'`` or ``'X'`` format was used) to be inserted before the " "first digit." msgstr "" -#: ../../library/stdtypes.rst:2430 ../../library/stdtypes.rst:3652 +#: ../../library/stdtypes.rst:2429 ../../library/stdtypes.rst:3651 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2433 ../../library/stdtypes.rst:3655 +#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3654 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2437 ../../library/stdtypes.rst:3659 +#: ../../library/stdtypes.rst:2436 ../../library/stdtypes.rst:3658 msgid "" "The alternate form causes the result to always contain a decimal point, and " "trailing zeroes are not removed as they would otherwise be." msgstr "" -#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:3662 +#: ../../library/stdtypes.rst:2439 ../../library/stdtypes.rst:3661 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2444 ../../library/stdtypes.rst:3666 +#: ../../library/stdtypes.rst:2443 ../../library/stdtypes.rst:3665 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2447 ../../library/stdtypes.rst:3675 +#: ../../library/stdtypes.rst:2446 ../../library/stdtypes.rst:3674 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`\\ 。" -#: ../../library/stdtypes.rst:2449 +#: ../../library/stdtypes.rst:2448 msgid "" "Since Python strings have an explicit length, ``%s`` conversions do not " "assume that ``'\\0'`` is the end of the string." msgstr "" -#: ../../library/stdtypes.rst:2454 +#: ../../library/stdtypes.rst:2453 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:2465 +#: ../../library/stdtypes.rst:2464 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:2473 +#: ../../library/stdtypes.rst:2472 msgid "" "The core built-in types for manipulating binary data are :class:`bytes` and :" "class:`bytearray`. They are supported by :class:`memoryview` which uses the :" @@ -3139,17 +3139,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:2478 +#: ../../library/stdtypes.rst:2477 msgid "" "The :mod:`array` module supports efficient storage of basic data types like " "32-bit integers and IEEE754 double-precision floating values." msgstr "" -#: ../../library/stdtypes.rst:2484 +#: ../../library/stdtypes.rst:2483 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:2488 +#: ../../library/stdtypes.rst:2487 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -3157,40 +3157,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:2495 +#: ../../library/stdtypes.rst:2494 msgid "" "Firstly, the syntax for bytes literals is largely the same as that for " "string literals, except that a ``b`` prefix is added:" msgstr "" -#: ../../library/stdtypes.rst:2498 +#: ../../library/stdtypes.rst:2497 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:2499 +#: ../../library/stdtypes.rst:2498 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:2500 +#: ../../library/stdtypes.rst:2499 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:2502 +#: ../../library/stdtypes.rst:2501 msgid "" "Only ASCII characters are permitted in bytes literals (regardless of the " "declared source code encoding). Any binary values over 127 must be entered " "into bytes literals using the appropriate escape sequence." msgstr "" -#: ../../library/stdtypes.rst:2506 +#: ../../library/stdtypes.rst:2505 msgid "" "As with string literals, bytes literals may also use a ``r`` prefix to " "disable processing of escape sequences. See :ref:`strings` for more about " "the various forms of bytes literal, including supported escape sequences." msgstr "" -#: ../../library/stdtypes.rst:2510 +#: ../../library/stdtypes.rst:2509 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -3203,29 +3203,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:2520 +#: ../../library/stdtypes.rst:2519 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:2523 +#: ../../library/stdtypes.rst:2522 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:2524 +#: ../../library/stdtypes.rst:2523 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2525 +#: ../../library/stdtypes.rst:2524 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:2527 +#: ../../library/stdtypes.rst:2526 msgid "Also see the :ref:`bytes ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2529 +#: ../../library/stdtypes.rst:2528 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3233,32 +3233,32 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:2535 +#: ../../library/stdtypes.rst:2534 msgid "" "This :class:`bytes` class method returns a bytes object, decoding the given " "string object. The string must contain two hexadecimal digits per byte, " "with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:2542 +#: ../../library/stdtypes.rst:2541 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:2546 +#: ../../library/stdtypes.rst:2545 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2551 ../../library/stdtypes.rst:2636 +#: ../../library/stdtypes.rst:2550 ../../library/stdtypes.rst:2635 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:2557 +#: ../../library/stdtypes.rst:2556 msgid "" "If you want to make the hex string easier to read, you can specify a single " "character separator *sep* parameter to include in the output. By default, " @@ -3267,13 +3267,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:2574 +#: ../../library/stdtypes.rst:2573 msgid "" ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters " "to insert separators between bytes in the hex output." msgstr "" -#: ../../library/stdtypes.rst:2578 +#: ../../library/stdtypes.rst:2577 msgid "" "Since bytes objects are sequences of integers (akin to a tuple), for a bytes " "object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes " @@ -3281,58 +3281,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2583 +#: ../../library/stdtypes.rst:2582 msgid "" "The representation of bytes objects uses the literal format (``b'...'``) " "since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can " "always convert a bytes object into a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2591 +#: ../../library/stdtypes.rst:2590 msgid "Bytearray Objects" msgstr "" -#: ../../library/stdtypes.rst:2595 +#: ../../library/stdtypes.rst:2594 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2599 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2603 +#: ../../library/stdtypes.rst:2602 msgid "Creating an empty instance: ``bytearray()``" msgstr "" -#: ../../library/stdtypes.rst:2604 +#: ../../library/stdtypes.rst:2603 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2605 +#: ../../library/stdtypes.rst:2604 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2606 +#: ../../library/stdtypes.rst:2605 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2608 +#: ../../library/stdtypes.rst:2607 msgid "" "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray " "operations described in :ref:`bytes-methods`." msgstr "" -#: ../../library/stdtypes.rst:2612 +#: ../../library/stdtypes.rst:2611 msgid "Also see the :ref:`bytearray ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2614 +#: ../../library/stdtypes.rst:2613 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3340,33 +3340,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2620 +#: ../../library/stdtypes.rst:2619 msgid "" "This :class:`bytearray` class method returns bytearray object, decoding the " "given string object. The string must contain two hexadecimal digits per " "byte, with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:2627 +#: ../../library/stdtypes.rst:2626 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2631 +#: ../../library/stdtypes.rst:2630 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2644 +#: ../../library/stdtypes.rst:2643 msgid "" "Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:2649 +#: ../../library/stdtypes.rst:2648 msgid "" "Since bytearray objects are sequences of integers (akin to a list), for a " "bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be " @@ -3374,7 +3374,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2654 +#: ../../library/stdtypes.rst:2653 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -3382,11 +3382,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2663 +#: ../../library/stdtypes.rst:2662 msgid "Bytes and Bytearray Operations" msgstr "" -#: ../../library/stdtypes.rst:2668 +#: ../../library/stdtypes.rst:2667 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -3395,107 +3395,107 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2676 +#: ../../library/stdtypes.rst:2675 msgid "" "The methods on bytes and bytearray objects don't accept strings as their " "arguments, just as the methods on strings don't accept bytes as their " "arguments. For example, you have to write::" msgstr "" -#: ../../library/stdtypes.rst:2683 +#: ../../library/stdtypes.rst:2682 msgid "and::" msgstr "" "和:\n" "\n" "::" -#: ../../library/stdtypes.rst:2688 +#: ../../library/stdtypes.rst:2687 msgid "" "Some bytes and bytearray operations assume the use of ASCII compatible " "binary formats, and hence should be avoided when working with arbitrary " "binary data. These restrictions are covered below." msgstr "" -#: ../../library/stdtypes.rst:2693 +#: ../../library/stdtypes.rst:2692 msgid "" "Using these ASCII based operations to manipulate binary data that is not " "stored in an ASCII based format may lead to data corruption." msgstr "" -#: ../../library/stdtypes.rst:2696 +#: ../../library/stdtypes.rst:2695 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2702 +#: ../../library/stdtypes.rst:2701 msgid "" "Return the number of non-overlapping occurrences of subsequence *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:2706 ../../library/stdtypes.rst:2811 -#: ../../library/stdtypes.rst:2833 ../../library/stdtypes.rst:2899 -#: ../../library/stdtypes.rst:2912 +#: ../../library/stdtypes.rst:2705 ../../library/stdtypes.rst:2810 +#: ../../library/stdtypes.rst:2832 ../../library/stdtypes.rst:2898 +#: ../../library/stdtypes.rst:2911 msgid "" "The subsequence to search for may be any :term:`bytes-like object` or an " "integer in the range 0 to 255." msgstr "" -#: ../../library/stdtypes.rst:2709 +#: ../../library/stdtypes.rst:2708 msgid "" "If *sub* is empty, returns the number of empty slices between characters " "which is the length of the bytes object plus one." msgstr "" -#: ../../library/stdtypes.rst:2712 ../../library/stdtypes.rst:2823 -#: ../../library/stdtypes.rst:2836 ../../library/stdtypes.rst:2902 -#: ../../library/stdtypes.rst:2915 +#: ../../library/stdtypes.rst:2711 ../../library/stdtypes.rst:2822 +#: ../../library/stdtypes.rst:2835 ../../library/stdtypes.rst:2901 +#: ../../library/stdtypes.rst:2914 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2719 +#: ../../library/stdtypes.rst:2718 msgid "" "If the binary data starts with the *prefix* string, return " "``bytes[len(prefix):]``. Otherwise, return a copy of the original binary " "data::" msgstr "" -#: ../../library/stdtypes.rst:2728 +#: ../../library/stdtypes.rst:2727 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2732 ../../library/stdtypes.rst:2754 -#: ../../library/stdtypes.rst:2887 ../../library/stdtypes.rst:2980 -#: ../../library/stdtypes.rst:2994 ../../library/stdtypes.rst:3025 -#: ../../library/stdtypes.rst:3039 ../../library/stdtypes.rst:3081 -#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:3169 -#: ../../library/stdtypes.rst:3197 ../../library/stdtypes.rst:3336 -#: ../../library/stdtypes.rst:3391 ../../library/stdtypes.rst:3434 -#: ../../library/stdtypes.rst:3455 ../../library/stdtypes.rst:3477 -#: ../../library/stdtypes.rst:3679 +#: ../../library/stdtypes.rst:2731 ../../library/stdtypes.rst:2753 +#: ../../library/stdtypes.rst:2886 ../../library/stdtypes.rst:2979 +#: ../../library/stdtypes.rst:2993 ../../library/stdtypes.rst:3024 +#: ../../library/stdtypes.rst:3038 ../../library/stdtypes.rst:3080 +#: ../../library/stdtypes.rst:3150 ../../library/stdtypes.rst:3168 +#: ../../library/stdtypes.rst:3196 ../../library/stdtypes.rst:3335 +#: ../../library/stdtypes.rst:3390 ../../library/stdtypes.rst:3433 +#: ../../library/stdtypes.rst:3454 ../../library/stdtypes.rst:3476 +#: ../../library/stdtypes.rst:3678 msgid "" "The bytearray version of this method does *not* operate in place - it always " "produces a new object, even if no changes were made." msgstr "" -#: ../../library/stdtypes.rst:2741 +#: ../../library/stdtypes.rst:2740 msgid "" "If the binary data ends with the *suffix* string and that *suffix* is not " "empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the " "original binary data::" msgstr "" -#: ../../library/stdtypes.rst:2750 +#: ../../library/stdtypes.rst:2749 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2763 +#: ../../library/stdtypes.rst:2762 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:2768 +#: ../../library/stdtypes.rst:2767 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -3503,21 +3503,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:2774 +#: ../../library/stdtypes.rst:2773 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:" "`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:2780 +#: ../../library/stdtypes.rst:2779 msgid "" "Passing the *encoding* argument to :class:`str` allows decoding any :term:" "`bytes-like object` directly, without needing to make a temporary :class:`!" "bytes` or :class:`!bytearray` object." msgstr "" -#: ../../library/stdtypes.rst:2795 +#: ../../library/stdtypes.rst:2794 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -3525,11 +3525,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2800 +#: ../../library/stdtypes.rst:2799 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2806 +#: ../../library/stdtypes.rst:2805 msgid "" "Return the lowest index in the data where the subsequence *sub* is found, " "such that *sub* is contained in the slice ``s[start:end]``. Optional " @@ -3537,20 +3537,20 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2816 +#: ../../library/stdtypes.rst:2815 msgid "" "The :meth:`~bytes.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:2830 +#: ../../library/stdtypes.rst:2829 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:2843 +#: ../../library/stdtypes.rst:2842 msgid "" "Return a bytes or bytearray object which is the concatenation of the binary " "data sequences in *iterable*. A :exc:`TypeError` will be raised if there " @@ -3560,7 +3560,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:2854 +#: ../../library/stdtypes.rst:2853 msgid "" "This static method returns a translation table usable for :meth:`bytes." "translate` that will map each character in *from* into the character at the " @@ -3568,7 +3568,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2864 msgid "" "Split the sequence at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -3577,24 +3577,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:2872 ../../library/stdtypes.rst:2929 +#: ../../library/stdtypes.rst:2871 ../../library/stdtypes.rst:2928 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2878 +#: ../../library/stdtypes.rst:2877 msgid "" "Return a copy of the sequence with all occurrences of subsequence *old* " "replaced by *new*. If the optional argument *count* is given, only the " "first *count* occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:2882 +#: ../../library/stdtypes.rst:2881 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:2894 +#: ../../library/stdtypes.rst:2893 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -3602,13 +3602,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2909 +#: ../../library/stdtypes.rst:2908 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2922 +#: ../../library/stdtypes.rst:2921 msgid "" "Split the sequence at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -3617,7 +3617,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:2935 +#: ../../library/stdtypes.rst:2934 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -3625,11 +3625,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2940 +#: ../../library/stdtypes.rst:2939 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2946 +#: ../../library/stdtypes.rst:2945 msgid "" "Return a copy of the bytes or bytearray object where all bytes occurring in " "the optional argument *delete* are removed, and the remaining bytes have " @@ -3637,22 +3637,22 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:2951 +#: ../../library/stdtypes.rst:2950 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:2954 +#: ../../library/stdtypes.rst:2953 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:2960 +#: ../../library/stdtypes.rst:2959 msgid "*delete* is now supported as a keyword argument." msgstr "" -#: ../../library/stdtypes.rst:2964 +#: ../../library/stdtypes.rst:2963 msgid "" "The following methods on bytes and bytearray objects have default behaviours " "that assume the use of ASCII compatible binary formats, but can still be " @@ -3661,7 +3661,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:2973 +#: ../../library/stdtypes.rst:2972 msgid "" "Return a copy of the object centered in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3669,7 +3669,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2987 +#: ../../library/stdtypes.rst:2986 msgid "" "Return a copy of the object left justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3677,7 +3677,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3001 +#: ../../library/stdtypes.rst:3000 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -3687,14 +3687,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3013 +#: ../../library/stdtypes.rst:3012 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removeprefix` for a method that will remove a " "single prefix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3032 +#: ../../library/stdtypes.rst:3031 msgid "" "Return a copy of the object right justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3702,7 +3702,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3046 +#: ../../library/stdtypes.rst:3045 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are " @@ -3712,7 +3712,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3057 +#: ../../library/stdtypes.rst:3056 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -3722,14 +3722,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3069 +#: ../../library/stdtypes.rst:3068 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removesuffix` for a method that will remove a " "single suffix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3088 +#: ../../library/stdtypes.rst:3087 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given and non-negative, at most " @@ -3738,7 +3738,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3094 +#: ../../library/stdtypes.rst:3093 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " @@ -3749,7 +3749,7 @@ msgid "" "object being split. The *sep* argument may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3112 +#: ../../library/stdtypes.rst:3111 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive ASCII whitespace are regarded as a single " @@ -3759,7 +3759,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3133 +#: ../../library/stdtypes.rst:3132 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *chars* argument is a binary sequence specifying the set of " @@ -3769,13 +3769,13 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3146 +#: ../../library/stdtypes.rst:3145 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3155 +#: ../../library/stdtypes.rst:3154 msgid "" "The following methods on bytes and bytearray objects assume the use of ASCII " "compatible binary formats and should not be applied to arbitrary binary " @@ -3783,14 +3783,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3163 +#: ../../library/stdtypes.rst:3162 msgid "" "Return a copy of the sequence with each byte interpreted as an ASCII " "character, and the first byte capitalized and the rest lowercased. Non-ASCII " "byte values are passed through unchanged." msgstr "" -#: ../../library/stdtypes.rst:3176 +#: ../../library/stdtypes.rst:3175 msgid "" "Return a copy of the sequence where all ASCII tab characters are replaced by " "one or more ASCII spaces, depending on the current column and the given tab " @@ -3806,7 +3806,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3204 +#: ../../library/stdtypes.rst:3203 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -3815,7 +3815,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3221 +#: ../../library/stdtypes.rst:3220 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -3823,35 +3823,35 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3237 +#: ../../library/stdtypes.rst:3236 msgid "" "Return ``True`` if the sequence is empty or all bytes in the sequence are " "ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." msgstr "" -#: ../../library/stdtypes.rst:3247 +#: ../../library/stdtypes.rst:3246 msgid "" "Return ``True`` if all bytes in the sequence are ASCII decimal digits and " "the sequence is not empty, ``False`` otherwise. ASCII decimal digits are " "those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3262 +#: ../../library/stdtypes.rst:3261 msgid "" "Return ``True`` if there is at least one lowercase ASCII character in the " "sequence and no uppercase ASCII characters, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:3272 ../../library/stdtypes.rst:3314 -#: ../../library/stdtypes.rst:3330 ../../library/stdtypes.rst:3380 -#: ../../library/stdtypes.rst:3449 +#: ../../library/stdtypes.rst:3271 ../../library/stdtypes.rst:3313 +#: ../../library/stdtypes.rst:3329 ../../library/stdtypes.rst:3379 +#: ../../library/stdtypes.rst:3448 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " "values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3280 +#: ../../library/stdtypes.rst:3279 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -3859,27 +3859,27 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3289 +#: ../../library/stdtypes.rst:3288 msgid "" "Return ``True`` if the sequence is ASCII titlecase and the sequence is not " "empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the " "definition of \"titlecase\"." msgstr "" -#: ../../library/stdtypes.rst:3304 +#: ../../library/stdtypes.rst:3303 msgid "" "Return ``True`` if there is at least one uppercase alphabetic ASCII " "character in the sequence and no lowercase ASCII characters, ``False`` " "otherwise." msgstr "" -#: ../../library/stdtypes.rst:3322 +#: ../../library/stdtypes.rst:3321 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3347 +#: ../../library/stdtypes.rst:3346 msgid "" "Return a list of the lines in the binary sequence, breaking at ASCII line " "boundaries. This method uses the :term:`universal newlines` approach to " @@ -3887,20 +3887,20 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3359 +#: ../../library/stdtypes.rst:3358 msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:3372 +#: ../../library/stdtypes.rst:3371 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart and vice-versa." msgstr "" -#: ../../library/stdtypes.rst:3384 +#: ../../library/stdtypes.rst:3383 msgid "" "Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -3908,14 +3908,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3398 +#: ../../library/stdtypes.rst:3397 msgid "" "Return a titlecased version of the binary sequence where words start with an " "uppercase ASCII character and the remaining characters are lowercase. " "Uncased byte values are left unmodified." msgstr "" -#: ../../library/stdtypes.rst:3407 +#: ../../library/stdtypes.rst:3406 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -3923,18 +3923,18 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3420 +#: ../../library/stdtypes.rst:3419 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3441 +#: ../../library/stdtypes.rst:3440 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3462 +#: ../../library/stdtypes.rst:3461 msgid "" "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make " "a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is " @@ -3943,11 +3943,11 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3484 +#: ../../library/stdtypes.rst:3483 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3501 +#: ../../library/stdtypes.rst:3500 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -3955,7 +3955,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3506 +#: ../../library/stdtypes.rst:3505 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -3965,7 +3965,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3513 +#: ../../library/stdtypes.rst:3512 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -3973,7 +3973,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3547 +#: ../../library/stdtypes.rst:3546 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the bytes object *must* include a parenthesised mapping key into " @@ -3981,73 +3981,73 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:3620 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3624 +#: ../../library/stdtypes.rst:3623 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3624 +#: ../../library/stdtypes.rst:3623 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3628 +#: ../../library/stdtypes.rst:3627 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3631 +#: ../../library/stdtypes.rst:3630 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:3633 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:3633 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3669 +#: ../../library/stdtypes.rst:3668 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3672 +#: ../../library/stdtypes.rst:3671 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3684 +#: ../../library/stdtypes.rst:3683 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3691 +#: ../../library/stdtypes.rst:3690 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3693 +#: ../../library/stdtypes.rst:3692 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " "copying." msgstr "" -#: ../../library/stdtypes.rst:3699 +#: ../../library/stdtypes.rst:3698 msgid "" "Create a :class:`memoryview` that references *object*. *object* must " "support the buffer protocol. Built-in objects that support the buffer " "protocol include :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/stdtypes.rst:3703 +#: ../../library/stdtypes.rst:3702 msgid "" "A :class:`memoryview` has the notion of an *element*, which is the atomic " "memory unit handled by the originating *object*. For many simple types such " @@ -4055,7 +4055,7 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:3708 +#: ../../library/stdtypes.rst:3707 msgid "" "``len(view)`` is equal to the length of :class:`~memoryview.tolist`. If " "``view.ndim = 0``, the length is 1. If ``view.ndim = 1``, the length is " @@ -4065,13 +4065,13 @@ msgid "" "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:3715 +#: ../../library/stdtypes.rst:3714 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:3728 +#: ../../library/stdtypes.rst:3727 msgid "" "If :class:`~memoryview.format` is one of the native format specifiers from " "the :mod:`struct` module, indexing with an integer or a tuple of integers is " @@ -4082,82 +4082,82 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:3737 +#: ../../library/stdtypes.rst:3736 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:3749 +#: ../../library/stdtypes.rst:3748 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:3770 +#: ../../library/stdtypes.rst:3769 msgid "" "One-dimensional memoryviews of :term:`hashable` (read-only) types with " "formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) " "== hash(m.tobytes())``::" msgstr "" -#: ../../library/stdtypes.rst:3782 +#: ../../library/stdtypes.rst:3781 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:3786 +#: ../../library/stdtypes.rst:3785 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:3790 +#: ../../library/stdtypes.rst:3789 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:3793 +#: ../../library/stdtypes.rst:3792 msgid ":class:`memoryview` has several methods:" msgstr "" -#: ../../library/stdtypes.rst:3797 +#: ../../library/stdtypes.rst:3796 msgid "" "A memoryview and a :pep:`3118` exporter are equal if their shapes are " "equivalent and if all corresponding values are equal when the operands' " "respective format codes are interpreted using :mod:`struct` syntax." msgstr "" -#: ../../library/stdtypes.rst:3801 +#: ../../library/stdtypes.rst:3800 msgid "" "For the subset of :mod:`struct` format strings currently supported by :meth:" "`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" msgstr "" -#: ../../library/stdtypes.rst:3820 +#: ../../library/stdtypes.rst:3819 msgid "" "If either format string is not supported by the :mod:`struct` module, then " "the objects will always compare as unequal (even if the format strings and " "buffer contents are identical)::" msgstr "" -#: ../../library/stdtypes.rst:3836 +#: ../../library/stdtypes.rst:3835 msgid "" "Note that, as with floating point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:3839 +#: ../../library/stdtypes.rst:3838 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:3845 +#: ../../library/stdtypes.rst:3844 msgid "" "Return the data in the buffer as a bytestring. This is equivalent to " "calling the :class:`bytes` constructor on the memoryview. ::" msgstr "" -#: ../../library/stdtypes.rst:3854 +#: ../../library/stdtypes.rst:3853 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -4165,7 +4165,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:3859 +#: ../../library/stdtypes.rst:3858 msgid "" "*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the " "original array is converted to C or Fortran order. For contiguous views, 'A' " @@ -4174,36 +4174,36 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:3868 +#: ../../library/stdtypes.rst:3867 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:3877 +#: ../../library/stdtypes.rst:3876 msgid "" "Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:3884 +#: ../../library/stdtypes.rst:3883 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:3894 +#: ../../library/stdtypes.rst:3893 msgid "" ":meth:`tolist` now supports all single character native formats in :mod:" "`struct` module syntax as well as multi-dimensional representations." msgstr "" -#: ../../library/stdtypes.rst:3901 +#: ../../library/stdtypes.rst:3900 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:3920 +#: ../../library/stdtypes.rst:3919 msgid "" "Release the underlying buffer exposed by the memoryview object. Many " "objects take special actions when a view is held on them (for example, a :" @@ -4212,20 +4212,20 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:3926 +#: ../../library/stdtypes.rst:3925 msgid "" "After this method has been called, any further operation on the view raises " "a :class:`ValueError` (except :meth:`release()` itself which can be called " "multiple times)::" msgstr "" -#: ../../library/stdtypes.rst:3937 +#: ../../library/stdtypes.rst:3936 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:3953 +#: ../../library/stdtypes.rst:3952 msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " "``[byte_length//new_itemsize]``, which means that the result view will be " @@ -4234,57 +4234,57 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:3959 +#: ../../library/stdtypes.rst:3958 msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " "'c'). The byte length of the result must be the same as the original length." msgstr "" -#: ../../library/stdtypes.rst:3964 +#: ../../library/stdtypes.rst:3963 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:3987 +#: ../../library/stdtypes.rst:3986 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:4000 +#: ../../library/stdtypes.rst:3999 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4026 +#: ../../library/stdtypes.rst:4025 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4040 +#: ../../library/stdtypes.rst:4039 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4043 +#: ../../library/stdtypes.rst:4042 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4047 +#: ../../library/stdtypes.rst:4046 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4058 +#: ../../library/stdtypes.rst:4057 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " "representation. It is not necessarily equal to ``len(m)``::" msgstr "" -#: ../../library/stdtypes.rst:4077 +#: ../../library/stdtypes.rst:4076 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4094 +#: ../../library/stdtypes.rst:4093 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4098 +#: ../../library/stdtypes.rst:4097 msgid "" "A string containing the format (in :mod:`struct` module style) for each " "element in the view. A memoryview can be created from exporters with " @@ -4292,59 +4292,59 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4103 +#: ../../library/stdtypes.rst:4102 msgid "" "format ``'B'`` is now handled according to the struct module syntax. This " "means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgstr "" -#: ../../library/stdtypes.rst:4109 +#: ../../library/stdtypes.rst:4108 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4122 +#: ../../library/stdtypes.rst:4121 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4127 +#: ../../library/stdtypes.rst:4126 msgid "" "A tuple of integers the length of :attr:`ndim` giving the shape of the " "memory as an N-dimensional array." msgstr "" -#: ../../library/stdtypes.rst:4130 ../../library/stdtypes.rst:4138 +#: ../../library/stdtypes.rst:4129 ../../library/stdtypes.rst:4137 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4135 +#: ../../library/stdtypes.rst:4134 msgid "" "A tuple of integers the length of :attr:`ndim` giving the size in bytes to " "access each element for each dimension of the array." msgstr "" -#: ../../library/stdtypes.rst:4143 +#: ../../library/stdtypes.rst:4142 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4147 +#: ../../library/stdtypes.rst:4146 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4153 +#: ../../library/stdtypes.rst:4152 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4159 +#: ../../library/stdtypes.rst:4158 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4167 +#: ../../library/stdtypes.rst:4166 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4171 +#: ../../library/stdtypes.rst:4170 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -4354,7 +4354,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4178 +#: ../../library/stdtypes.rst:4177 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " @@ -4362,7 +4362,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4183 +#: ../../library/stdtypes.rst:4182 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -4374,18 +4374,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4191 +#: ../../library/stdtypes.rst:4190 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -#: ../../library/stdtypes.rst:4195 +#: ../../library/stdtypes.rst:4194 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4200 +#: ../../library/stdtypes.rst:4199 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -4393,92 +4393,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4206 +#: ../../library/stdtypes.rst:4205 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4208 +#: ../../library/stdtypes.rst:4207 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4209 +#: ../../library/stdtypes.rst:4208 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4210 +#: ../../library/stdtypes.rst:4209 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4212 +#: ../../library/stdtypes.rst:4211 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4217 +#: ../../library/stdtypes.rst:4216 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4221 +#: ../../library/stdtypes.rst:4220 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4225 +#: ../../library/stdtypes.rst:4224 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4229 +#: ../../library/stdtypes.rst:4228 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." msgstr "" -#: ../../library/stdtypes.rst:4235 +#: ../../library/stdtypes.rst:4234 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4239 +#: ../../library/stdtypes.rst:4238 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4245 +#: ../../library/stdtypes.rst:4244 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4249 +#: ../../library/stdtypes.rst:4248 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4255 +#: ../../library/stdtypes.rst:4254 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4260 +#: ../../library/stdtypes.rst:4259 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4265 +#: ../../library/stdtypes.rst:4264 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4270 +#: ../../library/stdtypes.rst:4269 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4274 +#: ../../library/stdtypes.rst:4273 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4277 +#: ../../library/stdtypes.rst:4276 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -4488,7 +4488,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4284 +#: ../../library/stdtypes.rst:4283 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -4498,14 +4498,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4291 +#: ../../library/stdtypes.rst:4290 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " "returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." msgstr "" -#: ../../library/stdtypes.rst:4295 +#: ../../library/stdtypes.rst:4294 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -4513,71 +4513,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4300 +#: ../../library/stdtypes.rst:4299 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." msgstr "" -#: ../../library/stdtypes.rst:4303 +#: ../../library/stdtypes.rst:4302 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4305 +#: ../../library/stdtypes.rst:4304 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -#: ../../library/stdtypes.rst:4309 +#: ../../library/stdtypes.rst:4308 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4315 +#: ../../library/stdtypes.rst:4314 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4320 +#: ../../library/stdtypes.rst:4319 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4325 +#: ../../library/stdtypes.rst:4324 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4330 +#: ../../library/stdtypes.rst:4329 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4334 +#: ../../library/stdtypes.rst:4333 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4338 +#: ../../library/stdtypes.rst:4337 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4343 +#: ../../library/stdtypes.rst:4342 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4347 +#: ../../library/stdtypes.rst:4346 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4352 +#: ../../library/stdtypes.rst:4351 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4355 +#: ../../library/stdtypes.rst:4354 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4585,18 +4585,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4360 +#: ../../library/stdtypes.rst:4359 msgid "" "Note, the *elem* argument to the :meth:`__contains__`, :meth:`remove`, and :" "meth:`discard` methods may be a set. To support searching for an equivalent " "frozenset, a temporary one is created from *elem*." msgstr "" -#: ../../library/stdtypes.rst:4368 +#: ../../library/stdtypes.rst:4367 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4378 +#: ../../library/stdtypes.rst:4377 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4605,7 +4605,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4384 +#: ../../library/stdtypes.rst:4383 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4614,33 +4614,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4395 +#: ../../library/stdtypes.rst:4394 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4398 +#: ../../library/stdtypes.rst:4397 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4400 +#: ../../library/stdtypes.rst:4399 msgid "" "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " "4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4402 +#: ../../library/stdtypes.rst:4401 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4403 +#: ../../library/stdtypes.rst:4402 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4406 +#: ../../library/stdtypes.rst:4405 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it is a mapping object, a dictionary is " @@ -4652,7 +4652,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4416 +#: ../../library/stdtypes.rst:4415 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -4660,39 +4660,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:4420 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4433 +#: ../../library/stdtypes.rst:4432 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." msgstr "" -#: ../../library/stdtypes.rst:4437 +#: ../../library/stdtypes.rst:4436 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4442 +#: ../../library/stdtypes.rst:4441 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4446 +#: ../../library/stdtypes.rst:4445 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4450 +#: ../../library/stdtypes.rst:4449 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4455 +#: ../../library/stdtypes.rst:4454 msgid "" "If a subclass of dict defines a method :meth:`__missing__` and *key* is not " "present, the ``d[key]`` operation calls that method with the key *key* as " @@ -4703,51 +4703,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4473 +#: ../../library/stdtypes.rst:4472 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different ``__missing__`` method is used by :class:`collections." "defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:4479 +#: ../../library/stdtypes.rst:4478 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4483 +#: ../../library/stdtypes.rst:4482 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4488 +#: ../../library/stdtypes.rst:4487 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4492 +#: ../../library/stdtypes.rst:4491 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4496 +#: ../../library/stdtypes.rst:4495 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4501 +#: ../../library/stdtypes.rst:4500 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4505 +#: ../../library/stdtypes.rst:4504 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4509 +#: ../../library/stdtypes.rst:4508 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4511 +#: ../../library/stdtypes.rst:4510 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -4756,70 +4756,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4519 +#: ../../library/stdtypes.rst:4518 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " "raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4525 +#: ../../library/stdtypes.rst:4524 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4530 +#: ../../library/stdtypes.rst:4529 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4535 +#: ../../library/stdtypes.rst:4534 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " "*default*. If *default* is not given and *key* is not in the dictionary, a :" "exc:`KeyError` is raised." msgstr "" -#: ../../library/stdtypes.rst:4541 +#: ../../library/stdtypes.rst:4540 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -#: ../../library/stdtypes.rst:4544 +#: ../../library/stdtypes.rst:4543 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " "often used in set algorithms. If the dictionary is empty, calling :meth:" "`popitem` raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4548 +#: ../../library/stdtypes.rst:4547 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4554 +#: ../../library/stdtypes.rst:4553 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4561 +#: ../../library/stdtypes.rst:4560 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." msgstr "" -#: ../../library/stdtypes.rst:4567 +#: ../../library/stdtypes.rst:4566 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4570 +#: ../../library/stdtypes.rst:4569 msgid "" ":meth:`update` accepts either another dictionary object or an iterable of " "key/value pairs (as tuples or other iterables of length two). If keyword " @@ -4827,71 +4827,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4577 +#: ../../library/stdtypes.rst:4576 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4580 +#: ../../library/stdtypes.rst:4579 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" -#: ../../library/stdtypes.rst:4590 +#: ../../library/stdtypes.rst:4589 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4598 +#: ../../library/stdtypes.rst:4597 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4604 +#: ../../library/stdtypes.rst:4603 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " "'>') raise :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:4608 +#: ../../library/stdtypes.rst:4607 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" -#: ../../library/stdtypes.rst:4626 +#: ../../library/stdtypes.rst:4625 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4630 +#: ../../library/stdtypes.rst:4629 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4642 +#: ../../library/stdtypes.rst:4641 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4647 +#: ../../library/stdtypes.rst:4646 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4654 +#: ../../library/stdtypes.rst:4653 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4656 +#: ../../library/stdtypes.rst:4655 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -4899,23 +4899,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4661 +#: ../../library/stdtypes.rst:4660 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4666 +#: ../../library/stdtypes.rst:4665 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4670 +#: ../../library/stdtypes.rst:4669 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4673 +#: ../../library/stdtypes.rst:4672 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -4923,39 +4923,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4678 +#: ../../library/stdtypes.rst:4677 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" -#: ../../library/stdtypes.rst:4681 +#: ../../library/stdtypes.rst:4680 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4686 +#: ../../library/stdtypes.rst:4685 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" -#: ../../library/stdtypes.rst:4691 +#: ../../library/stdtypes.rst:4690 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -#: ../../library/stdtypes.rst:4694 +#: ../../library/stdtypes.rst:4693 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4699 +#: ../../library/stdtypes.rst:4698 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4704 +#: ../../library/stdtypes.rst:4703 msgid "" "Keys views are set-like since their entries are unique and :term:" "`hashable`. If all values are hashable, so that ``(key, value)`` pairs are " @@ -4966,15 +4966,15 @@ msgid "" "``<``, or ``^``)." msgstr "" -#: ../../library/stdtypes.rst:4711 +#: ../../library/stdtypes.rst:4710 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4752 +#: ../../library/stdtypes.rst:4751 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4759 +#: ../../library/stdtypes.rst:4758 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -4982,7 +4982,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4767 +#: ../../library/stdtypes.rst:4766 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -4990,14 +4990,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4772 +#: ../../library/stdtypes.rst:4771 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" "`open` to be used as the context expression in a :keyword:`with` statement." msgstr "" -#: ../../library/stdtypes.rst:4776 +#: ../../library/stdtypes.rst:4775 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -5007,7 +5007,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4786 +#: ../../library/stdtypes.rst:4785 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -5016,7 +5016,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4791 +#: ../../library/stdtypes.rst:4790 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -5027,7 +5027,7 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4798 +#: ../../library/stdtypes.rst:4797 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -5036,7 +5036,7 @@ msgid "" "method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4804 +#: ../../library/stdtypes.rst:4803 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -5045,7 +5045,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4810 +#: ../../library/stdtypes.rst:4809 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -5055,7 +5055,7 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4817 +#: ../../library/stdtypes.rst:4816 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -5064,23 +5064,23 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4825 +#: ../../library/stdtypes.rst:4824 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" msgstr "" -#: ../../library/stdtypes.rst:4830 +#: ../../library/stdtypes.rst:4829 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." msgstr "" -#: ../../library/stdtypes.rst:4837 +#: ../../library/stdtypes.rst:4836 msgid "Generic Alias Type" msgstr "" -#: ../../library/stdtypes.rst:4843 +#: ../../library/stdtypes.rst:4842 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -5090,19 +5090,19 @@ msgid "" "are intended primarily for use with :term:`type annotations `." msgstr "" -#: ../../library/stdtypes.rst:4853 +#: ../../library/stdtypes.rst:4852 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:4856 +#: ../../library/stdtypes.rst:4855 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." msgstr "" -#: ../../library/stdtypes.rst:4859 +#: ../../library/stdtypes.rst:4858 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -5111,7 +5111,7 @@ msgid "" "`bytes`." msgstr "" -#: ../../library/stdtypes.rst:4865 +#: ../../library/stdtypes.rst:4864 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -5120,7 +5120,7 @@ msgid "" "the :class:`str` data type and the :class:`bytes` data type:" msgstr "" -#: ../../library/stdtypes.rst:4871 +#: ../../library/stdtypes.rst:4870 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -5128,7 +5128,7 @@ msgid "" "annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" -#: ../../library/stdtypes.rst:4877 +#: ../../library/stdtypes.rst:4876 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -5137,21 +5137,21 @@ msgid "" "objects>` objects with ``re.Match[bytes]``." msgstr "" -#: ../../library/stdtypes.rst:4883 +#: ../../library/stdtypes.rst:4882 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " "directly." msgstr "" -#: ../../library/stdtypes.rst:4889 +#: ../../library/stdtypes.rst:4888 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " "expecting a :class:`list` containing :class:`float` elements::" msgstr "" -#: ../../library/stdtypes.rst:4897 +#: ../../library/stdtypes.rst:4896 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " @@ -5159,13 +5159,13 @@ msgid "" "of type :class:`str` and values of type :class:`int`::" msgstr "" -#: ../../library/stdtypes.rst:4905 +#: ../../library/stdtypes.rst:4904 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" msgstr "" -#: ../../library/stdtypes.rst:4913 +#: ../../library/stdtypes.rst:4912 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -5174,331 +5174,331 @@ msgid "" "discouraged, but will run without errors::" msgstr "" -#: ../../library/stdtypes.rst:4923 +#: ../../library/stdtypes.rst:4922 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "" -#: ../../library/stdtypes.rst:4934 +#: ../../library/stdtypes.rst:4933 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -#: ../../library/stdtypes.rst:4942 +#: ../../library/stdtypes.rst:4941 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -#: ../../library/stdtypes.rst:4950 +#: ../../library/stdtypes.rst:4949 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " "items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" msgstr "" -#: ../../library/stdtypes.rst:4961 +#: ../../library/stdtypes.rst:4960 msgid "Standard Generic Classes" msgstr "" -#: ../../library/stdtypes.rst:4963 +#: ../../library/stdtypes.rst:4962 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4965 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:4967 +#: ../../library/stdtypes.rst:4966 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:4967 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:4968 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:4970 +#: ../../library/stdtypes.rst:4969 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4970 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:4971 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:4973 +#: ../../library/stdtypes.rst:4972 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4973 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:4974 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4975 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:4976 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:4978 +#: ../../library/stdtypes.rst:4977 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4978 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:4980 +#: ../../library/stdtypes.rst:4979 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:4980 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:4981 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:4982 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:4984 +#: ../../library/stdtypes.rst:4983 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:4985 +#: ../../library/stdtypes.rst:4984 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:4986 +#: ../../library/stdtypes.rst:4985 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4986 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:4988 +#: ../../library/stdtypes.rst:4987 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:4988 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:4990 +#: ../../library/stdtypes.rst:4989 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:4990 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:4992 +#: ../../library/stdtypes.rst:4991 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:4992 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:4994 +#: ../../library/stdtypes.rst:4993 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:4994 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:4995 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:4996 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:4998 +#: ../../library/stdtypes.rst:4997 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:4999 +#: ../../library/stdtypes.rst:4998 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5000 +#: ../../library/stdtypes.rst:4999 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5001 +#: ../../library/stdtypes.rst:5000 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:5001 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5003 +#: ../../library/stdtypes.rst:5002 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5004 +#: ../../library/stdtypes.rst:5003 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5005 +#: ../../library/stdtypes.rst:5004 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5006 +#: ../../library/stdtypes.rst:5005 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5007 +#: ../../library/stdtypes.rst:5006 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5008 +#: ../../library/stdtypes.rst:5007 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5009 +#: ../../library/stdtypes.rst:5008 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5009 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5010 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5012 +#: ../../library/stdtypes.rst:5011 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5012 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5014 +#: ../../library/stdtypes.rst:5013 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5015 +#: ../../library/stdtypes.rst:5014 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5015 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5017 +#: ../../library/stdtypes.rst:5016 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5018 +#: ../../library/stdtypes.rst:5017 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5019 +#: ../../library/stdtypes.rst:5018 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5024 +#: ../../library/stdtypes.rst:5023 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "" -#: ../../library/stdtypes.rst:5026 +#: ../../library/stdtypes.rst:5025 msgid "All parameterized generics implement special read-only attributes." msgstr "" -#: ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:5029 msgid "This attribute points at the non-parameterized generic class::" msgstr "" -#: ../../library/stdtypes.rst:5038 +#: ../../library/stdtypes.rst:5037 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " "class::" msgstr "" -#: ../../library/stdtypes.rst:5048 +#: ../../library/stdtypes.rst:5047 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -#: ../../library/stdtypes.rst:5059 +#: ../../library/stdtypes.rst:5058 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." "ParamSpec` is intended primarily for static type checking." msgstr "" -#: ../../library/stdtypes.rst:5066 +#: ../../library/stdtypes.rst:5065 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." msgstr "" -#: ../../library/stdtypes.rst:5075 +#: ../../library/stdtypes.rst:5074 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../library/stdtypes.rst:5075 +#: ../../library/stdtypes.rst:5074 msgid "Introducing Python's framework for type annotations." msgstr "" -#: ../../library/stdtypes.rst:5080 +#: ../../library/stdtypes.rst:5079 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/stdtypes.rst:5078 +#: ../../library/stdtypes.rst:5077 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." "__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:5083 +#: ../../library/stdtypes.rst:5082 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" msgstr "" -#: ../../library/stdtypes.rst:5083 +#: ../../library/stdtypes.rst:5082 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../library/stdtypes.rst:5092 +#: ../../library/stdtypes.rst:5091 msgid "Union Type" msgstr "" -#: ../../library/stdtypes.rst:5098 +#: ../../library/stdtypes.rst:5097 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -5507,7 +5507,7 @@ msgid "" "Union`." msgstr "" -#: ../../library/stdtypes.rst:5105 +#: ../../library/stdtypes.rst:5104 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -5515,76 +5515,76 @@ msgid "" "class:`float`::" msgstr "" -#: ../../library/stdtypes.rst:5115 +#: ../../library/stdtypes.rst:5114 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5117 +#: ../../library/stdtypes.rst:5116 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5121 +#: ../../library/stdtypes.rst:5120 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5125 +#: ../../library/stdtypes.rst:5124 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5129 +#: ../../library/stdtypes.rst:5128 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5133 +#: ../../library/stdtypes.rst:5132 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5140 +#: ../../library/stdtypes.rst:5139 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5146 +#: ../../library/stdtypes.rst:5145 msgid "" "However, union objects containing :ref:`parameterized generics ` cannot be used::" msgstr "" -#: ../../library/stdtypes.rst:5154 +#: ../../library/stdtypes.rst:5153 msgid "" "The user-exposed type for the union object can be accessed from :data:`types." "UnionType` and used for :func:`isinstance` checks. An object cannot be " "instantiated from the type::" msgstr "" -#: ../../library/stdtypes.rst:5167 +#: ../../library/stdtypes.rst:5166 msgid "" "The :meth:`__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`__or__`, the Union may override " "it::" msgstr "" -#: ../../library/stdtypes.rst:5185 +#: ../../library/stdtypes.rst:5184 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5193 +#: ../../library/stdtypes.rst:5192 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5195 +#: ../../library/stdtypes.rst:5194 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5202 +#: ../../library/stdtypes.rst:5201 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5204 +#: ../../library/stdtypes.rst:5203 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -5595,7 +5595,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5211 +#: ../../library/stdtypes.rst:5210 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5606,32 +5606,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5219 +#: ../../library/stdtypes.rst:5218 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5227 +#: ../../library/stdtypes.rst:5226 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5229 +#: ../../library/stdtypes.rst:5228 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5235 +#: ../../library/stdtypes.rst:5234 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5237 +#: ../../library/stdtypes.rst:5236 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:5240 +#: ../../library/stdtypes.rst:5239 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5639,15 +5639,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5244 +#: ../../library/stdtypes.rst:5243 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`\\ 。" -#: ../../library/stdtypes.rst:5250 +#: ../../library/stdtypes.rst:5249 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5254 +#: ../../library/stdtypes.rst:5253 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: built-in methods (such as :meth:`append` on lists) and " @@ -5655,7 +5655,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:5259 +#: ../../library/stdtypes.rst:5258 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :dfn:" @@ -5667,7 +5667,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5268 +#: ../../library/stdtypes.rst:5267 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5677,15 +5677,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5288 ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5287 ../../library/stdtypes.rst:5318 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`\\ 。" -#: ../../library/stdtypes.rst:5296 +#: ../../library/stdtypes.rst:5295 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5302 +#: ../../library/stdtypes.rst:5301 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5695,23 +5695,23 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5309 +#: ../../library/stdtypes.rst:5308 msgid "" "Accessing ``__code__`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"__code__\"``." msgstr "" -#: ../../library/stdtypes.rst:5316 +#: ../../library/stdtypes.rst:5315 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:5325 +#: ../../library/stdtypes.rst:5324 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5331 +#: ../../library/stdtypes.rst:5330 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -5719,30 +5719,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5336 +#: ../../library/stdtypes.rst:5335 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5342 +#: ../../library/stdtypes.rst:5341 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5344 +#: ../../library/stdtypes.rst:5343 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:5348 +#: ../../library/stdtypes.rst:5347 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5355 +#: ../../library/stdtypes.rst:5354 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5357 +#: ../../library/stdtypes.rst:5356 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5750,15 +5750,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5362 +#: ../../library/stdtypes.rst:5361 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5368 +#: ../../library/stdtypes.rst:5367 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5370 +#: ../../library/stdtypes.rst:5369 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -5766,15 +5766,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5375 +#: ../../library/stdtypes.rst:5374 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5381 +#: ../../library/stdtypes.rst:5380 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5383 +#: ../../library/stdtypes.rst:5382 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5785,81 +5785,81 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5396 +#: ../../library/stdtypes.rst:5395 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5402 +#: ../../library/stdtypes.rst:5401 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5404 +#: ../../library/stdtypes.rst:5403 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5411 +#: ../../library/stdtypes.rst:5410 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5413 +#: ../../library/stdtypes.rst:5412 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:5420 +#: ../../library/stdtypes.rst:5419 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5426 +#: ../../library/stdtypes.rst:5425 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5431 +#: ../../library/stdtypes.rst:5430 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5436 +#: ../../library/stdtypes.rst:5435 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5442 +#: ../../library/stdtypes.rst:5441 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5450 +#: ../../library/stdtypes.rst:5449 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5456 +#: ../../library/stdtypes.rst:5455 msgid "" "This method can be overridden by a metaclass to customize the method " "resolution order for its instances. It is called at class instantiation, " "and its result is stored in :attr:`~class.__mro__`." msgstr "" -#: ../../library/stdtypes.rst:5463 +#: ../../library/stdtypes.rst:5462 msgid "" "Each class keeps a list of weak references to its immediate subclasses. " "This method returns a list of all those references still alive. The list is " "in definition order. Example::" msgstr "" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5473 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5476 +#: ../../library/stdtypes.rst:5475 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -5867,7 +5867,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5481 +#: ../../library/stdtypes.rst:5480 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -5877,25 +5877,25 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5488 +#: ../../library/stdtypes.rst:5487 msgid "" "Limiting conversion size offers a practical way to avoid `CVE-2020-10735 " "`_." msgstr "" -#: ../../library/stdtypes.rst:5491 +#: ../../library/stdtypes.rst:5490 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " "Underscores and the sign are not counted towards the limit." msgstr "" -#: ../../library/stdtypes.rst:5495 +#: ../../library/stdtypes.rst:5494 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5517 +#: ../../library/stdtypes.rst:5516 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -5903,94 +5903,94 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5522 +#: ../../library/stdtypes.rst:5521 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5537 +#: ../../library/stdtypes.rst:5536 msgid "Affected APIs" msgstr "" -#: ../../library/stdtypes.rst:5539 +#: ../../library/stdtypes.rst:5538 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5542 +#: ../../library/stdtypes.rst:5541 msgid "``int(string)`` with default base 10." msgstr "" -#: ../../library/stdtypes.rst:5543 +#: ../../library/stdtypes.rst:5542 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5543 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5545 +#: ../../library/stdtypes.rst:5544 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5546 +#: ../../library/stdtypes.rst:5545 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5548 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5550 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5552 +#: ../../library/stdtypes.rst:5551 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr "" -#: ../../library/stdtypes.rst:5553 +#: ../../library/stdtypes.rst:5552 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr "" -#: ../../library/stdtypes.rst:5554 +#: ../../library/stdtypes.rst:5553 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5555 +#: ../../library/stdtypes.rst:5554 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5556 +#: ../../library/stdtypes.rst:5555 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5559 +#: ../../library/stdtypes.rst:5558 msgid "Configuring the limit" msgstr "" -#: ../../library/stdtypes.rst:5561 +#: ../../library/stdtypes.rst:5560 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" msgstr "" -#: ../../library/stdtypes.rst:5564 +#: ../../library/stdtypes.rst:5563 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " "the limitation." msgstr "" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5566 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" msgstr "" -#: ../../library/stdtypes.rst:5569 +#: ../../library/stdtypes.rst:5568 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -5999,38 +5999,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5575 +#: ../../library/stdtypes.rst:5574 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5578 +#: ../../library/stdtypes.rst:5577 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " "their own limit." msgstr "" -#: ../../library/stdtypes.rst:5582 +#: ../../library/stdtypes.rst:5581 msgid "" "Information about the default and minimum can be found in :attr:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5584 +#: ../../library/stdtypes.rst:5583 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5586 +#: ../../library/stdtypes.rst:5585 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5592 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -6042,7 +6042,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5602 +#: ../../library/stdtypes.rst:5601 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -6050,11 +6050,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5608 +#: ../../library/stdtypes.rst:5607 msgid "Recommended configuration" msgstr "" -#: ../../library/stdtypes.rst:5610 +#: ../../library/stdtypes.rst:5609 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -6062,45 +6062,45 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.11." msgstr "" -#: ../../library/stdtypes.rst:5615 +#: ../../library/stdtypes.rst:5614 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:5627 +#: ../../library/stdtypes.rst:5626 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5631 +#: ../../library/stdtypes.rst:5630 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5632 +#: ../../library/stdtypes.rst:5631 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5635 +#: ../../library/stdtypes.rst:5634 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5638 +#: ../../library/stdtypes.rst:5637 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5640 +#: ../../library/stdtypes.rst:5639 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:5643 +#: ../../library/stdtypes.rst:5642 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." From dd62bba7a3ef7ed1bdfe4b6648968bead058bf90 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 22 Mar 2023 00:31:29 +0000 Subject: [PATCH 051/130] sync with cpython 1eb9b249 --- library/os.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/os.po b/library/os.po index e1cade5078..0ca9e7d4f0 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-04 00:32+0000\n" +"POT-Creation-Date: 2023-03-22 00:29+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4018,8 +4018,8 @@ msgstr "" #: ../../library/os.rst:3735 msgid "" -"The standard way to exit is ``sys.exit(n)``. :func:`_exit` should normally " -"only be used in the child process after a :func:`fork`." +"The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " +"should normally only be used in the child process after a :func:`fork`." msgstr "" #: ../../library/os.rst:3738 From f05f3a82b4f2a7476e00b11b97cd086fb72caaab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 23 Mar 2023 00:33:28 +0000 Subject: [PATCH 052/130] sync with cpython f79cfb66 --- c-api/object.po | 71 +++++--- library/asyncio-task.po | 360 +++++++++++++++++++------------------ library/sqlite3.po | 13 +- whatsnew/3.11.po | 381 ++++++++++++++++++++-------------------- 4 files changed, 421 insertions(+), 404 deletions(-) diff --git a/c-api/object.po b/c-api/object.po index bedeef6ab1..1012cee1e2 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:32+0000\n" +"POT-Creation-Date: 2023-03-23 00:31+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -193,7 +193,20 @@ msgid "" "will always return ``1`` for :const:`Py_EQ` and ``0`` for :const:`Py_NE`." msgstr "" -#: ../../c-api/object.rst:186 +#: ../../c-api/object.rst:184 +msgid "" +"Format *obj* using *format_spec*. This is equivalent to the Python " +"expression ``format(obj, format_spec)``." +msgstr "" + +#: ../../c-api/object.rst:187 +msgid "" +"*format_spec* may be ``NULL``. In this case the call is equivalent to " +"``format(obj)``. Returns the formatted string on success, ``NULL`` on " +"failure." +msgstr "" + +#: ../../c-api/object.rst:195 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -201,13 +214,13 @@ msgid "" "function." msgstr "" -#: ../../c-api/object.rst:190 ../../c-api/object.rst:214 +#: ../../c-api/object.rst:199 ../../c-api/object.rst:223 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." msgstr "" -#: ../../c-api/object.rst:198 +#: ../../c-api/object.rst:207 msgid "" "As :c:func:`PyObject_Repr`, compute a string representation of object *o*, " "but escape the non-ASCII characters in the string returned by :c:func:" @@ -216,7 +229,7 @@ msgid "" "Called by the :func:`ascii` built-in function." msgstr "" -#: ../../c-api/object.rst:209 +#: ../../c-api/object.rst:218 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -224,7 +237,7 @@ msgid "" "function and, therefore, by the :func:`print` function." msgstr "" -#: ../../c-api/object.rst:223 +#: ../../c-api/object.rst:232 msgid "" "Compute a bytes representation of object *o*. ``NULL`` is returned on " "failure and a bytes object on success. This is equivalent to the Python " @@ -233,20 +246,20 @@ msgid "" "bytes object." msgstr "" -#: ../../c-api/object.rst:232 +#: ../../c-api/object.rst:241 msgid "" "Return ``1`` if the class *derived* is identical to or derived from the " "class *cls*, otherwise return ``0``. In case of an error, return ``-1``." msgstr "" -#: ../../c-api/object.rst:235 ../../c-api/object.rst:254 +#: ../../c-api/object.rst:244 ../../c-api/object.rst:263 msgid "" "If *cls* is a tuple, the check will be done against every entry in *cls*. " "The result will be ``1`` when at least one of the checks returns ``1``, " "otherwise it will be ``0``." msgstr "" -#: ../../c-api/object.rst:239 +#: ../../c-api/object.rst:248 msgid "" "If *cls* has a :meth:`~class.__subclasscheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " @@ -254,52 +267,52 @@ msgid "" "e. contained in ``cls.__mro__``." msgstr "" -#: ../../c-api/object.rst:244 +#: ../../c-api/object.rst:253 msgid "" "Normally only class objects, i.e. instances of :class:`type` or a derived " "class, are considered classes. However, objects can override this by having " "a :attr:`__bases__` attribute (which must be a tuple of base classes)." msgstr "" -#: ../../c-api/object.rst:251 +#: ../../c-api/object.rst:260 msgid "" "Return ``1`` if *inst* is an instance of the class *cls* or a subclass of " "*cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception." msgstr "" -#: ../../c-api/object.rst:258 +#: ../../c-api/object.rst:267 msgid "" "If *cls* has a :meth:`~class.__instancecheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " "*inst* is an instance of *cls* if its class is a subclass of *cls*." msgstr "" -#: ../../c-api/object.rst:262 +#: ../../c-api/object.rst:271 msgid "" "An instance *inst* can override what is considered its class by having a :" "attr:`__class__` attribute." msgstr "" -#: ../../c-api/object.rst:265 +#: ../../c-api/object.rst:274 msgid "" "An object *cls* can override if it is considered a class, and what its base " "classes are, by having a :attr:`__bases__` attribute (which must be a tuple " "of base classes)." msgstr "" -#: ../../c-api/object.rst:274 +#: ../../c-api/object.rst:283 msgid "" "Compute and return the hash value of an object *o*. On failure, return " "``-1``. This is the equivalent of the Python expression ``hash(o)``." msgstr "" -#: ../../c-api/object.rst:277 +#: ../../c-api/object.rst:286 msgid "" "The return type is now Py_hash_t. This is a signed integer the same size " "as :c:type:`Py_ssize_t`." msgstr "" -#: ../../c-api/object.rst:284 +#: ../../c-api/object.rst:293 msgid "" "Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` " "and return ``-1``. This function receives special treatment when stored in a " @@ -307,21 +320,21 @@ msgid "" "that it is not hashable." msgstr "" -#: ../../c-api/object.rst:292 +#: ../../c-api/object.rst:301 msgid "" "Returns ``1`` if the object *o* is considered to be true, and ``0`` " "otherwise. This is equivalent to the Python expression ``not not o``. On " "failure, return ``-1``." msgstr "" -#: ../../c-api/object.rst:299 +#: ../../c-api/object.rst:308 msgid "" "Returns ``0`` if the object *o* is considered to be true, and ``1`` " "otherwise. This is equivalent to the Python expression ``not o``. On " "failure, return ``-1``." msgstr "" -#: ../../c-api/object.rst:308 +#: ../../c-api/object.rst:317 msgid "" "When *o* is non-``NULL``, returns a type object corresponding to the object " "type of object *o*. On failure, raises :exc:`SystemError` and returns " @@ -332,13 +345,13 @@ msgid "" "incremented reference count is needed." msgstr "" -#: ../../c-api/object.rst:319 +#: ../../c-api/object.rst:328 msgid "" "Return non-zero if the object *o* is of type *type* or a subtype of *type*, " "and ``0`` otherwise. Both parameters must be non-``NULL``." msgstr "" -#: ../../c-api/object.rst:328 +#: ../../c-api/object.rst:337 msgid "" "Return the length of object *o*. If the object *o* provides either the " "sequence and mapping protocols, the sequence length is returned. On error, " @@ -346,7 +359,7 @@ msgid "" "``len(o)``." msgstr "" -#: ../../c-api/object.rst:335 +#: ../../c-api/object.rst:344 msgid "" "Return an estimated length for the object *o*. First try to return its " "actual length, then an estimate using :meth:`~object.__length_hint__`, and " @@ -355,26 +368,26 @@ msgid "" "defaultvalue)``." msgstr "" -#: ../../c-api/object.rst:345 +#: ../../c-api/object.rst:354 msgid "" "Return element of *o* corresponding to the object *key* or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o[key]``." msgstr "" -#: ../../c-api/object.rst:351 +#: ../../c-api/object.rst:360 msgid "" "Map the object *key* to the value *v*. Raise an exception and return ``-1`` " "on failure; return ``0`` on success. This is the equivalent of the Python " "statement ``o[key] = v``. This function *does not* steal a reference to *v*." msgstr "" -#: ../../c-api/object.rst:359 +#: ../../c-api/object.rst:368 msgid "" "Remove the mapping for the object *key* from the object *o*. Return ``-1`` " "on failure. This is equivalent to the Python statement ``del o[key]``." msgstr "" -#: ../../c-api/object.rst:365 +#: ../../c-api/object.rst:374 msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " @@ -384,7 +397,7 @@ msgid "" "`PyErr_Occurred` will return false." msgstr "" -#: ../../c-api/object.rst:374 +#: ../../c-api/object.rst:383 msgid "" "This is equivalent to the Python expression ``iter(o)``. It returns a new " "iterator for the object argument, or the object itself if the object is " @@ -392,7 +405,7 @@ msgid "" "object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:382 +#: ../../c-api/object.rst:391 msgid "" "This is the equivalent to the Python expression ``aiter(o)``. Takes an :" "class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " diff --git a/library/asyncio-task.po b/library/asyncio-task.po index fcb5f09b4f..fa44854a4f 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-15 00:32+0000\n" +"POT-Creation-Date: 2023-03-23 00:31+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -241,7 +241,7 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1006 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1010 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" @@ -263,53 +263,56 @@ msgstr "" msgid "" "It is recommended that coroutines use ``try/finally`` blocks to robustly " "perform clean-up logic. In case :exc:`asyncio.CancelledError` is explicitly " -"caught, it should generally be propagated when clean-up is complete. Most " -"code can safely ignore :exc:`asyncio.CancelledError`." +"caught, it should generally be propagated when clean-up is complete. :exc:" +"`asyncio.CancelledError` directly subclasses :exc:`BaseException` so most " +"code will not need to be aware of it." msgstr "" -#: ../../library/asyncio-task.rst:305 +#: ../../library/asyncio-task.rst:306 msgid "" "The asyncio components that enable structured concurrency, like :class:" "`asyncio.TaskGroup` and :func:`asyncio.timeout`, are implemented using " "cancellation internally and might misbehave if a coroutine swallows :exc:" -"`asyncio.CancelledError`. Similarly, user code should not call :meth:" -"`uncancel `." +"`asyncio.CancelledError`. Similarly, user code should not generally call :" +"meth:`uncancel `. However, in cases when suppressing :" +"exc:`asyncio.CancelledError` is truly desired, it is necessary to also call " +"``uncancel()`` to completely remove the cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:314 +#: ../../library/asyncio-task.rst:318 msgid "Task Groups" msgstr "" -#: ../../library/asyncio-task.rst:316 +#: ../../library/asyncio-task.rst:320 msgid "" "Task groups combine a task creation API with a convenient and reliable way " "to wait for all tasks in the group to finish." msgstr "" -#: ../../library/asyncio-task.rst:321 +#: ../../library/asyncio-task.rst:325 msgid "" "An :ref:`asynchronous context manager ` holding a " "group of tasks. Tasks can be added to the group using :meth:`create_task`. " "All tasks are awaited when the context manager exits." msgstr "" -#: ../../library/asyncio-task.rst:330 +#: ../../library/asyncio-task.rst:334 msgid "" "Create a task in this task group. The signature matches that of :func:" "`asyncio.create_task`." msgstr "" -#: ../../library/asyncio-task.rst:333 ../../library/asyncio-task.rst:463 -#: ../../library/asyncio-task.rst:591 ../../library/asyncio-task.rst:655 -#: ../../library/asyncio-task.rst:681 ../../library/asyncio-task.rst:724 -#: ../../library/asyncio-task.rst:817 +#: ../../library/asyncio-task.rst:337 ../../library/asyncio-task.rst:467 +#: ../../library/asyncio-task.rst:595 ../../library/asyncio-task.rst:659 +#: ../../library/asyncio-task.rst:685 ../../library/asyncio-task.rst:728 +#: ../../library/asyncio-task.rst:821 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/asyncio-task.rst:341 +#: ../../library/asyncio-task.rst:345 msgid "" "The ``async with`` statement will wait for all tasks in the group to finish. " "While waiting, new tasks may still be added to the group (for example, by " @@ -318,7 +321,7 @@ msgid "" "block is exited, no new tasks may be added to the group." msgstr "" -#: ../../library/asyncio-task.rst:348 +#: ../../library/asyncio-task.rst:352 msgid "" "The first time any of the tasks belonging to the group fails with an " "exception other than :exc:`asyncio.CancelledError`, the remaining tasks in " @@ -330,7 +333,7 @@ msgid "" "bubble out of the containing ``async with`` statement." msgstr "" -#: ../../library/asyncio-task.rst:358 +#: ../../library/asyncio-task.rst:362 msgid "" "Once all tasks have finished, if any tasks have failed with an exception " "other than :exc:`asyncio.CancelledError`, those exceptions are combined in " @@ -338,7 +341,7 @@ msgid "" "their documentation) which is then raised." msgstr "" -#: ../../library/asyncio-task.rst:365 +#: ../../library/asyncio-task.rst:369 msgid "" "Two base exceptions are treated specially: If any task fails with :exc:" "`KeyboardInterrupt` or :exc:`SystemExit`, the task group still cancels the " @@ -347,7 +350,7 @@ msgid "" "`ExceptionGroup` or :exc:`BaseExceptionGroup`." msgstr "" -#: ../../library/asyncio-task.rst:371 +#: ../../library/asyncio-task.rst:375 msgid "" "If the body of the ``async with`` statement exits with an exception (so :" "meth:`~object.__aexit__` is called with an exception set), this is treated " @@ -359,68 +362,68 @@ msgid "" "`KeyboardInterrupt` and :exc:`SystemExit` as in the previous paragraph." msgstr "" -#: ../../library/asyncio-task.rst:385 +#: ../../library/asyncio-task.rst:389 msgid "Sleeping" msgstr "" -#: ../../library/asyncio-task.rst:389 +#: ../../library/asyncio-task.rst:393 msgid "Block for *delay* seconds." msgstr "" -#: ../../library/asyncio-task.rst:391 +#: ../../library/asyncio-task.rst:395 msgid "" "If *result* is provided, it is returned to the caller when the coroutine " "completes." msgstr "" -#: ../../library/asyncio-task.rst:394 +#: ../../library/asyncio-task.rst:398 msgid "" "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" -#: ../../library/asyncio-task.rst:397 +#: ../../library/asyncio-task.rst:401 msgid "" "Setting the delay to 0 provides an optimized path to allow other tasks to " "run. This can be used by long-running functions to avoid blocking the event " "loop for the full duration of the function call." msgstr "" -#: ../../library/asyncio-task.rst:403 +#: ../../library/asyncio-task.rst:407 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "" -#: ../../library/asyncio-task.rst:421 ../../library/asyncio-task.rst:512 -#: ../../library/asyncio-task.rst:566 ../../library/asyncio-task.rst:719 -#: ../../library/asyncio-task.rst:749 ../../library/asyncio-task.rst:801 -#: ../../library/asyncio-task.rst:823 +#: ../../library/asyncio-task.rst:425 ../../library/asyncio-task.rst:516 +#: ../../library/asyncio-task.rst:570 ../../library/asyncio-task.rst:723 +#: ../../library/asyncio-task.rst:753 ../../library/asyncio-task.rst:805 +#: ../../library/asyncio-task.rst:827 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-task.rst:426 +#: ../../library/asyncio-task.rst:430 msgid "Running Tasks Concurrently" msgstr "" -#: ../../library/asyncio-task.rst:430 +#: ../../library/asyncio-task.rst:434 msgid "" "Run :ref:`awaitable objects ` in the *aws* sequence " "*concurrently*." msgstr "" -#: ../../library/asyncio-task.rst:433 +#: ../../library/asyncio-task.rst:437 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task." msgstr "" -#: ../../library/asyncio-task.rst:436 +#: ../../library/asyncio-task.rst:440 msgid "" "If all awaitables are completed successfully, the result is an aggregate " "list of returned values. The order of result values corresponds to the " "order of awaitables in *aws*." msgstr "" -#: ../../library/asyncio-task.rst:440 +#: ../../library/asyncio-task.rst:444 msgid "" "If *return_exceptions* is ``False`` (default), the first raised exception is " "immediately propagated to the task that awaits on ``gather()``. Other " @@ -428,19 +431,19 @@ msgid "" "run." msgstr "" -#: ../../library/asyncio-task.rst:445 +#: ../../library/asyncio-task.rst:449 msgid "" "If *return_exceptions* is ``True``, exceptions are treated the same as " "successful results, and aggregated in the result list." msgstr "" -#: ../../library/asyncio-task.rst:448 +#: ../../library/asyncio-task.rst:452 msgid "" "If ``gather()`` is *cancelled*, all submitted awaitables (that have not " "completed yet) are also *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:451 +#: ../../library/asyncio-task.rst:455 msgid "" "If any Task or Future from the *aws* sequence is *cancelled*, it is treated " "as if it raised :exc:`CancelledError` -- the ``gather()`` call is **not** " @@ -448,13 +451,13 @@ msgid "" "submitted Task/Future to cause other Tasks/Futures to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:458 +#: ../../library/asyncio-task.rst:462 msgid "" "A more modern way to create and run tasks concurrently and wait for their " "completion is :class:`asyncio.TaskGroup`." msgstr "" -#: ../../library/asyncio-task.rst:501 +#: ../../library/asyncio-task.rst:505 msgid "" "If *return_exceptions* is False, cancelling gather() after it has been " "marked done won't cancel any submitted awaitables. For instance, gather can " @@ -463,42 +466,42 @@ msgid "" "the awaitables) from gather won't cancel any other awaitables." msgstr "" -#: ../../library/asyncio-task.rst:508 +#: ../../library/asyncio-task.rst:512 msgid "" "If the *gather* itself is cancelled, the cancellation is propagated " "regardless of *return_exceptions*." msgstr "" -#: ../../library/asyncio-task.rst:515 +#: ../../library/asyncio-task.rst:519 msgid "" "Deprecation warning is emitted if no positional arguments are provided or " "not all positional arguments are Future-like objects and there is no running " "event loop." msgstr "" -#: ../../library/asyncio-task.rst:522 +#: ../../library/asyncio-task.rst:526 msgid "Shielding From Cancellation" msgstr "" -#: ../../library/asyncio-task.rst:526 +#: ../../library/asyncio-task.rst:530 msgid "" "Protect an :ref:`awaitable object ` from being :meth:" "`cancelled `." msgstr "" -#: ../../library/asyncio-task.rst:529 ../../library/asyncio-task.rst:701 +#: ../../library/asyncio-task.rst:533 ../../library/asyncio-task.rst:705 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" -#: ../../library/asyncio-task.rst:531 +#: ../../library/asyncio-task.rst:535 msgid "The statement::" msgstr "" -#: ../../library/asyncio-task.rst:536 +#: ../../library/asyncio-task.rst:540 msgid "is equivalent to::" msgstr "" -#: ../../library/asyncio-task.rst:540 +#: ../../library/asyncio-task.rst:544 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -507,20 +510,20 @@ msgid "" "`CancelledError`." msgstr "" -#: ../../library/asyncio-task.rst:546 +#: ../../library/asyncio-task.rst:550 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." msgstr "" -#: ../../library/asyncio-task.rst:549 +#: ../../library/asyncio-task.rst:553 msgid "" "If it is desired to completely ignore cancellation (not recommended) the " "``shield()`` function should be combined with a try/except clause, as " "follows::" msgstr "" -#: ../../library/asyncio-task.rst:561 +#: ../../library/asyncio-task.rst:565 msgid "" "Save a reference to tasks passed to this function, to avoid a task " "disappearing mid-execution. The event loop only keeps weak references to " @@ -528,36 +531,36 @@ msgid "" "any time, even before it's done." msgstr "" -#: ../../library/asyncio-task.rst:569 +#: ../../library/asyncio-task.rst:573 msgid "" "Deprecation warning is emitted if *aw* is not Future-like object and there " "is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:575 +#: ../../library/asyncio-task.rst:579 msgid "Timeouts" msgstr "" -#: ../../library/asyncio-task.rst:579 +#: ../../library/asyncio-task.rst:583 msgid "" "An :ref:`asynchronous context manager ` that can be " "used to limit the amount of time spent waiting on something." msgstr "" -#: ../../library/asyncio-task.rst:583 +#: ../../library/asyncio-task.rst:587 msgid "" "*delay* can either be ``None``, or a float/int number of seconds to wait. If " "*delay* is ``None``, no time limit will be applied; this can be useful if " "the delay is unknown when the context manager is created." msgstr "" -#: ../../library/asyncio-task.rst:588 +#: ../../library/asyncio-task.rst:592 msgid "" "In either case, the context manager can be rescheduled after creation using :" "meth:`Timeout.reschedule`." msgstr "" -#: ../../library/asyncio-task.rst:597 +#: ../../library/asyncio-task.rst:601 msgid "" "If ``long_running_task`` takes more than 10 seconds to complete, the context " "manager will cancel the current task and handle the resulting :exc:`asyncio." @@ -565,7 +568,7 @@ msgid "" "TimeoutError` which can be caught and handled." msgstr "" -#: ../../library/asyncio-task.rst:604 +#: ../../library/asyncio-task.rst:608 msgid "" "The :func:`asyncio.timeout` context manager is what transforms the :exc:" "`asyncio.CancelledError` into an :exc:`asyncio.TimeoutError`, which means " @@ -573,198 +576,198 @@ msgid "" "manager." msgstr "" -#: ../../library/asyncio-task.rst:609 +#: ../../library/asyncio-task.rst:613 msgid "Example of catching :exc:`asyncio.TimeoutError`::" msgstr "" -#: ../../library/asyncio-task.rst:620 +#: ../../library/asyncio-task.rst:624 msgid "" "The context manager produced by :func:`asyncio.timeout` can be rescheduled " "to a different deadline and inspected." msgstr "" -#: ../../library/asyncio-task.rst:625 +#: ../../library/asyncio-task.rst:629 msgid "" "An :ref:`asynchronous context manager ` that limits " "time spent inside of it." msgstr "" -#: ../../library/asyncio-task.rst:632 +#: ../../library/asyncio-task.rst:636 msgid "" "Return the current deadline, or ``None`` if the current deadline is not set." msgstr "" -#: ../../library/asyncio-task.rst:635 +#: ../../library/asyncio-task.rst:639 msgid "" "The deadline is a float, consistent with the time returned by :meth:`loop." "time`." msgstr "" -#: ../../library/asyncio-task.rst:640 +#: ../../library/asyncio-task.rst:644 msgid "Change the time the timeout will trigger." msgstr "" -#: ../../library/asyncio-task.rst:642 +#: ../../library/asyncio-task.rst:646 msgid "" "If *when* is ``None``, any current deadline will be removed, and the context " "manager will wait indefinitely." msgstr "" -#: ../../library/asyncio-task.rst:645 +#: ../../library/asyncio-task.rst:649 msgid "If *when* is a float, it is set as the new deadline." msgstr "" -#: ../../library/asyncio-task.rst:647 +#: ../../library/asyncio-task.rst:651 msgid "" "if *when* is in the past, the timeout will trigger on the next iteration of " "the event loop." msgstr "" -#: ../../library/asyncio-task.rst:652 +#: ../../library/asyncio-task.rst:656 msgid "Return whether the context manager has exceeded its deadline (expired)." msgstr "" -#: ../../library/asyncio-task.rst:672 +#: ../../library/asyncio-task.rst:676 msgid "Timeout context managers can be safely nested." msgstr "" -#: ../../library/asyncio-task.rst:678 +#: ../../library/asyncio-task.rst:682 msgid "" "Similar to :func:`asyncio.timeout`, except *when* is the absolute time to " "stop waiting, or ``None``." msgstr "" -#: ../../library/asyncio-task.rst:698 +#: ../../library/asyncio-task.rst:702 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." msgstr "" -#: ../../library/asyncio-task.rst:703 +#: ../../library/asyncio-task.rst:707 msgid "" "*timeout* can either be ``None`` or a float or int number of seconds to wait " "for. If *timeout* is ``None``, block until the future completes." msgstr "" -#: ../../library/asyncio-task.rst:707 +#: ../../library/asyncio-task.rst:711 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`." msgstr "" -#: ../../library/asyncio-task.rst:710 +#: ../../library/asyncio-task.rst:714 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." msgstr "" -#: ../../library/asyncio-task.rst:713 +#: ../../library/asyncio-task.rst:717 msgid "" "The function will wait until the future is actually cancelled, so the total " "wait time may exceed the *timeout*. If an exception happens during " "cancellation, it is propagated." msgstr "" -#: ../../library/asyncio-task.rst:717 +#: ../../library/asyncio-task.rst:721 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:744 +#: ../../library/asyncio-task.rst:748 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`TimeoutError` immediately." msgstr "" -#: ../../library/asyncio-task.rst:754 +#: ../../library/asyncio-task.rst:758 msgid "Waiting Primitives" msgstr "" -#: ../../library/asyncio-task.rst:758 +#: ../../library/asyncio-task.rst:762 msgid "" "Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the " "*aws* iterable concurrently and block until the condition specified by " "*return_when*." msgstr "" -#: ../../library/asyncio-task.rst:762 +#: ../../library/asyncio-task.rst:766 msgid "The *aws* iterable must not be empty." msgstr "" -#: ../../library/asyncio-task.rst:764 +#: ../../library/asyncio-task.rst:768 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: ../../library/asyncio-task.rst:766 +#: ../../library/asyncio-task.rst:770 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-task.rst:770 +#: ../../library/asyncio-task.rst:774 msgid "" "*timeout* (a float or int), if specified, can be used to control the maximum " "number of seconds to wait before returning." msgstr "" -#: ../../library/asyncio-task.rst:773 +#: ../../library/asyncio-task.rst:777 msgid "" "Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks " "that aren't done when the timeout occurs are simply returned in the second " "set." msgstr "" -#: ../../library/asyncio-task.rst:777 +#: ../../library/asyncio-task.rst:781 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/asyncio-task.rst:783 +#: ../../library/asyncio-task.rst:787 msgid "Constant" msgstr "常數" -#: ../../library/asyncio-task.rst:783 +#: ../../library/asyncio-task.rst:787 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:785 +#: ../../library/asyncio-task.rst:789 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/asyncio-task.rst:785 +#: ../../library/asyncio-task.rst:789 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:788 +#: ../../library/asyncio-task.rst:792 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/asyncio-task.rst:788 +#: ../../library/asyncio-task.rst:792 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: ../../library/asyncio-task.rst:794 +#: ../../library/asyncio-task.rst:798 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/asyncio-task.rst:794 +#: ../../library/asyncio-task.rst:798 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:798 +#: ../../library/asyncio-task.rst:802 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:804 +#: ../../library/asyncio-task.rst:808 msgid "Passing coroutine objects to ``wait()`` directly is forbidden." msgstr "" -#: ../../library/asyncio-task.rst:809 +#: ../../library/asyncio-task.rst:813 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently. Return an iterator of coroutines. Each coroutine returned can " @@ -772,26 +775,26 @@ msgid "" "remaining awaitables." msgstr "" -#: ../../library/asyncio-task.rst:814 +#: ../../library/asyncio-task.rst:818 msgid "" "Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." msgstr "" -#: ../../library/asyncio-task.rst:826 +#: ../../library/asyncio-task.rst:830 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:832 +#: ../../library/asyncio-task.rst:836 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:836 +#: ../../library/asyncio-task.rst:840 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:838 +#: ../../library/asyncio-task.rst:842 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -799,19 +802,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:843 +#: ../../library/asyncio-task.rst:847 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:845 +#: ../../library/asyncio-task.rst:849 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were run in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:875 +#: ../../library/asyncio-task.rst:879 msgid "" "Directly calling ``blocking_io()`` in any coroutine would block the event " "loop for its duration, resulting in an additional 1 second of run time. " @@ -819,7 +822,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:882 +#: ../../library/asyncio-task.rst:886 msgid "" "Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used " "to make IO-bound functions non-blocking. However, for extension modules that " @@ -827,81 +830,81 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:891 +#: ../../library/asyncio-task.rst:895 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:895 +#: ../../library/asyncio-task.rst:899 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:897 +#: ../../library/asyncio-task.rst:901 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:900 +#: ../../library/asyncio-task.rst:904 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: ../../library/asyncio-task.rst:912 +#: ../../library/asyncio-task.rst:916 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: ../../library/asyncio-task.rst:926 +#: ../../library/asyncio-task.rst:930 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:929 +#: ../../library/asyncio-task.rst:933 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:936 +#: ../../library/asyncio-task.rst:940 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:941 +#: ../../library/asyncio-task.rst:945 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:944 +#: ../../library/asyncio-task.rst:948 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:952 +#: ../../library/asyncio-task.rst:956 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:955 +#: ../../library/asyncio-task.rst:959 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:962 +#: ../../library/asyncio-task.rst:966 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:966 +#: ../../library/asyncio-task.rst:970 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:969 +#: ../../library/asyncio-task.rst:973 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -909,21 +912,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:975 +#: ../../library/asyncio-task.rst:979 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:980 +#: ../../library/asyncio-task.rst:984 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:985 +#: ../../library/asyncio-task.rst:989 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -931,112 +934,112 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:990 +#: ../../library/asyncio-task.rst:994 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:995 +#: ../../library/asyncio-task.rst:999 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:999 +#: ../../library/asyncio-task.rst:1003 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:1003 +#: ../../library/asyncio-task.rst:1007 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1009 +#: ../../library/asyncio-task.rst:1013 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1015 +#: ../../library/asyncio-task.rst:1019 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1017 +#: ../../library/asyncio-task.rst:1021 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1022 +#: ../../library/asyncio-task.rst:1026 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1024 +#: ../../library/asyncio-task.rst:1028 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:1028 ../../library/asyncio-task.rst:1042 +#: ../../library/asyncio-task.rst:1032 ../../library/asyncio-task.rst:1046 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1031 +#: ../../library/asyncio-task.rst:1035 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1036 +#: ../../library/asyncio-task.rst:1040 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1038 +#: ../../library/asyncio-task.rst:1042 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1045 +#: ../../library/asyncio-task.rst:1049 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1050 +#: ../../library/asyncio-task.rst:1054 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1052 ../../library/asyncio-task.rst:1061 +#: ../../library/asyncio-task.rst:1056 ../../library/asyncio-task.rst:1065 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1054 +#: ../../library/asyncio-task.rst:1058 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1059 +#: ../../library/asyncio-task.rst:1063 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1063 +#: ../../library/asyncio-task.rst:1067 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1068 +#: ../../library/asyncio-task.rst:1072 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1070 +#: ../../library/asyncio-task.rst:1074 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1044,15 +1047,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1076 +#: ../../library/asyncio-task.rst:1080 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1078 +#: ../../library/asyncio-task.rst:1082 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1080 +#: ../../library/asyncio-task.rst:1084 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1061,115 +1064,117 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1089 +#: ../../library/asyncio-task.rst:1093 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1091 +#: ../../library/asyncio-task.rst:1095 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1094 +#: ../../library/asyncio-task.rst:1098 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1096 +#: ../../library/asyncio-task.rst:1100 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" -#: ../../library/asyncio-task.rst:1101 +#: ../../library/asyncio-task.rst:1105 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1107 +#: ../../library/asyncio-task.rst:1111 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1109 +#: ../../library/asyncio-task.rst:1113 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:1117 +#: ../../library/asyncio-task.rst:1121 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1119 +#: ../../library/asyncio-task.rst:1123 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1122 +#: ../../library/asyncio-task.rst:1126 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1129 +#: ../../library/asyncio-task.rst:1133 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1131 +#: ../../library/asyncio-task.rst:1135 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1134 +#: ../../library/asyncio-task.rst:1138 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " "CancelledError`` ... :keyword:`finally` block. Therefore, unlike :meth:" "`Future.cancel`, :meth:`Task.cancel` does not guarantee that the Task will " "be cancelled, although suppressing cancellation completely is not common and " -"is actively discouraged." +"is actively discouraged. Should the coroutine nevertheless decide to " +"suppress the cancellation, it needs to call :meth:`Task.uncancel` in " +"addition to catching the exception." msgstr "" -#: ../../library/asyncio-task.rst:1142 +#: ../../library/asyncio-task.rst:1148 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1145 +#: ../../library/asyncio-task.rst:1151 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1150 +#: ../../library/asyncio-task.rst:1156 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1189 +#: ../../library/asyncio-task.rst:1195 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1191 +#: ../../library/asyncio-task.rst:1197 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:1197 +#: ../../library/asyncio-task.rst:1203 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1199 +#: ../../library/asyncio-task.rst:1205 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1201 +#: ../../library/asyncio-task.rst:1207 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1206 +#: ../../library/asyncio-task.rst:1212 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1178,7 +1183,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1224 +#: ../../library/asyncio-task.rst:1230 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1187,13 +1192,20 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1232 +#: ../../library/asyncio-task.rst:1236 +msgid "" +"If end-user code is, for some reason, suppresing cancellation by catching :" +"exc:`CancelledError`, it needs to call this method to remove the " +"cancellation state." +msgstr "" + +#: ../../library/asyncio-task.rst:1242 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: ../../library/asyncio-task.rst:1236 +#: ../../library/asyncio-task.rst:1246 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1202,7 +1214,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1242 +#: ../../library/asyncio-task.rst:1252 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." diff --git a/library/sqlite3.po b/library/sqlite3.po index b693ae5f09..34d44525d3 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-03 02:28+0000\n" +"POT-Creation-Date: 2023-03-23 00:31+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-" @@ -273,10 +273,10 @@ msgstr "" #: ../../library/sqlite3.rst:272 msgid "" -"How many seconds the connection should wait before raising an exception, if " -"the database is locked by another connection. If another connection opens a " -"transaction to modify the database, it will be locked until that transaction " -"is committed. Default five seconds." +"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 "" #: ../../library/sqlite3.rst:279 @@ -894,7 +894,8 @@ msgstr "" #: ../../library/sqlite3.rst:868 msgid "" "Call this method from a different thread to abort any queries that might be " -"executing on the connection. Aborted queries will raise an exception." +"executing on the connection. Aborted queries will raise an :exc:" +"`OperationalError`." msgstr "" #: ../../library/sqlite3.rst:875 diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 2a3f7ba79a..a2f1d7180e 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-08 00:34+0000\n" +"POT-Creation-Date: 2023-03-23 00:31+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -152,7 +152,7 @@ msgid "" "pep670>`" msgstr "" -#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2207 +#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2199 msgid "New Features" msgstr "" @@ -2359,7 +2359,7 @@ msgid "" "POP_BLOCK`, :opcode:`!SETUP_FINALLY` and :opcode:`!YIELD_FROM`." msgstr "" -#: ../../whatsnew/3.11.rst:1699 ../../whatsnew/3.11.rst:2575 +#: ../../whatsnew/3.11.rst:1699 ../../whatsnew/3.11.rst:2567 msgid "Deprecated" msgstr "" @@ -2704,7 +2704,7 @@ msgstr ":meth:`unittest.TestLoader.getTestCaseNames`" msgid "(Contributed by Erlend E. Aasland in :issue:`5846`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1874 ../../whatsnew/3.11.rst:2603 +#: ../../whatsnew/3.11.rst:1874 ../../whatsnew/3.11.rst:2595 msgid "Pending Removal in Python 3.12" msgstr "" @@ -2970,7 +2970,7 @@ msgstr "" msgid "3.5" msgstr "" -#: ../../whatsnew/3.11.rst:1937 ../../whatsnew/3.11.rst:2629 +#: ../../whatsnew/3.11.rst:1937 ../../whatsnew/3.11.rst:2621 msgid "Removed" msgstr "" @@ -3143,7 +3143,7 @@ msgid "" "main>`_ from the Python source tree." msgstr "" -#: ../../whatsnew/3.11.rst:2043 ../../whatsnew/3.11.rst:2273 +#: ../../whatsnew/3.11.rst:2043 ../../whatsnew/3.11.rst:2265 msgid "Porting to Python 3.11" msgstr "" @@ -3252,47 +3252,38 @@ msgid "" msgstr "" #: ../../whatsnew/3.11.rst:2119 -msgid "Building Python now requires:" +msgid "Building CPython now requires:" msgstr "" #: ../../whatsnew/3.11.rst:2121 msgid "" -"A `C11 `_ compiler. `Optional C11 " -"features `_ compiler and standard library. " +"`Optional C11 features `_ are not required. " -"(Contributed by Victor Stinner in :issue:`46656`.)" +"(Contributed by Victor Stinner in :issue:`46656`, :issue:`45440` and :issue:" +"`46640`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2127 +#: ../../whatsnew/3.11.rst:2128 msgid "" "Support for `IEEE 754 `_ floating " "point numbers. (Contributed by Victor Stinner in :issue:`46917`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2131 +#: ../../whatsnew/3.11.rst:2132 msgid "" -"Support for `floating point Not-a-Number (NaN) `_, as the :c:macro:`!Py_NO_NAN` macro has been " -"removed. (Contributed by Victor Stinner in :issue:`46656`.)" +"The :c:macro:`!Py_NO_NAN` macro has been removed. Since CPython now requires " +"IEEE 754 floats, NaN values are always available. (Contributed by Victor " +"Stinner in :issue:`46656`.)" msgstr "" #: ../../whatsnew/3.11.rst:2136 msgid "" -"A `C99 `_ ```` header file " -"providing the :c:func:`!copysign`, :c:func:`!hypot`, :c:func:`!isfinite`, :c:" -"func:`!isinf`, :c:func:`!isnan`, and :c:func:`!round` functions (contributed " -"by Victor Stinner in :issue:`45440`); and a :c:data:`!NAN` constant or the :" -"c:func:`!__builtin_nan` function (Contributed by Victor Stinner in :issue:" -"`46640`)." -msgstr "" - -#: ../../whatsnew/3.11.rst:2144 -msgid "" "The :mod:`tkinter` package now requires `Tcl/Tk `_ " "version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2148 +#: ../../whatsnew/3.11.rst:2140 msgid "" "Build dependencies, compiler flags, and linker flags for most stdlib " "extension modules are now detected by :program:`configure`. libffi, libnsl, " @@ -3304,13 +3295,13 @@ msgid "" "`45847`, :issue:`45747`, and :issue:`45763`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2158 +#: ../../whatsnew/3.11.rst:2150 msgid "" "libpython is no longer linked against libcrypt. (Contributed by Mike Gilbert " "in :issue:`45433`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2161 +#: ../../whatsnew/3.11.rst:2153 msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " @@ -3318,7 +3309,7 @@ msgid "" "`44340`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2166 +#: ../../whatsnew/3.11.rst:2158 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " "option :option:`!--without-freelists` can be used to disable all freelists " @@ -3326,7 +3317,7 @@ msgid "" "`45522`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2171 +#: ../../whatsnew/3.11.rst:2163 msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " @@ -3335,7 +3326,7 @@ msgid "" "`45570`, :issue:`45571`, and :issue:`43974`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2178 +#: ../../whatsnew/3.11.rst:2170 msgid "" "Use the environment variables :envvar:`!TCLTK_CFLAGS` and :envvar:`!" "TCLTK_LIBS` to manually specify the location of Tcl/Tk headers and " @@ -3343,7 +3334,7 @@ msgid "" "and :option:`!--with-tcltk-libs` have been removed." msgstr "" -#: ../../whatsnew/3.11.rst:2184 +#: ../../whatsnew/3.11.rst:2176 msgid "" "On RHEL 7 and CentOS 7 the development packages do not provide ``tcl.pc`` " "and ``tk.pc``; use ``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``. The " @@ -3351,7 +3342,7 @@ msgid "" "build Python with RHEL 7's and CentOS 7's Tcl/Tk and OpenSSL." msgstr "" -#: ../../whatsnew/3.11.rst:2189 +#: ../../whatsnew/3.11.rst:2181 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 " @@ -3363,23 +3354,23 @@ msgid "" "in :issue:`45569`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2202 +#: ../../whatsnew/3.11.rst:2194 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.11.rst:2209 +#: ../../whatsnew/3.11.rst:2201 msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2212 +#: ../../whatsnew/3.11.rst:2204 msgid "" "Add a new :c:func:`PyType_GetQualName` function to get type's qualified " "name. (Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2215 +#: ../../whatsnew/3.11.rst:2207 msgid "" "Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " @@ -3387,78 +3378,78 @@ msgid "" "`43760`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2220 +#: ../../whatsnew/3.11.rst:2212 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2224 +#: ../../whatsnew/3.11.rst:2216 msgid "" ":c:type:`Py_buffer` and APIs are now part of the limited API and the stable " "ABI:" msgstr "" -#: ../../whatsnew/3.11.rst:2227 +#: ../../whatsnew/3.11.rst:2219 msgid ":c:func:`PyObject_CheckBuffer`" msgstr ":c:func:`PyObject_CheckBuffer`" -#: ../../whatsnew/3.11.rst:2228 +#: ../../whatsnew/3.11.rst:2220 msgid ":c:func:`PyObject_GetBuffer`" msgstr ":c:func:`PyObject_GetBuffer`" -#: ../../whatsnew/3.11.rst:2229 +#: ../../whatsnew/3.11.rst:2221 msgid ":c:func:`PyBuffer_GetPointer`" msgstr ":c:func:`PyBuffer_GetPointer`" -#: ../../whatsnew/3.11.rst:2230 +#: ../../whatsnew/3.11.rst:2222 msgid ":c:func:`PyBuffer_SizeFromFormat`" msgstr ":c:func:`PyBuffer_SizeFromFormat`" -#: ../../whatsnew/3.11.rst:2231 +#: ../../whatsnew/3.11.rst:2223 msgid ":c:func:`PyBuffer_ToContiguous`" msgstr ":c:func:`PyBuffer_ToContiguous`" -#: ../../whatsnew/3.11.rst:2232 +#: ../../whatsnew/3.11.rst:2224 msgid ":c:func:`PyBuffer_FromContiguous`" msgstr ":c:func:`PyBuffer_FromContiguous`" -#: ../../whatsnew/3.11.rst:2233 +#: ../../whatsnew/3.11.rst:2225 msgid ":c:func:`PyBuffer_CopyData`" msgstr ":c:func:`PyBuffer_CopyData`" -#: ../../whatsnew/3.11.rst:2234 +#: ../../whatsnew/3.11.rst:2226 msgid ":c:func:`PyBuffer_IsContiguous`" msgstr ":c:func:`PyBuffer_IsContiguous`" -#: ../../whatsnew/3.11.rst:2235 +#: ../../whatsnew/3.11.rst:2227 msgid ":c:func:`PyBuffer_FillContiguousStrides`" msgstr ":c:func:`PyBuffer_FillContiguousStrides`" -#: ../../whatsnew/3.11.rst:2236 +#: ../../whatsnew/3.11.rst:2228 msgid ":c:func:`PyBuffer_FillInfo`" msgstr ":c:func:`PyBuffer_FillInfo`" -#: ../../whatsnew/3.11.rst:2237 +#: ../../whatsnew/3.11.rst:2229 msgid ":c:func:`PyBuffer_Release`" msgstr ":c:func:`PyBuffer_Release`" -#: ../../whatsnew/3.11.rst:2238 +#: ../../whatsnew/3.11.rst:2230 msgid ":c:func:`PyMemoryView_FromBuffer`" msgstr ":c:func:`PyMemoryView_FromBuffer`" -#: ../../whatsnew/3.11.rst:2239 +#: ../../whatsnew/3.11.rst:2231 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` type slots" msgstr "" -#: ../../whatsnew/3.11.rst:2242 +#: ../../whatsnew/3.11.rst:2234 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2244 +#: ../../whatsnew/3.11.rst:2236 msgid "" "Added the :c:data:`PyType_GetModuleByDef` function, used to get the module " "in which a method was defined, in cases where this information is not " @@ -3466,7 +3457,7 @@ msgid "" "in :issue:`46613`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2249 +#: ../../whatsnew/3.11.rst:2241 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:" @@ -3474,14 +3465,14 @@ msgid "" "`PyFloat_Unpack8`. (Contributed by Victor Stinner in :issue:`46906`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2255 +#: ../../whatsnew/3.11.rst:2247 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`." msgstr "" -#: ../../whatsnew/3.11.rst:2259 +#: ../../whatsnew/3.11.rst:2251 msgid "" "Added two new functions to get and set the active exception instance: :c:" "func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " @@ -3490,13 +3481,13 @@ msgid "" "exceptions. (Contributed by Irit Katriel in :issue:`46343`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2266 +#: ../../whatsnew/3.11.rst:2258 msgid "" "Added the :c:member:`PyConfig.safe_path` member. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2277 +#: ../../whatsnew/3.11.rst:2269 msgid "" "Some macros have been converted to static inline functions to avoid `macro " "pitfalls `_. The " @@ -3508,7 +3499,7 @@ msgid "" "Stinner and Erlend E. Aasland in :gh:`89653`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2288 +#: ../../whatsnew/3.11.rst:2280 msgid "" ":c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback`` " "arguments, the interpreter now derives those values from the exception " @@ -3516,14 +3507,14 @@ msgid "" "all three arguments. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2294 +#: ../../whatsnew/3.11.rst:2286 msgid "" ":c:func:`PyErr_GetExcInfo()` now derives the ``type`` and ``traceback`` " "fields of the result from the exception instance (the ``value`` field). " "(Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2298 +#: ../../whatsnew/3.11.rst:2290 msgid "" ":c:struct:`_frozen` has a new ``is_package`` field to indicate whether or " "not the frozen module is a package. Previously, a negative value in the " @@ -3531,14 +3522,14 @@ msgid "" "``size``. (Contributed by Kumar Aditya in :issue:`46608`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2304 +#: ../../whatsnew/3.11.rst:2296 msgid "" ":c:func:`_PyFrameEvalFunction` now takes ``_PyInterpreterFrame*`` as its " "second parameter, instead of ``PyFrameObject*``. See :pep:`523` for more " "details of how to use this function pointer type." msgstr "" -#: ../../whatsnew/3.11.rst:2308 +#: ../../whatsnew/3.11.rst:2300 msgid "" ":c:func:`PyCode_New` and :c:func:`PyCode_NewWithPosOnlyArgs` now take an " "additional ``exception_table`` argument. Using these functions should be " @@ -3547,7 +3538,7 @@ msgid "" "method." msgstr "" -#: ../../whatsnew/3.11.rst:2314 +#: ../../whatsnew/3.11.rst:2306 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " "``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" @@ -3557,35 +3548,35 @@ msgid "" "and :gh:`94936`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2322 +#: ../../whatsnew/3.11.rst:2314 msgid "" "The old trashcan macros (``Py_TRASHCAN_SAFE_BEGIN``/" "``Py_TRASHCAN_SAFE_END``) are now deprecated. They should be replaced by the " "new macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.11.rst:2326 +#: ../../whatsnew/3.11.rst:2318 msgid "A tp_dealloc function that has the old macros, such as::" msgstr "" -#: ../../whatsnew/3.11.rst:2337 +#: ../../whatsnew/3.11.rst:2329 msgid "should migrate to the new macros as follows::" msgstr "" -#: ../../whatsnew/3.11.rst:2348 +#: ../../whatsnew/3.11.rst:2340 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in." msgstr "" -#: ../../whatsnew/3.11.rst:2351 +#: ../../whatsnew/3.11.rst:2343 msgid "" "To support older Python versions in the same codebase, you can define the " "following macros and use them throughout the code (credit: these were copied " "from the ``mypy`` codebase)::" msgstr "" -#: ../../whatsnew/3.11.rst:2363 +#: ../../whatsnew/3.11.rst:2355 msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " "with the :const:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function (:" @@ -3593,7 +3584,7 @@ msgid "" "issue:`44263`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2368 +#: ../../whatsnew/3.11.rst:2360 msgid "" "Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " "the :pep:`590` vectorcall protocol. Previously, this was only possible for :" @@ -3601,7 +3592,7 @@ msgid "" "issue:`43908`)" msgstr "" -#: ../../whatsnew/3.11.rst:2373 +#: ../../whatsnew/3.11.rst:2365 msgid "" "Since :c:func:`Py_TYPE()` is changed to a inline static function, " "``Py_TYPE(obj) = new_type`` must be replaced with ``Py_SET_TYPE(obj, " @@ -3609,11 +3600,11 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.11.rst:2385 ../../whatsnew/3.11.rst:2399 +#: ../../whatsnew/3.11.rst:2377 ../../whatsnew/3.11.rst:2391 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2387 +#: ../../whatsnew/3.11.rst:2379 msgid "" "Since :c:func:`Py_SIZE()` is changed to a inline static function, " "``Py_SIZE(obj) = new_size`` must be replaced with ``Py_SET_SIZE(obj, " @@ -3621,7 +3612,7 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.11.rst:2401 +#: ../../whatsnew/3.11.rst:2393 msgid "" "```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " @@ -3630,7 +3621,7 @@ msgid "" "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2407 +#: ../../whatsnew/3.11.rst:2399 msgid "" "The non-limited API files ``cellobject.h``, ``classobject.h``, ``code.h``, " "``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have " @@ -3641,7 +3632,7 @@ msgid "" "instead. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2415 +#: ../../whatsnew/3.11.rst:2407 msgid "" "The :c:func:`PyUnicode_CHECK_INTERNED` macro has been excluded from the " "limited C API. It was never usable there, because it used internal " @@ -3649,149 +3640,149 @@ msgid "" "Victor Stinner in :issue:`46007`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2420 +#: ../../whatsnew/3.11.rst:2412 msgid "" "The following frame functions and type are now directly available with " "``#include ``, it's no longer needed to add ``#include " "``:" msgstr "" -#: ../../whatsnew/3.11.rst:2424 +#: ../../whatsnew/3.11.rst:2416 msgid ":c:func:`PyFrame_Check`" msgstr ":c:func:`PyFrame_Check`" -#: ../../whatsnew/3.11.rst:2425 +#: ../../whatsnew/3.11.rst:2417 msgid ":c:func:`PyFrame_GetBack`" msgstr ":c:func:`PyFrame_GetBack`" -#: ../../whatsnew/3.11.rst:2426 +#: ../../whatsnew/3.11.rst:2418 msgid ":c:func:`PyFrame_GetBuiltins`" msgstr ":c:func:`PyFrame_GetBuiltins`" -#: ../../whatsnew/3.11.rst:2427 +#: ../../whatsnew/3.11.rst:2419 msgid ":c:func:`PyFrame_GetGenerator`" msgstr ":c:func:`PyFrame_GetGenerator`" -#: ../../whatsnew/3.11.rst:2428 +#: ../../whatsnew/3.11.rst:2420 msgid ":c:func:`PyFrame_GetGlobals`" msgstr ":c:func:`PyFrame_GetGlobals`" -#: ../../whatsnew/3.11.rst:2429 +#: ../../whatsnew/3.11.rst:2421 msgid ":c:func:`PyFrame_GetLasti`" msgstr ":c:func:`PyFrame_GetLasti`" -#: ../../whatsnew/3.11.rst:2430 +#: ../../whatsnew/3.11.rst:2422 msgid ":c:func:`PyFrame_GetLocals`" msgstr ":c:func:`PyFrame_GetLocals`" -#: ../../whatsnew/3.11.rst:2431 +#: ../../whatsnew/3.11.rst:2423 msgid ":c:type:`PyFrame_Type`" msgstr ":c:type:`PyFrame_Type`" -#: ../../whatsnew/3.11.rst:2433 +#: ../../whatsnew/3.11.rst:2425 msgid "(Contributed by Victor Stinner in :gh:`93937`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2437 +#: ../../whatsnew/3.11.rst:2429 msgid "" "The :c:type:`PyFrameObject` structure members have been removed from the " "public C API." msgstr "" -#: ../../whatsnew/3.11.rst:2440 +#: ../../whatsnew/3.11.rst:2432 msgid "" "While the documentation notes that the :c:type:`PyFrameObject` fields are " "subject to change at any time, they have been stable for a long time and " "were used in several popular extensions." msgstr "" -#: ../../whatsnew/3.11.rst:2444 +#: ../../whatsnew/3.11.rst:2436 msgid "" "In Python 3.11, the frame struct was reorganized to allow performance " "optimizations. Some fields were removed entirely, as they were details of " "the old implementation." msgstr "" -#: ../../whatsnew/3.11.rst:2448 +#: ../../whatsnew/3.11.rst:2440 msgid ":c:type:`PyFrameObject` fields:" msgstr "" -#: ../../whatsnew/3.11.rst:2450 +#: ../../whatsnew/3.11.rst:2442 msgid "``f_back``: use :c:func:`PyFrame_GetBack`." msgstr "" -#: ../../whatsnew/3.11.rst:2451 +#: ../../whatsnew/3.11.rst:2443 msgid "``f_blockstack``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2452 +#: ../../whatsnew/3.11.rst:2444 msgid "``f_builtins``: use :c:func:`PyFrame_GetBuiltins`." msgstr "" -#: ../../whatsnew/3.11.rst:2453 +#: ../../whatsnew/3.11.rst:2445 msgid "``f_code``: use :c:func:`PyFrame_GetCode`." msgstr "" -#: ../../whatsnew/3.11.rst:2454 +#: ../../whatsnew/3.11.rst:2446 msgid "``f_gen``: use :c:func:`PyFrame_GetGenerator`." msgstr "" -#: ../../whatsnew/3.11.rst:2455 +#: ../../whatsnew/3.11.rst:2447 msgid "``f_globals``: use :c:func:`PyFrame_GetGlobals`." msgstr "" -#: ../../whatsnew/3.11.rst:2456 +#: ../../whatsnew/3.11.rst:2448 msgid "``f_iblock``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2457 +#: ../../whatsnew/3.11.rst:2449 msgid "" "``f_lasti``: use :c:func:`PyFrame_GetLasti`. Code using ``f_lasti`` with " "``PyCode_Addr2Line()`` should use :c:func:`PyFrame_GetLineNumber` instead; " "it may be faster." msgstr "" -#: ../../whatsnew/3.11.rst:2460 +#: ../../whatsnew/3.11.rst:2452 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" msgstr "" -#: ../../whatsnew/3.11.rst:2461 +#: ../../whatsnew/3.11.rst:2453 msgid "``f_locals``: use :c:func:`PyFrame_GetLocals`." msgstr "" -#: ../../whatsnew/3.11.rst:2462 +#: ../../whatsnew/3.11.rst:2454 msgid "``f_stackdepth``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2463 +#: ../../whatsnew/3.11.rst:2455 msgid "``f_state``: no public API (renamed to ``f_frame.f_state``)." msgstr "" -#: ../../whatsnew/3.11.rst:2464 +#: ../../whatsnew/3.11.rst:2456 msgid "``f_trace``: no public API." msgstr "" -#: ../../whatsnew/3.11.rst:2465 +#: ../../whatsnew/3.11.rst:2457 msgid "" "``f_trace_lines``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_lines\")``." msgstr "" -#: ../../whatsnew/3.11.rst:2466 +#: ../../whatsnew/3.11.rst:2458 msgid "" "``f_trace_opcodes``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_opcodes\")``." msgstr "" -#: ../../whatsnew/3.11.rst:2467 +#: ../../whatsnew/3.11.rst:2459 msgid "``f_localsplus``: no public API (renamed to ``f_frame.localsplus``)." msgstr "" -#: ../../whatsnew/3.11.rst:2468 +#: ../../whatsnew/3.11.rst:2460 msgid "``f_valuestack``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2470 +#: ../../whatsnew/3.11.rst:2462 msgid "" "The Python frame object is now created lazily. A side effect is that the " "``f_back`` member must not be accessed directly, since its value is now also " @@ -3799,7 +3790,7 @@ msgid "" "instead." msgstr "" -#: ../../whatsnew/3.11.rst:2475 +#: ../../whatsnew/3.11.rst:2467 msgid "" "Debuggers that accessed the ``f_locals`` directly *must* call :c:func:" "`PyFrame_GetLocals` instead. They no longer need to call :c:func:" @@ -3808,71 +3799,71 @@ msgid "" "now managed by the virtual machine." msgstr "" -#: ../../whatsnew/3.11.rst:2481 +#: ../../whatsnew/3.11.rst:2473 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2491 +#: ../../whatsnew/3.11.rst:2483 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2501 +#: ../../whatsnew/3.11.rst:2493 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." msgstr "" -#: ../../whatsnew/3.11.rst:2505 +#: ../../whatsnew/3.11.rst:2497 msgid "Changes of the :c:type:`PyThreadState` structure members:" msgstr "" -#: ../../whatsnew/3.11.rst:2507 +#: ../../whatsnew/3.11.rst:2499 msgid "" "``frame``: removed, use :c:func:`PyThreadState_GetFrame` (function added to " "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " "reference`, need to call :c:func:`Py_XDECREF`." msgstr "" -#: ../../whatsnew/3.11.rst:2511 +#: ../../whatsnew/3.11.rst:2503 msgid "" "``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" "`43760`)." msgstr "" -#: ../../whatsnew/3.11.rst:2514 +#: ../../whatsnew/3.11.rst:2506 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." msgstr "" -#: ../../whatsnew/3.11.rst:2516 +#: ../../whatsnew/3.11.rst:2508 msgid "``stackcheck_counter``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2518 +#: ../../whatsnew/3.11.rst:2510 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2528 +#: ../../whatsnew/3.11.rst:2520 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2554 +#: ../../whatsnew/3.11.rst:2546 msgid "" "Or use `the pythoncapi_compat project `__ to get these functions on old Python functions." msgstr "" -#: ../../whatsnew/3.11.rst:2558 +#: ../../whatsnew/3.11.rst:2550 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." msgstr "" -#: ../../whatsnew/3.11.rst:2561 +#: ../../whatsnew/3.11.rst:2553 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to 1 " "for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -3880,7 +3871,7 @@ msgid "" "path and replace any values added to ``module_search_paths``." msgstr "" -#: ../../whatsnew/3.11.rst:2566 +#: ../../whatsnew/3.11.rst:2558 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 " @@ -3889,177 +3880,177 @@ msgid "" "object and modify it directly." msgstr "" -#: ../../whatsnew/3.11.rst:2577 +#: ../../whatsnew/3.11.rst:2569 msgid "" "Deprecate the following functions to configure the Python initialization:" msgstr "" -#: ../../whatsnew/3.11.rst:2579 +#: ../../whatsnew/3.11.rst:2571 msgid ":c:func:`PySys_AddWarnOptionUnicode`" msgstr ":c:func:`PySys_AddWarnOptionUnicode`" -#: ../../whatsnew/3.11.rst:2580 +#: ../../whatsnew/3.11.rst:2572 msgid ":c:func:`PySys_AddWarnOption`" msgstr ":c:func:`PySys_AddWarnOption`" -#: ../../whatsnew/3.11.rst:2581 +#: ../../whatsnew/3.11.rst:2573 msgid ":c:func:`PySys_AddXOption`" msgstr ":c:func:`PySys_AddXOption`" -#: ../../whatsnew/3.11.rst:2582 +#: ../../whatsnew/3.11.rst:2574 msgid ":c:func:`PySys_HasWarnOptions`" msgstr ":c:func:`PySys_HasWarnOptions`" -#: ../../whatsnew/3.11.rst:2583 +#: ../../whatsnew/3.11.rst:2575 msgid ":c:func:`PySys_SetArgvEx`" msgstr ":c:func:`PySys_SetArgvEx`" -#: ../../whatsnew/3.11.rst:2584 +#: ../../whatsnew/3.11.rst:2576 msgid ":c:func:`PySys_SetArgv`" msgstr ":c:func:`PySys_SetArgv`" -#: ../../whatsnew/3.11.rst:2585 +#: ../../whatsnew/3.11.rst:2577 msgid ":c:func:`PySys_SetPath`" msgstr ":c:func:`PySys_SetPath`" -#: ../../whatsnew/3.11.rst:2586 +#: ../../whatsnew/3.11.rst:2578 msgid ":c:func:`Py_SetPath`" msgstr ":c:func:`Py_SetPath`" -#: ../../whatsnew/3.11.rst:2587 +#: ../../whatsnew/3.11.rst:2579 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../whatsnew/3.11.rst:2588 +#: ../../whatsnew/3.11.rst:2580 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../whatsnew/3.11.rst:2589 +#: ../../whatsnew/3.11.rst:2581 msgid ":c:func:`Py_SetStandardStreamEncoding`" msgstr ":c:func:`Py_SetStandardStreamEncoding`" -#: ../../whatsnew/3.11.rst:2590 +#: ../../whatsnew/3.11.rst:2582 msgid ":c:func:`_Py_SetProgramFullPath`" msgstr ":c:func:`_Py_SetProgramFullPath`" -#: ../../whatsnew/3.11.rst:2592 +#: ../../whatsnew/3.11.rst:2584 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`). (Contributed by Victor " "Stinner in :gh:`88279`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2596 +#: ../../whatsnew/3.11.rst:2588 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2605 +#: ../../whatsnew/3.11.rst:2597 msgid "" "The following C APIs have been deprecated in earlier Python releases, and " "will be removed in Python 3.12." msgstr "" -#: ../../whatsnew/3.11.rst:2608 +#: ../../whatsnew/3.11.rst:2600 msgid ":c:func:`PyUnicode_AS_DATA`" msgstr ":c:func:`PyUnicode_AS_DATA`" -#: ../../whatsnew/3.11.rst:2609 +#: ../../whatsnew/3.11.rst:2601 msgid ":c:func:`PyUnicode_AS_UNICODE`" msgstr ":c:func:`PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.11.rst:2610 +#: ../../whatsnew/3.11.rst:2602 msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.11.rst:2611 +#: ../../whatsnew/3.11.rst:2603 msgid ":c:func:`PyUnicode_AsUnicode`" msgstr ":c:func:`PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2612 +#: ../../whatsnew/3.11.rst:2604 msgid ":c:func:`PyUnicode_FromUnicode`" msgstr ":c:func:`PyUnicode_FromUnicode`" -#: ../../whatsnew/3.11.rst:2613 +#: ../../whatsnew/3.11.rst:2605 msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.11.rst:2614 +#: ../../whatsnew/3.11.rst:2606 msgid ":c:func:`PyUnicode_GET_SIZE`" msgstr ":c:func:`PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.11.rst:2615 +#: ../../whatsnew/3.11.rst:2607 msgid ":c:func:`PyUnicode_GetSize`" msgstr ":c:func:`PyUnicode_GetSize`" -#: ../../whatsnew/3.11.rst:2616 +#: ../../whatsnew/3.11.rst:2608 msgid ":c:func:`PyUnicode_IS_COMPACT`" msgstr ":c:func:`PyUnicode_IS_COMPACT`" -#: ../../whatsnew/3.11.rst:2617 +#: ../../whatsnew/3.11.rst:2609 msgid ":c:func:`PyUnicode_IS_READY`" msgstr ":c:func:`PyUnicode_IS_READY`" -#: ../../whatsnew/3.11.rst:2618 +#: ../../whatsnew/3.11.rst:2610 msgid ":c:func:`PyUnicode_READY`" msgstr ":c:func:`PyUnicode_READY`" -#: ../../whatsnew/3.11.rst:2619 +#: ../../whatsnew/3.11.rst:2611 msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" -#: ../../whatsnew/3.11.rst:2620 +#: ../../whatsnew/3.11.rst:2612 msgid ":c:func:`_PyUnicode_AsUnicode`" msgstr ":c:func:`_PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2621 +#: ../../whatsnew/3.11.rst:2613 msgid ":c:macro:`PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.11.rst:2622 +#: ../../whatsnew/3.11.rst:2614 msgid ":c:type:`PyUnicodeObject`" msgstr ":c:type:`PyUnicodeObject`" -#: ../../whatsnew/3.11.rst:2623 +#: ../../whatsnew/3.11.rst:2615 msgid ":c:func:`PyUnicode_InternImmortal()`" msgstr ":c:func:`PyUnicode_InternImmortal()`" -#: ../../whatsnew/3.11.rst:2631 +#: ../../whatsnew/3.11.rst:2623 msgid "" ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2635 +#: ../../whatsnew/3.11.rst:2627 msgid "Remove the following math macros using the ``errno`` variable:" msgstr "" -#: ../../whatsnew/3.11.rst:2637 +#: ../../whatsnew/3.11.rst:2629 msgid "``Py_ADJUST_ERANGE1()``" msgstr "``Py_ADJUST_ERANGE1()``" -#: ../../whatsnew/3.11.rst:2638 +#: ../../whatsnew/3.11.rst:2630 msgid "``Py_ADJUST_ERANGE2()``" msgstr "``Py_ADJUST_ERANGE2()``" -#: ../../whatsnew/3.11.rst:2639 +#: ../../whatsnew/3.11.rst:2631 msgid "``Py_OVERFLOWED()``" msgstr "``Py_OVERFLOWED()``" -#: ../../whatsnew/3.11.rst:2640 +#: ../../whatsnew/3.11.rst:2632 msgid "``Py_SET_ERANGE_IF_OVERFLOW()``" msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" -#: ../../whatsnew/3.11.rst:2641 +#: ../../whatsnew/3.11.rst:2633 msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2643 +#: ../../whatsnew/3.11.rst:2635 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2645 +#: ../../whatsnew/3.11.rst:2637 msgid "" "Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated " "since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()`` " @@ -4067,62 +4058,62 @@ msgid "" "(Contributed by Victor Stinner in :issue:`41123`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2650 +#: ../../whatsnew/3.11.rst:2642 msgid "" "Remove the ``pystrhex.h`` header file. It only contains private functions. C " "extensions should only include the main ```` header file. " "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2654 +#: ../../whatsnew/3.11.rst:2646 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" "`45440`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2658 +#: ../../whatsnew/3.11.rst:2650 msgid "" "The following items are no longer available when :c:macro:`Py_LIMITED_API` " "is defined:" msgstr "" -#: ../../whatsnew/3.11.rst:2661 +#: ../../whatsnew/3.11.rst:2653 msgid ":c:func:`PyMarshal_WriteLongToFile`" msgstr ":c:func:`PyMarshal_WriteLongToFile`" -#: ../../whatsnew/3.11.rst:2662 +#: ../../whatsnew/3.11.rst:2654 msgid ":c:func:`PyMarshal_WriteObjectToFile`" msgstr ":c:func:`PyMarshal_WriteObjectToFile`" -#: ../../whatsnew/3.11.rst:2663 +#: ../../whatsnew/3.11.rst:2655 msgid ":c:func:`PyMarshal_ReadObjectFromString`" msgstr ":c:func:`PyMarshal_ReadObjectFromString`" -#: ../../whatsnew/3.11.rst:2664 +#: ../../whatsnew/3.11.rst:2656 msgid ":c:func:`PyMarshal_WriteObjectToString`" msgstr ":c:func:`PyMarshal_WriteObjectToString`" -#: ../../whatsnew/3.11.rst:2665 +#: ../../whatsnew/3.11.rst:2657 msgid "the ``Py_MARSHAL_VERSION`` macro" msgstr "``Py_MARSHAL_VERSION`` 巨集" -#: ../../whatsnew/3.11.rst:2667 +#: ../../whatsnew/3.11.rst:2659 msgid "These are not part of the :ref:`limited API `." msgstr "" -#: ../../whatsnew/3.11.rst:2669 +#: ../../whatsnew/3.11.rst:2661 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2671 +#: ../../whatsnew/3.11.rst:2663 msgid "" "Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API. It never " "worked since the :c:type:`PyWeakReference` structure is opaque in the " "limited C API. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2676 +#: ../../whatsnew/3.11.rst:2668 msgid "" "Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed in the public " "C API by mistake, it must only be used by Python internally. Use the " @@ -4130,76 +4121,76 @@ msgid "" "in :issue:`40170`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2681 +#: ../../whatsnew/3.11.rst:2673 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2687 +#: ../../whatsnew/3.11.rst:2679 msgid "" "Remove the :c:type:`Py_UNICODE` encoder APIs, as they have been deprecated " "since Python 3.3, are little used and are inefficient relative to the " "recommended alternatives." msgstr "" -#: ../../whatsnew/3.11.rst:2692 +#: ../../whatsnew/3.11.rst:2684 msgid "The removed functions are:" msgstr "" -#: ../../whatsnew/3.11.rst:2694 +#: ../../whatsnew/3.11.rst:2686 msgid ":func:`!PyUnicode_Encode`" msgstr ":func:`!PyUnicode_Encode`" -#: ../../whatsnew/3.11.rst:2695 +#: ../../whatsnew/3.11.rst:2687 msgid ":func:`!PyUnicode_EncodeASCII`" msgstr ":func:`!PyUnicode_EncodeASCII`" -#: ../../whatsnew/3.11.rst:2696 +#: ../../whatsnew/3.11.rst:2688 msgid ":func:`!PyUnicode_EncodeLatin1`" msgstr ":func:`!PyUnicode_EncodeLatin1`" -#: ../../whatsnew/3.11.rst:2697 +#: ../../whatsnew/3.11.rst:2689 msgid ":func:`!PyUnicode_EncodeUTF7`" msgstr ":func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.11.rst:2698 +#: ../../whatsnew/3.11.rst:2690 msgid ":func:`!PyUnicode_EncodeUTF8`" msgstr ":func:`!PyUnicode_EncodeUTF8`" -#: ../../whatsnew/3.11.rst:2699 +#: ../../whatsnew/3.11.rst:2691 msgid ":func:`!PyUnicode_EncodeUTF16`" msgstr ":func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.11.rst:2700 +#: ../../whatsnew/3.11.rst:2692 msgid ":func:`!PyUnicode_EncodeUTF32`" msgstr ":func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.11.rst:2701 +#: ../../whatsnew/3.11.rst:2693 msgid ":func:`!PyUnicode_EncodeUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2702 +#: ../../whatsnew/3.11.rst:2694 msgid ":func:`!PyUnicode_EncodeRawUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeRawUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2703 +#: ../../whatsnew/3.11.rst:2695 msgid ":func:`!PyUnicode_EncodeCharmap`" msgstr ":func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.11.rst:2704 +#: ../../whatsnew/3.11.rst:2696 msgid ":func:`!PyUnicode_TranslateCharmap`" msgstr ":func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.11.rst:2705 +#: ../../whatsnew/3.11.rst:2697 msgid ":func:`!PyUnicode_EncodeDecimal`" msgstr ":func:`!PyUnicode_EncodeDecimal`" -#: ../../whatsnew/3.11.rst:2706 +#: ../../whatsnew/3.11.rst:2698 msgid ":func:`!PyUnicode_TransformDecimalToASCII`" msgstr ":func:`!PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.11.rst:2708 +#: ../../whatsnew/3.11.rst:2700 msgid "" "See :pep:`624` for details and :pep:`migration guidance <624#alternative-" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" From a4130c0096194e412f275ba5aa09f5dce33ac975 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 24 Mar 2023 00:33:32 +0000 Subject: [PATCH 053/130] sync with cpython 8132aefa --- library/asyncio-task.po | 268 +++++++++++---------- library/inspect.po | 368 ++++++++++++++--------------- library/typing.po | 499 ++++++++++++++++++++-------------------- 3 files changed, 570 insertions(+), 565 deletions(-) diff --git a/library/asyncio-task.po b/library/asyncio-task.po index fa44854a4f..d60bf0fcee 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-23 00:31+0000\n" +"POT-Creation-Date: 2023-03-24 00:31+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -241,7 +241,7 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1010 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1004 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" @@ -303,9 +303,9 @@ msgid "" msgstr "" #: ../../library/asyncio-task.rst:337 ../../library/asyncio-task.rst:467 -#: ../../library/asyncio-task.rst:595 ../../library/asyncio-task.rst:659 -#: ../../library/asyncio-task.rst:685 ../../library/asyncio-task.rst:728 -#: ../../library/asyncio-task.rst:821 +#: ../../library/asyncio-task.rst:595 ../../library/asyncio-task.rst:653 +#: ../../library/asyncio-task.rst:679 ../../library/asyncio-task.rst:722 +#: ../../library/asyncio-task.rst:815 msgid "Example::" msgstr "" "範例:\n" @@ -394,9 +394,9 @@ msgid "" msgstr "" #: ../../library/asyncio-task.rst:425 ../../library/asyncio-task.rst:516 -#: ../../library/asyncio-task.rst:570 ../../library/asyncio-task.rst:723 -#: ../../library/asyncio-task.rst:753 ../../library/asyncio-task.rst:805 -#: ../../library/asyncio-task.rst:827 +#: ../../library/asyncio-task.rst:570 ../../library/asyncio-task.rst:717 +#: ../../library/asyncio-task.rst:747 ../../library/asyncio-task.rst:799 +#: ../../library/asyncio-task.rst:821 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" @@ -489,7 +489,7 @@ msgid "" "`cancelled `." msgstr "" -#: ../../library/asyncio-task.rst:533 ../../library/asyncio-task.rst:705 +#: ../../library/asyncio-task.rst:533 ../../library/asyncio-task.rst:699 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" @@ -588,186 +588,180 @@ msgstr "" #: ../../library/asyncio-task.rst:629 msgid "" -"An :ref:`asynchronous context manager ` that limits " -"time spent inside of it." -msgstr "" - -#: ../../library/asyncio-task.rst:636 -msgid "" -"Return the current deadline, or ``None`` if the current deadline is not set." +"An :ref:`asynchronous context manager ` for " +"cancelling overdue coroutines." msgstr "" -#: ../../library/asyncio-task.rst:639 +#: ../../library/asyncio-task.rst:632 msgid "" -"The deadline is a float, consistent with the time returned by :meth:`loop." -"time`." +"``when`` should be an absolute time at which the context should time out, as " +"measured by the event loop's clock:" msgstr "" -#: ../../library/asyncio-task.rst:644 -msgid "Change the time the timeout will trigger." +#: ../../library/asyncio-task.rst:635 +msgid "If ``when`` is ``None``, the timeout will never trigger." msgstr "" -#: ../../library/asyncio-task.rst:646 +#: ../../library/asyncio-task.rst:636 msgid "" -"If *when* is ``None``, any current deadline will be removed, and the context " -"manager will wait indefinitely." +"If ``when < loop.time()``, the timeout will trigger on the next iteration of " +"the event loop." msgstr "" -#: ../../library/asyncio-task.rst:649 -msgid "If *when* is a float, it is set as the new deadline." +#: ../../library/asyncio-task.rst:641 +msgid "" +"Return the current deadline, or ``None`` if the current deadline is not set." msgstr "" -#: ../../library/asyncio-task.rst:651 -msgid "" -"if *when* is in the past, the timeout will trigger on the next iteration of " -"the event loop." +#: ../../library/asyncio-task.rst:646 +msgid "Reschedule the timeout." msgstr "" -#: ../../library/asyncio-task.rst:656 +#: ../../library/asyncio-task.rst:650 msgid "Return whether the context manager has exceeded its deadline (expired)." msgstr "" -#: ../../library/asyncio-task.rst:676 +#: ../../library/asyncio-task.rst:670 msgid "Timeout context managers can be safely nested." msgstr "" -#: ../../library/asyncio-task.rst:682 +#: ../../library/asyncio-task.rst:676 msgid "" "Similar to :func:`asyncio.timeout`, except *when* is the absolute time to " "stop waiting, or ``None``." msgstr "" -#: ../../library/asyncio-task.rst:702 +#: ../../library/asyncio-task.rst:696 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." msgstr "" -#: ../../library/asyncio-task.rst:707 +#: ../../library/asyncio-task.rst:701 msgid "" "*timeout* can either be ``None`` or a float or int number of seconds to wait " "for. If *timeout* is ``None``, block until the future completes." msgstr "" -#: ../../library/asyncio-task.rst:711 +#: ../../library/asyncio-task.rst:705 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`." msgstr "" -#: ../../library/asyncio-task.rst:714 +#: ../../library/asyncio-task.rst:708 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." msgstr "" -#: ../../library/asyncio-task.rst:717 +#: ../../library/asyncio-task.rst:711 msgid "" "The function will wait until the future is actually cancelled, so the total " "wait time may exceed the *timeout*. If an exception happens during " "cancellation, it is propagated." msgstr "" -#: ../../library/asyncio-task.rst:721 +#: ../../library/asyncio-task.rst:715 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:748 +#: ../../library/asyncio-task.rst:742 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`TimeoutError` immediately." msgstr "" -#: ../../library/asyncio-task.rst:758 +#: ../../library/asyncio-task.rst:752 msgid "Waiting Primitives" msgstr "" -#: ../../library/asyncio-task.rst:762 +#: ../../library/asyncio-task.rst:756 msgid "" "Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the " "*aws* iterable concurrently and block until the condition specified by " "*return_when*." msgstr "" -#: ../../library/asyncio-task.rst:766 +#: ../../library/asyncio-task.rst:760 msgid "The *aws* iterable must not be empty." msgstr "" -#: ../../library/asyncio-task.rst:768 +#: ../../library/asyncio-task.rst:762 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: ../../library/asyncio-task.rst:770 +#: ../../library/asyncio-task.rst:764 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-task.rst:774 +#: ../../library/asyncio-task.rst:768 msgid "" "*timeout* (a float or int), if specified, can be used to control the maximum " "number of seconds to wait before returning." msgstr "" -#: ../../library/asyncio-task.rst:777 +#: ../../library/asyncio-task.rst:771 msgid "" "Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks " "that aren't done when the timeout occurs are simply returned in the second " "set." msgstr "" -#: ../../library/asyncio-task.rst:781 +#: ../../library/asyncio-task.rst:775 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/asyncio-task.rst:787 +#: ../../library/asyncio-task.rst:781 msgid "Constant" msgstr "常數" -#: ../../library/asyncio-task.rst:787 +#: ../../library/asyncio-task.rst:781 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:789 +#: ../../library/asyncio-task.rst:783 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/asyncio-task.rst:789 +#: ../../library/asyncio-task.rst:783 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:792 +#: ../../library/asyncio-task.rst:786 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/asyncio-task.rst:792 +#: ../../library/asyncio-task.rst:786 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: ../../library/asyncio-task.rst:798 +#: ../../library/asyncio-task.rst:792 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/asyncio-task.rst:798 +#: ../../library/asyncio-task.rst:792 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:802 +#: ../../library/asyncio-task.rst:796 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:808 +#: ../../library/asyncio-task.rst:802 msgid "Passing coroutine objects to ``wait()`` directly is forbidden." msgstr "" -#: ../../library/asyncio-task.rst:813 +#: ../../library/asyncio-task.rst:807 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently. Return an iterator of coroutines. Each coroutine returned can " @@ -775,26 +769,26 @@ msgid "" "remaining awaitables." msgstr "" -#: ../../library/asyncio-task.rst:818 +#: ../../library/asyncio-task.rst:812 msgid "" "Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." msgstr "" -#: ../../library/asyncio-task.rst:830 +#: ../../library/asyncio-task.rst:824 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:836 +#: ../../library/asyncio-task.rst:830 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:840 +#: ../../library/asyncio-task.rst:834 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:842 +#: ../../library/asyncio-task.rst:836 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -802,19 +796,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:847 +#: ../../library/asyncio-task.rst:841 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:849 +#: ../../library/asyncio-task.rst:843 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were run in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:879 +#: ../../library/asyncio-task.rst:873 msgid "" "Directly calling ``blocking_io()`` in any coroutine would block the event " "loop for its duration, resulting in an additional 1 second of run time. " @@ -822,7 +816,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:886 +#: ../../library/asyncio-task.rst:880 msgid "" "Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used " "to make IO-bound functions non-blocking. However, for extension modules that " @@ -830,81 +824,81 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:895 +#: ../../library/asyncio-task.rst:889 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:899 +#: ../../library/asyncio-task.rst:893 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:901 +#: ../../library/asyncio-task.rst:895 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:904 +#: ../../library/asyncio-task.rst:898 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: ../../library/asyncio-task.rst:916 +#: ../../library/asyncio-task.rst:910 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: ../../library/asyncio-task.rst:930 +#: ../../library/asyncio-task.rst:924 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:933 +#: ../../library/asyncio-task.rst:927 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:940 +#: ../../library/asyncio-task.rst:934 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:945 +#: ../../library/asyncio-task.rst:939 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:948 +#: ../../library/asyncio-task.rst:942 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:956 +#: ../../library/asyncio-task.rst:950 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:959 +#: ../../library/asyncio-task.rst:953 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:966 +#: ../../library/asyncio-task.rst:960 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:970 +#: ../../library/asyncio-task.rst:964 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:973 +#: ../../library/asyncio-task.rst:967 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -912,21 +906,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:979 +#: ../../library/asyncio-task.rst:973 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:984 +#: ../../library/asyncio-task.rst:978 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:989 +#: ../../library/asyncio-task.rst:983 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -934,112 +928,112 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:994 +#: ../../library/asyncio-task.rst:988 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:999 +#: ../../library/asyncio-task.rst:993 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:1003 +#: ../../library/asyncio-task.rst:997 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:1007 +#: ../../library/asyncio-task.rst:1001 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1013 +#: ../../library/asyncio-task.rst:1007 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1019 +#: ../../library/asyncio-task.rst:1013 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1021 +#: ../../library/asyncio-task.rst:1015 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1026 +#: ../../library/asyncio-task.rst:1020 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1028 +#: ../../library/asyncio-task.rst:1022 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:1032 ../../library/asyncio-task.rst:1046 +#: ../../library/asyncio-task.rst:1026 ../../library/asyncio-task.rst:1040 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1035 +#: ../../library/asyncio-task.rst:1029 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1040 +#: ../../library/asyncio-task.rst:1034 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1042 +#: ../../library/asyncio-task.rst:1036 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1049 +#: ../../library/asyncio-task.rst:1043 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1054 +#: ../../library/asyncio-task.rst:1048 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1056 ../../library/asyncio-task.rst:1065 +#: ../../library/asyncio-task.rst:1050 ../../library/asyncio-task.rst:1059 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1058 +#: ../../library/asyncio-task.rst:1052 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1063 +#: ../../library/asyncio-task.rst:1057 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1067 +#: ../../library/asyncio-task.rst:1061 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1072 +#: ../../library/asyncio-task.rst:1066 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1074 +#: ../../library/asyncio-task.rst:1068 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1047,15 +1041,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1080 +#: ../../library/asyncio-task.rst:1074 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1082 +#: ../../library/asyncio-task.rst:1076 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1084 +#: ../../library/asyncio-task.rst:1078 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1064,66 +1058,66 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1093 +#: ../../library/asyncio-task.rst:1087 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1095 +#: ../../library/asyncio-task.rst:1089 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1098 +#: ../../library/asyncio-task.rst:1092 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1100 +#: ../../library/asyncio-task.rst:1094 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" -#: ../../library/asyncio-task.rst:1105 +#: ../../library/asyncio-task.rst:1099 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1111 +#: ../../library/asyncio-task.rst:1105 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1113 +#: ../../library/asyncio-task.rst:1107 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:1121 +#: ../../library/asyncio-task.rst:1115 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1123 +#: ../../library/asyncio-task.rst:1117 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1126 +#: ../../library/asyncio-task.rst:1120 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1133 +#: ../../library/asyncio-task.rst:1127 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1135 +#: ../../library/asyncio-task.rst:1129 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1138 +#: ../../library/asyncio-task.rst:1132 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1135,46 +1129,46 @@ msgid "" "addition to catching the exception." msgstr "" -#: ../../library/asyncio-task.rst:1148 +#: ../../library/asyncio-task.rst:1142 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1151 +#: ../../library/asyncio-task.rst:1145 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1156 +#: ../../library/asyncio-task.rst:1150 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1195 +#: ../../library/asyncio-task.rst:1189 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1197 +#: ../../library/asyncio-task.rst:1191 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:1203 +#: ../../library/asyncio-task.rst:1197 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1205 +#: ../../library/asyncio-task.rst:1199 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1207 +#: ../../library/asyncio-task.rst:1201 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1212 +#: ../../library/asyncio-task.rst:1206 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1183,7 +1177,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1230 +#: ../../library/asyncio-task.rst:1224 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1192,20 +1186,20 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1236 +#: ../../library/asyncio-task.rst:1230 msgid "" "If end-user code is, for some reason, suppresing cancellation by catching :" "exc:`CancelledError`, it needs to call this method to remove the " "cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:1242 +#: ../../library/asyncio-task.rst:1236 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: ../../library/asyncio-task.rst:1246 +#: ../../library/asyncio-task.rst:1240 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1214,7 +1208,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1252 +#: ../../library/asyncio-task.rst:1246 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." diff --git a/library/inspect.po b/library/inspect.po index 9e9d665c11..c9b5e2b12e 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-28 00:33+0000\n" +"POT-Creation-Date: 2023-03-24 00:31+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -829,30 +829,32 @@ msgid "" "object. The source code is returned as a list of the lines corresponding to " "the object and the line number indicates where in the original source file " "the first line of code was found. An :exc:`OSError` is raised if the source " -"code cannot be retrieved." +"code cannot be retrieved. A :exc:`TypeError` is raised if the object is a " +"built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:557 ../../library/inspect.rst:569 +#: ../../library/inspect.rst:559 ../../library/inspect.rst:573 msgid "" ":exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the " "former." msgstr "" -#: ../../library/inspect.rst:564 +#: ../../library/inspect.rst:566 msgid "" "Return the text of the source code for an object. The argument may be a " "module, class, method, function, traceback, frame, or code object. The " "source code is returned as a single string. An :exc:`OSError` is raised if " -"the source code cannot be retrieved." +"the source code cannot be retrieved. A :exc:`TypeError` is raised if the " +"object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:576 +#: ../../library/inspect.rst:580 msgid "" "Clean up indentation from docstrings that are indented to line up with " "blocks of code." msgstr "" -#: ../../library/inspect.rst:579 +#: ../../library/inspect.rst:583 msgid "" "All leading whitespace is removed from the first line. Any leading " "whitespace that can be uniformly removed from the second line onwards is " @@ -860,28 +862,28 @@ msgid "" "Also, all tabs are expanded to spaces." msgstr "" -#: ../../library/inspect.rst:588 +#: ../../library/inspect.rst:592 msgid "Introspecting callables with the Signature object" msgstr "" -#: ../../library/inspect.rst:592 +#: ../../library/inspect.rst:596 msgid "" "The Signature object represents the call signature of a callable object and " "its return annotation. To retrieve a Signature object, use the :func:" "`signature` function." msgstr "" -#: ../../library/inspect.rst:598 +#: ../../library/inspect.rst:602 msgid "Return a :class:`Signature` object for the given ``callable``::" msgstr "" -#: ../../library/inspect.rst:615 +#: ../../library/inspect.rst:619 msgid "" "Accepts a wide range of Python callables, from plain functions and classes " "to :func:`functools.partial` objects." msgstr "" -#: ../../library/inspect.rst:618 +#: ../../library/inspect.rst:622 msgid "" "For objects defined in modules using stringized annotations (``from " "__future__ import annotations``), :func:`signature` will attempt to " @@ -892,7 +894,7 @@ msgid "" "instructions on how to use these parameters." msgstr "" -#: ../../library/inspect.rst:627 +#: ../../library/inspect.rst:631 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -901,39 +903,39 @@ msgid "" "exception." msgstr "" -#: ../../library/inspect.rst:633 +#: ../../library/inspect.rst:637 msgid "" "A slash(/) in the signature of a function denotes that the parameters prior " "to it are positional-only. For more info, see :ref:`the FAQ entry on " "positional-only parameters `." msgstr "" -#: ../../library/inspect.rst:637 +#: ../../library/inspect.rst:641 msgid "" "``follow_wrapped`` parameter. Pass ``False`` to get a signature of " "``callable`` specifically (``callable.__wrapped__`` will not be used to " "unwrap decorated callables.)" msgstr "" -#: ../../library/inspect.rst:642 +#: ../../library/inspect.rst:646 msgid "``globals``, ``locals``, and ``eval_str`` parameters." msgstr "" -#: ../../library/inspect.rst:647 +#: ../../library/inspect.rst:651 msgid "" "Some callables may not be introspectable in certain implementations of " "Python. For example, in CPython, some built-in functions defined in C " "provide no metadata about their arguments." msgstr "" -#: ../../library/inspect.rst:654 +#: ../../library/inspect.rst:658 msgid "" "A Signature object represents the call signature of a function and its " "return annotation. For each parameter accepted by the function it stores a :" "class:`Parameter` object in its :attr:`parameters` collection." msgstr "" -#: ../../library/inspect.rst:658 +#: ../../library/inspect.rst:662 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -942,54 +944,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:664 +#: ../../library/inspect.rst:668 msgid "" "The optional *return_annotation* argument, can be an arbitrary Python " "object, is the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:667 +#: ../../library/inspect.rst:671 msgid "" "Signature objects are *immutable*. Use :meth:`Signature.replace` to make a " "modified copy." msgstr "" -#: ../../library/inspect.rst:670 +#: ../../library/inspect.rst:674 msgid "Signature objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:675 +#: ../../library/inspect.rst:679 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:679 +#: ../../library/inspect.rst:683 msgid "" "An ordered mapping of parameters' names to the corresponding :class:" "`Parameter` objects. Parameters appear in strict definition order, " "including keyword-only parameters." msgstr "" -#: ../../library/inspect.rst:683 ../../library/inspect.rst:1008 +#: ../../library/inspect.rst:687 ../../library/inspect.rst:1012 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " "had always been preserved in Python 3." msgstr "" -#: ../../library/inspect.rst:690 +#: ../../library/inspect.rst:694 msgid "" "The \"return\" annotation for the callable. If the callable has no " "\"return\" annotation, this attribute is set to :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:695 +#: ../../library/inspect.rst:699 msgid "" "Create a mapping from positional and keyword arguments to parameters. " "Returns :class:`BoundArguments` if ``*args`` and ``**kwargs`` match the " "signature, or raises a :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:701 +#: ../../library/inspect.rst:705 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -997,7 +999,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:708 +#: ../../library/inspect.rst:712 msgid "" "Create a new Signature instance based on the instance replace was invoked " "on. It is possible to pass different ``parameters`` and/or " @@ -1006,7 +1008,7 @@ msgid "" "attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:725 +#: ../../library/inspect.rst:729 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "``obj``. Pass ``follow_wrapped=False`` to get a signature of ``obj`` " @@ -1014,139 +1016,139 @@ msgid "" "will be used as the namespaces when resolving annotations." msgstr "" -#: ../../library/inspect.rst:730 +#: ../../library/inspect.rst:734 msgid "This method simplifies subclassing of :class:`Signature`::" msgstr "" -#: ../../library/inspect.rst:739 +#: ../../library/inspect.rst:743 msgid "``globalns`` and ``localns`` parameters." msgstr "" -#: ../../library/inspect.rst:745 +#: ../../library/inspect.rst:749 msgid "" "Parameter objects are *immutable*. Instead of modifying a Parameter object, " "you can use :meth:`Parameter.replace` to create a modified copy." msgstr "" -#: ../../library/inspect.rst:748 +#: ../../library/inspect.rst:752 msgid "Parameter objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:753 +#: ../../library/inspect.rst:757 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:758 +#: ../../library/inspect.rst:762 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:763 +#: ../../library/inspect.rst:767 msgid "" "CPython generates implicit parameter names of the form ``.0`` on the code " "objects used to implement comprehensions and generator expressions." msgstr "" -#: ../../library/inspect.rst:767 +#: ../../library/inspect.rst:771 msgid "" "These parameter names are exposed by this module as names like ``implicit0``." msgstr "" -#: ../../library/inspect.rst:773 +#: ../../library/inspect.rst:777 msgid "" "The default value for the parameter. If the parameter has no default value, " "this attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:778 +#: ../../library/inspect.rst:782 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:783 +#: ../../library/inspect.rst:787 msgid "" "Describes how argument values are bound to the parameter. The possible " "values are accessible via :class:`Parameter` (like ``Parameter." "KEYWORD_ONLY``), and support comparison and ordering, in the following order:" msgstr "" -#: ../../library/inspect.rst:790 +#: ../../library/inspect.rst:794 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:790 +#: ../../library/inspect.rst:794 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:792 +#: ../../library/inspect.rst:796 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:792 +#: ../../library/inspect.rst:796 msgid "" "Value must be supplied as a positional argument. Positional only parameters " "are those which appear before a ``/`` entry (if present) in a Python " "function definition." msgstr "" -#: ../../library/inspect.rst:797 +#: ../../library/inspect.rst:801 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:797 +#: ../../library/inspect.rst:801 msgid "" "Value may be supplied as either a keyword or positional argument (this is " "the standard binding behaviour for functions implemented in Python.)" msgstr "" -#: ../../library/inspect.rst:802 +#: ../../library/inspect.rst:806 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:802 +#: ../../library/inspect.rst:806 msgid "" "A tuple of positional arguments that aren't bound to any other parameter. " "This corresponds to a ``*args`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:807 +#: ../../library/inspect.rst:811 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:807 +#: ../../library/inspect.rst:811 msgid "" "Value must be supplied as a keyword argument. Keyword only parameters are " "those which appear after a ``*`` or ``*args`` entry in a Python function " "definition." msgstr "" -#: ../../library/inspect.rst:812 +#: ../../library/inspect.rst:816 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:812 +#: ../../library/inspect.rst:816 msgid "" "A dict of keyword arguments that aren't bound to any other parameter. This " "corresponds to a ``**kwargs`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:818 +#: ../../library/inspect.rst:822 msgid "Example: print all keyword-only arguments without default values::" msgstr "" -#: ../../library/inspect.rst:832 +#: ../../library/inspect.rst:836 msgid "Describes a enum value of Parameter.kind." msgstr "" -#: ../../library/inspect.rst:836 +#: ../../library/inspect.rst:840 msgid "Example: print all descriptions of arguments::" msgstr "" -#: ../../library/inspect.rst:851 +#: ../../library/inspect.rst:855 msgid "" "Create a new Parameter instance based on the instance replaced was invoked " "on. To override a :class:`Parameter` attribute, pass the corresponding " @@ -1154,94 +1156,94 @@ msgid "" "pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:869 +#: ../../library/inspect.rst:873 msgid "" "In Python 3.3 Parameter objects were allowed to have ``name`` set to " "``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no longer " "permitted." msgstr "" -#: ../../library/inspect.rst:876 +#: ../../library/inspect.rst:880 msgid "" "Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. " "Holds the mapping of arguments to the function's parameters." msgstr "" -#: ../../library/inspect.rst:881 +#: ../../library/inspect.rst:885 msgid "" "A mutable mapping of parameters' names to arguments' values. Contains only " "explicitly bound arguments. Changes in :attr:`arguments` will reflect in :" "attr:`args` and :attr:`kwargs`." msgstr "" -#: ../../library/inspect.rst:885 +#: ../../library/inspect.rst:889 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:890 +#: ../../library/inspect.rst:894 msgid "" "Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` " "relied on a default value are skipped. However, if needed, use :meth:" "`BoundArguments.apply_defaults` to add them." msgstr "" -#: ../../library/inspect.rst:895 +#: ../../library/inspect.rst:899 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:901 +#: ../../library/inspect.rst:905 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:906 +#: ../../library/inspect.rst:910 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:911 +#: ../../library/inspect.rst:915 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:915 +#: ../../library/inspect.rst:919 msgid "Set default values for missing arguments." msgstr "" -#: ../../library/inspect.rst:917 +#: ../../library/inspect.rst:921 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:920 +#: ../../library/inspect.rst:924 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:933 +#: ../../library/inspect.rst:937 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions::" msgstr "" -#: ../../library/inspect.rst:946 +#: ../../library/inspect.rst:950 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:947 +#: ../../library/inspect.rst:951 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:953 +#: ../../library/inspect.rst:957 msgid "Classes and functions" msgstr "" -#: ../../library/inspect.rst:957 +#: ../../library/inspect.rst:961 msgid "" "Arrange the given list of classes into a hierarchy of nested lists. Where a " "nested list appears, it contains classes derived from the class whose entry " @@ -1252,19 +1254,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:968 +#: ../../library/inspect.rst:972 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:971 +#: ../../library/inspect.rst:975 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:974 +#: ../../library/inspect.rst:978 msgid "" "*args* is a list of the positional parameter names. *varargs* is the name of " "the ``*`` parameter or ``None`` if arbitrary positional arguments are not " @@ -1279,7 +1281,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:989 +#: ../../library/inspect.rst:993 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1289,14 +1291,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:996 +#: ../../library/inspect.rst:1000 msgid "" "This function is now based on :func:`signature`, but still ignores " "``__wrapped__`` attributes and includes the already bound first parameter in " "the signature output for bound methods." msgstr "" -#: ../../library/inspect.rst:1001 +#: ../../library/inspect.rst:1005 msgid "" "This method was previously documented as deprecated in favour of :func:" "`signature` in Python 3.5, but that decision has been reversed in order to " @@ -1304,7 +1306,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1016 +#: ../../library/inspect.rst:1020 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1313,18 +1315,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1023 ../../library/inspect.rst:1033 +#: ../../library/inspect.rst:1027 ../../library/inspect.rst:1037 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1028 +#: ../../library/inspect.rst:1032 msgid "" "Format a pretty argument spec from the four values returned by :func:" "`getargvalues`. The format\\* arguments are the corresponding optional " "formatting functions that are called to turn names and values into strings." msgstr "" -#: ../../library/inspect.rst:1038 +#: ../../library/inspect.rst:1042 msgid "" "Return a tuple of class cls's base classes, including cls, in method " "resolution order. No class appears more than once in this tuple. Note that " @@ -1332,7 +1334,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1046 +#: ../../library/inspect.rst:1050 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -1345,11 +1347,11 @@ msgid "" "example::" msgstr "" -#: ../../library/inspect.rst:1069 +#: ../../library/inspect.rst:1073 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "" -#: ../../library/inspect.rst:1075 +#: ../../library/inspect.rst:1079 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1361,18 +1363,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1084 +#: ../../library/inspect.rst:1088 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "" -#: ../../library/inspect.rst:1091 +#: ../../library/inspect.rst:1095 msgid "" "Get the object wrapped by *func*. It follows the chain of :attr:" "`__wrapped__` attributes returning the last object in the chain." msgstr "" -#: ../../library/inspect.rst:1094 +#: ../../library/inspect.rst:1098 msgid "" "*stop* is an optional callback accepting an object in the wrapper chain as " "its sole argument that allows the unwrapping to be terminated early if the " @@ -1382,68 +1384,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1101 +#: ../../library/inspect.rst:1105 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "" -#: ../../library/inspect.rst:1108 +#: ../../library/inspect.rst:1112 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1110 +#: ../../library/inspect.rst:1114 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1113 +#: ../../library/inspect.rst:1117 msgid "" "Returns a dict. ``get_annotations()`` returns a new dict every time it's " "called; calling it twice on the same object will return two different but " "equivalent dicts." msgstr "" -#: ../../library/inspect.rst:1117 +#: ../../library/inspect.rst:1121 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1119 +#: ../../library/inspect.rst:1123 msgid "" "If ``eval_str`` is true, values of type ``str`` will be un-stringized using :" "func:`eval()`. This is intended for use with stringized annotations (``from " "__future__ import annotations``)." msgstr "" -#: ../../library/inspect.rst:1123 +#: ../../library/inspect.rst:1127 msgid "" "If ``obj`` doesn't have an annotations dict, returns an empty dict. " "(Functions and methods always have an annotations dict; classes, modules, " "and other types of callables may not.)" msgstr "" -#: ../../library/inspect.rst:1127 +#: ../../library/inspect.rst:1131 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1129 +#: ../../library/inspect.rst:1133 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1131 +#: ../../library/inspect.rst:1135 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1133 +#: ../../library/inspect.rst:1137 msgid "" "``eval_str`` controls whether or not values of type ``str`` are replaced " "with the result of calling :func:`eval()` on those values:" msgstr "" -#: ../../library/inspect.rst:1136 +#: ../../library/inspect.rst:1140 msgid "" "If eval_str is true, :func:`eval()` is called on values of type ``str``. " "(Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval()` " @@ -1451,12 +1453,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1140 +#: ../../library/inspect.rst:1144 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1142 +#: ../../library/inspect.rst:1146 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1464,35 +1466,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1147 +#: ../../library/inspect.rst:1151 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1148 +#: ../../library/inspect.rst:1152 msgid "" "If ``obj`` is a class, ``globals`` defaults to ``sys.modules[obj.__module__]." "__dict__`` and ``locals`` defaults to the ``obj`` class namespace." msgstr "" -#: ../../library/inspect.rst:1151 +#: ../../library/inspect.rst:1155 msgid "" "If ``obj`` is a callable, ``globals`` defaults to ``obj.__globals__``, " "although if ``obj`` is a wrapped function (using ``functools." "update_wrapper()``) it is first unwrapped." msgstr "" -#: ../../library/inspect.rst:1155 +#: ../../library/inspect.rst:1159 msgid "" "Calling ``get_annotations`` is best practice for accessing the annotations " "dict of any object. See :ref:`annotations-howto` for more information on " "annotations best practices." msgstr "" -#: ../../library/inspect.rst:1165 +#: ../../library/inspect.rst:1169 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1167 +#: ../../library/inspect.rst:1171 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1500,95 +1502,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1176 +#: ../../library/inspect.rst:1180 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1180 +#: ../../library/inspect.rst:1184 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1185 +#: ../../library/inspect.rst:1189 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1190 +#: ../../library/inspect.rst:1194 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1194 +#: ../../library/inspect.rst:1198 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1199 ../../library/inspect.rst:1238 +#: ../../library/inspect.rst:1203 ../../library/inspect.rst:1242 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1203 +#: ../../library/inspect.rst:1207 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1207 +#: ../../library/inspect.rst:1211 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1210 +#: ../../library/inspect.rst:1214 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1219 +#: ../../library/inspect.rst:1223 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1224 +#: ../../library/inspect.rst:1228 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1229 +#: ../../library/inspect.rst:1233 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1233 +#: ../../library/inspect.rst:1237 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1242 +#: ../../library/inspect.rst:1246 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1247 +#: ../../library/inspect.rst:1251 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1254 +#: ../../library/inspect.rst:1258 msgid "" "Keeping references to frame objects, as found in the first element of the " "frame records these functions return, can cause your program to create " @@ -1600,7 +1602,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1262 +#: ../../library/inspect.rst:1266 msgid "" "Though the cycle detector will catch these, destruction of the frames (and " "local variables) can be made deterministic by removing the cycle in a :" @@ -1608,31 +1610,31 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1274 +#: ../../library/inspect.rst:1278 msgid "" "If you want to keep the frame around (for example to print a traceback " "later), you can also break reference cycles by using the :meth:`frame.clear` " "method." msgstr "" -#: ../../library/inspect.rst:1278 +#: ../../library/inspect.rst:1282 msgid "" "The optional *context* argument supported by most of these functions " "specifies the number of lines of context to return, which are centered " "around the current line." msgstr "" -#: ../../library/inspect.rst:1285 +#: ../../library/inspect.rst:1289 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1288 +#: ../../library/inspect.rst:1292 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1293 +#: ../../library/inspect.rst:1297 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -1640,19 +1642,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1298 ../../library/inspect.rst:1313 -#: ../../library/inspect.rst:1339 ../../library/inspect.rst:1354 +#: ../../library/inspect.rst:1302 ../../library/inspect.rst:1317 +#: ../../library/inspect.rst:1343 ../../library/inspect.rst:1358 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1303 ../../library/inspect.rst:1318 -#: ../../library/inspect.rst:1344 ../../library/inspect.rst:1359 +#: ../../library/inspect.rst:1307 ../../library/inspect.rst:1322 +#: ../../library/inspect.rst:1348 ../../library/inspect.rst:1363 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "" -#: ../../library/inspect.rst:1308 +#: ../../library/inspect.rst:1312 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -1660,11 +1662,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1323 +#: ../../library/inspect.rst:1327 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1327 +#: ../../library/inspect.rst:1331 msgid "" "This function relies on Python stack frame support in the interpreter, which " "isn't guaranteed to exist in all implementations of Python. If running in " @@ -1672,14 +1674,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1335 +#: ../../library/inspect.rst:1339 msgid "" "Return a list of :class:`FrameInfo` objects for the caller's stack. The " "first entry in the returned list represents the caller; the last entry " "represents the outermost call on the stack." msgstr "" -#: ../../library/inspect.rst:1349 +#: ../../library/inspect.rst:1353 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -1687,11 +1689,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1363 +#: ../../library/inspect.rst:1367 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1365 +#: ../../library/inspect.rst:1369 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1699,20 +1701,20 @@ msgid "" "`__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1370 +#: ../../library/inspect.rst:1374 msgid "" "For cases where you want passive introspection, like documentation tools, " "this can be inconvenient. :func:`getattr_static` has the same signature as :" "func:`getattr` but avoids executing code when it fetches attributes." msgstr "" -#: ../../library/inspect.rst:1376 +#: ../../library/inspect.rst:1380 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`__getattr__` or :meth:`__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1379 +#: ../../library/inspect.rst:1383 msgid "" "Note: this function may not be able to retrieve all attributes that getattr " "can fetch (like dynamically created attributes) and may find attributes that " @@ -1720,31 +1722,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1385 +#: ../../library/inspect.rst:1389 msgid "" "If the instance :attr:`~object.__dict__` is shadowed by another member (for " "example a property) then this function will be unable to find instance " "members." msgstr "" -#: ../../library/inspect.rst:1391 +#: ../../library/inspect.rst:1395 msgid "" ":func:`getattr_static` does not resolve descriptors, for example slot " "descriptors or getset descriptors on objects implemented in C. The " "descriptor object is returned instead of the underlying attribute." msgstr "" -#: ../../library/inspect.rst:1395 +#: ../../library/inspect.rst:1399 msgid "" "You can handle these with code like the following. Note that for arbitrary " "getset descriptors invoking these may trigger code execution::" msgstr "" -#: ../../library/inspect.rst:1421 +#: ../../library/inspect.rst:1425 msgid "Current State of Generators and Coroutines" msgstr "" -#: ../../library/inspect.rst:1423 +#: ../../library/inspect.rst:1427 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1753,31 +1755,31 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1431 +#: ../../library/inspect.rst:1435 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1437 ../../library/inspect.rst:1452 +#: ../../library/inspect.rst:1441 ../../library/inspect.rst:1456 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1434 +#: ../../library/inspect.rst:1438 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1435 +#: ../../library/inspect.rst:1439 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1436 +#: ../../library/inspect.rst:1440 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1437 +#: ../../library/inspect.rst:1441 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1443 +#: ../../library/inspect.rst:1447 msgid "" "Get current state of a coroutine object. The function is intended to be " "used with coroutine objects created by :keyword:`async def` functions, but " @@ -1785,30 +1787,30 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1449 +#: ../../library/inspect.rst:1453 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1450 +#: ../../library/inspect.rst:1454 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1451 +#: ../../library/inspect.rst:1455 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1452 +#: ../../library/inspect.rst:1456 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1456 +#: ../../library/inspect.rst:1460 msgid "" "The current internal state of the generator can also be queried. This is " "mostly useful for testing purposes, to ensure that internal state is being " "updated as expected:" msgstr "" -#: ../../library/inspect.rst:1462 +#: ../../library/inspect.rst:1466 msgid "" "Get the mapping of live local variables in *generator* to their current " "values. A dictionary is returned that maps from variable names to values. " @@ -1816,14 +1818,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1467 +#: ../../library/inspect.rst:1471 msgid "" "If *generator* is a :term:`generator` with no currently associated frame, " "then an empty dictionary is returned. :exc:`TypeError` is raised if " "*generator* is not a Python generator object." msgstr "" -#: ../../library/inspect.rst:1473 +#: ../../library/inspect.rst:1477 msgid "" "This function relies on the generator exposing a Python stack frame for " "introspection, which isn't guaranteed to be the case in all implementations " @@ -1831,72 +1833,72 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1482 +#: ../../library/inspect.rst:1486 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1491 +#: ../../library/inspect.rst:1495 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1493 +#: ../../library/inspect.rst:1497 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1498 +#: ../../library/inspect.rst:1502 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1502 +#: ../../library/inspect.rst:1506 msgid "" "If set, a new dict will be created for the frame's ``f_locals`` when the " "code object is executed." msgstr "" -#: ../../library/inspect.rst:1507 +#: ../../library/inspect.rst:1511 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1511 +#: ../../library/inspect.rst:1515 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1515 +#: ../../library/inspect.rst:1519 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1519 +#: ../../library/inspect.rst:1523 msgid "" "The flag is set when the code object is a generator function, i.e. a " "generator object is returned when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1524 +#: ../../library/inspect.rst:1528 msgid "" "The flag is set when the code object is a coroutine function. When the code " "object is executed it returns a coroutine object. See :pep:`492` for more " "details." msgstr "" -#: ../../library/inspect.rst:1532 +#: ../../library/inspect.rst:1536 msgid "" "The flag is used to transform generators into generator-based coroutines. " "Generator objects with this flag can be used in ``await`` expression, and " "can ``yield from`` coroutine objects. See :pep:`492` for more details." msgstr "" -#: ../../library/inspect.rst:1541 +#: ../../library/inspect.rst:1545 msgid "" "The flag is set when the code object is an asynchronous generator function. " "When the code object is executed it returns an asynchronous generator " "object. See :pep:`525` for more details." msgstr "" -#: ../../library/inspect.rst:1548 +#: ../../library/inspect.rst:1552 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1904,24 +1906,24 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1558 +#: ../../library/inspect.rst:1562 msgid "Command Line Interface" msgstr "" -#: ../../library/inspect.rst:1560 +#: ../../library/inspect.rst:1564 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1565 +#: ../../library/inspect.rst:1569 msgid "" "By default, accepts the name of a module and prints the source of that " "module. A class or function within the module can be printed instead by " "appended a colon and the qualified name of the target object." msgstr "" -#: ../../library/inspect.rst:1571 +#: ../../library/inspect.rst:1575 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/typing.po b/library/typing.po index bdd73a9c41..73ca47750c 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-26 00:38+0000\n" +"POT-Creation-Date: 2023-03-24 00:31+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -337,7 +337,7 @@ msgid "" msgstr "" #: ../../library/typing.rst:222 ../../library/typing.rst:1164 -#: ../../library/typing.rst:2801 +#: ../../library/typing.rst:2817 msgid "For example::" msgstr "" "舉例來說:\n" @@ -657,7 +657,7 @@ msgid "" "``LiteralString``-typed objects is also acceptable as a ``LiteralString``." msgstr "" -#: ../../library/typing.rst:615 ../../library/typing.rst:2443 +#: ../../library/typing.rst:615 ../../library/typing.rst:2459 msgid "Example::" msgstr "" "舉例來說:\n" @@ -1024,7 +1024,7 @@ msgid "" "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1031 ../../library/typing.rst:2684 +#: ../../library/typing.rst:1031 ../../library/typing.rst:2700 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1231,7 +1231,7 @@ msgid "Type variable." msgstr "" #: ../../library/typing.rst:1232 ../../library/typing.rst:1429 -#: ../../library/typing.rst:1606 +#: ../../library/typing.rst:1622 msgid "Usage::" msgstr "" "用法:\n" @@ -1503,48 +1503,57 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1587 +#: ../../library/typing.rst:1594 msgid "" -":func:`runtime_checkable` will check only the presence of the required " -"methods, not their type signatures. For example, :class:`ssl.SSLObject` is a " -"class, therefore it passes an :func:`issubclass` check against :data:" -"`Callable`. However, the ``ssl.SSLObject.__init__`` method exists only to " -"raise a :exc:`TypeError` with a more informative message, therefore making " -"it impossible to call (instantiate) :class:`ssl.SSLObject`." +":func:`!runtime_checkable` will check only the presence of the required " +"methods or attributes, not their type signatures or types. For example, :" +"class:`ssl.SSLObject` is a class, therefore it passes an :func:`issubclass` " +"check against :data:`Callable`. However, the ``ssl.SSLObject.__init__`` " +"method exists only to raise a :exc:`TypeError` with a more informative " +"message, therefore making it impossible to call (instantiate) :class:`ssl." +"SSLObject`." msgstr "" -#: ../../library/typing.rst:1598 +#: ../../library/typing.rst:1605 +msgid "" +"An :func:`isinstance` check against a runtime-checkable protocol can be " +"surprisingly slow compared to an ``isinstance()`` check against a non-" +"protocol class. Consider using alternative idioms such as :func:`hasattr` " +"calls for structural checks in performance-sensitive code." +msgstr "" + +#: ../../library/typing.rst:1614 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1600 +#: ../../library/typing.rst:1616 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1604 +#: ../../library/typing.rst:1620 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1612 +#: ../../library/typing.rst:1628 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1616 +#: ../../library/typing.rst:1632 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1625 +#: ../../library/typing.rst:1641 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1627 +#: ../../library/typing.rst:1643 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1553,60 +1562,60 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1633 +#: ../../library/typing.rst:1649 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1643 +#: ../../library/typing.rst:1659 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1649 +#: ../../library/typing.rst:1665 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1653 +#: ../../library/typing.rst:1669 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1656 +#: ../../library/typing.rst:1672 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1659 +#: ../../library/typing.rst:1675 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1663 +#: ../../library/typing.rst:1679 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1667 +#: ../../library/typing.rst:1683 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1688 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1682 +#: ../../library/typing.rst:1698 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1687 +#: ../../library/typing.rst:1703 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1690 +#: ../../library/typing.rst:1706 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1614,53 +1623,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1706 +#: ../../library/typing.rst:1722 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1710 +#: ../../library/typing.rst:1726 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1714 +#: ../../library/typing.rst:1730 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1721 +#: ../../library/typing.rst:1737 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1722 +#: ../../library/typing.rst:1738 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1734 +#: ../../library/typing.rst:1750 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1745 +#: ../../library/typing.rst:1761 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1748 +#: ../../library/typing.rst:1764 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1758 +#: ../../library/typing.rst:1774 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1668,61 +1677,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1763 +#: ../../library/typing.rst:1779 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:1778 +#: ../../library/typing.rst:1794 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1785 +#: ../../library/typing.rst:1801 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1793 +#: ../../library/typing.rst:1809 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:1811 +#: ../../library/typing.rst:1827 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:1817 +#: ../../library/typing.rst:1833 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:1823 +#: ../../library/typing.rst:1839 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example::" msgstr "" -#: ../../library/typing.rst:1843 +#: ../../library/typing.rst:1859 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:1846 +#: ../../library/typing.rst:1862 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:1849 +#: ../../library/typing.rst:1865 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1731,162 +1740,162 @@ msgid "" "``TypedDict`` with a different value for ``total``::" msgstr "" -#: ../../library/typing.rst:1870 +#: ../../library/typing.rst:1886 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1874 +#: ../../library/typing.rst:1890 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:1878 +#: ../../library/typing.rst:1894 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:1882 +#: ../../library/typing.rst:1898 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1885 +#: ../../library/typing.rst:1901 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1889 +#: ../../library/typing.rst:1905 msgid "" "A generic version of :class:`dict`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Mapping`." msgstr "" -#: ../../library/typing.rst:1893 +#: ../../library/typing.rst:1909 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1898 +#: ../../library/typing.rst:1914 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1904 +#: ../../library/typing.rst:1920 msgid "" "Generic version of :class:`list`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:1909 +#: ../../library/typing.rst:1925 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1919 +#: ../../library/typing.rst:1935 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1925 +#: ../../library/typing.rst:1941 msgid "" "A generic version of :class:`builtins.set `. Useful for annotating " "return types. To annotate arguments it is preferred to use an abstract " "collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:1929 +#: ../../library/typing.rst:1945 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1935 +#: ../../library/typing.rst:1951 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1937 +#: ../../library/typing.rst:1953 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1942 +#: ../../library/typing.rst:1958 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1945 +#: ../../library/typing.rst:1961 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1949 +#: ../../library/typing.rst:1965 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:1969 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1959 +#: ../../library/typing.rst:1975 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:1963 +#: ../../library/typing.rst:1979 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:1985 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:1974 +#: ../../library/typing.rst:1990 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1980 +#: ../../library/typing.rst:1996 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:1985 +#: ../../library/typing.rst:2001 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1991 +#: ../../library/typing.rst:2007 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:1996 +#: ../../library/typing.rst:2012 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2001 +#: ../../library/typing.rst:2017 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2007 +#: ../../library/typing.rst:2023 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2014 +#: ../../library/typing.rst:2030 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2019 +#: ../../library/typing.rst:2035 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1894,32 +1903,32 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2029 +#: ../../library/typing.rst:2045 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2030 +#: ../../library/typing.rst:2046 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2036 +#: ../../library/typing.rst:2052 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:2040 +#: ../../library/typing.rst:2056 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2048 +#: ../../library/typing.rst:2064 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " @@ -1927,416 +1936,416 @@ msgid "" "wherever possible." msgstr "" -#: ../../library/typing.rst:2055 +#: ../../library/typing.rst:2071 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2058 +#: ../../library/typing.rst:2074 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2062 +#: ../../library/typing.rst:2078 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2064 +#: ../../library/typing.rst:2080 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2070 +#: ../../library/typing.rst:2086 msgid "A generic version of :class:`collections.abc.ByteString`." msgstr "" -#: ../../library/typing.rst:2072 +#: ../../library/typing.rst:2088 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2075 +#: ../../library/typing.rst:2091 msgid "" "As a shorthand for this type, :class:`bytes` can be used to annotate " "arguments of any of the types mentioned above." msgstr "" -#: ../../library/typing.rst:2078 +#: ../../library/typing.rst:2094 msgid "" ":class:`collections.abc.ByteString` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2084 +#: ../../library/typing.rst:2100 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:2088 +#: ../../library/typing.rst:2104 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2094 +#: ../../library/typing.rst:2110 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2096 +#: ../../library/typing.rst:2112 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2102 +#: ../../library/typing.rst:2118 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2104 +#: ../../library/typing.rst:2120 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2110 +#: ../../library/typing.rst:2126 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2112 +#: ../../library/typing.rst:2128 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2134 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:2124 +#: ../../library/typing.rst:2140 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2130 +#: ../../library/typing.rst:2146 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2132 +#: ../../library/typing.rst:2148 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2138 +#: ../../library/typing.rst:2154 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2140 +#: ../../library/typing.rst:2156 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2147 +#: ../../library/typing.rst:2163 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2165 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2156 +#: ../../library/typing.rst:2172 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2158 +#: ../../library/typing.rst:2174 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2164 +#: ../../library/typing.rst:2180 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2166 +#: ../../library/typing.rst:2182 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2172 +#: ../../library/typing.rst:2188 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2174 +#: ../../library/typing.rst:2190 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2179 +#: ../../library/typing.rst:2195 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2183 +#: ../../library/typing.rst:2199 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2185 +#: ../../library/typing.rst:2201 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2191 +#: ../../library/typing.rst:2207 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2193 +#: ../../library/typing.rst:2209 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2199 +#: ../../library/typing.rst:2215 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2208 +#: ../../library/typing.rst:2224 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2212 +#: ../../library/typing.rst:2228 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2220 +#: ../../library/typing.rst:2236 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2228 +#: ../../library/typing.rst:2244 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2234 +#: ../../library/typing.rst:2250 msgid "An alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2238 +#: ../../library/typing.rst:2254 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2240 +#: ../../library/typing.rst:2256 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2246 +#: ../../library/typing.rst:2262 msgid "An alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2249 +#: ../../library/typing.rst:2265 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2253 +#: ../../library/typing.rst:2269 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:2265 +#: ../../library/typing.rst:2281 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2287 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2280 +#: ../../library/typing.rst:2296 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2284 +#: ../../library/typing.rst:2300 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2292 +#: ../../library/typing.rst:2308 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2302 +#: ../../library/typing.rst:2318 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2309 +#: ../../library/typing.rst:2325 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2313 +#: ../../library/typing.rst:2329 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2319 +#: ../../library/typing.rst:2335 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2323 +#: ../../library/typing.rst:2339 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2329 +#: ../../library/typing.rst:2345 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2333 +#: ../../library/typing.rst:2349 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2339 +#: ../../library/typing.rst:2355 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2343 +#: ../../library/typing.rst:2359 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2348 +#: ../../library/typing.rst:2364 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2355 +#: ../../library/typing.rst:2371 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2360 +#: ../../library/typing.rst:2376 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2366 +#: ../../library/typing.rst:2382 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2368 +#: ../../library/typing.rst:2384 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2372 +#: ../../library/typing.rst:2388 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2377 +#: ../../library/typing.rst:2393 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2381 +#: ../../library/typing.rst:2397 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2385 +#: ../../library/typing.rst:2401 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2389 +#: ../../library/typing.rst:2405 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2395 +#: ../../library/typing.rst:2411 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2399 +#: ../../library/typing.rst:2415 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2403 +#: ../../library/typing.rst:2419 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2407 +#: ../../library/typing.rst:2423 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2409 +#: ../../library/typing.rst:2425 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2416 +#: ../../library/typing.rst:2432 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2418 +#: ../../library/typing.rst:2434 msgid "" "When the type checker encounters a call to ``assert_type()``, it emits an " "error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2425 +#: ../../library/typing.rst:2441 msgid "" "At runtime this returns the first argument unchanged with no side effects." msgstr "" -#: ../../library/typing.rst:2427 +#: ../../library/typing.rst:2443 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2441 +#: ../../library/typing.rst:2457 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2454 +#: ../../library/typing.rst:2470 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " @@ -2349,53 +2358,53 @@ msgid "" "bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2466 +#: ../../library/typing.rst:2482 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2469 +#: ../../library/typing.rst:2485 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2493 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2479 +#: ../../library/typing.rst:2495 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2485 +#: ../../library/typing.rst:2501 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2488 +#: ../../library/typing.rst:2504 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2493 +#: ../../library/typing.rst:2509 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2498 +#: ../../library/typing.rst:2514 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2508 +#: ../../library/typing.rst:2524 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -2404,19 +2413,19 @@ msgid "" "`dataclasses.dataclass`-like behaviors." msgstr "" -#: ../../library/typing.rst:2514 +#: ../../library/typing.rst:2530 msgid "Example usage with a decorator function::" msgstr "" -#: ../../library/typing.rst:2528 +#: ../../library/typing.rst:2544 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2537 +#: ../../library/typing.rst:2553 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2548 +#: ../../library/typing.rst:2564 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*. *func* is the function object for the implementation of the " @@ -2562,25 +2571,25 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2650 +#: ../../library/typing.rst:2666 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2658 +#: ../../library/typing.rst:2674 msgid "" "Clear all registered overloads in the internal registry. This can be used to " "reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2666 +#: ../../library/typing.rst:2682 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2689 +#: ../../library/typing.rst:2705 msgid "" "The decorator will now set the ``__final__`` attribute to ``True`` on the " "decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2590,59 +2599,59 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2700 +#: ../../library/typing.rst:2716 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2702 +#: ../../library/typing.rst:2718 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods and classes defined in that class (but not to " "methods defined in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2706 +#: ../../library/typing.rst:2722 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2710 +#: ../../library/typing.rst:2726 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2712 +#: ../../library/typing.rst:2728 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2717 +#: ../../library/typing.rst:2733 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2719 +#: ../../library/typing.rst:2735 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2730 +#: ../../library/typing.rst:2746 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2734 +#: ../../library/typing.rst:2750 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2738 +#: ../../library/typing.rst:2754 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2741 +#: ../../library/typing.rst:2757 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2651,36 +2660,36 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2747 +#: ../../library/typing.rst:2763 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2762 +#: ../../library/typing.rst:2778 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2767 +#: ../../library/typing.rst:2783 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2770 +#: ../../library/typing.rst:2786 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2778 +#: ../../library/typing.rst:2794 msgid "Provide basic introspection for generic types and special typing forms." msgstr "" -#: ../../library/typing.rst:2780 +#: ../../library/typing.rst:2796 msgid "" "For a typing object of the form ``X[Y, Z, ...]`` these functions return " "``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" @@ -2691,11 +2700,11 @@ msgid "" "and ``()`` correspondingly. Examples::" msgstr "" -#: ../../library/typing.rst:2799 +#: ../../library/typing.rst:2815 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2814 +#: ../../library/typing.rst:2830 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2703,24 +2712,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2820 +#: ../../library/typing.rst:2836 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2827 +#: ../../library/typing.rst:2843 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2831 +#: ../../library/typing.rst:2847 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2840 +#: ../../library/typing.rst:2856 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2728,7 +2737,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2863 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2736,11 +2745,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2856 +#: ../../library/typing.rst:2872 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:2874 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2748,62 +2757,62 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2879 msgid "Feature" msgstr "" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2879 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2879 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2879 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2881 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2881 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2881 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2881 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2884 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2884 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:2868 ../../library/typing.rst:2871 +#: ../../library/typing.rst:2884 ../../library/typing.rst:2887 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2884 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:2871 +#: ../../library/typing.rst:2887 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2871 +#: ../../library/typing.rst:2887 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:2871 +#: ../../library/typing.rst:2887 msgid ":gh:`92332`" msgstr ":gh:`92332`" From 50d24aaaaca3451c338b780724d4e73d65b39712 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 25 Mar 2023 00:31:59 +0000 Subject: [PATCH 054/130] sync with cpython a08b65fa --- library/logging.po | 391 +++++++++++++++++++++++---------------------- library/ssl.po | 4 +- 2 files changed, 198 insertions(+), 197 deletions(-) diff --git a/library/logging.po b/library/logging.po index 445bd5e5d5..be59a4b686 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-03-25 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -268,7 +268,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:189 ../../library/logging.rst:1066 +#: ../../library/logging.rst:189 ../../library/logging.rst:1067 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -280,14 +280,14 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:198 ../../library/logging.rst:1075 +#: ../../library/logging.rst:198 ../../library/logging.rst:1076 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:206 ../../library/logging.rst:1083 +#: ../../library/logging.rst:206 ../../library/logging.rst:1084 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." @@ -336,7 +336,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:246 ../../library/logging.rst:1114 +#: ../../library/logging.rst:246 ../../library/logging.rst:1115 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -354,7 +354,7 @@ msgid "" "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:257 ../../library/logging.rst:1125 +#: ../../library/logging.rst:257 ../../library/logging.rst:1126 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" @@ -1001,33 +1001,34 @@ msgstr "" #: ../../library/logging.rst:798 msgid "" "The event description message, which can be a %-format string with " -"placeholders for variable data." +"placeholders for variable data, or an arbitrary object (see :ref:`arbitrary-" +"object-messages`)." msgstr "" -#: ../../library/logging.rst:802 +#: ../../library/logging.rst:803 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:806 +#: ../../library/logging.rst:807 msgid "" "An exception tuple with the current exception information, as returned by :" "func:`sys.exc_info`, or ``None`` if no exception information is available." msgstr "" -#: ../../library/logging.rst:811 +#: ../../library/logging.rst:812 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:815 +#: ../../library/logging.rst:816 msgid "" "A text string representing stack information from the base of the stack in " "the current thread, up to the logging call." msgstr "" -#: ../../library/logging.rst:822 +#: ../../library/logging.rst:823 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1036,7 +1037,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:829 +#: ../../library/logging.rst:830 msgid "" "The creation of a :class:`LogRecord` has been made more configurable by " "providing a factory which is used to create the record. The factory can be " @@ -1044,24 +1045,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:835 +#: ../../library/logging.rst:836 msgid "" "This functionality can be used to inject your own values into a :class:" "`LogRecord` at creation time. You can use the following pattern::" msgstr "" -#: ../../library/logging.rst:847 +#: ../../library/logging.rst:848 msgid "" "With this pattern, multiple factories could be chained, and as long as they " "don't overwrite each other's attributes or unintentionally overwrite the " "standard attributes listed above, there should be no surprises." msgstr "" -#: ../../library/logging.rst:856 +#: ../../library/logging.rst:857 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:858 +#: ../../library/logging.rst:859 msgid "" "The LogRecord has a number of attributes, most of which are derived from the " "parameters to the constructor. (Note that the names do not always correspond " @@ -1072,7 +1073,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:866 +#: ../../library/logging.rst:867 msgid "" "If you are using {}-formatting (:func:`str.format`), you can use ``{attrname}" "`` as the placeholder in the format string. If you are using $-formatting (:" @@ -1080,7 +1081,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:872 +#: ../../library/logging.rst:873 msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " @@ -1089,308 +1090,308 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:879 +#: ../../library/logging.rst:880 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:879 ../../library/logging.rst:1270 +#: ../../library/logging.rst:880 ../../library/logging.rst:1271 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:879 ../../library/logging.rst:1270 +#: ../../library/logging.rst:880 ../../library/logging.rst:1271 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:881 +#: ../../library/logging.rst:0 ../../library/logging.rst:882 msgid "args" msgstr "" -#: ../../library/logging.rst:881 ../../library/logging.rst:895 -#: ../../library/logging.rst:923 ../../library/logging.rst:941 +#: ../../library/logging.rst:882 ../../library/logging.rst:896 +#: ../../library/logging.rst:924 ../../library/logging.rst:942 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:881 +#: ../../library/logging.rst:882 msgid "" "The tuple of arguments merged into ``msg`` to produce ``message``, or a dict " "whose values are used for the merge (when there is only one argument, and it " "is a dictionary)." msgstr "" -#: ../../library/logging.rst:886 +#: ../../library/logging.rst:887 msgid "asctime" msgstr "" -#: ../../library/logging.rst:886 +#: ../../library/logging.rst:887 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:886 +#: ../../library/logging.rst:887 msgid "" "Human-readable time when the :class:`LogRecord` was created. By default " "this is of the form '2003-07-08 16:49:45,896' (the numbers after the comma " "are millisecond portion of the time)." msgstr "" -#: ../../library/logging.rst:892 +#: ../../library/logging.rst:893 msgid "created" msgstr "" -#: ../../library/logging.rst:892 +#: ../../library/logging.rst:893 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:892 +#: ../../library/logging.rst:893 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:895 +#: ../../library/logging.rst:0 ../../library/logging.rst:896 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:895 +#: ../../library/logging.rst:896 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:898 +#: ../../library/logging.rst:899 msgid "filename" msgstr "" -#: ../../library/logging.rst:898 +#: ../../library/logging.rst:899 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:898 +#: ../../library/logging.rst:899 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:900 +#: ../../library/logging.rst:901 msgid "funcName" msgstr "" -#: ../../library/logging.rst:900 +#: ../../library/logging.rst:901 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:900 +#: ../../library/logging.rst:901 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:903 msgid "levelname" msgstr "" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:903 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:903 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:906 +#: ../../library/logging.rst:907 msgid "levelno" msgstr "" -#: ../../library/logging.rst:906 +#: ../../library/logging.rst:907 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:906 +#: ../../library/logging.rst:907 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:911 +#: ../../library/logging.rst:912 msgid "lineno" msgstr "" -#: ../../library/logging.rst:911 +#: ../../library/logging.rst:912 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:911 +#: ../../library/logging.rst:912 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:914 +#: ../../library/logging.rst:915 msgid "message" msgstr "" -#: ../../library/logging.rst:914 +#: ../../library/logging.rst:915 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:914 +#: ../../library/logging.rst:915 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:919 msgid "module" msgstr "模組" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:919 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:919 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:921 msgid "msecs" msgstr "" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:921 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:921 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:923 +#: ../../library/logging.rst:0 ../../library/logging.rst:924 msgid "msg" msgstr "" -#: ../../library/logging.rst:923 +#: ../../library/logging.rst:924 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:928 +#: ../../library/logging.rst:0 ../../library/logging.rst:929 msgid "name" msgstr "" -#: ../../library/logging.rst:928 +#: ../../library/logging.rst:929 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:928 +#: ../../library/logging.rst:929 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:930 +#: ../../library/logging.rst:931 msgid "pathname" msgstr "" -#: ../../library/logging.rst:930 +#: ../../library/logging.rst:931 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:930 +#: ../../library/logging.rst:931 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:933 +#: ../../library/logging.rst:934 msgid "process" msgstr "" -#: ../../library/logging.rst:933 +#: ../../library/logging.rst:934 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:933 +#: ../../library/logging.rst:934 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:935 +#: ../../library/logging.rst:936 msgid "processName" msgstr "" -#: ../../library/logging.rst:935 +#: ../../library/logging.rst:936 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:935 +#: ../../library/logging.rst:936 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:937 +#: ../../library/logging.rst:938 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:937 +#: ../../library/logging.rst:938 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:937 +#: ../../library/logging.rst:938 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:941 +#: ../../library/logging.rst:942 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:941 +#: ../../library/logging.rst:942 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:947 +#: ../../library/logging.rst:948 msgid "thread" msgstr "" -#: ../../library/logging.rst:947 +#: ../../library/logging.rst:948 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:947 +#: ../../library/logging.rst:948 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:949 +#: ../../library/logging.rst:950 msgid "threadName" msgstr "" -#: ../../library/logging.rst:949 +#: ../../library/logging.rst:950 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:949 +#: ../../library/logging.rst:950 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:952 +#: ../../library/logging.rst:953 msgid "*processName* was added." msgstr "新增 *processName*\\ 。" -#: ../../library/logging.rst:959 +#: ../../library/logging.rst:960 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:961 +#: ../../library/logging.rst:962 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " "information into logging calls. For a usage example, see the section on :ref:" "`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:967 +#: ../../library/logging.rst:968 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:972 +#: ../../library/logging.rst:973 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1399,7 +1400,7 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:978 +#: ../../library/logging.rst:979 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1411,24 +1412,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:987 +#: ../../library/logging.rst:988 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:992 +#: ../../library/logging.rst:993 msgid "" "Attribute :attr:`manager` and method :meth:`_log` were added, which delegate " "to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:998 +#: ../../library/logging.rst:999 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1000 +#: ../../library/logging.rst:1001 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1437,7 +1438,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1005 +#: ../../library/logging.rst:1006 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1445,17 +1446,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1012 +#: ../../library/logging.rst:1013 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1015 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1020 +#: ../../library/logging.rst:1021 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1464,14 +1465,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:1025 +#: ../../library/logging.rst:1026 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1032 +#: ../../library/logging.rst:1033 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1480,24 +1481,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1043 +#: ../../library/logging.rst:1044 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1045 +#: ../../library/logging.rst:1046 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1050 +#: ../../library/logging.rst:1051 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1055 +#: ../../library/logging.rst:1056 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1506,7 +1507,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:1060 +#: ../../library/logging.rst:1061 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1516,7 +1517,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1086 +#: ../../library/logging.rst:1087 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1525,18 +1526,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1097 +#: ../../library/logging.rst:1098 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1103 +#: ../../library/logging.rst:1104 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1107 +#: ../../library/logging.rst:1108 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1547,58 +1548,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1121 +#: ../../library/logging.rst:1122 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1130 +#: ../../library/logging.rst:1131 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1136 +#: ../../library/logging.rst:1137 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1139 +#: ../../library/logging.rst:1140 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1146 +#: ../../library/logging.rst:1147 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1152 +#: ../../library/logging.rst:1153 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1158 +#: ../../library/logging.rst:1159 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1164 +#: ../../library/logging.rst:1165 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1169 +#: ../../library/logging.rst:1170 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1612,7 +1613,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1180 +#: ../../library/logging.rst:1181 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1620,13 +1621,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1185 +#: ../../library/logging.rst:1186 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1191 +#: ../../library/logging.rst:1192 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1636,24 +1637,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1198 +#: ../../library/logging.rst:1199 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1203 +#: ../../library/logging.rst:1204 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1211 +#: ../../library/logging.rst:1212 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1213 +#: ../../library/logging.rst:1214 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1663,29 +1664,29 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1220 +#: ../../library/logging.rst:1221 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1224 +#: ../../library/logging.rst:1225 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1227 +#: ../../library/logging.rst:1228 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " -"level name displayed in the formatted log output by means of the ``" -"%(levelname)s`` format specifier (see :ref:`logrecord-attributes`), and vice " -"versa." +"level name displayed in the formatted log output by means of the " +"``%(levelname)s`` format specifier (see :ref:`logrecord-attributes`), and " +"vice versa." msgstr "" -#: ../../library/logging.rst:1233 +#: ../../library/logging.rst:1234 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1693,7 +1694,7 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1241 +#: ../../library/logging.rst:1242 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1701,7 +1702,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1249 +#: ../../library/logging.rst:1250 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1710,13 +1711,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1255 +#: ../../library/logging.rst:1256 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1258 +#: ../../library/logging.rst:1259 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1725,54 +1726,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1265 +#: ../../library/logging.rst:1266 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1272 +#: ../../library/logging.rst:1273 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1272 +#: ../../library/logging.rst:1273 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1276 +#: ../../library/logging.rst:1277 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1276 +#: ../../library/logging.rst:1277 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1280 +#: ../../library/logging.rst:1281 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1280 +#: ../../library/logging.rst:1281 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1285 +#: ../../library/logging.rst:1286 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1285 +#: ../../library/logging.rst:1286 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1288 +#: ../../library/logging.rst:1289 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1288 +#: ../../library/logging.rst:1289 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1299 +#: ../../library/logging.rst:1300 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1299 +#: ../../library/logging.rst:1300 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1305 +#: ../../library/logging.rst:1306 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1305 +#: ../../library/logging.rst:1306 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -1812,33 +1813,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1314 +#: ../../library/logging.rst:1315 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1314 +#: ../../library/logging.rst:1315 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1320 +#: ../../library/logging.rst:1321 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1320 +#: ../../library/logging.rst:1321 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1325 +#: ../../library/logging.rst:1326 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1325 +#: ../../library/logging.rst:1326 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -1847,39 +1848,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1336 +#: ../../library/logging.rst:1337 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1339 +#: ../../library/logging.rst:1340 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1345 +#: ../../library/logging.rst:1346 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1348 +#: ../../library/logging.rst:1349 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1353 +#: ../../library/logging.rst:1354 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1357 +#: ../../library/logging.rst:1358 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1364 +#: ../../library/logging.rst:1365 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`__init__` such that only a name " @@ -1891,32 +1892,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1375 +#: ../../library/logging.rst:1376 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1377 +#: ../../library/logging.rst:1378 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1379 +#: ../../library/logging.rst:1380 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1384 +#: ../../library/logging.rst:1385 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1386 +#: ../../library/logging.rst:1387 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1389 msgid "The logger name." msgstr "" @@ -1924,7 +1925,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1389 +#: ../../library/logging.rst:1390 msgid "The logging level (numeric)." msgstr "" @@ -1932,7 +1933,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1390 +#: ../../library/logging.rst:1391 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1940,19 +1941,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1391 +#: ../../library/logging.rst:1392 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1392 +#: ../../library/logging.rst:1393 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1393 +#: ../../library/logging.rst:1394 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1394 +#: ../../library/logging.rst:1395 msgid "An exception tuple, or ``None``." msgstr "" @@ -1960,7 +1961,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1395 +#: ../../library/logging.rst:1396 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1968,7 +1969,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1397 +#: ../../library/logging.rst:1398 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1978,15 +1979,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1399 +#: ../../library/logging.rst:1400 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1403 +#: ../../library/logging.rst:1404 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1407 +#: ../../library/logging.rst:1408 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -1997,22 +1998,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1418 +#: ../../library/logging.rst:1419 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1420 +#: ../../library/logging.rst:1421 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1425 +#: ../../library/logging.rst:1426 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1428 +#: ../../library/logging.rst:1429 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2021,46 +2022,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1433 +#: ../../library/logging.rst:1434 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1441 +#: ../../library/logging.rst:1442 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1441 +#: ../../library/logging.rst:1442 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1444 +#: ../../library/logging.rst:1445 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1444 +#: ../../library/logging.rst:1445 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1448 +#: ../../library/logging.rst:1449 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1447 +#: ../../library/logging.rst:1448 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1453 +#: ../../library/logging.rst:1454 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1451 +#: ../../library/logging.rst:1452 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " diff --git a/library/ssl.po b/library/ssl.po index 6950a090a8..6573813814 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-03-25 00:29+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-" @@ -1425,7 +1425,7 @@ msgstr "" #: ../../library/ssl.rst:1312 msgid "" -"Return the list of ciphers shared by the client during the handshake. Each " +"Return the list of ciphers available in both the client and server. Each " "entry of the returned list is a three-value tuple containing the name of the " "cipher, the version of the SSL protocol that defines its use, and the number " "of secret bits the cipher uses. :meth:`~SSLSocket.shared_ciphers` returns " From c65fc9c3f10b9ff6a73ca6152b96d311bf2482ef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 Mar 2023 00:35:22 +0000 Subject: [PATCH 055/130] sync with cpython b28f9190 --- c-api/weakref.po | 15 ++++- library/asyncio-task.po | 122 +++++++++++++++++++++------------------- library/ctypes.po | 4 +- library/gzip.po | 67 ++++++++++++---------- library/pdb.po | 63 +++++++++++---------- 5 files changed, 148 insertions(+), 123 deletions(-) diff --git a/c-api/weakref.po b/c-api/weakref.po index 6536863d9d..4e6d3a0cae 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-03-26 00:33+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -87,3 +87,16 @@ msgstr "" #: ../../c-api/weakref.rst:69 msgid "Similar to :c:func:`PyWeakref_GetObject`, but does no error checking." msgstr "" + +#: ../../c-api/weakref.rst:74 +msgid "" +"This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " +"to clear weak references." +msgstr "" + +#: ../../c-api/weakref.rst:77 +msgid "" +"This iterates through the weak references for *object* and calls callbacks " +"for those references which have one. It returns when all callbacks have been " +"attempted." +msgstr "" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index d60bf0fcee..cd1262bb54 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-24 00:31+0000\n" +"POT-Creation-Date: 2023-03-26 00:33+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -241,7 +241,7 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1004 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1011 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" @@ -888,17 +888,21 @@ msgid "" "loop." msgstr "" -#: ../../library/asyncio-task.rst:960 +#: ../../library/asyncio-task.rst:961 +msgid "Return ``True`` if *obj* is a coroutine object." +msgstr "" + +#: ../../library/asyncio-task.rst:967 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:964 +#: ../../library/asyncio-task.rst:971 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:967 +#: ../../library/asyncio-task.rst:974 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -906,21 +910,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:973 +#: ../../library/asyncio-task.rst:980 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:978 +#: ../../library/asyncio-task.rst:985 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:983 +#: ../../library/asyncio-task.rst:990 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -928,112 +932,112 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:988 +#: ../../library/asyncio-task.rst:995 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:993 +#: ../../library/asyncio-task.rst:1000 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:997 +#: ../../library/asyncio-task.rst:1004 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:1001 +#: ../../library/asyncio-task.rst:1008 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1007 +#: ../../library/asyncio-task.rst:1014 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1013 +#: ../../library/asyncio-task.rst:1020 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1015 +#: ../../library/asyncio-task.rst:1022 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1020 +#: ../../library/asyncio-task.rst:1027 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1022 +#: ../../library/asyncio-task.rst:1029 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:1026 ../../library/asyncio-task.rst:1040 +#: ../../library/asyncio-task.rst:1033 ../../library/asyncio-task.rst:1047 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1029 +#: ../../library/asyncio-task.rst:1036 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1034 +#: ../../library/asyncio-task.rst:1041 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1036 +#: ../../library/asyncio-task.rst:1043 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1043 +#: ../../library/asyncio-task.rst:1050 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1048 +#: ../../library/asyncio-task.rst:1055 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1050 ../../library/asyncio-task.rst:1059 +#: ../../library/asyncio-task.rst:1057 ../../library/asyncio-task.rst:1066 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1052 +#: ../../library/asyncio-task.rst:1059 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1057 +#: ../../library/asyncio-task.rst:1064 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1061 +#: ../../library/asyncio-task.rst:1068 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1066 +#: ../../library/asyncio-task.rst:1073 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1068 +#: ../../library/asyncio-task.rst:1075 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1041,15 +1045,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1074 +#: ../../library/asyncio-task.rst:1081 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1076 +#: ../../library/asyncio-task.rst:1083 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1078 +#: ../../library/asyncio-task.rst:1085 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1058,66 +1062,66 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1087 +#: ../../library/asyncio-task.rst:1094 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1089 +#: ../../library/asyncio-task.rst:1096 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1092 +#: ../../library/asyncio-task.rst:1099 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1094 +#: ../../library/asyncio-task.rst:1101 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" -#: ../../library/asyncio-task.rst:1099 +#: ../../library/asyncio-task.rst:1106 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1105 +#: ../../library/asyncio-task.rst:1112 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1107 +#: ../../library/asyncio-task.rst:1114 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:1115 +#: ../../library/asyncio-task.rst:1122 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1117 +#: ../../library/asyncio-task.rst:1124 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1120 +#: ../../library/asyncio-task.rst:1127 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1127 +#: ../../library/asyncio-task.rst:1134 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1129 +#: ../../library/asyncio-task.rst:1136 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1132 +#: ../../library/asyncio-task.rst:1139 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1129,46 +1133,46 @@ msgid "" "addition to catching the exception." msgstr "" -#: ../../library/asyncio-task.rst:1142 +#: ../../library/asyncio-task.rst:1149 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1145 +#: ../../library/asyncio-task.rst:1152 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1150 +#: ../../library/asyncio-task.rst:1157 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1189 +#: ../../library/asyncio-task.rst:1196 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1191 +#: ../../library/asyncio-task.rst:1198 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:1197 +#: ../../library/asyncio-task.rst:1204 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1199 +#: ../../library/asyncio-task.rst:1206 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1201 +#: ../../library/asyncio-task.rst:1208 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1206 +#: ../../library/asyncio-task.rst:1213 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1177,7 +1181,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1224 +#: ../../library/asyncio-task.rst:1231 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1186,20 +1190,20 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1230 +#: ../../library/asyncio-task.rst:1237 msgid "" "If end-user code is, for some reason, suppresing cancellation by catching :" "exc:`CancelledError`, it needs to call this method to remove the " "cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:1236 +#: ../../library/asyncio-task.rst:1243 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: ../../library/asyncio-task.rst:1240 +#: ../../library/asyncio-task.rst:1247 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1208,7 +1212,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1246 +#: ../../library/asyncio-task.rst:1253 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." diff --git a/library/ctypes.po b/library/ctypes.po index 388e9d54b8..ff09c324fd 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-10 17:25+0000\n" +"POT-Creation-Date: 2023-03-26 00:33+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -492,7 +492,7 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:378 -msgid "Calling varadic functions" +msgid "Calling variadic functions" msgstr "" #: ../../library/ctypes.rst:380 diff --git a/library/gzip.po b/library/gzip.po index 80d5a11fcd..3c16c7a106 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-03-26 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -105,7 +105,7 @@ msgstr "" msgid "Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes." msgstr "" -#: ../../library/gzip.rst:59 ../../library/gzip.rst:165 +#: ../../library/gzip.rst:59 ../../library/gzip.rst:171 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -224,38 +224,45 @@ msgid "" "returned by :func:`os.stat`." msgstr "" -#: ../../library/gzip.rst:146 +#: ../../library/gzip.rst:148 +msgid "" +"The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. " +"Equivalent to the output of :func:`os.fspath` on the original input path, " +"with no other normalization, resolution or expansion." +msgstr "" + +#: ../../library/gzip.rst:152 msgid "" "Support for the :keyword:`with` statement was added, along with the *mtime* " "constructor argument and :attr:`mtime` attribute." msgstr "" -#: ../../library/gzip.rst:150 +#: ../../library/gzip.rst:156 msgid "Support for zero-padded and unseekable files was added." msgstr "" -#: ../../library/gzip.rst:153 +#: ../../library/gzip.rst:159 msgid "The :meth:`io.BufferedIOBase.read1` method is now implemented." msgstr "" -#: ../../library/gzip.rst:156 +#: ../../library/gzip.rst:162 msgid "Added support for the ``'x'`` and ``'xb'`` modes." msgstr "" -#: ../../library/gzip.rst:159 +#: ../../library/gzip.rst:165 msgid "" "Added support for writing arbitrary :term:`bytes-like objects `. The :meth:`~io.BufferedIOBase.read` method now accepts an argument " "of ``None``." msgstr "" -#: ../../library/gzip.rst:168 +#: ../../library/gzip.rst:174 msgid "" "Opening :class:`GzipFile` for writing without specifying the *mode* argument " "is deprecated." msgstr "" -#: ../../library/gzip.rst:175 +#: ../../library/gzip.rst:181 msgid "" "Compress the *data*, returning a :class:`bytes` object containing the " "compressed data. *compresslevel* and *mtime* have the same meaning as in " @@ -264,18 +271,18 @@ msgid "" "The zlib function is faster." msgstr "" -#: ../../library/gzip.rst:182 +#: ../../library/gzip.rst:188 msgid "Added the *mtime* parameter for reproducible output." msgstr "" -#: ../../library/gzip.rst:184 +#: ../../library/gzip.rst:190 msgid "" "Speed is improved by compressing all data at once instead of in a streamed " "fashion. Calls with *mtime* set to ``0`` are delegated to :func:`zlib." "compress` for better speed." msgstr "" -#: ../../library/gzip.rst:191 +#: ../../library/gzip.rst:197 msgid "" "Decompress the *data*, returning a :class:`bytes` object containing the " "uncompressed data. This function is capable of decompressing multi-member " @@ -284,82 +291,82 @@ msgid "" "*wbits* set to 31 is faster." msgstr "" -#: ../../library/gzip.rst:198 +#: ../../library/gzip.rst:204 msgid "" "Speed is improved by decompressing members at once in memory instead of in a " "streamed fashion." msgstr "" -#: ../../library/gzip.rst:205 +#: ../../library/gzip.rst:211 msgid "Examples of usage" msgstr "用法範例" -#: ../../library/gzip.rst:207 +#: ../../library/gzip.rst:213 msgid "Example of how to read a compressed file::" msgstr "" -#: ../../library/gzip.rst:213 +#: ../../library/gzip.rst:219 msgid "Example of how to create a compressed GZIP file::" msgstr "" -#: ../../library/gzip.rst:220 +#: ../../library/gzip.rst:226 msgid "Example of how to GZIP compress an existing file::" msgstr "" -#: ../../library/gzip.rst:228 +#: ../../library/gzip.rst:234 msgid "Example of how to GZIP compress a binary string::" msgstr "" -#: ../../library/gzip.rst:237 +#: ../../library/gzip.rst:243 msgid "Module :mod:`zlib`" msgstr ":mod:`zlib` 模組" -#: ../../library/gzip.rst:237 +#: ../../library/gzip.rst:243 msgid "" "The basic data compression module needed to support the :program:`gzip` file " "format." msgstr "" -#: ../../library/gzip.rst:244 +#: ../../library/gzip.rst:250 msgid "Command Line Interface" msgstr "" -#: ../../library/gzip.rst:246 +#: ../../library/gzip.rst:252 msgid "" "The :mod:`gzip` module provides a simple command line interface to compress " "or decompress files." msgstr "" -#: ../../library/gzip.rst:249 +#: ../../library/gzip.rst:255 msgid "Once executed the :mod:`gzip` module keeps the input file(s)." msgstr "" -#: ../../library/gzip.rst:253 +#: ../../library/gzip.rst:259 msgid "" "Add a new command line interface with a usage. By default, when you will " "execute the CLI, the default compression level is 6." msgstr "" -#: ../../library/gzip.rst:257 +#: ../../library/gzip.rst:263 msgid "Command line options" msgstr "" -#: ../../library/gzip.rst:261 +#: ../../library/gzip.rst:267 msgid "If *file* is not specified, read from :attr:`sys.stdin`." msgstr "" -#: ../../library/gzip.rst:265 +#: ../../library/gzip.rst:271 msgid "Indicates the fastest compression method (less compression)." msgstr "" -#: ../../library/gzip.rst:269 +#: ../../library/gzip.rst:275 msgid "Indicates the slowest compression method (best compression)." msgstr "" -#: ../../library/gzip.rst:273 +#: ../../library/gzip.rst:279 msgid "Decompress the given file." msgstr "" -#: ../../library/gzip.rst:277 +#: ../../library/gzip.rst:283 msgid "Show the help message." msgstr "" diff --git a/library/pdb.po b/library/pdb.po index 582a33bc48..291a36b075 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-15 00:32+0000\n" +"POT-Creation-Date: 2023-03-26 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -147,7 +147,7 @@ msgstr "" msgid "" "Evaluate the *expression* (given as a string or a code object) under " "debugger control. When :func:`runeval` returns, it returns the value of the " -"expression. Otherwise this function is similar to :func:`run`." +"*expression*. Otherwise this function is similar to :func:`run`." msgstr "" #: ../../library/pdb.rst:133 @@ -211,10 +211,10 @@ msgstr "" #: ../../library/pdb.rst:180 msgid "" "By default, Pdb sets a handler for the SIGINT signal (which is sent when the " -"user presses :kbd:`Ctrl-C` on the console) when you give a ``continue`` " -"command. This allows you to break into the debugger again by pressing :kbd:" -"`Ctrl-C`. If you want Pdb not to touch the SIGINT handler, set *nosigint* " -"to true." +"user presses :kbd:`Ctrl-C` on the console) when you give a :pdbcmd:" +"`continue` command. This allows you to break into the debugger again by " +"pressing :kbd:`Ctrl-C`. If you want Pdb not to touch the SIGINT handler, " +"set *nosigint* to true." msgstr "" #: ../../library/pdb.rst:185 @@ -400,11 +400,11 @@ msgstr "" #: ../../library/pdb.rst:331 msgid "" -"Set the ignore count for the given breakpoint number. If count is omitted, " -"the ignore count is set to 0. A breakpoint becomes active when the ignore " -"count is zero. When non-zero, the count is decremented each time the " -"breakpoint is reached and the breakpoint is not disabled and any associated " -"condition evaluates to true." +"Set the ignore count for the given breakpoint number. If *count* is " +"omitted, the ignore count is set to 0. A breakpoint becomes active when the " +"ignore count is zero. When non-zero, the *count* is decremented each time " +"the breakpoint is reached and the breakpoint is not disabled and any " +"associated condition evaluates to true." msgstr "" #: ../../library/pdb.rst:339 @@ -452,8 +452,8 @@ msgstr "" #: ../../library/pdb.rst:372 msgid "" -"If you use the 'silent' command in the command list, the usual message about " -"stopping at a breakpoint is not printed. This may be desirable for " +"If you use the ``silent`` command in the command list, the usual message " +"about stopping at a breakpoint is not printed. This may be desirable for " "breakpoints that are to print a specific message and then continue. If none " "of the other commands print anything, you see no sign that the breakpoint " "was reached." @@ -482,9 +482,9 @@ msgstr "" #: ../../library/pdb.rst:395 msgid "" -"With a line number, continue execution until a line with a number greater or " -"equal to that is reached. In both cases, also stop when the current frame " -"returns." +"With *lineno*, continue execution until a line with a number greater or " +"equal to *lineno* is reached. In both cases, also stop when the current " +"frame returns." msgstr "" #: ../../library/pdb.rst:399 @@ -545,7 +545,7 @@ msgid "Print the argument list of the current function." msgstr "" #: ../../library/pdb.rst:449 -msgid "Evaluate the *expression* in the current context and print its value." +msgid "Evaluate *expression* in the current context and print its value." msgstr "" #: ../../library/pdb.rst:453 @@ -556,32 +556,33 @@ msgstr "" #: ../../library/pdb.rst:459 msgid "" -"Like the :pdbcmd:`p` command, except the value of the expression is pretty-" +"Like the :pdbcmd:`p` command, except the value of *expression* is pretty-" "printed using the :mod:`pprint` module." msgstr "" #: ../../library/pdb.rst:464 -msgid "Print the type of the *expression*." +msgid "Print the type of *expression*." msgstr "" #: ../../library/pdb.rst:468 -msgid "Try to get source code for the given object and display it." +msgid "Try to get source code of *expression* and display it." msgstr "" #: ../../library/pdb.rst:474 msgid "" -"Display the value of the expression if it changed, each time execution stops " +"Display the value of *expression* if it changed, each time execution stops " "in the current frame." msgstr "" #: ../../library/pdb.rst:477 -msgid "Without expression, list all display expressions for the current frame." +msgid "" +"Without *expression*, list all display expressions for the current frame." msgstr "" #: ../../library/pdb.rst:483 msgid "" -"Do not display the expression any more in the current frame. Without " -"expression, clear all display expressions for the current frame." +"Do not display *expression* anymore in the current frame. Without " +"*expression*, clear all display expressions for the current frame." msgstr "" #: ../../library/pdb.rst:490 @@ -593,10 +594,10 @@ msgstr "" #: ../../library/pdb.rst:500 msgid "" -"Create an alias called *name* that executes *command*. The command must " +"Create an alias called *name* that executes *command*. The *command* must " "*not* be enclosed in quotes. Replaceable parameters can be indicated by " "``%1``, ``%2``, and so on, while ``%*`` is replaced by all the parameters. " -"If no command is given, the current alias for *name* is shown. If no " +"If *command* is omitted, the current alias for *name* is shown. If no " "arguments are given, all aliases are listed." msgstr "" @@ -616,7 +617,7 @@ msgid "" msgstr "" #: ../../library/pdb.rst:522 -msgid "Delete the specified alias." +msgid "Delete the specified alias *name*." msgstr "" #: ../../library/pdb.rst:526 @@ -630,8 +631,8 @@ msgstr "" #: ../../library/pdb.rst:538 msgid "" -"Restart the debugged Python program. If an argument is supplied, it is " -"split with :mod:`shlex` and the result is used as the new :data:`sys.argv`. " +"Restart the debugged Python program. If *args* is supplied, it is split " +"with :mod:`shlex` and the result is used as the new :data:`sys.argv`. " "History, breakpoints, actions and debugger options are preserved. :pdbcmd:" "`restart` is an alias for :pdbcmd:`run`." msgstr "" @@ -642,8 +643,8 @@ msgstr "" #: ../../library/pdb.rst:549 msgid "" -"Enter a recursive debugger that steps through the code argument (which is an " -"arbitrary expression or statement to be executed in the current environment)." +"Enter a recursive debugger that steps through *code* (which is an arbitrary " +"expression or statement to be executed in the current environment)." msgstr "" #: ../../library/pdb.rst:555 From 70353949011ae15d2cd67bdefbcafb8d35fdc37c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Mar 2023 00:33:51 +0000 Subject: [PATCH 056/130] sync with cpython ae42c1d1 --- howto/logging-cookbook.po | 554 +++++++++++++++++++------------------- 1 file changed, 277 insertions(+), 277 deletions(-) diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 2e4934ddb3..8406a49eb6 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-27 00:34+0000\n" +"POT-Creation-Date: 2023-03-30 00:31+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-" @@ -195,17 +195,17 @@ msgid "" "adding a ``filters`` section parallel to ``formatters`` and ``handlers``:" msgstr "" -#: ../../howto/logging-cookbook.rst:350 +#: ../../howto/logging-cookbook.rst:352 msgid "and changing the section on the ``stdout`` handler to add it:" msgstr "" -#: ../../howto/logging-cookbook.rst:362 +#: ../../howto/logging-cookbook.rst:366 msgid "" "A filter is just a function, so we can define the ``filter_maker`` (a " "factory function) as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:375 +#: ../../howto/logging-cookbook.rst:379 msgid "" "This converts the string argument passed in to a numeric level, and returns " "a function which only returns ``True`` if the level of the passed in record " @@ -216,45 +216,45 @@ msgid "" "you define it in a different module." msgstr "" -#: ../../howto/logging-cookbook.rst:383 +#: ../../howto/logging-cookbook.rst:387 msgid "With the filter added, we can run ``main.py``, which in full is:" msgstr "" -#: ../../howto/logging-cookbook.rst:453 +#: ../../howto/logging-cookbook.rst:457 msgid "And after running it like this:" msgstr "" -#: ../../howto/logging-cookbook.rst:459 +#: ../../howto/logging-cookbook.rst:463 msgid "We can see the results are as expected:" msgstr "" -#: ../../howto/logging-cookbook.rst:485 +#: ../../howto/logging-cookbook.rst:489 msgid "Configuration server example" msgstr "" -#: ../../howto/logging-cookbook.rst:487 +#: ../../howto/logging-cookbook.rst:491 msgid "Here is an example of a module using the logging configuration server::" msgstr "" -#: ../../howto/logging-cookbook.rst:518 +#: ../../howto/logging-cookbook.rst:522 msgid "" "And here is a script that takes a filename and sends that file to the " "server, properly preceded with the binary-encoded length, as the new logging " "configuration::" msgstr "" -#: ../../howto/logging-cookbook.rst:543 +#: ../../howto/logging-cookbook.rst:547 msgid "Dealing with handlers that block" msgstr "" -#: ../../howto/logging-cookbook.rst:547 +#: ../../howto/logging-cookbook.rst:551 msgid "" "Sometimes you have to get your logging handlers to do their work without " "blocking the thread you're logging from. This is common in web applications, " "though of course it also occurs in other scenarios." msgstr "" -#: ../../howto/logging-cookbook.rst:551 +#: ../../howto/logging-cookbook.rst:555 msgid "" "A common culprit which demonstrates sluggish behaviour is the :class:" "`SMTPHandler`: sending emails can take a long time, for a number of reasons " @@ -265,7 +265,7 @@ msgid "" "below the Python layer, and outside your control)." msgstr "" -#: ../../howto/logging-cookbook.rst:559 +#: ../../howto/logging-cookbook.rst:563 msgid "" "One solution is to use a two-part approach. For the first part, attach only " "a :class:`QueueHandler` to those loggers which are accessed from performance-" @@ -279,7 +279,7 @@ msgid "" "developers who will use your code." msgstr "" -#: ../../howto/logging-cookbook.rst:570 +#: ../../howto/logging-cookbook.rst:574 msgid "" "The second part of the solution is :class:`QueueListener`, which has been " "designed as the counterpart to :class:`QueueHandler`. A :class:" @@ -290,7 +290,7 @@ msgid "" "handlers for processing." msgstr "" -#: ../../howto/logging-cookbook.rst:578 +#: ../../howto/logging-cookbook.rst:582 msgid "" "The advantage of having a separate :class:`QueueListener` class is that you " "can use the same instance to service multiple ``QueueHandlers``. This is " @@ -299,15 +299,15 @@ msgid "" "benefit." msgstr "" -#: ../../howto/logging-cookbook.rst:583 +#: ../../howto/logging-cookbook.rst:587 msgid "An example of using these two classes follows (imports omitted)::" msgstr "" -#: ../../howto/logging-cookbook.rst:601 +#: ../../howto/logging-cookbook.rst:605 msgid "which, when run, will produce:" msgstr "" -#: ../../howto/logging-cookbook.rst:607 +#: ../../howto/logging-cookbook.rst:611 msgid "" "Although the earlier discussion wasn't specifically talking about async " "code, but rather about slow logging handlers, it should be noted that when " @@ -318,7 +318,7 @@ msgid "" "code runs only in the ``QueueListener`` thread." msgstr "" -#: ../../howto/logging-cookbook.rst:615 +#: ../../howto/logging-cookbook.rst:619 msgid "" "Prior to Python 3.5, the :class:`QueueListener` always passed every message " "received from the queue to every handler it was initialized with. (This was " @@ -330,30 +330,30 @@ msgid "" "handler if it's appropriate to do so." msgstr "" -#: ../../howto/logging-cookbook.rst:628 +#: ../../howto/logging-cookbook.rst:632 msgid "Sending and receiving logging events across a network" msgstr "" -#: ../../howto/logging-cookbook.rst:630 +#: ../../howto/logging-cookbook.rst:634 msgid "" "Let's say you want to send logging events across a network, and handle them " "at the receiving end. A simple way of doing this is attaching a :class:" "`SocketHandler` instance to the root logger at the sending end::" msgstr "" -#: ../../howto/logging-cookbook.rst:658 +#: ../../howto/logging-cookbook.rst:662 msgid "" "At the receiving end, you can set up a receiver using the :mod:" "`socketserver` module. Here is a basic working example::" msgstr "" -#: ../../howto/logging-cookbook.rst:746 +#: ../../howto/logging-cookbook.rst:750 msgid "" "First run the server, and then the client. On the client side, nothing is " "printed on the console; on the server side, you should see something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:758 +#: ../../howto/logging-cookbook.rst:762 msgid "" "Note that there are some security issues with pickle in some scenarios. If " "these affect you, you can use an alternative serialization scheme by " @@ -362,11 +362,11 @@ msgid "" "use your alternative serialization." msgstr "" -#: ../../howto/logging-cookbook.rst:766 +#: ../../howto/logging-cookbook.rst:770 msgid "Running a logging socket listener in production" msgstr "" -#: ../../howto/logging-cookbook.rst:770 +#: ../../howto/logging-cookbook.rst:774 msgid "" "To run a logging listener in production, you may need to use a process-" "management tool such as `Supervisor `_. `Here is a " @@ -374,79 +374,79 @@ msgid "" "the above functionality using Supervisor. It consists of the following files:" msgstr "" -#: ../../howto/logging-cookbook.rst:777 +#: ../../howto/logging-cookbook.rst:781 msgid "File" msgstr "" -#: ../../howto/logging-cookbook.rst:777 +#: ../../howto/logging-cookbook.rst:781 msgid "Purpose" msgstr "" -#: ../../howto/logging-cookbook.rst:779 +#: ../../howto/logging-cookbook.rst:783 msgid ":file:`prepare.sh`" msgstr "" -#: ../../howto/logging-cookbook.rst:779 +#: ../../howto/logging-cookbook.rst:783 msgid "A Bash script to prepare the environment for testing" msgstr "" -#: ../../howto/logging-cookbook.rst:782 +#: ../../howto/logging-cookbook.rst:786 msgid ":file:`supervisor.conf`" msgstr "" -#: ../../howto/logging-cookbook.rst:782 +#: ../../howto/logging-cookbook.rst:786 msgid "" "The Supervisor configuration file, which has entries for the listener and a " "multi-process web application" msgstr "" -#: ../../howto/logging-cookbook.rst:786 +#: ../../howto/logging-cookbook.rst:790 msgid ":file:`ensure_app.sh`" msgstr "" -#: ../../howto/logging-cookbook.rst:786 +#: ../../howto/logging-cookbook.rst:790 msgid "" "A Bash script to ensure that Supervisor is running with the above " "configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:789 +#: ../../howto/logging-cookbook.rst:793 msgid ":file:`log_listener.py`" msgstr "" -#: ../../howto/logging-cookbook.rst:789 +#: ../../howto/logging-cookbook.rst:793 msgid "" "The socket listener program which receives log events and records them to a " "file" msgstr "" -#: ../../howto/logging-cookbook.rst:792 +#: ../../howto/logging-cookbook.rst:796 msgid ":file:`main.py`" msgstr "" -#: ../../howto/logging-cookbook.rst:792 +#: ../../howto/logging-cookbook.rst:796 msgid "" "A simple web application which performs logging via a socket connected to " "the listener" msgstr "" -#: ../../howto/logging-cookbook.rst:795 +#: ../../howto/logging-cookbook.rst:799 msgid ":file:`webapp.json`" msgstr "" -#: ../../howto/logging-cookbook.rst:795 +#: ../../howto/logging-cookbook.rst:799 msgid "A JSON configuration file for the web application" msgstr "" -#: ../../howto/logging-cookbook.rst:797 +#: ../../howto/logging-cookbook.rst:801 msgid ":file:`client.py`" msgstr "" -#: ../../howto/logging-cookbook.rst:797 +#: ../../howto/logging-cookbook.rst:801 msgid "A Python script to exercise the web application" msgstr "" -#: ../../howto/logging-cookbook.rst:800 +#: ../../howto/logging-cookbook.rst:804 msgid "" "The web application uses `Gunicorn `_, which is a " "popular web application server that starts multiple worker processes to " @@ -455,21 +455,21 @@ msgid "" "the socket listener." msgstr "" -#: ../../howto/logging-cookbook.rst:805 +#: ../../howto/logging-cookbook.rst:809 msgid "To test these files, do the following in a POSIX environment:" msgstr "" -#: ../../howto/logging-cookbook.rst:807 +#: ../../howto/logging-cookbook.rst:811 msgid "" "Download `the Gist `__ as a ZIP archive using the :" "guilabel:`Download ZIP` button." msgstr "" -#: ../../howto/logging-cookbook.rst:810 +#: ../../howto/logging-cookbook.rst:814 msgid "Unzip the above files from the archive into a scratch directory." msgstr "" -#: ../../howto/logging-cookbook.rst:812 +#: ../../howto/logging-cookbook.rst:816 msgid "" "In the scratch directory, run ``bash prepare.sh`` to get things ready. This " "creates a :file:`run` subdirectory to contain Supervisor-related and log " @@ -477,19 +477,19 @@ msgid "" "which ``bottle``, ``gunicorn`` and ``supervisor`` are installed." msgstr "" -#: ../../howto/logging-cookbook.rst:817 +#: ../../howto/logging-cookbook.rst:821 msgid "" "Run ``bash ensure_app.sh`` to ensure that Supervisor is running with the " "above configuration." msgstr "" -#: ../../howto/logging-cookbook.rst:820 +#: ../../howto/logging-cookbook.rst:824 msgid "" "Run ``venv/bin/python client.py`` to exercise the web application, which " "will lead to records being written to the log." msgstr "" -#: ../../howto/logging-cookbook.rst:823 +#: ../../howto/logging-cookbook.rst:827 msgid "" "Inspect the log files in the :file:`run` subdirectory. You should see the " "most recent log lines in files matching the pattern :file:`app.log*`. They " @@ -497,23 +497,23 @@ msgid "" "by different worker processes in a non-deterministic way." msgstr "" -#: ../../howto/logging-cookbook.rst:828 +#: ../../howto/logging-cookbook.rst:832 msgid "" "You can shut down the listener and the web application by running ``venv/bin/" "supervisorctl -c supervisor.conf shutdown``." msgstr "" -#: ../../howto/logging-cookbook.rst:831 +#: ../../howto/logging-cookbook.rst:835 msgid "" "You may need to tweak the configuration files in the unlikely event that the " "configured ports clash with something else in your test environment." msgstr "" -#: ../../howto/logging-cookbook.rst:837 +#: ../../howto/logging-cookbook.rst:841 msgid "Adding contextual information to your logging output" msgstr "" -#: ../../howto/logging-cookbook.rst:839 +#: ../../howto/logging-cookbook.rst:843 msgid "" "Sometimes you want logging output to contain contextual information in " "addition to the parameters passed to the logging call. For example, in a " @@ -529,11 +529,11 @@ msgid "" "`Logger` instances becomes effectively unbounded." msgstr "" -#: ../../howto/logging-cookbook.rst:854 +#: ../../howto/logging-cookbook.rst:858 msgid "Using LoggerAdapters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:856 +#: ../../howto/logging-cookbook.rst:860 msgid "" "An easy way in which you can pass contextual information to be output along " "with logging event information is to use the :class:`LoggerAdapter` class. " @@ -544,7 +544,7 @@ msgid "" "types of instances interchangeably." msgstr "" -#: ../../howto/logging-cookbook.rst:864 +#: ../../howto/logging-cookbook.rst:868 msgid "" "When you create an instance of :class:`LoggerAdapter`, you pass it a :class:" "`Logger` instance and a dict-like object which contains your contextual " @@ -555,7 +555,7 @@ msgid "" "of :class:`LoggerAdapter`::" msgstr "" -#: ../../howto/logging-cookbook.rst:880 +#: ../../howto/logging-cookbook.rst:884 msgid "" "The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where " "the contextual information is added to the logging output. It's passed the " @@ -568,7 +568,7 @@ msgid "" "be silently overwritten." msgstr "" -#: ../../howto/logging-cookbook.rst:889 +#: ../../howto/logging-cookbook.rst:893 msgid "" "The advantage of using 'extra' is that the values in the dict-like object " "are merged into the :class:`LogRecord` instance's __dict__, allowing you to " @@ -579,21 +579,21 @@ msgid "" "`~LoggerAdapter.process` to do what you need. Here is a simple example::" msgstr "" -#: ../../howto/logging-cookbook.rst:905 +#: ../../howto/logging-cookbook.rst:909 msgid "which you can use like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:910 +#: ../../howto/logging-cookbook.rst:914 msgid "" "Then any events that you log to the adapter will have the value of " "``some_conn_id`` prepended to the log messages." msgstr "" -#: ../../howto/logging-cookbook.rst:914 +#: ../../howto/logging-cookbook.rst:918 msgid "Using objects other than dicts to pass contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:916 +#: ../../howto/logging-cookbook.rst:920 msgid "" "You don't need to pass an actual dict to a :class:`LoggerAdapter` - you " "could pass an instance of a class which implements ``__getitem__`` and " @@ -602,11 +602,11 @@ msgid "" "would be constant)." msgstr "" -#: ../../howto/logging-cookbook.rst:925 +#: ../../howto/logging-cookbook.rst:929 msgid "Using Filters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:927 +#: ../../howto/logging-cookbook.rst:931 msgid "" "You can also add contextual information to log output using a user-defined :" "class:`Filter`. ``Filter`` instances are allowed to modify the " @@ -615,7 +615,7 @@ msgid "" "class:`Formatter`." msgstr "" -#: ../../howto/logging-cookbook.rst:932 +#: ../../howto/logging-cookbook.rst:936 msgid "" "For example in a web application, the request being processed (or at least, " "the interesting parts of it) can be stored in a threadlocal (:class:" @@ -627,15 +627,15 @@ msgid "" "an example script::" msgstr "" -#: ../../howto/logging-cookbook.rst:978 +#: ../../howto/logging-cookbook.rst:982 msgid "which, when run, produces something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:996 +#: ../../howto/logging-cookbook.rst:1000 msgid "Use of ``contextvars``" msgstr "" -#: ../../howto/logging-cookbook.rst:998 +#: ../../howto/logging-cookbook.rst:1002 msgid "" "Since Python 3.7, the :mod:`contextvars` module has provided context-local " "storage which works for both :mod:`threading` and :mod:`asyncio` processing " @@ -645,7 +645,7 @@ msgid "" "attributes handled by web applications." msgstr "" -#: ../../howto/logging-cookbook.rst:1004 +#: ../../howto/logging-cookbook.rst:1008 msgid "" "For the purposes of illustration, say that you have different web " "applications, each independent of the other but running in the same Python " @@ -656,18 +656,18 @@ msgid "" "information such as client IP, HTTP request method and client username?" msgstr "" -#: ../../howto/logging-cookbook.rst:1011 +#: ../../howto/logging-cookbook.rst:1015 msgid "Let's assume that the library can be simulated by the following code:" msgstr "" -#: ../../howto/logging-cookbook.rst:1027 +#: ../../howto/logging-cookbook.rst:1031 msgid "" "We can simulate the multiple web applications by means of two simple " "classes, ``Request`` and ``WebApp``. These simulate how real threaded web " "applications work - each request is handled by a thread:" msgstr "" -#: ../../howto/logging-cookbook.rst:1171 +#: ../../howto/logging-cookbook.rst:1175 msgid "" "If you run the above, you should find that roughly half the requests go " "into :file:`app1.log` and the rest into :file:`app2.log`, and the all the " @@ -678,11 +678,11 @@ msgid "" "illustrated by the following shell output:" msgstr "" -#: ../../howto/logging-cookbook.rst:1218 +#: ../../howto/logging-cookbook.rst:1222 msgid "Imparting contextual information in handlers" msgstr "" -#: ../../howto/logging-cookbook.rst:1220 +#: ../../howto/logging-cookbook.rst:1224 msgid "" "Each :class:`~Handler` has its own chain of filters. If you want to add " "contextual information to a :class:`LogRecord` without leaking it to other " @@ -690,11 +690,11 @@ msgid "" "instead of modifying it in-place, as shown in the following script::" msgstr "" -#: ../../howto/logging-cookbook.rst:1247 +#: ../../howto/logging-cookbook.rst:1251 msgid "Logging to a single file from multiple processes" msgstr "" -#: ../../howto/logging-cookbook.rst:1249 +#: ../../howto/logging-cookbook.rst:1253 msgid "" "Although logging is thread-safe, and logging to a single file from multiple " "threads in a single process *is* supported, logging to a single file from " @@ -710,7 +710,7 @@ msgid "" "you to adapt in your own applications." msgstr "" -#: ../../howto/logging-cookbook.rst:1262 +#: ../../howto/logging-cookbook.rst:1266 msgid "" "You could also write your own handler which uses the :class:" "`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " @@ -721,7 +721,7 @@ msgid "" "platforms (see https://bugs.python.org/issue3770)." msgstr "" -#: ../../howto/logging-cookbook.rst:1272 +#: ../../howto/logging-cookbook.rst:1276 msgid "" "Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send " "all logging events to one of the processes in your multi-process " @@ -736,13 +736,13 @@ msgid "" "requirements::" msgstr "" -#: ../../howto/logging-cookbook.rst:1388 +#: ../../howto/logging-cookbook.rst:1392 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "" -#: ../../howto/logging-cookbook.rst:1483 +#: ../../howto/logging-cookbook.rst:1487 msgid "" "This variant shows how you can e.g. apply configuration for particular " "loggers - e.g. the ``foo`` logger has a special handler which stores all " @@ -752,34 +752,34 @@ msgid "" "appropriate destinations." msgstr "" -#: ../../howto/logging-cookbook.rst:1490 +#: ../../howto/logging-cookbook.rst:1494 msgid "Using concurrent.futures.ProcessPoolExecutor" msgstr "" -#: ../../howto/logging-cookbook.rst:1492 +#: ../../howto/logging-cookbook.rst:1496 msgid "" "If you want to use :class:`concurrent.futures.ProcessPoolExecutor` to start " "your worker processes, you need to create the queue slightly differently. " "Instead of" msgstr "" -#: ../../howto/logging-cookbook.rst:1500 +#: ../../howto/logging-cookbook.rst:1504 msgid "you should use" msgstr "" -#: ../../howto/logging-cookbook.rst:1506 +#: ../../howto/logging-cookbook.rst:1510 msgid "and you can then replace the worker creation from this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1517 +#: ../../howto/logging-cookbook.rst:1521 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" -#: ../../howto/logging-cookbook.rst:1524 +#: ../../howto/logging-cookbook.rst:1528 msgid "Deploying Web applications using Gunicorn and uWSGI" msgstr "" -#: ../../howto/logging-cookbook.rst:1526 +#: ../../howto/logging-cookbook.rst:1530 msgid "" "When deploying Web applications using `Gunicorn `_ or " "`uWSGI `_ (or similar), " @@ -791,11 +791,11 @@ msgid "" "listener in production`_ for more details." msgstr "" -#: ../../howto/logging-cookbook.rst:1536 +#: ../../howto/logging-cookbook.rst:1540 msgid "Using file rotation" msgstr "" -#: ../../howto/logging-cookbook.rst:1541 +#: ../../howto/logging-cookbook.rst:1545 msgid "" "Sometimes you want to let a log file grow to a certain size, then open a new " "file and log to that. You may want to keep a certain number of these files, " @@ -805,13 +805,13 @@ msgid "" "RotatingFileHandler`::" msgstr "" -#: ../../howto/logging-cookbook.rst:1573 +#: ../../howto/logging-cookbook.rst:1577 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" msgstr "" -#: ../../howto/logging-cookbook.rst:1585 +#: ../../howto/logging-cookbook.rst:1589 msgid "" "The most current file is always :file:`logging_rotatingfile_example.out`, " "and each time it reaches the size limit it is renamed with the suffix " @@ -819,17 +819,17 @@ msgid "" "(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." msgstr "" -#: ../../howto/logging-cookbook.rst:1590 +#: ../../howto/logging-cookbook.rst:1594 msgid "" "Obviously this example sets the log length much too small as an extreme " "example. You would want to set *maxBytes* to an appropriate value." msgstr "" -#: ../../howto/logging-cookbook.rst:1596 +#: ../../howto/logging-cookbook.rst:1600 msgid "Use of alternative formatting styles" msgstr "" -#: ../../howto/logging-cookbook.rst:1598 +#: ../../howto/logging-cookbook.rst:1602 msgid "" "When logging was added to the Python standard library, the only way of " "formatting messages with variable content was to use the %-formatting " @@ -838,7 +838,7 @@ msgid "" "Python 2.6)." msgstr "" -#: ../../howto/logging-cookbook.rst:1604 +#: ../../howto/logging-cookbook.rst:1608 msgid "" "Logging (as of 3.2) provides improved support for these two additional " "formatting styles. The :class:`Formatter` class been enhanced to take an " @@ -851,14 +851,14 @@ msgid "" "session to show the possibilities:" msgstr "" -#: ../../howto/logging-cookbook.rst:1638 +#: ../../howto/logging-cookbook.rst:1642 msgid "" "Note that the formatting of logging messages for final output to logs is " "completely independent of how an individual logging message is constructed. " "That can still use %-formatting, as shown here::" msgstr "" -#: ../../howto/logging-cookbook.rst:1646 +#: ../../howto/logging-cookbook.rst:1650 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -874,7 +874,7 @@ msgid "" "strings." msgstr "" -#: ../../howto/logging-cookbook.rst:1659 +#: ../../howto/logging-cookbook.rst:1663 msgid "" "There is, however, a way that you can use {}- and $- formatting to construct " "your individual log messages. Recall that for a message you can use an " @@ -883,7 +883,7 @@ msgid "" "the following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:1683 +#: ../../howto/logging-cookbook.rst:1687 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -894,21 +894,21 @@ msgid "" "used as a synonym/alias for :func:`gettext.gettext` or its brethren)." msgstr "" -#: ../../howto/logging-cookbook.rst:1691 +#: ../../howto/logging-cookbook.rst:1695 msgid "" "The above classes are not included in Python, though they're easy enough to " "copy and paste into your own code. They can be used as follows (assuming " "that they're declared in a module called ``wherever``):" msgstr "" -#: ../../howto/logging-cookbook.rst:1713 +#: ../../howto/logging-cookbook.rst:1717 msgid "" "While the above examples use ``print()`` to show how the formatting works, " "you would of course use ``logger.debug()`` or similar to actually log using " "this approach." msgstr "" -#: ../../howto/logging-cookbook.rst:1717 +#: ../../howto/logging-cookbook.rst:1721 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -919,23 +919,23 @@ msgid "" "sugar for a constructor call to one of the XXXMessage classes." msgstr "" -#: ../../howto/logging-cookbook.rst:1725 +#: ../../howto/logging-cookbook.rst:1729 msgid "" "If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar " "effect to the above, as in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1756 +#: ../../howto/logging-cookbook.rst:1760 msgid "" "The above script should log the message ``Hello, world!`` when run with " "Python 3.2 or later." msgstr "" -#: ../../howto/logging-cookbook.rst:1765 +#: ../../howto/logging-cookbook.rst:1769 msgid "Customizing ``LogRecord``" msgstr "" -#: ../../howto/logging-cookbook.rst:1767 +#: ../../howto/logging-cookbook.rst:1771 msgid "" "Every logging event is represented by a :class:`LogRecord` instance. When an " "event is logged and not filtered out by a logger's level, a :class:" @@ -946,13 +946,13 @@ msgid "" "was done:" msgstr "" -#: ../../howto/logging-cookbook.rst:1774 +#: ../../howto/logging-cookbook.rst:1778 msgid "" ":meth:`Logger.makeRecord`, which is called in the normal process of logging " "an event. This invoked :class:`LogRecord` directly to create an instance." msgstr "" -#: ../../howto/logging-cookbook.rst:1777 +#: ../../howto/logging-cookbook.rst:1781 msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " @@ -961,27 +961,27 @@ msgid "" "`~handlers.HTTPHandler`)." msgstr "" -#: ../../howto/logging-cookbook.rst:1783 +#: ../../howto/logging-cookbook.rst:1787 msgid "" "This has usually meant that if you need to do anything special with a :class:" "`LogRecord`, you've had to do one of the following." msgstr "" -#: ../../howto/logging-cookbook.rst:1786 +#: ../../howto/logging-cookbook.rst:1790 msgid "" "Create your own :class:`Logger` subclass, which overrides :meth:`Logger." "makeRecord`, and set it using :func:`~logging.setLoggerClass` before any " "loggers that you care about are instantiated." msgstr "" -#: ../../howto/logging-cookbook.rst:1789 +#: ../../howto/logging-cookbook.rst:1793 msgid "" "Add a :class:`Filter` to a logger or handler, which does the necessary " "special manipulation you need when its :meth:`~Filter.filter` method is " "called." msgstr "" -#: ../../howto/logging-cookbook.rst:1793 +#: ../../howto/logging-cookbook.rst:1797 msgid "" "The first approach would be a little unwieldy in the scenario where (say) " "several different libraries wanted to do different things. Each would " @@ -989,7 +989,7 @@ msgid "" "last would win." msgstr "" -#: ../../howto/logging-cookbook.rst:1798 +#: ../../howto/logging-cookbook.rst:1802 msgid "" "The second approach works reasonably well for many cases, but does not allow " "you to e.g. use a specialized subclass of :class:`LogRecord`. Library " @@ -998,7 +998,7 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" -#: ../../howto/logging-cookbook.rst:1806 +#: ../../howto/logging-cookbook.rst:1810 msgid "" "at module level). It's probably one too many things to think about. " "Developers could also add the filter to a :class:`~logging.NullHandler` " @@ -1008,7 +1008,7 @@ msgid "" "developer." msgstr "" -#: ../../howto/logging-cookbook.rst:1812 +#: ../../howto/logging-cookbook.rst:1816 msgid "" "In Python 3.2 and later, :class:`~logging.LogRecord` creation is done " "through a factory, which you can specify. The factory is just a callable you " @@ -1018,7 +1018,7 @@ msgid "" "`LogRecord` is the default setting for the factory." msgstr "" -#: ../../howto/logging-cookbook.rst:1819 +#: ../../howto/logging-cookbook.rst:1823 msgid "" "This approach allows a custom factory to control all aspects of LogRecord " "creation. For example, you could return a subclass, or just add some " @@ -1026,7 +1026,7 @@ msgid "" "this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1832 +#: ../../howto/logging-cookbook.rst:1836 msgid "" "This pattern allows different libraries to chain factories together, and as " "long as they don't overwrite each other's attributes or unintentionally " @@ -1036,70 +1036,70 @@ msgid "" "used when the use of a :class:`Filter` does not provide the desired result." msgstr "" -#: ../../howto/logging-cookbook.rst:1843 +#: ../../howto/logging-cookbook.rst:1847 msgid "Subclassing QueueHandler - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1845 +#: ../../howto/logging-cookbook.rst:1849 msgid "" "You can use a :class:`QueueHandler` subclass to send messages to other kinds " "of queues, for example a ZeroMQ 'publish' socket. In the example below,the " "socket is created separately and passed to the handler (as its 'queue')::" msgstr "" -#: ../../howto/logging-cookbook.rst:1864 +#: ../../howto/logging-cookbook.rst:1868 msgid "" "Of course there are other ways of organizing this, for example passing in " "the data needed by the handler to create the socket::" msgstr "" -#: ../../howto/logging-cookbook.rst:1882 +#: ../../howto/logging-cookbook.rst:1886 msgid "Subclassing QueueListener - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1884 +#: ../../howto/logging-cookbook.rst:1888 msgid "" "You can also subclass :class:`QueueListener` to get messages from other " "kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1903 ../../howto/logging-cookbook.rst:3944 +#: ../../howto/logging-cookbook.rst:1907 ../../howto/logging-cookbook.rst:3948 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:1903 ../../howto/logging-cookbook.rst:3944 +#: ../../howto/logging-cookbook.rst:1907 ../../howto/logging-cookbook.rst:3948 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1906 ../../howto/logging-cookbook.rst:3947 +#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3951 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:1906 ../../howto/logging-cookbook.rst:3947 +#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3951 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1909 ../../howto/logging-cookbook.rst:3950 +#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3954 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:1909 ../../howto/logging-cookbook.rst:3950 +#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3954 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1911 +#: ../../howto/logging-cookbook.rst:1915 msgid ":ref:`A basic logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1913 +#: ../../howto/logging-cookbook.rst:1917 msgid ":ref:`A more advanced logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1917 +#: ../../howto/logging-cookbook.rst:1921 msgid "An example dictionary-based configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:1919 +#: ../../howto/logging-cookbook.rst:1923 msgid "" "Below is an example of a logging configuration dictionary - it's taken from " "the `documentation on the Django project `_ of the Django documentation." msgstr "" -#: ../../howto/logging-cookbook.rst:1982 +#: ../../howto/logging-cookbook.rst:1986 msgid "Using a rotator and namer to customize log rotation processing" msgstr "" -#: ../../howto/logging-cookbook.rst:1984 +#: ../../howto/logging-cookbook.rst:1988 msgid "" "An example of how you can define a namer and rotator is given in the " "following runnable script, which shows gzip compression of the log file::" msgstr "" -#: ../../howto/logging-cookbook.rst:2015 +#: ../../howto/logging-cookbook.rst:2019 msgid "" "After running this, you will see six new files, five of which are compressed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2028 +#: ../../howto/logging-cookbook.rst:2032 msgid "A more elaborate multiprocessing example" msgstr "" -#: ../../howto/logging-cookbook.rst:2030 +#: ../../howto/logging-cookbook.rst:2034 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -1141,7 +1141,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2035 +#: ../../howto/logging-cookbook.rst:2039 msgid "" "In the example, the main process spawns a listener process and some worker " "processes. Each of the main process, the listener and the workers have three " @@ -1154,17 +1154,17 @@ msgid "" "own scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2045 +#: ../../howto/logging-cookbook.rst:2049 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: ../../howto/logging-cookbook.rst:2257 +#: ../../howto/logging-cookbook.rst:2261 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: ../../howto/logging-cookbook.rst:2259 +#: ../../howto/logging-cookbook.rst:2263 msgid "" ":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a " "set of bytes which have the following structure: an optional pure-ASCII " @@ -1173,7 +1173,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: ../../howto/logging-cookbook.rst:2265 +#: ../../howto/logging-cookbook.rst:2269 msgid "" "In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to " "insert a BOM into the message, but unfortunately, it was implemented " @@ -1181,7 +1181,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: ../../howto/logging-cookbook.rst:2271 +#: ../../howto/logging-cookbook.rst:2275 msgid "" "As this behaviour is broken, the incorrect BOM insertion code is being " "removed from Python 3.2.4 and later. However, it is not being replaced, and " @@ -1190,33 +1190,33 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: ../../howto/logging-cookbook.rst:2277 +#: ../../howto/logging-cookbook.rst:2281 msgid "" "Attach a :class:`~logging.Formatter` instance to your :class:`~logging." "handlers.SysLogHandler` instance, with a format string such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2283 +#: ../../howto/logging-cookbook.rst:2287 msgid "" "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as " "a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." msgstr "" -#: ../../howto/logging-cookbook.rst:2286 +#: ../../howto/logging-cookbook.rst:2290 msgid "" "Replace the ASCII section with whatever placeholders you like, but make sure " "that the data that appears in there after substitution is always ASCII (that " "way, it will remain unchanged after UTF-8 encoding)." msgstr "" -#: ../../howto/logging-cookbook.rst:2290 +#: ../../howto/logging-cookbook.rst:2294 msgid "" "Replace the Unicode section with whatever placeholders you like; if the data " "which appears there after substitution contains characters outside the ASCII " "range, that's fine -- it will be encoded using UTF-8." msgstr "" -#: ../../howto/logging-cookbook.rst:2294 +#: ../../howto/logging-cookbook.rst:2298 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -1225,11 +1225,11 @@ msgid "" "daemon may complain." msgstr "" -#: ../../howto/logging-cookbook.rst:2301 +#: ../../howto/logging-cookbook.rst:2305 msgid "Implementing structured logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2303 +#: ../../howto/logging-cookbook.rst:2307 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -1241,31 +1241,31 @@ msgid "" "machine-parseable manner::" msgstr "" -#: ../../howto/logging-cookbook.rst:2327 +#: ../../howto/logging-cookbook.rst:2331 msgid "If the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2333 ../../howto/logging-cookbook.rst:2375 +#: ../../howto/logging-cookbook.rst:2337 ../../howto/logging-cookbook.rst:2379 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: ../../howto/logging-cookbook.rst:2336 +#: ../../howto/logging-cookbook.rst:2340 msgid "" "If you need more specialised processing, you can use a custom JSON encoder, " "as in the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2369 +#: ../../howto/logging-cookbook.rst:2373 msgid "When the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2384 +#: ../../howto/logging-cookbook.rst:2388 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2386 +#: ../../howto/logging-cookbook.rst:2390 msgid "" "There are times when you want to customize logging handlers in particular " "ways, and if you use :func:`dictConfig` you may be able to do this without " @@ -1275,24 +1275,24 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2400 +#: ../../howto/logging-cookbook.rst:2404 msgid "" "You can then specify, in a logging configuration passed to :func:" "`dictConfig`, that a logging handler be created by calling this function::" msgstr "" -#: ../../howto/logging-cookbook.rst:2433 +#: ../../howto/logging-cookbook.rst:2437 msgid "" "In this example I am setting the ownership using the ``pulse`` user and " "group, just for the purposes of illustration. Putting it together into a " "working script, ``chowntest.py``::" msgstr "" -#: ../../howto/logging-cookbook.rst:2480 +#: ../../howto/logging-cookbook.rst:2484 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2490 +#: ../../howto/logging-cookbook.rst:2494 msgid "" "Note that this example uses Python 3.3 because that's where :func:`shutil." "chown` makes an appearance. This approach should work with any Python " @@ -1301,17 +1301,17 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: ../../howto/logging-cookbook.rst:2496 +#: ../../howto/logging-cookbook.rst:2500 msgid "" "In practice, the handler-creating function may be in a utility module " "somewhere in your project. Instead of the line in the configuration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2501 +#: ../../howto/logging-cookbook.rst:2505 msgid "you could use e.g.::" msgstr "" -#: ../../howto/logging-cookbook.rst:2505 +#: ../../howto/logging-cookbook.rst:2509 msgid "" "where ``project.util`` can be replaced with the actual name of the package " "where the function resides. In the above working script, using ``'ext://" @@ -1319,25 +1319,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: ../../howto/logging-cookbook.rst:2510 +#: ../../howto/logging-cookbook.rst:2514 msgid "" "This example hopefully also points the way to how you could implement other " "types of file change - e.g. setting specific POSIX permission bits - in the " "same way, using :func:`os.chmod`." msgstr "" -#: ../../howto/logging-cookbook.rst:2514 +#: ../../howto/logging-cookbook.rst:2518 msgid "" "Of course, the approach could also be extended to types of handler other " "than a :class:`~logging.FileHandler` - for example, one of the rotating file " "handlers, or a different type of handler altogether." msgstr "" -#: ../../howto/logging-cookbook.rst:2524 +#: ../../howto/logging-cookbook.rst:2528 msgid "Using particular formatting styles throughout your application" msgstr "" -#: ../../howto/logging-cookbook.rst:2526 +#: ../../howto/logging-cookbook.rst:2530 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -1348,7 +1348,7 @@ msgid "" "is constructed." msgstr "" -#: ../../howto/logging-cookbook.rst:2533 +#: ../../howto/logging-cookbook.rst:2537 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -1363,7 +1363,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: ../../howto/logging-cookbook.rst:2545 +#: ../../howto/logging-cookbook.rst:2549 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -1371,7 +1371,7 @@ msgid "" "formatting." msgstr "" -#: ../../howto/logging-cookbook.rst:2549 +#: ../../howto/logging-cookbook.rst:2553 msgid "" "For logging to work interoperably between any third-party libraries and your " "code, decisions about formatting need to be made at the level of the " @@ -1379,11 +1379,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: ../../howto/logging-cookbook.rst:2556 +#: ../../howto/logging-cookbook.rst:2560 msgid "Using LogRecord factories" msgstr "" -#: ../../howto/logging-cookbook.rst:2558 +#: ../../howto/logging-cookbook.rst:2562 msgid "" "In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned " "above, the logging package gained the ability to allow users to set their " @@ -1398,17 +1398,17 @@ msgid "" "implementation does." msgstr "" -#: ../../howto/logging-cookbook.rst:2569 +#: ../../howto/logging-cookbook.rst:2573 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: ../../howto/logging-cookbook.rst:2574 +#: ../../howto/logging-cookbook.rst:2578 msgid "Using custom message objects" msgstr "" -#: ../../howto/logging-cookbook.rst:2576 +#: ../../howto/logging-cookbook.rst:2580 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -1418,7 +1418,7 @@ msgid "" "following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:2601 +#: ../../howto/logging-cookbook.rst:2605 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -1429,17 +1429,17 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: ../../howto/logging-cookbook.rst:2609 +#: ../../howto/logging-cookbook.rst:2613 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2623 +#: ../../howto/logging-cookbook.rst:2627 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2630 +#: ../../howto/logging-cookbook.rst:2634 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -1451,11 +1451,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2644 +#: ../../howto/logging-cookbook.rst:2648 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2646 +#: ../../howto/logging-cookbook.rst:2650 msgid "" "You *can* configure filters using :func:`~logging.config.dictConfig`, though " "it might not be obvious at first glance how to do it (hence this recipe). " @@ -1470,22 +1470,22 @@ msgid "" "complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2699 +#: ../../howto/logging-cookbook.rst:2703 msgid "" "This example shows how you can pass configuration data to the callable which " "constructs the instance, in the form of keyword parameters. When run, the " "above script will print:" msgstr "" -#: ../../howto/logging-cookbook.rst:2707 +#: ../../howto/logging-cookbook.rst:2711 msgid "which shows that the filter is working as configured." msgstr "" -#: ../../howto/logging-cookbook.rst:2709 +#: ../../howto/logging-cookbook.rst:2713 msgid "A couple of extra points to note:" msgstr "" -#: ../../howto/logging-cookbook.rst:2711 +#: ../../howto/logging-cookbook.rst:2715 msgid "" "If you can't refer to the callable directly in the configuration (e.g. if it " "lives in a different module, and you can't import it directly where the " @@ -1495,7 +1495,7 @@ msgid "" "the above example." msgstr "" -#: ../../howto/logging-cookbook.rst:2718 +#: ../../howto/logging-cookbook.rst:2722 msgid "" "As well as for filters, this technique can also be used to configure custom " "handlers and formatters. See :ref:`logging-config-dict-userdef` for more " @@ -1504,11 +1504,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2727 +#: ../../howto/logging-cookbook.rst:2731 msgid "Customized exception formatting" msgstr "" -#: ../../howto/logging-cookbook.rst:2729 +#: ../../howto/logging-cookbook.rst:2733 msgid "" "There might be times when you want to do customized exception formatting - " "for argument's sake, let's say you want exactly one line per logged event, " @@ -1516,22 +1516,22 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2770 +#: ../../howto/logging-cookbook.rst:2774 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: ../../howto/logging-cookbook.rst:2777 +#: ../../howto/logging-cookbook.rst:2781 msgid "" "While the above treatment is simplistic, it points the way to how exception " "information can be formatted to your liking. The :mod:`traceback` module may " "be helpful for more specialized needs." msgstr "" -#: ../../howto/logging-cookbook.rst:2784 +#: ../../howto/logging-cookbook.rst:2788 msgid "Speaking logging messages" msgstr "" -#: ../../howto/logging-cookbook.rst:2786 +#: ../../howto/logging-cookbook.rst:2790 msgid "" "There might be situations when it is desirable to have logging messages " "rendered in an audible rather than a visible format. This is easy to do if " @@ -1548,24 +1548,24 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: ../../howto/logging-cookbook.rst:2828 +#: ../../howto/logging-cookbook.rst:2832 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: ../../howto/logging-cookbook.rst:2830 +#: ../../howto/logging-cookbook.rst:2834 msgid "" "The above approach can, of course, be adapted to other TTS systems and even " "other systems altogether which can process messages via external programs " "run from a command line." msgstr "" -#: ../../howto/logging-cookbook.rst:2838 +#: ../../howto/logging-cookbook.rst:2842 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: ../../howto/logging-cookbook.rst:2840 +#: ../../howto/logging-cookbook.rst:2844 msgid "" "There might be situations where you want to log messages in a temporary area " "and only output them if a certain condition occurs. For example, you may " @@ -1575,7 +1575,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: ../../howto/logging-cookbook.rst:2847 +#: ../../howto/logging-cookbook.rst:2851 msgid "" "Here is an example which shows how you could do this using a decorator for " "your functions where you want logging to behave this way. It makes use of " @@ -1588,7 +1588,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: ../../howto/logging-cookbook.rst:2857 +#: ../../howto/logging-cookbook.rst:2861 msgid "" "The example script has a simple function, ``foo``, which just cycles through " "all the logging levels, writing to ``sys.stderr`` to say what level it's " @@ -1597,7 +1597,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: ../../howto/logging-cookbook.rst:2863 +#: ../../howto/logging-cookbook.rst:2867 msgid "" "The script just arranges to decorate ``foo`` with a decorator which will do " "the conditional logging that's required. The decorator takes a logger as a " @@ -1609,30 +1609,30 @@ msgid "" "respectively." msgstr "" -#: ../../howto/logging-cookbook.rst:2871 +#: ../../howto/logging-cookbook.rst:2875 msgid "Here's the script::" msgstr "" -#: ../../howto/logging-cookbook.rst:2934 +#: ../../howto/logging-cookbook.rst:2938 msgid "When this script is run, the following output should be observed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2964 +#: ../../howto/logging-cookbook.rst:2968 msgid "" "As you can see, actual logging output only occurs when an event is logged " "whose severity is ERROR or greater, but in that case, any previous events at " "lower severities are also logged." msgstr "" -#: ../../howto/logging-cookbook.rst:2968 +#: ../../howto/logging-cookbook.rst:2972 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2978 +#: ../../howto/logging-cookbook.rst:2982 msgid "Sending logging messages to email, with buffering" msgstr "" -#: ../../howto/logging-cookbook.rst:2980 +#: ../../howto/logging-cookbook.rst:2984 msgid "" "To illustrate how you can send log messages via email, so that a set number " "of messages are sent per email, you can subclass :class:`~logging.handlers." @@ -1643,7 +1643,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: ../../howto/logging-cookbook.rst:3052 +#: ../../howto/logging-cookbook.rst:3056 msgid "" "If you run this script and your SMTP server is correctly set up, you should " "find that it sends eleven emails to the addressee you specify. The first ten " @@ -1651,17 +1651,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: ../../howto/logging-cookbook.rst:3060 +#: ../../howto/logging-cookbook.rst:3064 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3062 +#: ../../howto/logging-cookbook.rst:3066 msgid "" "Sometimes you want to format times using UTC, which can be done using a " "class such as ``UTCFormatter``, shown below::" msgstr "" -#: ../../howto/logging-cookbook.rst:3071 +#: ../../howto/logging-cookbook.rst:3075 msgid "" "and you can then use the ``UTCFormatter`` in your code instead of :class:" "`~logging.Formatter`. If you want to do that via configuration, you can use " @@ -1669,21 +1669,21 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:3114 +#: ../../howto/logging-cookbook.rst:3118 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:3121 +#: ../../howto/logging-cookbook.rst:3125 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:3128 +#: ../../howto/logging-cookbook.rst:3132 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3130 +#: ../../howto/logging-cookbook.rst:3134 msgid "" "There are times when it would be useful to temporarily change the logging " "configuration and revert it back after doing something. For this, a context " @@ -1693,7 +1693,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:3163 +#: ../../howto/logging-cookbook.rst:3167 msgid "" "If you specify a level value, the logger's level is set to that value in the " "scope of the with block covered by the context manager. If you specify a " @@ -1702,13 +1702,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:3169 +#: ../../howto/logging-cookbook.rst:3173 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:3187 +#: ../../howto/logging-cookbook.rst:3191 msgid "" "We initially set the logger's level to ``INFO``, so message #1 appears and " "message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the " @@ -1721,56 +1721,56 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:3197 +#: ../../howto/logging-cookbook.rst:3201 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:3208 +#: ../../howto/logging-cookbook.rst:3212 msgid "" "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " "following, which is the only message written to ``stdout``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3216 +#: ../../howto/logging-cookbook.rst:3220 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:3226 +#: ../../howto/logging-cookbook.rst:3230 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:3228 +#: ../../howto/logging-cookbook.rst:3232 msgid "" "Of course, the approach described here can be generalised, for example to " "attach logging filters temporarily. Note that the above code works in Python " "2 as well as Python 3." msgstr "" -#: ../../howto/logging-cookbook.rst:3236 +#: ../../howto/logging-cookbook.rst:3240 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:3238 +#: ../../howto/logging-cookbook.rst:3242 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:3240 +#: ../../howto/logging-cookbook.rst:3244 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:3241 +#: ../../howto/logging-cookbook.rst:3245 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:3243 +#: ../../howto/logging-cookbook.rst:3247 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3245 +#: ../../howto/logging-cookbook.rst:3249 msgid "" "Suppose we have a command-line application whose job is to stop, start or " "restart some services. This could be organised for the purposes of " @@ -1781,53 +1781,53 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:3294 +#: ../../howto/logging-cookbook.rst:3298 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3307 +#: ../../howto/logging-cookbook.rst:3311 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:3328 +#: ../../howto/logging-cookbook.rst:3332 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3349 +#: ../../howto/logging-cookbook.rst:3353 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3362 +#: ../../howto/logging-cookbook.rst:3366 msgid "" "The first word is the logging level, and the second word is the module or " "package name of the place where the event was logged." msgstr "" -#: ../../howto/logging-cookbook.rst:3365 +#: ../../howto/logging-cookbook.rst:3369 msgid "" "If we change the logging level, then we can change the information sent to " "the log. For example, if we want more information:" msgstr "" -#: ../../howto/logging-cookbook.rst:3382 +#: ../../howto/logging-cookbook.rst:3386 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3390 +#: ../../howto/logging-cookbook.rst:3394 msgid "" "In this case, the commands don't print anything to the console, since " "nothing at ``WARNING`` level or above is logged by them." msgstr "" -#: ../../howto/logging-cookbook.rst:3396 +#: ../../howto/logging-cookbook.rst:3400 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3398 +#: ../../howto/logging-cookbook.rst:3402 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" @@ -1835,7 +1835,7 @@ msgid "" "project/PySide2/>`_ or `PyQt5 `_ libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3404 +#: ../../howto/logging-cookbook.rst:3408 msgid "" "The following example shows how to log to a Qt GUI. This introduces a simple " "``QtHandler`` class which takes a callable, which should be a slot in the " @@ -1845,14 +1845,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3411 +#: ../../howto/logging-cookbook.rst:3415 msgid "" "The worker thread is implemented using Qt's ``QThread`` class rather than " "the :mod:`threading` module, as there are circumstances where one has to use " "``QThread``, which offers better integration with other ``Qt`` components." msgstr "" -#: ../../howto/logging-cookbook.rst:3415 +#: ../../howto/logging-cookbook.rst:3419 msgid "" "The code should work with recent releases of either ``PySide2`` or " "``PyQt5``. You should be able to adapt the approach to earlier versions of " @@ -1860,11 +1860,11 @@ msgid "" "information." msgstr "" -#: ../../howto/logging-cookbook.rst:3629 +#: ../../howto/logging-cookbook.rst:3633 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3631 +#: ../../howto/logging-cookbook.rst:3635 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "detault to use the older :rfc:`3164`, which hails from 2001. When " @@ -1874,14 +1874,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3638 +#: ../../howto/logging-cookbook.rst:3642 msgid "" "RFC 5424 contains some useful features such as support for structured data, " "and if you need to be able to log to a syslog server with support for it, " "you can do so with a subclassed handler which looks something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3704 +#: ../../howto/logging-cookbook.rst:3708 msgid "" "You'll need to be familiar with RFC 5424 to fully understand the above code, " "and it may be that you have slightly different needs (e.g. for how you pass " @@ -1890,11 +1890,11 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3718 +#: ../../howto/logging-cookbook.rst:3722 msgid "How to treat a logger like an output stream" msgstr "" -#: ../../howto/logging-cookbook.rst:3720 +#: ../../howto/logging-cookbook.rst:3724 msgid "" "Sometimes, you need to interface to a third-party API which expects a file-" "like object to write to, but you want to direct the API's output to a " @@ -1902,17 +1902,17 @@ msgid "" "API. Here's a short script illustrating such a class:" msgstr "" -#: ../../howto/logging-cookbook.rst:3760 +#: ../../howto/logging-cookbook.rst:3764 msgid "When this script is run, it prints" msgstr "" -#: ../../howto/logging-cookbook.rst:3767 +#: ../../howto/logging-cookbook.rst:3771 msgid "" "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." "stderr`` by doing something like this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3777 +#: ../../howto/logging-cookbook.rst:3781 msgid "" "You should do this *after* configuring logging for your needs. In the above " "example, the :func:`~logging.basicConfig` call does this (using the ``sys." @@ -1920,25 +1920,25 @@ msgid "" "Then, you'd get this kind of result:" msgstr "" -#: ../../howto/logging-cookbook.rst:3790 +#: ../../howto/logging-cookbook.rst:3794 msgid "" "Of course, the examples above show output according to the format used by :" "func:`~logging.basicConfig`, but you can use a different formatter when you " "configure logging." msgstr "" -#: ../../howto/logging-cookbook.rst:3794 +#: ../../howto/logging-cookbook.rst:3798 msgid "" "Note that with the above scheme, you are somewhat at the mercy of buffering " "and the sequence of write calls which you are intercepting. For example, " "with the definition of ``LoggerWriter`` above, if you have the snippet" msgstr "" -#: ../../howto/logging-cookbook.rst:3803 +#: ../../howto/logging-cookbook.rst:3807 msgid "then running the script results in" msgstr "" -#: ../../howto/logging-cookbook.rst:3821 +#: ../../howto/logging-cookbook.rst:3825 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes mutiple writes, each of which results " @@ -1948,17 +1948,17 @@ msgid "" "``LoggerWriter``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3846 +#: ../../howto/logging-cookbook.rst:3850 msgid "" "This just buffers up stuff until a newline is seen, and then logs complete " "lines. With this approach, you get better output:" msgstr "" -#: ../../howto/logging-cookbook.rst:3862 +#: ../../howto/logging-cookbook.rst:3866 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:3864 +#: ../../howto/logging-cookbook.rst:3868 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 " @@ -1966,11 +1966,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:3870 +#: ../../howto/logging-cookbook.rst:3874 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:3872 +#: ../../howto/logging-cookbook.rst:3876 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. " @@ -1978,32 +1978,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:3877 +#: ../../howto/logging-cookbook.rst:3881 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:3880 +#: ../../howto/logging-cookbook.rst:3884 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:3883 +#: ../../howto/logging-cookbook.rst:3887 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:3887 +#: ../../howto/logging-cookbook.rst:3891 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:3890 +#: ../../howto/logging-cookbook.rst:3894 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 " @@ -2012,7 +2012,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:3896 +#: ../../howto/logging-cookbook.rst:3900 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 " @@ -2022,17 +2022,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:3903 +#: ../../howto/logging-cookbook.rst:3907 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:3907 +#: ../../howto/logging-cookbook.rst:3911 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:3909 +#: ../../howto/logging-cookbook.rst:3913 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 " @@ -2043,12 +2043,12 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:3918 +#: ../../howto/logging-cookbook.rst:3922 msgid "" "Adding handlers other than :class:`NullHandler` to a logger in a library" msgstr "" -#: ../../howto/logging-cookbook.rst:3920 +#: ../../howto/logging-cookbook.rst:3924 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -2056,11 +2056,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:3926 +#: ../../howto/logging-cookbook.rst:3930 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:3928 +#: ../../howto/logging-cookbook.rst:3932 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. " @@ -2071,14 +2071,14 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:3939 +#: ../../howto/logging-cookbook.rst:3943 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:3952 +#: ../../howto/logging-cookbook.rst:3956 msgid ":ref:`Basic Tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:3954 +#: ../../howto/logging-cookbook.rst:3958 msgid ":ref:`Advanced Tutorial `" msgstr "" From 81a926fb0dd4203cdafe5b3c1e4b5bfa7f572ef6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 31 Mar 2023 00:33:54 +0000 Subject: [PATCH 057/130] sync with cpython 41e3ea13 --- library/codeop.po | 21 +- library/typing.po | 972 +++++++++++++++++++++++----------------------- 2 files changed, 504 insertions(+), 489 deletions(-) diff --git a/library/codeop.po b/library/codeop.po index bb6a0b0eab..47d5bee87c 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-03-31 00:31+0000\n" "PO-Revision-Date: 2016-11-19 00:28+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,13 +41,13 @@ msgstr "" #: ../../library/codeop.rst:22 msgid "" -"Being able to tell if a line of input completes a Python statement: in " +"Being able to tell if a line of input completes a Python statement: in " "short, telling whether to print '``>>>``' or '``...``' next." msgstr "" #: ../../library/codeop.rst:25 msgid "" -"Remembering which future statements the user has entered, so subsequent " +"Remembering which future statements the user has entered, so subsequent " "input can be compiled with these in effect." msgstr "" @@ -64,9 +64,9 @@ msgstr "" #: ../../library/codeop.rst:35 msgid "" "Tries to compile *source*, which should be a string of Python code and " -"return a code object if *source* is valid Python code. In that case, the " +"return a code object if *source* is valid Python code. In that case, the " "filename attribute of the code object will be *filename*, which defaults to " -"``''``. Returns ``None`` if *source* is *not* valid Python code, but " +"``''``. Returns ``None`` if *source* is *not* valid Python code, but " "is a prefix of valid Python code." msgstr "" @@ -80,9 +80,9 @@ msgstr "" #: ../../library/codeop.rst:45 msgid "" "The *symbol* argument determines whether *source* is compiled as a statement " -"(``'single'``, the default), as a sequence of statements (``'exec'``) or as " -"an :term:`expression` (``'eval'``). Any other value will cause :exc:" -"`ValueError` to be raised." +"(``'single'``, the default), as a sequence of :term:`statement` (``'exec'``) " +"or as an :term:`expression` (``'eval'``). Any other value will cause :exc:" +"`ValueError` to be raised." msgstr "" #: ../../library/codeop.rst:52 @@ -107,6 +107,7 @@ msgstr "" msgid "" "Instances of this class have :meth:`__call__` methods identical in signature " "to :func:`compile_command`; the difference is that if the instance compiles " -"program text containing a ``__future__`` statement, the instance 'remembers' " -"and compiles all subsequent program texts with the statement in force." +"program text containing a :mod:`__future__` statement, the instance " +"'remembers' and compiles all subsequent program texts with the statement in " +"force." msgstr "" diff --git a/library/typing.po b/library/typing.po index 73ca47750c..e6680541a8 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-24 00:31+0000\n" +"POT-Creation-Date: 2023-03-31 00:31+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,199 +68,213 @@ msgstr "" #: ../../library/typing.rst:44 msgid "" +"For a quick overview of type hints, refer to `this cheat sheet `_." +msgstr "" + +#: ../../library/typing.rst:47 +msgid "" +"The \"Type System Reference\" section of https://mypy.readthedocs.io/ -- " +"since the Python typing system is standardised via PEPs, this reference " +"should broadly apply to most Python type checkers, although some parts may " +"still be specific to mypy." +msgstr "" + +#: ../../library/typing.rst:52 +msgid "" "The documentation at https://typing.readthedocs.io/ serves as useful " "reference for type system features, useful typing related tools and typing " "best practices." msgstr "" -#: ../../library/typing.rst:51 +#: ../../library/typing.rst:58 msgid "Relevant PEPs" msgstr "" -#: ../../library/typing.rst:53 +#: ../../library/typing.rst:60 msgid "" "Since the initial introduction of type hints in :pep:`484` and :pep:`483`, a " "number of PEPs have modified and enhanced Python's framework for type " "annotations. These include:" msgstr "" -#: ../../library/typing.rst:58 +#: ../../library/typing.rst:65 msgid ":pep:`526`: Syntax for Variable Annotations" msgstr "" -#: ../../library/typing.rst:58 +#: ../../library/typing.rst:65 msgid "" "*Introducing* syntax for annotating variables outside of function " "definitions, and :data:`ClassVar`" msgstr "" -#: ../../library/typing.rst:61 +#: ../../library/typing.rst:68 msgid ":pep:`544`: Protocols: Structural subtyping (static duck typing)" msgstr "" -#: ../../library/typing.rst:61 +#: ../../library/typing.rst:68 msgid "" "*Introducing* :class:`Protocol` and the :func:" "`@runtime_checkable` decorator" msgstr "" -#: ../../library/typing.rst:64 +#: ../../library/typing.rst:71 msgid ":pep:`585`: Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/typing.rst:64 +#: ../../library/typing.rst:71 msgid "" "*Introducing* :class:`types.GenericAlias` and the ability to use standard " "library classes as :ref:`generic types`" msgstr "" -#: ../../library/typing.rst:66 +#: ../../library/typing.rst:73 msgid ":pep:`586`: Literal Types" msgstr "" -#: ../../library/typing.rst:67 +#: ../../library/typing.rst:74 msgid "*Introducing* :data:`Literal`" msgstr "" -#: ../../library/typing.rst:68 +#: ../../library/typing.rst:75 msgid "" ":pep:`589`: TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys" msgstr "" -#: ../../library/typing.rst:69 +#: ../../library/typing.rst:76 msgid "*Introducing* :class:`TypedDict`" msgstr "" -#: ../../library/typing.rst:70 +#: ../../library/typing.rst:77 msgid ":pep:`591`: Adding a final qualifier to typing" msgstr "" -#: ../../library/typing.rst:71 +#: ../../library/typing.rst:78 msgid "*Introducing* :data:`Final` and the :func:`@final` decorator" msgstr "" -#: ../../library/typing.rst:72 +#: ../../library/typing.rst:79 msgid ":pep:`593`: Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:73 +#: ../../library/typing.rst:80 msgid "*Introducing* :data:`Annotated`" msgstr "" -#: ../../library/typing.rst:76 +#: ../../library/typing.rst:83 msgid ":pep:`604`: Allow writing union types as ``X | Y``" msgstr "" -#: ../../library/typing.rst:75 +#: ../../library/typing.rst:82 msgid "" "*Introducing* :data:`types.UnionType` and the ability to use the binary-or " "operator ``|`` to signify a :ref:`union of types`" msgstr "" -#: ../../library/typing.rst:78 +#: ../../library/typing.rst:85 msgid ":pep:`612`: Parameter Specification Variables" msgstr "" -#: ../../library/typing.rst:79 +#: ../../library/typing.rst:86 msgid "*Introducing* :class:`ParamSpec` and :data:`Concatenate`" msgstr "" -#: ../../library/typing.rst:80 +#: ../../library/typing.rst:87 msgid ":pep:`613`: Explicit Type Aliases" msgstr "" -#: ../../library/typing.rst:81 +#: ../../library/typing.rst:88 msgid "*Introducing* :data:`TypeAlias`" msgstr "*引入* :data:`TypeAlias`" -#: ../../library/typing.rst:82 +#: ../../library/typing.rst:89 msgid ":pep:`646`: Variadic Generics" msgstr "" -#: ../../library/typing.rst:83 +#: ../../library/typing.rst:90 msgid "*Introducing* :data:`TypeVarTuple`" msgstr "*引入* :data:`TypeVarTuple`" -#: ../../library/typing.rst:84 +#: ../../library/typing.rst:91 msgid ":pep:`647`: User-Defined Type Guards" msgstr "" -#: ../../library/typing.rst:85 +#: ../../library/typing.rst:92 msgid "*Introducing* :data:`TypeGuard`" msgstr "*引入* :data:`TypeGuard`" -#: ../../library/typing.rst:86 +#: ../../library/typing.rst:93 msgid "" ":pep:`655`: Marking individual TypedDict items as required or potentially " "missing" msgstr "" -#: ../../library/typing.rst:87 +#: ../../library/typing.rst:94 msgid "*Introducing* :data:`Required` and :data:`NotRequired`" msgstr "*引入* :data:`Required` 和 :data:`NotRequired`" -#: ../../library/typing.rst:88 +#: ../../library/typing.rst:95 msgid ":pep:`673`: Self type" msgstr "" -#: ../../library/typing.rst:89 +#: ../../library/typing.rst:96 msgid "*Introducing* :data:`Self`" msgstr "*引入* :data:`Self`" -#: ../../library/typing.rst:90 +#: ../../library/typing.rst:97 msgid ":pep:`675`: Arbitrary Literal String Type" msgstr "" -#: ../../library/typing.rst:91 +#: ../../library/typing.rst:98 msgid "*Introducing* :data:`LiteralString`" msgstr "*引入* :data:`LiteralString`" -#: ../../library/typing.rst:93 +#: ../../library/typing.rst:100 msgid ":pep:`681`: Data Class Transforms" msgstr "" -#: ../../library/typing.rst:93 +#: ../../library/typing.rst:100 msgid "" "*Introducing* the :func:`@dataclass_transform` decorator" msgstr "*引入* :func:`@dataclass_transform` 裝飾器" -#: ../../library/typing.rst:98 +#: ../../library/typing.rst:105 msgid "Type aliases" msgstr "" -#: ../../library/typing.rst:100 +#: ../../library/typing.rst:107 msgid "" "A type alias is defined by assigning the type to the alias. In this example, " "``Vector`` and ``list[float]`` will be treated as interchangeable synonyms::" msgstr "" -#: ../../library/typing.rst:111 +#: ../../library/typing.rst:118 msgid "" "Type aliases are useful for simplifying complex type signatures. For " "example::" msgstr "" -#: ../../library/typing.rst:129 +#: ../../library/typing.rst:136 msgid "" "Note that ``None`` as a type hint is a special case and is replaced by " "``type(None)``." msgstr "" -#: ../../library/typing.rst:135 +#: ../../library/typing.rst:142 msgid "NewType" msgstr "NewType" -#: ../../library/typing.rst:137 +#: ../../library/typing.rst:144 msgid "Use the :class:`NewType` helper to create distinct types::" msgstr "" -#: ../../library/typing.rst:144 +#: ../../library/typing.rst:151 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. This is useful in helping catch logical errors::" msgstr "" -#: ../../library/typing.rst:156 +#: ../../library/typing.rst:163 msgid "" "You may still perform all ``int`` operations on a variable of type " "``UserId``, but the result will always be of type ``int``. This lets you " @@ -268,7 +282,7 @@ msgid "" "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" -#: ../../library/typing.rst:164 +#: ../../library/typing.rst:171 msgid "" "Note that these checks are enforced only by the static type checker. At " "runtime, the statement ``Derived = NewType('Derived', Base)`` will make " @@ -277,31 +291,31 @@ msgid "" "class or introduce much overhead beyond that of a regular function call." msgstr "" -#: ../../library/typing.rst:170 +#: ../../library/typing.rst:177 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" -#: ../../library/typing.rst:173 +#: ../../library/typing.rst:180 msgid "It is invalid to create a subtype of ``Derived``::" msgstr "" -#: ../../library/typing.rst:182 +#: ../../library/typing.rst:189 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" -#: ../../library/typing.rst:190 +#: ../../library/typing.rst:197 msgid "and typechecking for ``ProUserId`` will work as expected." msgstr "" -#: ../../library/typing.rst:192 +#: ../../library/typing.rst:199 msgid "See :pep:`484` for more details." msgstr "更多細節請見 :pep:`484`\\ 。" -#: ../../library/typing.rst:196 +#: ../../library/typing.rst:203 msgid "" "Recall that the use of a type alias declares two types to be *equivalent* to " "one another. Doing ``Alias = Original`` will make the static type checker " @@ -309,7 +323,7 @@ msgid "" "This is useful when you want to simplify complex type signatures." msgstr "" -#: ../../library/typing.rst:201 +#: ../../library/typing.rst:208 msgid "" "In contrast, ``NewType`` declares one type to be a *subtype* of another. " "Doing ``Derived = NewType('Derived', Original)`` will make the static type " @@ -319,39 +333,39 @@ msgid "" "errors with minimal runtime cost." msgstr "" -#: ../../library/typing.rst:210 +#: ../../library/typing.rst:217 msgid "" "``NewType`` is now a class rather than a function. There is some additional " "runtime cost when calling ``NewType`` over a regular function. However, " "this cost will be reduced in 3.11.0." msgstr "" -#: ../../library/typing.rst:217 +#: ../../library/typing.rst:224 msgid "Callable" msgstr "" -#: ../../library/typing.rst:219 +#: ../../library/typing.rst:226 msgid "" "Frameworks expecting callback functions of specific signatures might be type " "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:222 ../../library/typing.rst:1164 -#: ../../library/typing.rst:2817 +#: ../../library/typing.rst:229 ../../library/typing.rst:1171 +#: ../../library/typing.rst:2824 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:237 +#: ../../library/typing.rst:244 msgid "" "It is possible to declare the return type of a callable without specifying " "the call signature by substituting a literal ellipsis for the list of " "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:241 ../../library/typing.rst:843 +#: ../../library/typing.rst:248 ../../library/typing.rst:850 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -362,97 +376,97 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:249 ../../library/typing.rst:855 +#: ../../library/typing.rst:256 ../../library/typing.rst:862 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:254 +#: ../../library/typing.rst:261 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:260 +#: ../../library/typing.rst:267 msgid "Generics" msgstr "" -#: ../../library/typing.rst:262 +#: ../../library/typing.rst:269 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, abstract base classes have been extended to " "support subscription to denote expected types for container elements." msgstr "" -#: ../../library/typing.rst:273 +#: ../../library/typing.rst:280 msgid "" "Generics can be parameterized by using a factory available in typing called :" "class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:289 +#: ../../library/typing.rst:296 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:291 +#: ../../library/typing.rst:298 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:317 +#: ../../library/typing.rst:324 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:321 +#: ../../library/typing.rst:328 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[T]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:330 +#: ../../library/typing.rst:337 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:342 +#: ../../library/typing.rst:349 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:353 +#: ../../library/typing.rst:360 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:363 +#: ../../library/typing.rst:370 msgid "" "When inheriting from generic classes, some type variables could be fixed::" msgstr "" -#: ../../library/typing.rst:373 +#: ../../library/typing.rst:380 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:375 +#: ../../library/typing.rst:382 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``::" msgstr "" -#: ../../library/typing.rst:383 +#: ../../library/typing.rst:390 msgid "User defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:400 +#: ../../library/typing.rst:407 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:403 +#: ../../library/typing.rst:410 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -462,7 +476,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:420 +#: ../../library/typing.rst:427 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -470,20 +484,20 @@ msgid "" "converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:432 +#: ../../library/typing.rst:439 msgid "" "Do note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:436 +#: ../../library/typing.rst:443 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:440 +#: ../../library/typing.rst:447 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -491,24 +505,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:447 +#: ../../library/typing.rst:454 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:449 +#: ../../library/typing.rst:456 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:453 +#: ../../library/typing.rst:460 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:471 +#: ../../library/typing.rst:478 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -517,19 +531,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:477 +#: ../../library/typing.rst:484 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:490 +#: ../../library/typing.rst:497 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:493 +#: ../../library/typing.rst:500 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -537,7 +551,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:498 +#: ../../library/typing.rst:505 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -545,24 +559,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:520 +#: ../../library/typing.rst:527 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:525 +#: ../../library/typing.rst:532 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:527 +#: ../../library/typing.rst:534 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:531 +#: ../../library/typing.rst:538 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -571,7 +585,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:544 +#: ../../library/typing.rst:551 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -580,22 +594,22 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:560 +#: ../../library/typing.rst:567 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:565 +#: ../../library/typing.rst:572 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:567 +#: ../../library/typing.rst:574 msgid "The module defines the following classes, functions and decorators." msgstr "" -#: ../../library/typing.rst:571 +#: ../../library/typing.rst:578 msgid "" "This module defines several types that are subclasses of pre-existing " "standard library classes which also extend :class:`Generic` to support type " @@ -603,7 +617,7 @@ msgid "" "corresponding pre-existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:577 +#: ../../library/typing.rst:584 msgid "" "The redundant types are deprecated as of Python 3.9 but no deprecation " "warnings will be issued by the interpreter. It is expected that type " @@ -611,45 +625,45 @@ msgid "" "Python 3.9 or newer." msgstr "" -#: ../../library/typing.rst:582 +#: ../../library/typing.rst:589 msgid "" "The deprecated types will be removed from the :mod:`typing` module in the " "first Python version released 5 years after the release of Python 3.9.0. See " "details in :pep:`585`—*Type Hinting Generics In Standard Collections*." msgstr "" -#: ../../library/typing.rst:588 +#: ../../library/typing.rst:595 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:591 +#: ../../library/typing.rst:598 msgid "Special types" msgstr "" -#: ../../library/typing.rst:593 +#: ../../library/typing.rst:600 msgid "These can be used as types in annotations and do not support ``[]``." msgstr "" -#: ../../library/typing.rst:597 +#: ../../library/typing.rst:604 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:599 +#: ../../library/typing.rst:606 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:600 +#: ../../library/typing.rst:607 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:602 +#: ../../library/typing.rst:609 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:609 +#: ../../library/typing.rst:616 msgid "" "Special type that includes only literal strings. A string literal is " "compatible with ``LiteralString``, as is another ``LiteralString``, but an " @@ -657,47 +671,47 @@ msgid "" "``LiteralString``-typed objects is also acceptable as a ``LiteralString``." msgstr "" -#: ../../library/typing.rst:615 ../../library/typing.rst:2459 +#: ../../library/typing.rst:622 ../../library/typing.rst:2466 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:629 +#: ../../library/typing.rst:636 msgid "" "This is useful for sensitive APIs where arbitrary user-generated strings " "could generate problems. For example, the two cases above that generate type " "checker errors could be vulnerable to an SQL injection attack." msgstr "" -#: ../../library/typing.rst:634 +#: ../../library/typing.rst:641 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:640 +#: ../../library/typing.rst:647 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:643 +#: ../../library/typing.rst:650 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:663 +#: ../../library/typing.rst:670 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:668 +#: ../../library/typing.rst:675 msgid "Special type indicating that a function never returns. For example::" msgstr "" -#: ../../library/typing.rst:676 +#: ../../library/typing.rst:683 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -705,150 +719,150 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:687 +#: ../../library/typing.rst:694 msgid "Special type to represent the current enclosed class. For example::" msgstr "" -#: ../../library/typing.rst:698 +#: ../../library/typing.rst:705 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:710 +#: ../../library/typing.rst:717 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:717 +#: ../../library/typing.rst:724 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:720 +#: ../../library/typing.rst:727 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:722 +#: ../../library/typing.rst:729 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:724 +#: ../../library/typing.rst:731 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:726 +#: ../../library/typing.rst:733 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:732 +#: ../../library/typing.rst:739 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `. For example::" msgstr "" -#: ../../library/typing.rst:739 +#: ../../library/typing.rst:746 msgid "See :pep:`613` for more details about explicit type aliases." msgstr "" -#: ../../library/typing.rst:744 +#: ../../library/typing.rst:751 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:746 +#: ../../library/typing.rst:753 msgid "" "These can be used as types in annotations using ``[]``, each having a unique " "syntax." msgstr "" -#: ../../library/typing.rst:750 +#: ../../library/typing.rst:757 msgid "" "Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the " "first item of type X and the second of type Y. The type of the empty tuple " "can be written as ``Tuple[()]``." msgstr "" -#: ../../library/typing.rst:754 +#: ../../library/typing.rst:761 msgid "" "Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " "variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " "float and a string." msgstr "" -#: ../../library/typing.rst:758 +#: ../../library/typing.rst:765 msgid "" "To specify a variable-length tuple of homogeneous type, use literal " "ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` is equivalent to " "``Tuple[Any, ...]``, and in turn to :class:`tuple`." msgstr "" -#: ../../library/typing.rst:762 +#: ../../library/typing.rst:769 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:768 +#: ../../library/typing.rst:775 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:770 +#: ../../library/typing.rst:777 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:772 +#: ../../library/typing.rst:779 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:774 +#: ../../library/typing.rst:781 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:778 +#: ../../library/typing.rst:785 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:782 +#: ../../library/typing.rst:789 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:786 +#: ../../library/typing.rst:793 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:790 +#: ../../library/typing.rst:797 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:799 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:794 +#: ../../library/typing.rst:801 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:797 +#: ../../library/typing.rst:804 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:803 +#: ../../library/typing.rst:810 msgid "Optional type." msgstr "" -#: ../../library/typing.rst:805 +#: ../../library/typing.rst:812 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:807 +#: ../../library/typing.rst:814 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -856,31 +870,31 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:815 +#: ../../library/typing.rst:822 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:822 +#: ../../library/typing.rst:829 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:828 +#: ../../library/typing.rst:835 msgid "Callable type; ``Callable[[int], str]`` is a function of (int) -> str." msgstr "" -#: ../../library/typing.rst:830 +#: ../../library/typing.rst:837 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " "types or an ellipsis; the return type must be a single type." msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:842 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -890,19 +904,19 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:851 +#: ../../library/typing.rst:858 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:860 +#: ../../library/typing.rst:867 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:865 +#: ../../library/typing.rst:872 msgid "" "Used with :data:`Callable` and :class:`ParamSpec` to type annotate a higher " "order callable which adds, removes, or transforms parameters of another " @@ -912,7 +926,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:873 +#: ../../library/typing.rst:880 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -923,17 +937,17 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:912 ../../library/typing.rst:1500 +#: ../../library/typing.rst:919 ../../library/typing.rst:1507 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:914 +#: ../../library/typing.rst:921 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:919 +#: ../../library/typing.rst:926 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``Type[C]`` may accept values that are " @@ -941,11 +955,11 @@ msgid "" "``C``. For example::" msgstr "" -#: ../../library/typing.rst:928 +#: ../../library/typing.rst:935 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:940 +#: ../../library/typing.rst:947 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -955,39 +969,39 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:948 +#: ../../library/typing.rst:955 msgid "" "The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:954 +#: ../../library/typing.rst:961 msgid "" "``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " "``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:959 +#: ../../library/typing.rst:966 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:965 +#: ../../library/typing.rst:972 msgid "" "A type that can be used to indicate to type checkers that the corresponding " "variable or function parameter has a value equivalent to the provided " "literal (or one of several literals). For example::" msgstr "" -#: ../../library/typing.rst:979 +#: ../../library/typing.rst:986 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:985 +#: ../../library/typing.rst:992 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -995,22 +1009,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:993 +#: ../../library/typing.rst:1000 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:995 +#: ../../library/typing.rst:1002 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1003 +#: ../../library/typing.rst:1010 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1005 +#: ../../library/typing.rst:1012 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1018,29 +1032,29 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1019 +#: ../../library/typing.rst:1026 msgid "" "A special typing construct to indicate to type checkers that a name cannot " "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1031 ../../library/typing.rst:2700 +#: ../../library/typing.rst:1038 ../../library/typing.rst:2707 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1040 +#: ../../library/typing.rst:1047 msgid "" "Special typing constructs that mark individual keys of a :class:`TypedDict` " "as either required or non-required respectively." msgstr "" -#: ../../library/typing.rst:1043 +#: ../../library/typing.rst:1050 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1049 +#: ../../library/typing.rst:1056 msgid "" "A type, introduced in :pep:`593` (``Flexible function and variable " "annotations``), to decorate existing types with context-specific metadata " @@ -1057,7 +1071,7 @@ msgid "" "application." msgstr "" -#: ../../library/typing.rst:1063 +#: ../../library/typing.rst:1070 msgid "" "Ultimately, the responsibility of how to interpret the annotations (if at " "all) is the responsibility of the tool or library encountering the " @@ -1066,21 +1080,21 @@ msgid "" "using ``isinstance()``)." msgstr "" -#: ../../library/typing.rst:1069 +#: ../../library/typing.rst:1076 msgid "" "When a tool or a library does not support annotations or encounters an " "unknown annotation it should just ignore it and treat annotated type as the " "underlying type." msgstr "" -#: ../../library/typing.rst:1073 +#: ../../library/typing.rst:1080 msgid "" "It's up to the tool consuming the annotations to decide whether the client " "is allowed to have several annotations on one type and how to merge those " "annotations." msgstr "" -#: ../../library/typing.rst:1077 +#: ../../library/typing.rst:1084 msgid "" "Since the ``Annotated`` type allows you to put several annotations of the " "same (or different) type(s) on any node, the tools or libraries consuming " @@ -1088,59 +1102,59 @@ msgid "" "example, if you are doing value range analysis you might allow this::" msgstr "" -#: ../../library/typing.rst:1086 +#: ../../library/typing.rst:1093 msgid "" "Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " "the extra annotations at runtime." msgstr "" -#: ../../library/typing.rst:1089 +#: ../../library/typing.rst:1096 msgid "The details of the syntax:" msgstr "" -#: ../../library/typing.rst:1091 +#: ../../library/typing.rst:1098 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1093 +#: ../../library/typing.rst:1100 msgid "" "Multiple type annotations are supported (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1098 +#: ../../library/typing.rst:1105 msgid "" "``Annotated`` must be called with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1101 +#: ../../library/typing.rst:1108 msgid "" "The order of the annotations is preserved and matters for equality checks::" msgstr "" -#: ../../library/typing.rst:1108 +#: ../../library/typing.rst:1115 msgid "" "Nested ``Annotated`` types are flattened, with metadata ordered starting " "with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1115 +#: ../../library/typing.rst:1122 msgid "Duplicated annotations are not removed::" msgstr "" -#: ../../library/typing.rst:1121 +#: ../../library/typing.rst:1128 msgid "``Annotated`` can be used with nested and generic aliases::" msgstr "" -#: ../../library/typing.rst:1134 +#: ../../library/typing.rst:1141 msgid "" "Special typing form used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1138 +#: ../../library/typing.rst:1145 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1149,44 +1163,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1153 +#: ../../library/typing.rst:1160 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1157 +#: ../../library/typing.rst:1164 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1160 +#: ../../library/typing.rst:1167 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1161 +#: ../../library/typing.rst:1168 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1178 +#: ../../library/typing.rst:1185 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1182 +#: ../../library/typing.rst:1189 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1188 +#: ../../library/typing.rst:1195 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1195,50 +1209,50 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1194 +#: ../../library/typing.rst:1201 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1200 +#: ../../library/typing.rst:1207 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1202 +#: ../../library/typing.rst:1209 msgid "" "These are not used in annotations. They are building blocks for creating " "generic types." msgstr "" -#: ../../library/typing.rst:1206 +#: ../../library/typing.rst:1213 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1208 +#: ../../library/typing.rst:1215 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1217 +#: ../../library/typing.rst:1224 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1230 +#: ../../library/typing.rst:1237 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1232 ../../library/typing.rst:1429 -#: ../../library/typing.rst:1622 +#: ../../library/typing.rst:1239 ../../library/typing.rst:1436 +#: ../../library/typing.rst:1629 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1238 +#: ../../library/typing.rst:1245 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1246,51 +1260,51 @@ msgid "" "types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1258 +#: ../../library/typing.rst:1265 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1261 +#: ../../library/typing.rst:1268 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1276 +#: ../../library/typing.rst:1283 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1282 +#: ../../library/typing.rst:1289 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1293 +#: ../../library/typing.rst:1300 msgid "" "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, :" "func:`isinstance` and :func:`issubclass` should not be used with types." msgstr "" -#: ../../library/typing.rst:1296 +#: ../../library/typing.rst:1303 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " "details. By default, type variables are invariant." msgstr "" -#: ../../library/typing.rst:1302 +#: ../../library/typing.rst:1309 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1305 +#: ../../library/typing.rst:1312 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1298,7 +1312,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1333 +#: ../../library/typing.rst:1340 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1308,36 +1322,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1341 +#: ../../library/typing.rst:1348 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1348 +#: ../../library/typing.rst:1355 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1357 +#: ../../library/typing.rst:1364 msgid "" "Type variable tuples can be happily combined with normal type variables::" msgstr "" -#: ../../library/typing.rst:1370 +#: ../../library/typing.rst:1377 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1377 +#: ../../library/typing.rst:1384 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1387 +#: ../../library/typing.rst:1394 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1346,11 +1360,11 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1394 +#: ../../library/typing.rst:1401 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1400 +#: ../../library/typing.rst:1407 msgid "" "A typing operator that conceptually marks an object as having been unpacked. " "For example, using the unpack operator ``*`` on a :class:`type variable " @@ -1358,20 +1372,20 @@ msgid "" "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1410 +#: ../../library/typing.rst:1417 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context of " "types. You might see ``Unpack`` being used explicitly in older versions of " "Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1426 +#: ../../library/typing.rst:1433 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1433 +#: ../../library/typing.rst:1440 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1381,7 +1395,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1440 +#: ../../library/typing.rst:1447 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1389,27 +1403,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1464 +#: ../../library/typing.rst:1471 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1468 +#: ../../library/typing.rst:1475 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1470 +#: ../../library/typing.rst:1477 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1477 +#: ../../library/typing.rst:1484 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1422,7 +1436,7 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1487 +#: ../../library/typing.rst:1494 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1431,17 +1445,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1496 +#: ../../library/typing.rst:1503 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1502 +#: ../../library/typing.rst:1509 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1507 +#: ../../library/typing.rst:1514 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1449,36 +1463,36 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1512 +#: ../../library/typing.rst:1519 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``::" msgstr "" -#: ../../library/typing.rst:1524 +#: ../../library/typing.rst:1531 msgid "" "``AnyStr`` is a :class:`constrained type variable ` defined as " "``AnyStr = TypeVar('AnyStr', str, bytes)``." msgstr "" -#: ../../library/typing.rst:1527 +#: ../../library/typing.rst:1534 msgid "" "It is meant to be used for functions that may accept any kind of string " "without allowing different kinds of strings to mix. For example::" msgstr "" -#: ../../library/typing.rst:1539 +#: ../../library/typing.rst:1546 msgid "" "Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1545 +#: ../../library/typing.rst:1552 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1557 +#: ../../library/typing.rst:1564 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1486,15 +1500,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1562 +#: ../../library/typing.rst:1569 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1572 +#: ../../library/typing.rst:1579 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1574 +#: ../../library/typing.rst:1581 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1503,7 +1517,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1594 +#: ../../library/typing.rst:1601 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1514,7 +1528,7 @@ msgid "" "SSLObject`." msgstr "" -#: ../../library/typing.rst:1605 +#: ../../library/typing.rst:1612 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1522,38 +1536,38 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1614 +#: ../../library/typing.rst:1621 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1616 +#: ../../library/typing.rst:1623 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1620 +#: ../../library/typing.rst:1627 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1628 +#: ../../library/typing.rst:1635 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1632 +#: ../../library/typing.rst:1639 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1641 +#: ../../library/typing.rst:1648 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1643 +#: ../../library/typing.rst:1650 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1562,60 +1576,60 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1649 +#: ../../library/typing.rst:1656 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1659 +#: ../../library/typing.rst:1666 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1665 +#: ../../library/typing.rst:1672 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1669 +#: ../../library/typing.rst:1676 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1679 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1675 +#: ../../library/typing.rst:1682 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1679 +#: ../../library/typing.rst:1686 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1683 +#: ../../library/typing.rst:1690 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1688 +#: ../../library/typing.rst:1695 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1698 +#: ../../library/typing.rst:1705 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1703 +#: ../../library/typing.rst:1710 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1706 +#: ../../library/typing.rst:1713 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1623,53 +1637,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1722 +#: ../../library/typing.rst:1729 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1726 +#: ../../library/typing.rst:1733 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1730 +#: ../../library/typing.rst:1737 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1737 +#: ../../library/typing.rst:1744 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1738 +#: ../../library/typing.rst:1745 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1750 +#: ../../library/typing.rst:1757 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1761 +#: ../../library/typing.rst:1768 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1764 +#: ../../library/typing.rst:1771 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1774 +#: ../../library/typing.rst:1781 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1677,61 +1691,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1779 +#: ../../library/typing.rst:1786 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:1794 +#: ../../library/typing.rst:1801 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:1808 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1809 +#: ../../library/typing.rst:1816 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:1827 +#: ../../library/typing.rst:1834 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:1833 +#: ../../library/typing.rst:1840 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:1839 +#: ../../library/typing.rst:1846 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example::" msgstr "" -#: ../../library/typing.rst:1859 +#: ../../library/typing.rst:1866 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:1862 +#: ../../library/typing.rst:1869 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:1865 +#: ../../library/typing.rst:1872 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1740,162 +1754,162 @@ msgid "" "``TypedDict`` with a different value for ``total``::" msgstr "" -#: ../../library/typing.rst:1886 +#: ../../library/typing.rst:1893 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1890 +#: ../../library/typing.rst:1897 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:1894 +#: ../../library/typing.rst:1901 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:1898 +#: ../../library/typing.rst:1905 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1901 +#: ../../library/typing.rst:1908 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1905 +#: ../../library/typing.rst:1912 msgid "" "A generic version of :class:`dict`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Mapping`." msgstr "" -#: ../../library/typing.rst:1909 +#: ../../library/typing.rst:1916 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1914 +#: ../../library/typing.rst:1921 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1920 +#: ../../library/typing.rst:1927 msgid "" "Generic version of :class:`list`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:1925 +#: ../../library/typing.rst:1932 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1935 +#: ../../library/typing.rst:1942 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1941 +#: ../../library/typing.rst:1948 msgid "" "A generic version of :class:`builtins.set `. Useful for annotating " "return types. To annotate arguments it is preferred to use an abstract " "collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:1945 +#: ../../library/typing.rst:1952 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1951 +#: ../../library/typing.rst:1958 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:1960 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1958 +#: ../../library/typing.rst:1965 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1961 +#: ../../library/typing.rst:1968 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1965 +#: ../../library/typing.rst:1972 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:1976 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1975 +#: ../../library/typing.rst:1982 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:1979 +#: ../../library/typing.rst:1986 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1985 +#: ../../library/typing.rst:1992 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:1990 +#: ../../library/typing.rst:1997 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1996 +#: ../../library/typing.rst:2003 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2001 +#: ../../library/typing.rst:2008 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2007 +#: ../../library/typing.rst:2014 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2012 +#: ../../library/typing.rst:2019 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2017 +#: ../../library/typing.rst:2024 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2023 +#: ../../library/typing.rst:2030 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2030 +#: ../../library/typing.rst:2037 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2035 +#: ../../library/typing.rst:2042 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1903,32 +1917,32 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2045 +#: ../../library/typing.rst:2052 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2046 +#: ../../library/typing.rst:2053 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2052 +#: ../../library/typing.rst:2059 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:2056 +#: ../../library/typing.rst:2063 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2064 +#: ../../library/typing.rst:2071 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " @@ -1936,416 +1950,416 @@ msgid "" "wherever possible." msgstr "" -#: ../../library/typing.rst:2071 +#: ../../library/typing.rst:2078 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2074 +#: ../../library/typing.rst:2081 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2078 +#: ../../library/typing.rst:2085 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2080 +#: ../../library/typing.rst:2087 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2086 +#: ../../library/typing.rst:2093 msgid "A generic version of :class:`collections.abc.ByteString`." msgstr "" -#: ../../library/typing.rst:2088 +#: ../../library/typing.rst:2095 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2091 +#: ../../library/typing.rst:2098 msgid "" "As a shorthand for this type, :class:`bytes` can be used to annotate " "arguments of any of the types mentioned above." msgstr "" -#: ../../library/typing.rst:2094 +#: ../../library/typing.rst:2101 msgid "" ":class:`collections.abc.ByteString` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2100 +#: ../../library/typing.rst:2107 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:2104 +#: ../../library/typing.rst:2111 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2110 +#: ../../library/typing.rst:2117 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2112 +#: ../../library/typing.rst:2119 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2125 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2120 +#: ../../library/typing.rst:2127 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2126 +#: ../../library/typing.rst:2133 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2128 +#: ../../library/typing.rst:2135 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2134 +#: ../../library/typing.rst:2141 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:2140 +#: ../../library/typing.rst:2147 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2146 +#: ../../library/typing.rst:2153 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2148 +#: ../../library/typing.rst:2155 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2154 +#: ../../library/typing.rst:2161 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2156 +#: ../../library/typing.rst:2163 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2163 +#: ../../library/typing.rst:2170 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2165 +#: ../../library/typing.rst:2172 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2172 +#: ../../library/typing.rst:2179 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2174 +#: ../../library/typing.rst:2181 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2180 +#: ../../library/typing.rst:2187 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2182 +#: ../../library/typing.rst:2189 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2188 +#: ../../library/typing.rst:2195 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2190 +#: ../../library/typing.rst:2197 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2195 +#: ../../library/typing.rst:2202 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2199 +#: ../../library/typing.rst:2206 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2201 +#: ../../library/typing.rst:2208 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2214 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2209 +#: ../../library/typing.rst:2216 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2215 +#: ../../library/typing.rst:2222 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2224 +#: ../../library/typing.rst:2231 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2228 +#: ../../library/typing.rst:2235 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2236 +#: ../../library/typing.rst:2243 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2244 +#: ../../library/typing.rst:2251 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2250 +#: ../../library/typing.rst:2257 msgid "An alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2254 +#: ../../library/typing.rst:2261 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2256 +#: ../../library/typing.rst:2263 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2262 +#: ../../library/typing.rst:2269 msgid "An alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2265 +#: ../../library/typing.rst:2272 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2269 +#: ../../library/typing.rst:2276 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:2281 +#: ../../library/typing.rst:2288 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2287 +#: ../../library/typing.rst:2294 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2296 +#: ../../library/typing.rst:2303 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2300 +#: ../../library/typing.rst:2307 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2308 +#: ../../library/typing.rst:2315 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2318 +#: ../../library/typing.rst:2325 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2325 +#: ../../library/typing.rst:2332 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2329 +#: ../../library/typing.rst:2336 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2335 +#: ../../library/typing.rst:2342 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2339 +#: ../../library/typing.rst:2346 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2345 +#: ../../library/typing.rst:2352 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2349 +#: ../../library/typing.rst:2356 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2355 +#: ../../library/typing.rst:2362 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2359 +#: ../../library/typing.rst:2366 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2364 +#: ../../library/typing.rst:2371 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2371 +#: ../../library/typing.rst:2378 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2376 +#: ../../library/typing.rst:2383 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2382 +#: ../../library/typing.rst:2389 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2384 +#: ../../library/typing.rst:2391 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2388 +#: ../../library/typing.rst:2395 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2393 +#: ../../library/typing.rst:2400 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2397 +#: ../../library/typing.rst:2404 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2401 +#: ../../library/typing.rst:2408 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2405 +#: ../../library/typing.rst:2412 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2411 +#: ../../library/typing.rst:2418 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2415 +#: ../../library/typing.rst:2422 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2419 +#: ../../library/typing.rst:2426 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2423 +#: ../../library/typing.rst:2430 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2425 +#: ../../library/typing.rst:2432 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2432 +#: ../../library/typing.rst:2439 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2434 +#: ../../library/typing.rst:2441 msgid "" "When the type checker encounters a call to ``assert_type()``, it emits an " "error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2441 +#: ../../library/typing.rst:2448 msgid "" "At runtime this returns the first argument unchanged with no side effects." msgstr "" -#: ../../library/typing.rst:2443 +#: ../../library/typing.rst:2450 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2457 +#: ../../library/typing.rst:2464 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2470 +#: ../../library/typing.rst:2477 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " @@ -2358,53 +2372,53 @@ msgid "" "bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2482 +#: ../../library/typing.rst:2489 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2485 +#: ../../library/typing.rst:2492 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2493 +#: ../../library/typing.rst:2500 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2495 +#: ../../library/typing.rst:2502 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2501 +#: ../../library/typing.rst:2508 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2504 +#: ../../library/typing.rst:2511 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2509 +#: ../../library/typing.rst:2516 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2514 +#: ../../library/typing.rst:2521 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2524 +#: ../../library/typing.rst:2531 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -2413,19 +2427,19 @@ msgid "" "`dataclasses.dataclass`-like behaviors." msgstr "" -#: ../../library/typing.rst:2530 +#: ../../library/typing.rst:2537 msgid "Example usage with a decorator function::" msgstr "" -#: ../../library/typing.rst:2544 +#: ../../library/typing.rst:2551 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2553 +#: ../../library/typing.rst:2560 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2564 +#: ../../library/typing.rst:2571 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*. *func* is the function object for the implementation of the " @@ -2571,25 +2585,25 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2666 +#: ../../library/typing.rst:2673 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2674 +#: ../../library/typing.rst:2681 msgid "" "Clear all registered overloads in the internal registry. This can be used to " "reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2682 +#: ../../library/typing.rst:2689 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2705 +#: ../../library/typing.rst:2712 msgid "" "The decorator will now set the ``__final__`` attribute to ``True`` on the " "decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2599,59 +2613,59 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2716 +#: ../../library/typing.rst:2723 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2718 +#: ../../library/typing.rst:2725 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods and classes defined in that class (but not to " "methods defined in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2722 +#: ../../library/typing.rst:2729 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2726 +#: ../../library/typing.rst:2733 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2728 +#: ../../library/typing.rst:2735 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2733 +#: ../../library/typing.rst:2740 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2735 +#: ../../library/typing.rst:2742 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2746 +#: ../../library/typing.rst:2753 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2750 +#: ../../library/typing.rst:2757 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2754 +#: ../../library/typing.rst:2761 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2757 +#: ../../library/typing.rst:2764 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2660,36 +2674,36 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2763 +#: ../../library/typing.rst:2770 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2778 +#: ../../library/typing.rst:2785 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2783 +#: ../../library/typing.rst:2790 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2786 +#: ../../library/typing.rst:2793 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2794 +#: ../../library/typing.rst:2801 msgid "Provide basic introspection for generic types and special typing forms." msgstr "" -#: ../../library/typing.rst:2796 +#: ../../library/typing.rst:2803 msgid "" "For a typing object of the form ``X[Y, Z, ...]`` these functions return " "``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" @@ -2700,11 +2714,11 @@ msgid "" "and ``()`` correspondingly. Examples::" msgstr "" -#: ../../library/typing.rst:2815 +#: ../../library/typing.rst:2822 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2830 +#: ../../library/typing.rst:2837 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2712,24 +2726,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2836 +#: ../../library/typing.rst:2843 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2843 +#: ../../library/typing.rst:2850 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2854 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2856 +#: ../../library/typing.rst:2863 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2737,7 +2751,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2870 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2745,11 +2759,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2872 +#: ../../library/typing.rst:2879 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:2874 +#: ../../library/typing.rst:2881 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2757,62 +2771,62 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:2879 +#: ../../library/typing.rst:2886 msgid "Feature" msgstr "" -#: ../../library/typing.rst:2879 +#: ../../library/typing.rst:2886 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:2879 +#: ../../library/typing.rst:2886 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:2879 +#: ../../library/typing.rst:2886 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:2881 +#: ../../library/typing.rst:2888 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:2881 +#: ../../library/typing.rst:2888 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:2881 +#: ../../library/typing.rst:2888 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:2881 +#: ../../library/typing.rst:2888 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:2884 +#: ../../library/typing.rst:2891 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:2884 +#: ../../library/typing.rst:2891 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:2884 ../../library/typing.rst:2887 +#: ../../library/typing.rst:2891 ../../library/typing.rst:2894 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:2884 +#: ../../library/typing.rst:2891 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:2887 +#: ../../library/typing.rst:2894 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2887 +#: ../../library/typing.rst:2894 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:2887 +#: ../../library/typing.rst:2894 msgid ":gh:`92332`" msgstr ":gh:`92332`" From b1e527284012fb2081038046f1414f2d73d46c61 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 3 Apr 2023 00:32:32 +0000 Subject: [PATCH 058/130] sync with cpython 82362221 --- library/profile.po | 4 ++-- library/test.po | 42 +++++++++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/library/profile.po b/library/profile.po index bb1e4ea951..a840dc1566 100644 --- a/library/profile.po +++ b/library/profile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-04-03 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -101,7 +101,7 @@ msgstr "" msgid "" "The first line indicates that 214 calls were monitored. Of those calls, 207 " "were :dfn:`primitive`, meaning that the call was not induced via recursion. " -"The next line: ``Ordered by: cumulative name``, indicates that the text " +"The next line: ``Ordered by: cumulative time``, indicates that the text " "string in the far right column was used to sort the output. The column " "headings include:" msgstr "" diff --git a/library/test.po b/library/test.po index a252ce1480..3f2a29d31b 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-04-03 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -671,9 +671,9 @@ msgstr "" #: ../../library/test.rst:624 msgid "" -"Print a warning into :data:`sys.__stderr__`. Format the message as: ``f" -"\"Warning -- {msg}\"``. If *msg* is made of multiple lines, add ``\"Warning " -"-- \"`` prefix to each line." +"Print a warning into :data:`sys.__stderr__`. Format the message as: " +"``f\"Warning -- {msg}\"``. If *msg* is made of multiple lines, add " +"``\"Warning -- \"`` prefix to each line." msgstr "" #: ../../library/test.rst:633 @@ -1674,12 +1674,20 @@ msgstr "" #: ../../library/test.rst:1636 msgid "" +"Suppress warnings that are instances of *category*, which must be :exc:" +"`Warning` or a subclass. Roughly equivalent to :func:`warnings." +"catch_warnings` with :meth:`warnings.simplefilter('ignore', " +"category=category) `. For example::" +msgstr "" + +#: ../../library/test.rst:1651 +msgid "" "Context manager to check that no :exc:`ResourceWarning` was raised. You " "must remove the object which may emit :exc:`ResourceWarning` before the end " "of the context manager." msgstr "" -#: ../../library/test.rst:1643 +#: ../../library/test.rst:1658 msgid "" "Test for syntax warning in *statement* by attempting to compile *statement*. " "Test also that the :exc:`SyntaxWarning` is emitted only once, and that it " @@ -1691,7 +1699,7 @@ msgid "" "``None``, compares to the offset of the exception." msgstr "" -#: ../../library/test.rst:1657 +#: ../../library/test.rst:1672 msgid "" "A convenience wrapper for :func:`warnings.catch_warnings()` that makes it " "easier to test that a warning was correctly raised. It is approximately " @@ -1700,7 +1708,7 @@ msgid "" "automatically validate the results that are recorded." msgstr "" -#: ../../library/test.rst:1663 +#: ../../library/test.rst:1678 msgid "" "``check_warnings`` accepts 2-tuples of the form ``(\"message regexp\", " "WarningCategory)`` as positional arguments. If one or more *filters* are " @@ -1712,15 +1720,15 @@ msgid "" "*quiet* to ``True``." msgstr "" -#: ../../library/test.rst:1672 +#: ../../library/test.rst:1687 msgid "If no arguments are specified, it defaults to::" msgstr "" -#: ../../library/test.rst:1676 +#: ../../library/test.rst:1691 msgid "In this case all warnings are caught and no errors are raised." msgstr "" -#: ../../library/test.rst:1678 +#: ../../library/test.rst:1693 msgid "" "On entry to the context manager, a :class:`WarningRecorder` instance is " "returned. The underlying warnings list from :func:`~warnings.catch_warnings` " @@ -1732,39 +1740,39 @@ msgid "" "return ``None``." msgstr "" -#: ../../library/test.rst:1687 +#: ../../library/test.rst:1702 msgid "" "The recorder object also has a :meth:`reset` method, which clears the " "warnings list." msgstr "" -#: ../../library/test.rst:1690 +#: ../../library/test.rst:1705 msgid "The context manager is designed to be used like this::" msgstr "" -#: ../../library/test.rst:1697 +#: ../../library/test.rst:1712 msgid "" "In this case if either warning was not raised, or some other warning was " "raised, :func:`check_warnings` would raise an error." msgstr "" -#: ../../library/test.rst:1700 +#: ../../library/test.rst:1715 msgid "" "When a test needs to look more deeply into the warnings, rather than just " "checking whether or not they occurred, code like this can be used::" msgstr "" -#: ../../library/test.rst:1714 +#: ../../library/test.rst:1729 msgid "" "Here all warnings will be caught, and the test code tests the captured " "warnings directly." msgstr "" -#: ../../library/test.rst:1717 +#: ../../library/test.rst:1732 msgid "New optional arguments *filters* and *quiet*." msgstr "" -#: ../../library/test.rst:1723 +#: ../../library/test.rst:1738 msgid "" "Class used to record warnings for unit tests. See documentation of :func:" "`check_warnings` above for more details." From 8dcc1a6f3e5929b9860ec83a4b4bca9f8da1a30a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 4 Apr 2023 00:32:28 +0000 Subject: [PATCH 059/130] sync with cpython 5342f5e7 --- howto/enum.po | 345 ++++++++++++++++++++++++------------------------ library/enum.po | 289 ++++++++++++++++++++-------------------- 2 files changed, 321 insertions(+), 313 deletions(-) diff --git a/howto/enum.po b/howto/enum.po index 3cac97121c..04c7ed8840 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-12 20:01+0000\n" +"POT-Creation-Date: 2023-04-04 00:30+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -280,10 +280,17 @@ msgid "" msgstr "" #: ../../howto/enum.rst:376 +msgid "" +"It is possible to reload modules -- if a reloaded module contains enums, " +"they will be recreated, and the new members may not compare identical/equal " +"to the original members." +msgstr "" + +#: ../../howto/enum.rst:381 msgid "Allowed members and attributes of enumerations" msgstr "" -#: ../../howto/enum.rst:378 +#: ../../howto/enum.rst:383 msgid "" "Most of the examples above use integers for enumeration values. Using " "integers is short and handy (and provided by default by the `Functional " @@ -292,17 +299,17 @@ msgid "" "*is* important, enumerations can have arbitrary values." msgstr "" -#: ../../howto/enum.rst:384 +#: ../../howto/enum.rst:389 msgid "" "Enumerations are Python classes, and can have methods and special methods as " "usual. If we have this enumeration::" msgstr "" -#: ../../howto/enum.rst:404 +#: ../../howto/enum.rst:409 msgid "Then::" msgstr "" -#: ../../howto/enum.rst:413 +#: ../../howto/enum.rst:418 msgid "" "The rules for what is allowed are as follows: names that start and end with " "a single underscore are reserved by enum and cannot be used; all other " @@ -312,35 +319,35 @@ msgid "" "names listed in :attr:`_ignore_`." msgstr "" -#: ../../howto/enum.rst:420 +#: ../../howto/enum.rst:425 msgid "" "Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` " "then any value(s) given to the enum member will be passed into those " "methods. See `Planet`_ for an example." msgstr "" -#: ../../howto/enum.rst:426 +#: ../../howto/enum.rst:431 msgid "Restricted Enum subclassing" msgstr "" -#: ../../howto/enum.rst:428 +#: ../../howto/enum.rst:433 msgid "" "A new :class:`Enum` class must have one base enum class, up to one concrete " "data type, and as many :class:`object`-based mixin classes as needed. The " "order of these base classes is::" msgstr "" -#: ../../howto/enum.rst:435 +#: ../../howto/enum.rst:440 msgid "" "Also, subclassing an enumeration is allowed only if the enumeration does not " "define any members. So this is forbidden::" msgstr "" -#: ../../howto/enum.rst:445 +#: ../../howto/enum.rst:450 msgid "But this is allowed::" msgstr "" -#: ../../howto/enum.rst:456 +#: ../../howto/enum.rst:461 msgid "" "Allowing subclassing of enums that define members would lead to a violation " "of some important invariants of types and instances. On the other hand, it " @@ -348,49 +355,49 @@ msgid "" "enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" -#: ../../howto/enum.rst:463 +#: ../../howto/enum.rst:468 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:465 +#: ../../howto/enum.rst:470 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:472 +#: ../../howto/enum.rst:477 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -#: ../../howto/enum.rst:478 +#: ../../howto/enum.rst:483 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:481 +#: ../../howto/enum.rst:486 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`__reduce_ex__` in the enumeration class." msgstr "" -#: ../../howto/enum.rst:486 +#: ../../howto/enum.rst:491 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:488 +#: ../../howto/enum.rst:493 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:498 +#: ../../howto/enum.rst:503 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: ../../howto/enum.rst:501 +#: ../../howto/enum.rst:506 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -402,14 +409,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:517 +#: ../../howto/enum.rst:522 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -#: ../../howto/enum.rst:521 +#: ../../howto/enum.rst:526 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -418,14 +425,14 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:531 +#: ../../howto/enum.rst:536 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: ../../howto/enum.rst:535 +#: ../../howto/enum.rst:540 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -433,7 +440,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:542 +#: ../../howto/enum.rst:547 msgid "The complete signature is::" msgstr "" @@ -441,7 +448,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../howto/enum.rst:554 +#: ../../howto/enum.rst:559 msgid "What the new enum class will record as its name." msgstr "" @@ -449,21 +456,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../howto/enum.rst:556 +#: ../../howto/enum.rst:561 msgid "" "The enum members. This can be a whitespace- or comma-separated string " "(values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../howto/enum.rst:561 +#: ../../howto/enum.rst:566 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:565 +#: ../../howto/enum.rst:570 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:569 +#: ../../howto/enum.rst:574 msgid "or a mapping::" msgstr "" @@ -471,7 +478,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../howto/enum.rst:573 +#: ../../howto/enum.rst:578 msgid "name of module where new enum class can be found." msgstr "" @@ -479,7 +486,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../howto/enum.rst:575 +#: ../../howto/enum.rst:580 msgid "where in module new enum class can be found." msgstr "" @@ -487,7 +494,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../howto/enum.rst:577 +#: ../../howto/enum.rst:582 msgid "type to mix in to new enum class." msgstr "" @@ -495,23 +502,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../howto/enum.rst:579 +#: ../../howto/enum.rst:584 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:581 +#: ../../howto/enum.rst:586 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:586 +#: ../../howto/enum.rst:591 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:589 +#: ../../howto/enum.rst:594 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:591 +#: ../../howto/enum.rst:596 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -519,22 +526,22 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:612 +#: ../../howto/enum.rst:617 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:625 +#: ../../howto/enum.rst:630 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:636 +#: ../../howto/enum.rst:641 msgid "StrEnum" msgstr "" -#: ../../howto/enum.rst:638 +#: ../../howto/enum.rst:643 msgid "" "The second variation of :class:`Enum` that is provided is also a subclass " "of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " @@ -542,11 +549,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:647 +#: ../../howto/enum.rst:652 msgid "IntFlag" msgstr "" -#: ../../howto/enum.rst:649 +#: ../../howto/enum.rst:654 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -556,60 +563,60 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:657 +#: ../../howto/enum.rst:662 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:660 +#: ../../howto/enum.rst:665 msgid "" "Bit-wise operations that result in invalid :class:`IntFlag` values will lose " "the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" -#: ../../howto/enum.rst:667 +#: ../../howto/enum.rst:672 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:683 +#: ../../howto/enum.rst:688 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:699 +#: ../../howto/enum.rst:704 msgid "" "Named combinations are considered aliases. Aliases do not show up during " "iteration, but can be returned from by-value lookups." msgstr "" -#: ../../howto/enum.rst:704 +#: ../../howto/enum.rst:709 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: ../../howto/enum.rst:712 +#: ../../howto/enum.rst:717 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" -#: ../../howto/enum.rst:723 +#: ../../howto/enum.rst:728 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:729 +#: ../../howto/enum.rst:734 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:738 +#: ../../howto/enum.rst:743 msgid "Flag" msgstr "" -#: ../../howto/enum.rst:740 +#: ../../howto/enum.rst:745 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -619,29 +626,29 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:749 +#: ../../howto/enum.rst:754 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: ../../howto/enum.rst:763 +#: ../../howto/enum.rst:768 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags will not::" msgstr "" -#: ../../howto/enum.rst:775 +#: ../../howto/enum.rst:780 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:789 +#: ../../howto/enum.rst:794 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:799 +#: ../../howto/enum.rst:804 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -652,42 +659,42 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:809 +#: ../../howto/enum.rst:814 msgid "Others" msgstr "" -#: ../../howto/enum.rst:811 +#: ../../howto/enum.rst:816 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:817 +#: ../../howto/enum.rst:822 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: ../../howto/enum.rst:820 +#: ../../howto/enum.rst:825 msgid "Some rules:" msgstr "" -#: ../../howto/enum.rst:822 +#: ../../howto/enum.rst:827 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before :class:" "`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " "above." msgstr "" -#: ../../howto/enum.rst:825 +#: ../../howto/enum.rst:830 msgid "" "Mix-in types must be subclassable. For example, :class:`bool` and :class:" "`range` are not subclassable and will throw an error during Enum creation if " "used as the mix-in type." msgstr "" -#: ../../howto/enum.rst:828 +#: ../../howto/enum.rst:833 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -695,157 +702,157 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:832 +#: ../../howto/enum.rst:837 msgid "" "When another data type is mixed in, the :attr:`value` attribute is *not the " "same* as the enum member itself, although it is equivalent and will compare " "equal." msgstr "" -#: ../../howto/enum.rst:835 +#: ../../howto/enum.rst:840 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " "``%h`` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../howto/enum.rst:838 +#: ../../howto/enum.rst:843 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:843 +#: ../../howto/enum.rst:848 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" "`__str__` method has been reset to their data types :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:849 +#: ../../howto/enum.rst:854 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:851 +#: ../../howto/enum.rst:856 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:855 +#: ../../howto/enum.rst:860 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:882 +#: ../../howto/enum.rst:887 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:885 +#: ../../howto/enum.rst:890 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:887 +#: ../../howto/enum.rst:892 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:890 +#: ../../howto/enum.rst:895 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../howto/enum.rst:896 +#: ../../howto/enum.rst:901 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:898 +#: ../../howto/enum.rst:903 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:899 +#: ../../howto/enum.rst:904 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:901 +#: ../../howto/enum.rst:906 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:903 +#: ../../howto/enum.rst:908 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../howto/enum.rst:906 +#: ../../howto/enum.rst:911 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:908 +#: ../../howto/enum.rst:913 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:914 +#: ../../howto/enum.rst:919 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:917 +#: ../../howto/enum.rst:922 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../howto/enum.rst:920 +#: ../../howto/enum.rst:925 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:921 +#: ../../howto/enum.rst:926 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:923 +#: ../../howto/enum.rst:928 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:941 +#: ../../howto/enum.rst:946 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:946 +#: ../../howto/enum.rst:951 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:948 +#: ../../howto/enum.rst:953 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:955 +#: ../../howto/enum.rst:960 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:957 +#: ../../howto/enum.rst:962 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In Python versions ``3.5`` to ``3.10`` you could " @@ -853,22 +860,22 @@ msgid "" "``3.11`` :class:`Enum` returns to not allowing it::" msgstr "" -#: ../../howto/enum.rst:978 +#: ../../howto/enum.rst:983 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:980 +#: ../../howto/enum.rst:985 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:992 +#: ../../howto/enum.rst:997 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:994 +#: ../../howto/enum.rst:999 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -877,137 +884,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1003 +#: ../../howto/enum.rst:1008 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1007 +#: ../../howto/enum.rst:1012 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1009 +#: ../../howto/enum.rst:1014 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1020 +#: ../../howto/enum.rst:1025 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1022 +#: ../../howto/enum.rst:1027 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1040 +#: ../../howto/enum.rst:1045 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1042 +#: ../../howto/enum.rst:1047 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1053 +#: ../../howto/enum.rst:1058 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1055 +#: ../../howto/enum.rst:1060 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1056 +#: ../../howto/enum.rst:1061 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1057 +#: ../../howto/enum.rst:1062 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1062 +#: ../../howto/enum.rst:1067 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1071 +#: ../../howto/enum.rst:1076 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1076 +#: ../../howto/enum.rst:1081 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1087 +#: ../../howto/enum.rst:1092 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1093 +#: ../../howto/enum.rst:1098 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1102 +#: ../../howto/enum.rst:1107 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1105 +#: ../../howto/enum.rst:1110 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1106 +#: ../../howto/enum.rst:1111 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1107 +#: ../../howto/enum.rst:1112 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1116 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1109 +#: ../../howto/enum.rst:1114 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1110 +#: ../../howto/enum.rst:1115 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1116 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1113 +#: ../../howto/enum.rst:1118 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1121 +#: ../../howto/enum.rst:1126 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1123 +#: ../../howto/enum.rst:1128 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1128 +#: ../../howto/enum.rst:1133 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1130 +#: ../../howto/enum.rst:1135 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1018,11 +1025,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1139 +#: ../../howto/enum.rst:1144 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1141 +#: ../../howto/enum.rst:1146 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1031,11 +1038,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1147 +#: ../../howto/enum.rst:1152 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1149 +#: ../../howto/enum.rst:1154 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1044,37 +1051,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1155 +#: ../../howto/enum.rst:1160 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1157 +#: ../../howto/enum.rst:1162 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1163 +#: ../../howto/enum.rst:1168 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1170 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1171 +#: ../../howto/enum.rst:1176 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1181 +#: ../../howto/enum.rst:1186 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1184 +#: ../../howto/enum.rst:1189 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1082,149 +1089,149 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1191 +#: ../../howto/enum.rst:1196 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1193 +#: ../../howto/enum.rst:1198 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1196 +#: ../../howto/enum.rst:1201 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1197 +#: ../../howto/enum.rst:1202 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1198 +#: ../../howto/enum.rst:1203 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1199 +#: ../../howto/enum.rst:1204 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1202 +#: ../../howto/enum.rst:1207 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1208 +#: ../../howto/enum.rst:1213 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1210 +#: ../../howto/enum.rst:1215 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1222 +#: ../../howto/enum.rst:1227 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1224 +#: ../../howto/enum.rst:1229 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1234 +#: ../../howto/enum.rst:1239 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1250 +#: ../../howto/enum.rst:1255 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1252 +#: ../../howto/enum.rst:1257 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1264 +#: ../../howto/enum.rst:1269 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1266 +#: ../../howto/enum.rst:1271 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1283 +#: ../../howto/enum.rst:1288 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1293 +#: ../../howto/enum.rst:1298 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1312 +#: ../../howto/enum.rst:1317 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1318 +#: ../../howto/enum.rst:1323 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1320 +#: ../../howto/enum.rst:1325 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1354 +#: ../../howto/enum.rst:1359 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1356 +#: ../../howto/enum.rst:1361 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1381 +#: ../../howto/enum.rst:1386 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1387 +#: ../../howto/enum.rst:1392 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1389 +#: ../../howto/enum.rst:1394 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1418 +#: ../../howto/enum.rst:1423 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1420 +#: ../../howto/enum.rst:1425 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1439 +#: ../../howto/enum.rst:1444 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1441 +#: ../../howto/enum.rst:1446 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/library/enum.po b/library/enum.po index ccc1a64e14..d7b1f024c9 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-18 00:33+0000\n" +"POT-Creation-Date: 2023-04-04 00:30+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-" @@ -255,23 +255,23 @@ msgstr ":func:`global_enum`" #: ../../library/enum.rst:143 msgid "" "Modify the :class:`str() ` and :func:`repr` of an enum to show its " -"members as belonging to the module instead of its class. Should only be used " -"if the enum members will be exported to the module global namespace." +"members as belonging to the module instead of its class, and export the enum " +"members to the global namespace." msgstr "" -#: ../../library/enum.rst:148 +#: ../../library/enum.rst:147 msgid ":func:`show_flag_values`" msgstr ":func:`show_flag_values`" -#: ../../library/enum.rst:150 +#: ../../library/enum.rst:149 msgid "Return a list of all power-of-two integers contained in a flag." msgstr "" -#: ../../library/enum.rst:153 +#: ../../library/enum.rst:152 msgid "``Flag``, ``IntFlag``, ``auto``" msgstr "``Flag``, ``IntFlag``, ``auto``" -#: ../../library/enum.rst:154 +#: ../../library/enum.rst:153 msgid "" "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" @@ -279,18 +279,18 @@ msgstr "" "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" -#: ../../library/enum.rst:159 +#: ../../library/enum.rst:158 msgid "Data Types" msgstr "" -#: ../../library/enum.rst:164 +#: ../../library/enum.rst:163 msgid "" "*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible " "to subclass *EnumType* -- see :ref:`Subclassing EnumType ` for details." msgstr "" -#: ../../library/enum.rst:168 +#: ../../library/enum.rst:167 msgid "" "*EnumType* is responsible for setting the correct :meth:`!__repr__`, :meth:`!" "__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the final " @@ -298,88 +298,11 @@ msgid "" "providing iteration over the enum class, etc." msgstr "" -#: ../../library/enum.rst:175 -msgid "Returns ``True`` if member belongs to the ``cls``::" -msgstr "" - -#: ../../library/enum.rst:183 -msgid "" -"In Python 3.12 it will be possible to check for member values and not just " -"members; until then, a ``TypeError`` will be raised if a non-Enum-member is " -"used in a containment check." -msgstr "" - -#: ../../library/enum.rst:189 -msgid "" -"Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " -"names of the members in *cls*::" -msgstr "" - -#: ../../library/enum.rst:197 -msgid "" -"Returns the Enum member in *cls* matching *name*, or raises an :exc:" -"`AttributeError`::" -msgstr "" - -#: ../../library/enum.rst:204 -msgid "" -"Returns the Enum member in *cls* matching *name*, or raises a :exc:" -"`KeyError`::" -msgstr "" - -#: ../../library/enum.rst:211 -msgid "Returns each member in *cls* in definition order::" -msgstr "" - -#: ../../library/enum.rst:218 -msgid "Returns the number of member in *cls*::" -msgstr "" - -#: ../../library/enum.rst:225 -msgid "Returns each member in *cls* in reverse definition order::" -msgstr "" - -#: ../../library/enum.rst:233 -msgid "*Enum* is the base class for all *enum* enumerations." -msgstr "" - -#: ../../library/enum.rst:237 -msgid "The name used to define the ``Enum`` member::" -msgstr "" - -#: ../../library/enum.rst:244 -msgid "The value given to the ``Enum`` member::" -msgstr "" - -#: ../../library/enum.rst:249 -msgid "Enum member values" -msgstr "" - -#: ../../library/enum.rst:251 -msgid "" -"Member values can be anything: :class:`int`, :class:`str`, etc. If the " -"exact value is unimportant you may use :class:`auto` instances and an " -"appropriate value will be chosen for you. See :class:`auto` for the details." -msgstr "" - -#: ../../library/enum.rst:258 -msgid "" -"``_ignore_`` is only used during creation and is removed from the " -"enumeration once creation is complete." -msgstr "" - -#: ../../library/enum.rst:261 -msgid "" -"``_ignore_`` is a list of names that will not become members, and whose " -"names will also be removed from the completed enumeration. See :ref:" -"`TimePeriod ` for an example." -msgstr "" - -#: ../../library/enum.rst:267 +#: ../../library/enum.rst:174 msgid "This method is called in two different ways:" msgstr "" -#: ../../library/enum.rst:269 +#: ../../library/enum.rst:176 msgid "to look up an existing member:" msgstr "" @@ -387,7 +310,7 @@ msgstr "" msgid "cls" msgstr "cls" -#: ../../library/enum.rst:271 ../../library/enum.rst:276 +#: ../../library/enum.rst:178 ../../library/enum.rst:184 msgid "The enum class being called." msgstr "" @@ -395,15 +318,17 @@ msgstr "" msgid "value" msgstr "" -#: ../../library/enum.rst:272 +#: ../../library/enum.rst:179 msgid "The value to lookup." msgstr "" -#: ../../library/enum.rst:274 -msgid "to use the ``cls`` enum to create a new enum:" +#: ../../library/enum.rst:181 +msgid "" +"to use the ``cls`` enum to create a new enum (only if the existing enum does " +"not have any members):" msgstr "" -#: ../../library/enum.rst:277 +#: ../../library/enum.rst:185 msgid "The name of the new Enum to create." msgstr "" @@ -411,7 +336,7 @@ msgstr "" msgid "names" msgstr "" -#: ../../library/enum.rst:278 +#: ../../library/enum.rst:186 msgid "The names/values of the members for the new Enum." msgstr "" @@ -419,7 +344,7 @@ msgstr "" msgid "module" msgstr "模組" -#: ../../library/enum.rst:279 +#: ../../library/enum.rst:187 msgid "The name of the module the new Enum is created in." msgstr "" @@ -427,7 +352,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../library/enum.rst:280 +#: ../../library/enum.rst:188 msgid "The actual location in the module where this Enum can be found." msgstr "" @@ -435,7 +360,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../library/enum.rst:281 +#: ../../library/enum.rst:189 msgid "A mix-in type for the new Enum." msgstr "" @@ -443,7 +368,7 @@ msgstr "" msgid "start" msgstr "" -#: ../../library/enum.rst:282 +#: ../../library/enum.rst:190 msgid "The first integer value for the Enum (used by :class:`auto`)." msgstr "" @@ -451,11 +376,88 @@ msgstr "" msgid "boundary" msgstr "" -#: ../../library/enum.rst:283 +#: ../../library/enum.rst:191 msgid "" "How to handle out-of-range values from bit operations (:class:`Flag` only)." msgstr "" +#: ../../library/enum.rst:195 +msgid "Returns ``True`` if member belongs to the ``cls``::" +msgstr "" + +#: ../../library/enum.rst:203 +msgid "" +"In Python 3.12 it will be possible to check for member values and not just " +"members; until then, a ``TypeError`` will be raised if a non-Enum-member is " +"used in a containment check." +msgstr "" + +#: ../../library/enum.rst:209 +msgid "" +"Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " +"names of the members in *cls*::" +msgstr "" + +#: ../../library/enum.rst:217 +msgid "" +"Returns the Enum member in *cls* matching *name*, or raises an :exc:" +"`AttributeError`::" +msgstr "" + +#: ../../library/enum.rst:224 +msgid "" +"Returns the Enum member in *cls* matching *name*, or raises a :exc:" +"`KeyError`::" +msgstr "" + +#: ../../library/enum.rst:231 +msgid "Returns each member in *cls* in definition order::" +msgstr "" + +#: ../../library/enum.rst:238 +msgid "Returns the number of member in *cls*::" +msgstr "" + +#: ../../library/enum.rst:245 +msgid "Returns each member in *cls* in reverse definition order::" +msgstr "" + +#: ../../library/enum.rst:253 +msgid "*Enum* is the base class for all *enum* enumerations." +msgstr "" + +#: ../../library/enum.rst:257 +msgid "The name used to define the ``Enum`` member::" +msgstr "" + +#: ../../library/enum.rst:264 +msgid "The value given to the ``Enum`` member::" +msgstr "" + +#: ../../library/enum.rst:269 +msgid "Enum member values" +msgstr "" + +#: ../../library/enum.rst:271 +msgid "" +"Member values can be anything: :class:`int`, :class:`str`, etc. If the " +"exact value is unimportant you may use :class:`auto` instances and an " +"appropriate value will be chosen for you. See :class:`auto` for the details." +msgstr "" + +#: ../../library/enum.rst:278 +msgid "" +"``_ignore_`` is only used during creation and is removed from the " +"enumeration once creation is complete." +msgstr "" + +#: ../../library/enum.rst:281 +msgid "" +"``_ignore_`` is a list of names that will not become members, and whose " +"names will also be removed from the completed enumeration. See :ref:" +"`TimePeriod ` for an example." +msgstr "" + #: ../../library/enum.rst:287 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " @@ -757,96 +759,95 @@ msgstr "" #: ../../library/enum.rst:724 msgid "" -"Out-of-range values lose their *Flag* membership and revert to :class:`int`. " -"This is the default for :class:`IntFlag`::" +"Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "" -#: ../../library/enum.rst:737 +#: ../../library/enum.rst:736 msgid "" -"Out-of-range values are kept, and the *Flag* membership is kept. This is " -"used for some stdlib flags::" +"Out-of-range values are kept, and the *Flag* membership is kept. This is the " +"default for :class:`IntFlag`::" msgstr "" -#: ../../library/enum.rst:753 +#: ../../library/enum.rst:752 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../library/enum.rst:755 +#: ../../library/enum.rst:754 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:758 +#: ../../library/enum.rst:757 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " "appropriately. Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:764 +#: ../../library/enum.rst:763 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../library/enum.rst:766 +#: ../../library/enum.rst:765 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../library/enum.rst:767 +#: ../../library/enum.rst:766 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../library/enum.rst:769 +#: ../../library/enum.rst:768 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../library/enum.rst:771 +#: ../../library/enum.rst:770 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../library/enum.rst:774 +#: ../../library/enum.rst:773 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:776 +#: ../../library/enum.rst:775 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "" -#: ../../library/enum.rst:781 +#: ../../library/enum.rst:780 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../library/enum.rst:784 +#: ../../library/enum.rst:783 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../library/enum.rst:787 +#: ../../library/enum.rst:786 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:788 +#: ../../library/enum.rst:787 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:793 +#: ../../library/enum.rst:792 msgid "Utilities and Decorators" msgstr "" -#: ../../library/enum.rst:797 +#: ../../library/enum.rst:796 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -857,58 +858,58 @@ msgid "" "manually specified values." msgstr "" -#: ../../library/enum.rst:805 +#: ../../library/enum.rst:804 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: ../../library/enum.rst:807 +#: ../../library/enum.rst:806 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: ../../library/enum.rst:808 +#: ../../library/enum.rst:807 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" -#: ../../library/enum.rst:809 +#: ../../library/enum.rst:808 msgid "used to create the ``SECOND`` enum member;" msgstr "" -#: ../../library/enum.rst:810 +#: ../../library/enum.rst:809 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:815 +#: ../../library/enum.rst:814 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "" -#: ../../library/enum.rst:818 +#: ../../library/enum.rst:817 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:821 +#: ../../library/enum.rst:820 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:827 +#: ../../library/enum.rst:826 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:831 +#: ../../library/enum.rst:830 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -916,29 +917,29 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:840 +#: ../../library/enum.rst:839 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:858 +#: ../../library/enum.rst:857 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:866 +#: ../../library/enum.rst:865 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:872 +#: ../../library/enum.rst:871 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:878 +#: ../../library/enum.rst:877 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -946,41 +947,41 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:888 +#: ../../library/enum.rst:887 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:895 +#: ../../library/enum.rst:894 msgid "Notes" msgstr "" -#: ../../library/enum.rst:897 +#: ../../library/enum.rst:896 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:899 +#: ../../library/enum.rst:898 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:902 +#: ../../library/enum.rst:901 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:904 +#: ../../library/enum.rst:903 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:907 +#: ../../library/enum.rst:906 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:914 +#: ../../library/enum.rst:913 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" From fa8c85894491e4ea39e0312cebf3f23f6df0a078 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 5 Apr 2023 00:28:17 +0000 Subject: [PATCH 060/130] sync with cpython 6258c3cd --- library/socket.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/socket.po b/library/socket.po index 1afcb98c28..f2abdf4044 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-05 00:26+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-" @@ -1882,8 +1882,8 @@ msgstr "" #: ../../library/socket.rst:1690 msgid "" -"The socket timeout is no more reset each time data is sent successfully. The " -"socket timeout is now the maximum total duration to send all data." +"The socket timeout is no longer reset each time data is sent successfully. " +"The socket timeout is now the maximum total duration to send all data." msgstr "" #: ../../library/socket.rst:1703 @@ -2094,8 +2094,8 @@ msgstr "" msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " -"the :mod:`select` can be used to know when and whether a socket is available " -"for reading or writing." +"the :mod:`select` module can be used to know when and whether a socket is " +"available for reading or writing." msgstr "" #: ../../library/socket.rst:1917 @@ -2204,7 +2204,7 @@ msgstr "" #: ../../library/socket.rst:2103 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " -"socket, you can use the :meth:`socket.send`, and the :meth:`socket.recv` " +"socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" From 8e743bdee4d88d9fabca04988b1d481c25b3be40 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 6 Apr 2023 00:31:09 +0000 Subject: [PATCH 061/130] sync with cpython 851e7444 --- library/functions.po | 206 +++++++++++++++++++++---------------------- library/sys.po | 4 +- 2 files changed, 105 insertions(+), 105 deletions(-) diff --git a/library/functions.po b/library/functions.po index 22082e1214..6e61533af5 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-25 00:33+0000\n" +"POT-Creation-Date: 2023-04-06 00:29+0000\n" "PO-Revision-Date: 2023-01-04 14:53+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2375,36 +2375,36 @@ msgstr "" #: ../../library/functions.rst:1446 msgid "" -"Whether the output is buffered is usually determined by *file*, but if the " -"*flush* keyword argument is true, the stream is forcibly flushed." +"Output buffering is usually determined by *file*. However, if *flush* is " +"true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1449 +#: ../../library/functions.rst:1450 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1455 +#: ../../library/functions.rst:1456 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1457 +#: ../../library/functions.rst:1458 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " "attribute value. And *doc* creates a docstring for the attribute." msgstr "" -#: ../../library/functions.rst:1461 +#: ../../library/functions.rst:1462 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1478 +#: ../../library/functions.rst:1479 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter, and ``del c.x`` the deleter." msgstr "" -#: ../../library/functions.rst:1481 +#: ../../library/functions.rst:1482 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -2412,14 +2412,14 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1494 +#: ../../library/functions.rst:1495 msgid "" "The ``@property`` decorator turns the :meth:`voltage` method into a " "\"getter\" for a read-only attribute with the same name, and it sets the " "docstring for *voltage* to \"Get the current voltage.\"" msgstr "" -#: ../../library/functions.rst:1498 +#: ../../library/functions.rst:1499 msgid "" "A property object has :attr:`~property.getter`, :attr:`~property.setter`, " "and :attr:`~property.deleter` methods usable as decorators that create a " @@ -2427,30 +2427,30 @@ msgid "" "decorated function. This is best explained with an example::" msgstr "" -#: ../../library/functions.rst:1520 +#: ../../library/functions.rst:1521 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " "case.)" msgstr "" -#: ../../library/functions.rst:1524 +#: ../../library/functions.rst:1525 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1527 +#: ../../library/functions.rst:1528 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1536 +#: ../../library/functions.rst:1537 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1542 +#: ../../library/functions.rst:1543 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -2463,7 +2463,7 @@ msgid "" "`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1555 +#: ../../library/functions.rst:1556 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" @@ -2471,14 +2471,14 @@ msgid "" "starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1563 +#: ../../library/functions.rst:1564 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " "input." msgstr "" -#: ../../library/functions.rst:1567 +#: ../../library/functions.rst:1568 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -2489,13 +2489,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1576 +#: ../../library/functions.rst:1577 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1581 +#: ../../library/functions.rst:1582 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -2504,21 +2504,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1593 +#: ../../library/functions.rst:1594 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" "set` for documentation about this class." msgstr "" -#: ../../library/functions.rst:1597 +#: ../../library/functions.rst:1598 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " "module." msgstr "" -#: ../../library/functions.rst:1604 +#: ../../library/functions.rst:1605 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string, and an arbitrary value. The string may name an existing attribute " @@ -2527,7 +2527,7 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1610 +#: ../../library/functions.rst:1611 msgid "" "*name* need not be a Python identifier as defined in :ref:`identifiers` " "unless the object chooses to enforce that, for example in a custom :meth:" @@ -2536,14 +2536,14 @@ msgid "" "notation, but is accessible through :func:`getattr` etc.." msgstr "" -#: ../../library/functions.rst:1618 +#: ../../library/functions.rst:1619 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " "with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" -#: ../../library/functions.rst:1627 +#: ../../library/functions.rst:1628 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -2556,35 +2556,35 @@ msgid "" "func:`itertools.islice` for an alternate version that returns an iterator." msgstr "" -#: ../../library/functions.rst:1640 +#: ../../library/functions.rst:1641 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1642 +#: ../../library/functions.rst:1643 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1644 +#: ../../library/functions.rst:1645 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -#: ../../library/functions.rst:1648 +#: ../../library/functions.rst:1649 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/functions.rst:1651 +#: ../../library/functions.rst:1652 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1654 +#: ../../library/functions.rst:1655 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -2592,7 +2592,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1659 +#: ../../library/functions.rst:1660 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2604,22 +2604,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1668 +#: ../../library/functions.rst:1669 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1672 +#: ../../library/functions.rst:1673 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1674 +#: ../../library/functions.rst:1675 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1681 +#: ../../library/functions.rst:1682 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -2627,21 +2627,21 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1684 +#: ../../library/functions.rst:1685 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, they can be called as regular " "functions (such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1688 +#: ../../library/functions.rst:1689 msgid "" "Static methods in Python are similar to those found in Java or C++. Also, " "see :func:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" -#: ../../library/functions.rst:1692 +#: ../../library/functions.rst:1693 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -2650,36 +2650,36 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1704 +#: ../../library/functions.rst:1705 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1706 +#: ../../library/functions.rst:1707 msgid "" "Static methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``), have a " "new ``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" -#: ../../library/functions.rst:1721 +#: ../../library/functions.rst:1722 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1723 +#: ../../library/functions.rst:1724 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1729 +#: ../../library/functions.rst:1730 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -#: ../../library/functions.rst:1733 +#: ../../library/functions.rst:1734 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." @@ -2688,31 +2688,31 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1739 +#: ../../library/functions.rst:1740 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1745 +#: ../../library/functions.rst:1746 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " "been overridden in a class." msgstr "" -#: ../../library/functions.rst:1749 +#: ../../library/functions.rst:1750 msgid "" "The *object_or_type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." msgstr "" -#: ../../library/functions.rst:1753 +#: ../../library/functions.rst:1754 msgid "" "For example, if :attr:`~class.__mro__` of *object_or_type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" -#: ../../library/functions.rst:1757 +#: ../../library/functions.rst:1758 msgid "" "The :attr:`~class.__mro__` attribute of the *object_or_type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2720,7 +2720,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1762 +#: ../../library/functions.rst:1763 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -2728,7 +2728,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1767 +#: ../../library/functions.rst:1768 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -2736,7 +2736,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1772 +#: ../../library/functions.rst:1773 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -2749,18 +2749,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1782 +#: ../../library/functions.rst:1783 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1789 +#: ../../library/functions.rst:1790 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " "` in a parent or sibling class." msgstr "" -#: ../../library/functions.rst:1793 +#: ../../library/functions.rst:1794 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2770,7 +2770,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1800 +#: ../../library/functions.rst:1801 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -2780,33 +2780,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1807 +#: ../../library/functions.rst:1808 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1817 +#: ../../library/functions.rst:1818 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1826 +#: ../../library/functions.rst:1827 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." "__class__ `." msgstr "" -#: ../../library/functions.rst:1830 +#: ../../library/functions.rst:1831 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." msgstr "" -#: ../../library/functions.rst:1834 +#: ../../library/functions.rst:1835 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -2819,11 +2819,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1849 +#: ../../library/functions.rst:1850 msgid "See also :ref:`bltin-type-objects`." msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:1851 +#: ../../library/functions.rst:1852 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2831,23 +2831,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1856 +#: ../../library/functions.rst:1857 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:1858 +#: ../../library/functions.rst:1859 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../library/functions.rst:1865 +#: ../../library/functions.rst:1866 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/functions.rst:1868 +#: ../../library/functions.rst:1869 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2855,54 +2855,54 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1873 +#: ../../library/functions.rst:1874 msgid "" "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " "locals dictionary is only useful for reads since updates to the locals " "dictionary are ignored." msgstr "" -#: ../../library/functions.rst:1877 +#: ../../library/functions.rst:1878 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " "defines the :attr:`~object.__slots__` attribute)." msgstr "" -#: ../../library/functions.rst:1883 +#: ../../library/functions.rst:1884 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:1886 +#: ../../library/functions.rst:1887 msgid "Example::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:1895 +#: ../../library/functions.rst:1896 msgid "" "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " "tuple contains the *i*-th element from each of the argument iterables." msgstr "" -#: ../../library/functions.rst:1898 +#: ../../library/functions.rst:1899 msgid "" "Another way to think of :func:`zip` is that it turns rows into columns, and " "columns into rows. This is similar to `transposing a matrix `_." msgstr "" -#: ../../library/functions.rst:1902 +#: ../../library/functions.rst:1903 msgid "" ":func:`zip` is lazy: The elements won't be processed until the iterable is " "iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" "`list`." msgstr "" -#: ../../library/functions.rst:1906 +#: ../../library/functions.rst:1907 msgid "" "One thing to consider is that the iterables passed to :func:`zip` could have " "different lengths; sometimes by design, and sometimes because of a bug in " @@ -2910,51 +2910,51 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:1911 +#: ../../library/functions.rst:1912 msgid "" "By default, :func:`zip` stops when the shortest iterable is exhausted. It " "will ignore the remaining items in the longer iterables, cutting off the " "result to the length of the shortest iterable::" msgstr "" -#: ../../library/functions.rst:1918 +#: ../../library/functions.rst:1919 msgid "" ":func:`zip` is often used in cases where the iterables are assumed to be of " "equal length. In such cases, it's recommended to use the ``strict=True`` " "option. Its output is the same as regular :func:`zip`::" msgstr "" -#: ../../library/functions.rst:1925 +#: ../../library/functions.rst:1926 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -#: ../../library/functions.rst:1943 +#: ../../library/functions.rst:1944 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " "bug in another part of the program." msgstr "" -#: ../../library/functions.rst:1947 +#: ../../library/functions.rst:1948 msgid "" "Shorter iterables can be padded with a constant value to make all the " "iterables have the same length. This is done by :func:`itertools." "zip_longest`." msgstr "" -#: ../../library/functions.rst:1951 +#: ../../library/functions.rst:1952 msgid "" "Edge cases: With a single iterable argument, :func:`zip` returns an iterator " "of 1-tuples. With no arguments, it returns an empty iterator." msgstr "" -#: ../../library/functions.rst:1954 +#: ../../library/functions.rst:1955 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:1956 +#: ../../library/functions.rst:1957 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -2963,23 +2963,23 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1962 +#: ../../library/functions.rst:1963 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1973 +#: ../../library/functions.rst:1974 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:1985 +#: ../../library/functions.rst:1986 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1988 +#: ../../library/functions.rst:1989 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -2991,7 +2991,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1997 +#: ../../library/functions.rst:1998 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3001,7 +3001,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2004 +#: ../../library/functions.rst:2005 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3010,7 +3010,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:2010 +#: ../../library/functions.rst:2011 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -3018,58 +3018,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:2015 +#: ../../library/functions.rst:2016 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:2020 +#: ../../library/functions.rst:2021 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:2024 +#: ../../library/functions.rst:2025 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2027 +#: ../../library/functions.rst:2028 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:2034 +#: ../../library/functions.rst:2035 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " "respective names." msgstr "" -#: ../../library/functions.rst:2038 +#: ../../library/functions.rst:2039 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2041 +#: ../../library/functions.rst:2042 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:2045 +#: ../../library/functions.rst:2046 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -#: ../../library/functions.rst:2050 +#: ../../library/functions.rst:2051 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2051 +#: ../../library/functions.rst:2052 msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " diff --git a/library/sys.po b/library/sys.po index b6e22cdf0b..8084625db0 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-16 00:34+0000\n" +"POT-Creation-Date: 2023-04-06 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1075,7 +1075,7 @@ msgid "" "the encoding used with the :term:`filesystem error handler ` to convert between Unicode filenames and bytes " "filenames. The filesystem error handler is returned from :func:" -"`getfilesystemencoding`." +"`getfilesystemencodeerrors`." msgstr "" #: ../../library/sys.rst:702 From 6ddfe2481377c12b7ac8b5410c73a726c43c5336 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 7 Apr 2023 00:29:59 +0000 Subject: [PATCH 062/130] sync with cpython 123680f9 --- howto/enum.po | 156 +++++++++++++++++++++++++------------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/howto/enum.po b/howto/enum.po index 04c7ed8840..c531be1f56 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-04 00:30+0000\n" +"POT-Creation-Date: 2023-04-07 00:27+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -855,27 +855,27 @@ msgstr "" #: ../../howto/enum.rst:962 msgid "" "Enum members are instances of their enum class, and are normally accessed as " -"``EnumClass.member``. In Python versions ``3.5`` to ``3.10`` you could " -"access members from other members -- this practice was discouraged, and in " -"``3.11`` :class:`Enum` returns to not allowing it::" +"``EnumClass.member``. In certain situations, such as writing custom enum " +"behavior, being able to access one member directly from another is useful, " +"and is supported." msgstr "" -#: ../../howto/enum.rst:983 +#: ../../howto/enum.rst:971 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:985 +#: ../../howto/enum.rst:973 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:997 +#: ../../howto/enum.rst:985 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:999 +#: ../../howto/enum.rst:987 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -884,137 +884,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1008 +#: ../../howto/enum.rst:996 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1012 +#: ../../howto/enum.rst:1000 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1014 +#: ../../howto/enum.rst:1002 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1025 +#: ../../howto/enum.rst:1013 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1027 +#: ../../howto/enum.rst:1015 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1045 +#: ../../howto/enum.rst:1033 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1047 +#: ../../howto/enum.rst:1035 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1058 +#: ../../howto/enum.rst:1046 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1060 +#: ../../howto/enum.rst:1048 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1061 +#: ../../howto/enum.rst:1049 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1062 +#: ../../howto/enum.rst:1050 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1067 +#: ../../howto/enum.rst:1055 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1076 +#: ../../howto/enum.rst:1064 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1081 +#: ../../howto/enum.rst:1069 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1092 +#: ../../howto/enum.rst:1080 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1098 +#: ../../howto/enum.rst:1086 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1107 +#: ../../howto/enum.rst:1095 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1110 +#: ../../howto/enum.rst:1098 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1099 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1112 +#: ../../howto/enum.rst:1100 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1104 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1114 +#: ../../howto/enum.rst:1102 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1115 +#: ../../howto/enum.rst:1103 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1104 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1118 +#: ../../howto/enum.rst:1106 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1126 +#: ../../howto/enum.rst:1114 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1128 +#: ../../howto/enum.rst:1116 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1133 +#: ../../howto/enum.rst:1121 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1135 +#: ../../howto/enum.rst:1123 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1025,11 +1025,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1144 +#: ../../howto/enum.rst:1132 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1146 +#: ../../howto/enum.rst:1134 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1038,11 +1038,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1152 +#: ../../howto/enum.rst:1140 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1154 +#: ../../howto/enum.rst:1142 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1051,37 +1051,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1160 +#: ../../howto/enum.rst:1148 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1162 +#: ../../howto/enum.rst:1150 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1168 +#: ../../howto/enum.rst:1156 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1170 +#: ../../howto/enum.rst:1158 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1176 +#: ../../howto/enum.rst:1164 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1186 +#: ../../howto/enum.rst:1174 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1189 +#: ../../howto/enum.rst:1177 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1089,149 +1089,149 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1196 +#: ../../howto/enum.rst:1184 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1198 +#: ../../howto/enum.rst:1186 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1201 +#: ../../howto/enum.rst:1189 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1202 +#: ../../howto/enum.rst:1190 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1203 +#: ../../howto/enum.rst:1191 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1204 +#: ../../howto/enum.rst:1192 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1207 +#: ../../howto/enum.rst:1195 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1213 +#: ../../howto/enum.rst:1201 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1215 +#: ../../howto/enum.rst:1203 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1227 +#: ../../howto/enum.rst:1215 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1229 +#: ../../howto/enum.rst:1217 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1239 +#: ../../howto/enum.rst:1227 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1255 +#: ../../howto/enum.rst:1243 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1257 +#: ../../howto/enum.rst:1245 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1269 +#: ../../howto/enum.rst:1257 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1271 +#: ../../howto/enum.rst:1259 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1288 +#: ../../howto/enum.rst:1276 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1298 +#: ../../howto/enum.rst:1286 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1317 +#: ../../howto/enum.rst:1305 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1323 +#: ../../howto/enum.rst:1311 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1325 +#: ../../howto/enum.rst:1313 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1359 +#: ../../howto/enum.rst:1347 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1361 +#: ../../howto/enum.rst:1349 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1386 +#: ../../howto/enum.rst:1374 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1392 +#: ../../howto/enum.rst:1380 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1394 +#: ../../howto/enum.rst:1382 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1423 +#: ../../howto/enum.rst:1411 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1425 +#: ../../howto/enum.rst:1413 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1444 +#: ../../howto/enum.rst:1432 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1446 +#: ../../howto/enum.rst:1434 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " From 5c77449a76508155c7e9066167664d06f8929015 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 9 Apr 2023 00:33:30 +0000 Subject: [PATCH 063/130] sync with cpython 4fa5fda1 --- library/datetime.po | 820 +++++++++++++++++++++-------------------- reference/datamodel.po | 320 ++++++++-------- 2 files changed, 574 insertions(+), 566 deletions(-) diff --git a/library/datetime.po b/library/datetime.po index f8b6e4c994..c1f70ae4a8 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:32+0000\n" +"POT-Creation-Date: 2023-04-09 00:31+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -356,8 +356,8 @@ msgid "" msgstr "" #: ../../library/datetime.rst:256 ../../library/datetime.rst:552 -#: ../../library/datetime.rst:1059 ../../library/datetime.rst:1677 -#: ../../library/datetime.rst:2281 +#: ../../library/datetime.rst:1057 ../../library/datetime.rst:1676 +#: ../../library/datetime.rst:2278 msgid "Class attributes:" msgstr "" @@ -384,7 +384,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:277 ../../library/datetime.rst:570 -#: ../../library/datetime.rst:1079 ../../library/datetime.rst:1697 +#: ../../library/datetime.rst:1077 ../../library/datetime.rst:1696 msgid "Instance attributes (read-only):" msgstr "" @@ -421,17 +421,17 @@ msgid "Between 0 and 999999 inclusive" msgstr "" #: ../../library/datetime.rst:289 ../../library/datetime.rst:587 -#: ../../library/datetime.rst:1132 +#: ../../library/datetime.rst:1130 msgid "Supported operations:" msgstr "" #: ../../library/datetime.rst:294 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1135 +#: ../../library/datetime.rst:1133 msgid "Operation" msgstr "" #: ../../library/datetime.rst:294 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1135 +#: ../../library/datetime.rst:1133 msgid "Result" msgstr "" @@ -576,7 +576,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:355 ../../library/datetime.rst:604 -#: ../../library/datetime.rst:2494 +#: ../../library/datetime.rst:2499 msgid "Notes:" msgstr "註解:" @@ -650,7 +650,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:422 ../../library/datetime.rst:633 -#: ../../library/datetime.rst:1206 ../../library/datetime.rst:1805 +#: ../../library/datetime.rst:1204 ../../library/datetime.rst:1804 msgid "Instance methods:" msgstr "" @@ -714,12 +714,12 @@ msgstr "``1 <= month <= 12``" msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:487 ../../library/datetime.rst:849 +#: ../../library/datetime.rst:487 ../../library/datetime.rst:847 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:490 ../../library/datetime.rst:854 +#: ../../library/datetime.rst:490 ../../library/datetime.rst:852 msgid "Other constructors, all class methods:" msgstr "" @@ -798,15 +798,15 @@ msgid "" "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:574 ../../library/datetime.rst:1083 +#: ../../library/datetime.rst:574 ../../library/datetime.rst:1081 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:579 ../../library/datetime.rst:1088 +#: ../../library/datetime.rst:579 ../../library/datetime.rst:1086 msgid "Between 1 and 12 inclusive." msgstr "" -#: ../../library/datetime.rst:584 ../../library/datetime.rst:1093 +#: ../../library/datetime.rst:584 ../../library/datetime.rst:1091 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" @@ -830,7 +830,7 @@ msgstr "" msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:598 ../../library/datetime.rst:1141 +#: ../../library/datetime.rst:598 ../../library/datetime.rst:1139 msgid "\\(3)" msgstr "\\(3)" @@ -887,14 +887,14 @@ msgid "" "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:640 ../../library/datetime.rst:1848 +#: ../../library/datetime.rst:640 ../../library/datetime.rst:1847 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:650 ../../library/datetime.rst:1319 +#: ../../library/datetime.rst:650 ../../library/datetime.rst:1317 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." @@ -904,7 +904,7 @@ msgstr "" msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:654 ../../library/datetime.rst:1321 +#: ../../library/datetime.rst:654 ../../library/datetime.rst:1319 msgid "``d.timetuple()`` is equivalent to::" msgstr "" "``d.timetuple()`` 等價於:\n" @@ -981,7 +981,7 @@ msgstr "" msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:728 ../../library/datetime.rst:1505 +#: ../../library/datetime.rst:728 ../../library/datetime.rst:1503 msgid "``d.ctime()`` is equivalent to::" msgstr "" @@ -996,41 +996,41 @@ msgstr "" msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " -"values. For a complete list of formatting directives, see :ref:`strftime-" -"strptime-behavior`." +"values. See also :ref:`strftime-strptime-behavior` and :meth:`date." +"isoformat`." msgstr "" -#: ../../library/datetime.rst:747 +#: ../../library/datetime.rst:746 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals ` and when using :meth:`str.format`. For a complete list of " -"formatting directives, see :ref:`strftime-strptime-behavior`." +"strings>` and when using :meth:`str.format`. See also :ref:`strftime-" +"strptime-behavior` and :meth:`date.isoformat`." msgstr "" -#: ../../library/datetime.rst:754 +#: ../../library/datetime.rst:752 msgid "Examples of Usage: :class:`date`" msgstr "用法範例:\\ :class:`date`" -#: ../../library/datetime.rst:756 +#: ../../library/datetime.rst:754 msgid "Example of counting days to an event::" msgstr "" -#: ../../library/datetime.rst:774 +#: ../../library/datetime.rst:772 msgid "More examples of working with :class:`date`:" msgstr "" -#: ../../library/datetime.rst:823 +#: ../../library/datetime.rst:821 msgid ":class:`.datetime` Objects" msgstr ":class:`.datetime` 物件" -#: ../../library/datetime.rst:825 +#: ../../library/datetime.rst:823 msgid "" "A :class:`.datetime` object is a single object containing all the " "information from a :class:`date` object and a :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:828 +#: ../../library/datetime.rst:826 msgid "" "Like a :class:`date` object, :class:`.datetime` assumes the current " "Gregorian calendar extended in both directions; like a :class:`.time` " @@ -1038,80 +1038,80 @@ msgid "" "every day." msgstr "" -#: ../../library/datetime.rst:832 +#: ../../library/datetime.rst:830 msgid "Constructor:" msgstr "" -#: ../../library/datetime.rst:836 +#: ../../library/datetime.rst:834 msgid "" "The *year*, *month* and *day* arguments are required. *tzinfo* may be " "``None``, or an instance of a :class:`tzinfo` subclass. The remaining " "arguments must be integers in the following ranges:" msgstr "" -#: ../../library/datetime.rst:840 +#: ../../library/datetime.rst:838 msgid "``MINYEAR <= year <= MAXYEAR``," msgstr "" -#: ../../library/datetime.rst:841 +#: ../../library/datetime.rst:839 msgid "``1 <= month <= 12``," msgstr "" -#: ../../library/datetime.rst:842 +#: ../../library/datetime.rst:840 msgid "``1 <= day <= number of days in the given month and year``," msgstr "" -#: ../../library/datetime.rst:843 ../../library/datetime.rst:1668 +#: ../../library/datetime.rst:841 ../../library/datetime.rst:1667 msgid "``0 <= hour < 24``," msgstr "" -#: ../../library/datetime.rst:844 ../../library/datetime.rst:1669 +#: ../../library/datetime.rst:842 ../../library/datetime.rst:1668 msgid "``0 <= minute < 60``," msgstr "" -#: ../../library/datetime.rst:845 ../../library/datetime.rst:1670 +#: ../../library/datetime.rst:843 ../../library/datetime.rst:1669 msgid "``0 <= second < 60``," msgstr "" -#: ../../library/datetime.rst:846 ../../library/datetime.rst:1671 +#: ../../library/datetime.rst:844 ../../library/datetime.rst:1670 msgid "``0 <= microsecond < 1000000``," msgstr "" -#: ../../library/datetime.rst:847 ../../library/datetime.rst:1672 +#: ../../library/datetime.rst:845 ../../library/datetime.rst:1671 msgid "``fold in [0, 1]``." msgstr "" -#: ../../library/datetime.rst:851 ../../library/datetime.rst:1240 -#: ../../library/datetime.rst:1815 +#: ../../library/datetime.rst:849 ../../library/datetime.rst:1238 +#: ../../library/datetime.rst:1814 msgid "Added the ``fold`` argument." msgstr "新增 ``fold`` 引數。" -#: ../../library/datetime.rst:858 +#: ../../library/datetime.rst:856 msgid "Return the current local datetime, with :attr:`.tzinfo` ``None``." msgstr "" -#: ../../library/datetime.rst:860 +#: ../../library/datetime.rst:858 msgid "Equivalent to::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/datetime.rst:864 +#: ../../library/datetime.rst:862 msgid "See also :meth:`now`, :meth:`fromtimestamp`." msgstr "也請見 :meth:`now`\\ 、\\ :meth:`fromtimestamp`\\ 。" -#: ../../library/datetime.rst:866 +#: ../../library/datetime.rst:864 msgid "" "This method is functionally equivalent to :meth:`now`, but without a ``tz`` " "parameter." msgstr "" -#: ../../library/datetime.rst:871 +#: ../../library/datetime.rst:869 msgid "Return the current local date and time." msgstr "" -#: ../../library/datetime.rst:873 +#: ../../library/datetime.rst:871 msgid "" "If optional argument *tz* is ``None`` or not specified, this is like :meth:" "`today`, but, if possible, supplies more precision than can be gotten from " @@ -1119,28 +1119,28 @@ msgid "" "possible on platforms supplying the C :c:func:`gettimeofday` function)." msgstr "" -#: ../../library/datetime.rst:879 +#: ../../library/datetime.rst:877 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the current date and time are converted to *tz*’s time zone." msgstr "" -#: ../../library/datetime.rst:882 +#: ../../library/datetime.rst:880 msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." msgstr "" -#: ../../library/datetime.rst:887 +#: ../../library/datetime.rst:885 msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." msgstr "" -#: ../../library/datetime.rst:889 +#: ../../library/datetime.rst:887 msgid "" "This is like :meth:`now`, but returns the current UTC date and time, as a " "naive :class:`.datetime` object. An aware current UTC datetime can be " "obtained by calling ``datetime.now(timezone.utc)``. See also :meth:`now`." msgstr "" -#: ../../library/datetime.rst:895 +#: ../../library/datetime.rst:893 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1148,7 +1148,7 @@ msgid "" "current time in UTC is by calling ``datetime.now(timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:903 +#: ../../library/datetime.rst:901 msgid "" "Return the local date and time corresponding to the POSIX timestamp, such as " "is returned by :func:`time.time`. If optional argument *tz* is ``None`` or " @@ -1156,13 +1156,13 @@ msgid "" "time, and the returned :class:`.datetime` object is naive." msgstr "" -#: ../../library/datetime.rst:908 +#: ../../library/datetime.rst:906 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the timestamp is converted to *tz*’s time zone." msgstr "" -#: ../../library/datetime.rst:911 +#: ../../library/datetime.rst:909 msgid "" ":meth:`fromtimestamp` may raise :exc:`OverflowError`, if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1175,7 +1175,7 @@ msgid "" "preferred over :meth:`utcfromtimestamp`." msgstr "" -#: ../../library/datetime.rst:922 +#: ../../library/datetime.rst:920 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1183,17 +1183,17 @@ msgid "" "`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:929 +#: ../../library/datetime.rst:927 msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." msgstr "" -#: ../../library/datetime.rst:934 +#: ../../library/datetime.rst:932 msgid "" "Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, " "with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" msgstr "" -#: ../../library/datetime.rst:937 +#: ../../library/datetime.rst:935 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`gmtime` function, and :exc:" @@ -1201,23 +1201,23 @@ msgid "" "to years in 1970 through 2038." msgstr "" -#: ../../library/datetime.rst:942 +#: ../../library/datetime.rst:940 msgid "To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" msgstr "" -#: ../../library/datetime.rst:946 +#: ../../library/datetime.rst:944 msgid "" "On the POSIX compliant platforms, it is equivalent to the following " "expression::" msgstr "" -#: ../../library/datetime.rst:951 +#: ../../library/datetime.rst:949 msgid "" "except the latter formula always supports the full years range: between :" "const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:956 +#: ../../library/datetime.rst:954 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1226,7 +1226,7 @@ msgid "" "tz=timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:962 +#: ../../library/datetime.rst:960 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`gmtime` " @@ -1234,7 +1234,7 @@ msgid "" "`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:971 +#: ../../library/datetime.rst:969 msgid "" "Return the :class:`.datetime` corresponding to the proleptic Gregorian " "ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is " @@ -1243,7 +1243,7 @@ msgid "" "is ``None``." msgstr "" -#: ../../library/datetime.rst:979 +#: ../../library/datetime.rst:977 msgid "" "Return a new :class:`.datetime` object whose date components are equal to " "the given :class:`date` object's, and whose time components are equal to the " @@ -1252,54 +1252,54 @@ msgid "" "the :attr:`~.time.tzinfo` attribute of the *time* argument is used." msgstr "" -#: ../../library/datetime.rst:986 +#: ../../library/datetime.rst:984 msgid "" "For any :class:`.datetime` object *d*, ``d == datetime.combine(d.date(), d." "time(), d.tzinfo)``. If date is a :class:`.datetime` object, its time " "components and :attr:`.tzinfo` attributes are ignored." msgstr "" -#: ../../library/datetime.rst:991 +#: ../../library/datetime.rst:989 msgid "Added the *tzinfo* argument." msgstr "新增 *tzinfo* 引數。" -#: ../../library/datetime.rst:997 +#: ../../library/datetime.rst:995 msgid "" "Return a :class:`.datetime` corresponding to a *date_string* in any valid " "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1000 ../../library/datetime.rst:1771 +#: ../../library/datetime.rst:998 ../../library/datetime.rst:1770 msgid "Time zone offsets may have fractional seconds." msgstr "" -#: ../../library/datetime.rst:1001 +#: ../../library/datetime.rst:999 msgid "The ``T`` separator may be replaced by any single unicode character." msgstr "" -#: ../../library/datetime.rst:1002 +#: ../../library/datetime.rst:1000 msgid "Ordinal dates are not currently supported." msgstr "" -#: ../../library/datetime.rst:1003 ../../library/datetime.rst:1776 +#: ../../library/datetime.rst:1001 ../../library/datetime.rst:1775 msgid "Fractional hours and minutes are not supported." msgstr "" -#: ../../library/datetime.rst:1005 ../../library/datetime.rst:1434 -#: ../../library/datetime.rst:1778 +#: ../../library/datetime.rst:1003 ../../library/datetime.rst:1432 +#: ../../library/datetime.rst:1777 msgid "Examples::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:1029 +#: ../../library/datetime.rst:1027 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`date.isoformat()` or :meth:`datetime.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1036 +#: ../../library/datetime.rst:1034 msgid "" "Return a :class:`.datetime` corresponding to the ISO calendar date specified " "by year, week and day. The non-date components of the datetime are populated " @@ -1307,65 +1307,65 @@ msgid "" "`datetime.isocalendar`." msgstr "" -#: ../../library/datetime.rst:1045 +#: ../../library/datetime.rst:1043 msgid "" "Return a :class:`.datetime` corresponding to *date_string*, parsed according " "to *format*." msgstr "" -#: ../../library/datetime.rst:1048 +#: ../../library/datetime.rst:1046 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/datetime.rst:1052 +#: ../../library/datetime.rst:1050 msgid "" ":exc:`ValueError` is raised if the date_string and format can't be parsed " -"by :func:`time.strptime` or if it returns a value which isn't a time tuple. " -"For a complete list of formatting directives, see :ref:`strftime-strptime-" -"behavior`." +"by :func:`time.strptime` or if it returns a value which isn't a time tuple. " +"See also :ref:`strftime-strptime-behavior` and :meth:`datetime." +"fromisoformat`." msgstr "" -#: ../../library/datetime.rst:1063 +#: ../../library/datetime.rst:1061 msgid "" "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " "tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1069 +#: ../../library/datetime.rst:1067 msgid "" "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1075 +#: ../../library/datetime.rst:1073 msgid "" "The smallest possible difference between non-equal :class:`.datetime` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:1098 ../../library/datetime.rst:1701 +#: ../../library/datetime.rst:1096 ../../library/datetime.rst:1700 msgid "In ``range(24)``." msgstr "" -#: ../../library/datetime.rst:1103 ../../library/datetime.rst:1108 -#: ../../library/datetime.rst:1706 ../../library/datetime.rst:1711 +#: ../../library/datetime.rst:1101 ../../library/datetime.rst:1106 +#: ../../library/datetime.rst:1705 ../../library/datetime.rst:1710 msgid "In ``range(60)``." msgstr "" -#: ../../library/datetime.rst:1113 ../../library/datetime.rst:1716 +#: ../../library/datetime.rst:1111 ../../library/datetime.rst:1715 msgid "In ``range(1000000)``." msgstr "" -#: ../../library/datetime.rst:1118 +#: ../../library/datetime.rst:1116 msgid "" "The object passed as the *tzinfo* argument to the :class:`.datetime` " "constructor, or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1124 ../../library/datetime.rst:1727 +#: ../../library/datetime.rst:1122 ../../library/datetime.rst:1726 msgid "" "In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " "(A repeated interval occurs when clocks are rolled back at the end of " @@ -1374,38 +1374,38 @@ msgid "" "(later) of the two moments with the same wall time representation." msgstr "" -#: ../../library/datetime.rst:1137 +#: ../../library/datetime.rst:1135 msgid "``datetime2 = datetime1 + timedelta``" msgstr "``datetime2 = datetime1 + timedelta``" -#: ../../library/datetime.rst:1137 ../../library/datetime.rst:2329 -#: ../../library/datetime.rst:2334 ../../library/datetime.rst:2346 -#: ../../library/datetime.rst:2351 ../../library/datetime.rst:2411 -#: ../../library/datetime.rst:2416 ../../library/datetime.rst:2420 +#: ../../library/datetime.rst:1135 ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2339 ../../library/datetime.rst:2351 +#: ../../library/datetime.rst:2356 ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2425 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/datetime.rst:1139 +#: ../../library/datetime.rst:1137 msgid "``datetime2 = datetime1 - timedelta``" msgstr "``datetime2 = datetime1 - timedelta``" -#: ../../library/datetime.rst:1139 ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:1137 ../../library/datetime.rst:2367 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/datetime.rst:1141 +#: ../../library/datetime.rst:1139 msgid "``timedelta = datetime1 - datetime2``" msgstr "``timedelta = datetime1 - datetime2``" -#: ../../library/datetime.rst:1143 +#: ../../library/datetime.rst:1141 msgid "``datetime1 < datetime2``" msgstr "``datetime1 < datetime2``" -#: ../../library/datetime.rst:1143 +#: ../../library/datetime.rst:1141 msgid "Compares :class:`.datetime` to :class:`.datetime`. (4)" msgstr "" -#: ../../library/datetime.rst:1148 +#: ../../library/datetime.rst:1146 msgid "" "datetime2 is a duration of timedelta removed from datetime1, moving forward " "in time if ``timedelta.days`` > 0, or backward if ``timedelta.days`` < 0. " @@ -1416,7 +1416,7 @@ msgid "" "the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1157 +#: ../../library/datetime.rst:1155 msgid "" "Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " "addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " @@ -1424,14 +1424,14 @@ msgid "" "aware." msgstr "" -#: ../../library/datetime.rst:1162 +#: ../../library/datetime.rst:1160 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1166 +#: ../../library/datetime.rst:1164 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " @@ -1439,7 +1439,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1171 +#: ../../library/datetime.rst:1169 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes " @@ -1448,20 +1448,20 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1177 +#: ../../library/datetime.rst:1175 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time." msgstr "" -#: ../../library/datetime.rst:1180 +#: ../../library/datetime.rst:1178 msgid "" "If one comparand is naive and the other is aware, :exc:`TypeError` is raised " "if an order comparison is attempted. For equality comparisons, naive " "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1184 +#: ../../library/datetime.rst:1182 msgid "" "If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " "attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " @@ -1471,13 +1471,13 @@ msgid "" "utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1190 +#: ../../library/datetime.rst:1188 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1196 +#: ../../library/datetime.rst:1194 msgid "" "In order to stop comparison from falling back to the default scheme of " "comparing object addresses, datetime comparison normally raises :exc:" @@ -1490,27 +1490,27 @@ msgid "" "cases return :const:`False` or :const:`True`, respectively." msgstr "" -#: ../../library/datetime.rst:1210 +#: ../../library/datetime.rst:1208 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1215 +#: ../../library/datetime.rst:1213 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1218 ../../library/datetime.rst:1227 +#: ../../library/datetime.rst:1216 ../../library/datetime.rst:1225 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1224 +#: ../../library/datetime.rst:1222 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1235 +#: ../../library/datetime.rst:1233 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1518,21 +1518,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1246 +#: ../../library/datetime.rst:1244 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1250 +#: ../../library/datetime.rst:1248 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system timezone." msgstr "" -#: ../../library/datetime.rst:1254 +#: ../../library/datetime.rst:1252 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1540,7 +1540,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1259 +#: ../../library/datetime.rst:1257 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1549,7 +1549,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1265 +#: ../../library/datetime.rst:1263 msgid "" "If you merely want to attach a time zone object *tz* to a datetime *dt* " "without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " @@ -1557,56 +1557,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1270 +#: ../../library/datetime.rst:1268 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: ../../library/datetime.rst:1282 +#: ../../library/datetime.rst:1280 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1285 +#: ../../library/datetime.rst:1283 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1292 +#: ../../library/datetime.rst:1290 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1296 ../../library/datetime.rst:1890 -#: ../../library/datetime.rst:1996 ../../library/datetime.rst:2241 -#: ../../library/datetime.rst:2253 ../../library/datetime.rst:2550 +#: ../../library/datetime.rst:1294 ../../library/datetime.rst:1887 +#: ../../library/datetime.rst:1993 ../../library/datetime.rst:2238 +#: ../../library/datetime.rst:2250 ../../library/datetime.rst:2555 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1302 +#: ../../library/datetime.rst:1300 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1306 ../../library/datetime.rst:1900 -#: ../../library/datetime.rst:2050 +#: ../../library/datetime.rst:1304 ../../library/datetime.rst:1897 +#: ../../library/datetime.rst:2047 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1312 +#: ../../library/datetime.rst:1310 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: ../../library/datetime.rst:1327 +#: ../../library/datetime.rst:1325 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st. The :" @@ -1616,14 +1616,14 @@ msgid "" "attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" -#: ../../library/datetime.rst:1338 +#: ../../library/datetime.rst:1336 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`tm_isdst` is forced to 0 regardless of what " "``d.dst()`` returns. DST is never in effect for a UTC time." msgstr "" -#: ../../library/datetime.rst:1342 +#: ../../library/datetime.rst:1340 msgid "" "If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -1632,7 +1632,7 @@ msgid "" "spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1351 +#: ../../library/datetime.rst:1349 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1642,20 +1642,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1360 +#: ../../library/datetime.rst:1358 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1365 +#: ../../library/datetime.rst:1363 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: ../../library/datetime.rst:1369 +#: ../../library/datetime.rst:1367 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " @@ -1664,18 +1664,18 @@ msgid "" "`OverflowError` for times far in the past or far in the future." msgstr "" -#: ../../library/datetime.rst:1376 +#: ../../library/datetime.rst:1374 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1383 +#: ../../library/datetime.rst:1381 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1389 +#: ../../library/datetime.rst:1387 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1683,216 +1683,216 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1397 +#: ../../library/datetime.rst:1395 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1403 +#: ../../library/datetime.rst:1401 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1409 +#: ../../library/datetime.rst:1407 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: ../../library/datetime.rst:1416 +#: ../../library/datetime.rst:1414 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1422 +#: ../../library/datetime.rst:1420 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1424 +#: ../../library/datetime.rst:1422 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1425 +#: ../../library/datetime.rst:1423 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1427 +#: ../../library/datetime.rst:1425 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" -#: ../../library/datetime.rst:1430 +#: ../../library/datetime.rst:1428 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" msgstr "" -#: ../../library/datetime.rst:1432 +#: ../../library/datetime.rst:1430 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1442 +#: ../../library/datetime.rst:1440 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1456 ../../library/datetime.rst:1828 +#: ../../library/datetime.rst:1454 ../../library/datetime.rst:1827 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1460 ../../library/datetime.rst:1832 +#: ../../library/datetime.rst:1458 ../../library/datetime.rst:1831 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1462 ../../library/datetime.rst:1834 +#: ../../library/datetime.rst:1460 ../../library/datetime.rst:1833 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1463 ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1461 ../../library/datetime.rst:1834 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1464 ../../library/datetime.rst:1836 +#: ../../library/datetime.rst:1462 ../../library/datetime.rst:1835 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1838 +#: ../../library/datetime.rst:1464 ../../library/datetime.rst:1837 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1468 ../../library/datetime.rst:1840 +#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1839 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1472 ../../library/datetime.rst:1844 +#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1474 +#: ../../library/datetime.rst:1472 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1484 ../../library/datetime.rst:1859 +#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1858 msgid "Added the *timespec* argument." msgstr "新增 *timespec* 引數。" -#: ../../library/datetime.rst:1490 +#: ../../library/datetime.rst:1488 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1496 +#: ../../library/datetime.rst:1494 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1502 +#: ../../library/datetime.rst:1500 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1509 +#: ../../library/datetime.rst:1507 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: ../../library/datetime.rst:1515 +#: ../../library/datetime.rst:1514 msgid "" "Return a string representing the date and time, controlled by an explicit " -"format string. For a complete list of formatting directives, see :ref:" -"`strftime-strptime-behavior`." +"format string. See also :ref:`strftime-strptime-behavior` and :meth:" +"`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1522 +#: ../../library/datetime.rst:1521 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " -"literals ` and when using :meth:`str.format`. For a complete list " -"of formatting directives, see :ref:`strftime-strptime-behavior`." +"literals ` and when using :meth:`str.format`. See also :ref:" +"`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1529 +#: ../../library/datetime.rst:1528 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:1531 +#: ../../library/datetime.rst:1530 msgid "Examples of working with :class:`~datetime.datetime` objects:" msgstr "" -#: ../../library/datetime.rst:1584 +#: ../../library/datetime.rst:1583 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1631 +#: ../../library/datetime.rst:1630 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1657 +#: ../../library/datetime.rst:1656 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1659 +#: ../../library/datetime.rst:1658 msgid "" "A :class:`time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1664 +#: ../../library/datetime.rst:1663 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1674 +#: ../../library/datetime.rst:1673 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" -#: ../../library/datetime.rst:1682 +#: ../../library/datetime.rst:1681 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1687 +#: ../../library/datetime.rst:1686 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1692 +#: ../../library/datetime.rst:1691 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: ../../library/datetime.rst:1721 +#: ../../library/datetime.rst:1720 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1735 +#: ../../library/datetime.rst:1734 msgid "" ":class:`.time` objects support comparison of :class:`.time` to :class:`." "time`, where *a* is considered less than *b* when *a* precedes *b* in time. " @@ -1901,7 +1901,7 @@ msgid "" "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1741 +#: ../../library/datetime.rst:1740 msgid "" "If both comparands are aware, and have the same :attr:`~time.tzinfo` " "attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " @@ -1915,18 +1915,18 @@ msgid "" "respectively." msgstr "" -#: ../../library/datetime.rst:1751 +#: ../../library/datetime.rst:1750 msgid "" "Equality comparisons between aware and naive :class:`~datetime.time` " "instances don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1755 +#: ../../library/datetime.rst:1754 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1757 +#: ../../library/datetime.rst:1756 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -1934,35 +1934,35 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1764 +#: ../../library/datetime.rst:1763 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1768 +#: ../../library/datetime.rst:1767 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1772 +#: ../../library/datetime.rst:1771 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" -#: ../../library/datetime.rst:1774 +#: ../../library/datetime.rst:1773 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1800 +#: ../../library/datetime.rst:1799 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1810 +#: ../../library/datetime.rst:1809 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1970,94 +1970,94 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1821 +#: ../../library/datetime.rst:1820 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1823 +#: ../../library/datetime.rst:1822 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1824 +#: ../../library/datetime.rst:1823 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1825 +#: ../../library/datetime.rst:1824 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1826 +#: ../../library/datetime.rst:1825 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1846 +#: ../../library/datetime.rst:1845 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1865 +#: ../../library/datetime.rst:1864 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1870 +#: ../../library/datetime.rst:1869 msgid "" "Return a string representing the time, controlled by an explicit format " -"string. For a complete list of formatting directives, see :ref:`strftime-" -"strptime-behavior`." +"string. See also :ref:`strftime-strptime-behavior` and :meth:`time." +"isoformat`." msgstr "" -#: ../../library/datetime.rst:1877 +#: ../../library/datetime.rst:1875 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` and when using :meth:`str.format`. For a complete list of " -"formatting directives, see :ref:`strftime-strptime-behavior`." +"strings>` and when using :meth:`str.format`. See also :ref:`strftime-" +"strptime-behavior` and :meth:`time.isoformat`." msgstr "" -#: ../../library/datetime.rst:1886 +#: ../../library/datetime.rst:1883 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(None)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1896 +#: ../../library/datetime.rst:1893 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(None)``, and raises an exception if the latter doesn't return ``None``, " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1905 +#: ../../library/datetime.rst:1902 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(None)``, or raises an exception if the latter doesn't return ``None`` " "or a string object." msgstr "" -#: ../../library/datetime.rst:1910 +#: ../../library/datetime.rst:1907 msgid "Examples of Usage: :class:`.time`" msgstr "" -#: ../../library/datetime.rst:1912 +#: ../../library/datetime.rst:1909 msgid "Examples of working with a :class:`.time` object::" msgstr "" -#: ../../library/datetime.rst:1943 +#: ../../library/datetime.rst:1940 msgid ":class:`tzinfo` Objects" msgstr ":class:`tzinfo` 物件" -#: ../../library/datetime.rst:1947 +#: ../../library/datetime.rst:1944 msgid "" "This is an abstract base class, meaning that this class should not be " "instantiated directly. Define a subclass of :class:`tzinfo` to capture " "information about a particular time zone." msgstr "" -#: ../../library/datetime.rst:1951 +#: ../../library/datetime.rst:1948 msgid "" "An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the " "constructors for :class:`.datetime` and :class:`.time` objects. The latter " @@ -2067,7 +2067,7 @@ msgid "" "object passed to them." msgstr "" -#: ../../library/datetime.rst:1957 +#: ../../library/datetime.rst:1954 msgid "" "You need to derive a concrete subclass, and (at least) supply " "implementations of the standard :class:`tzinfo` methods needed by the :class:" @@ -2077,7 +2077,7 @@ msgid "" "American EST and EDT." msgstr "" -#: ../../library/datetime.rst:1964 +#: ../../library/datetime.rst:1961 msgid "" "Special requirement for pickling: A :class:`tzinfo` subclass must have an :" "meth:`__init__` method that can be called with no arguments, otherwise it " @@ -2085,20 +2085,20 @@ msgid "" "requirement that may be relaxed in the future." msgstr "" -#: ../../library/datetime.rst:1969 +#: ../../library/datetime.rst:1966 msgid "" "A concrete subclass of :class:`tzinfo` may need to implement the following " "methods. Exactly which methods are needed depends on the uses made of aware :" "mod:`datetime` objects. If in doubt, simply implement all of them." msgstr "" -#: ../../library/datetime.rst:1976 +#: ../../library/datetime.rst:1973 msgid "" "Return offset of local time from UTC, as a :class:`timedelta` object that is " "positive east of UTC. If local time is west of UTC, this should be negative." msgstr "" -#: ../../library/datetime.rst:1979 +#: ../../library/datetime.rst:1976 msgid "" "This represents the *total* offset from UTC; for example, if a :class:" "`tzinfo` object represents both time zone and DST adjustments, :meth:" @@ -2109,25 +2109,25 @@ msgid "" "meth:`utcoffset` will probably look like one of these two::" msgstr "" -#: ../../library/datetime.rst:1990 +#: ../../library/datetime.rst:1987 msgid "" "If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not return " "``None`` either." msgstr "" -#: ../../library/datetime.rst:1993 +#: ../../library/datetime.rst:1990 msgid "" "The default implementation of :meth:`utcoffset` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2002 +#: ../../library/datetime.rst:1999 msgid "" "Return the daylight saving time (DST) adjustment, as a :class:`timedelta` " "object or ``None`` if DST information isn't known." msgstr "" -#: ../../library/datetime.rst:2006 +#: ../../library/datetime.rst:2003 msgid "" "Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return " "the offset as a :class:`timedelta` object (see :meth:`utcoffset` for " @@ -2140,17 +2140,17 @@ msgid "" "DST changes when crossing time zones." msgstr "" -#: ../../library/datetime.rst:2016 +#: ../../library/datetime.rst:2013 msgid "" "An instance *tz* of a :class:`tzinfo` subclass that models both standard and " "daylight times must be consistent in this sense:" msgstr "" -#: ../../library/datetime.rst:2019 +#: ../../library/datetime.rst:2016 msgid "``tz.utcoffset(dt) - tz.dst(dt)``" msgstr "``tz.utcoffset(dt) - tz.dst(dt)``" -#: ../../library/datetime.rst:2021 +#: ../../library/datetime.rst:2018 msgid "" "must return the same result for every :class:`.datetime` *dt* with ``dt." "tzinfo == tz`` For sane :class:`tzinfo` subclasses, this expression yields " @@ -2163,25 +2163,25 @@ msgid "" "regardless." msgstr "" -#: ../../library/datetime.rst:2030 +#: ../../library/datetime.rst:2027 msgid "" "Most implementations of :meth:`dst` will probably look like one of these " "two::" msgstr "" -#: ../../library/datetime.rst:2036 +#: ../../library/datetime.rst:2033 msgid "or::" msgstr "" "或是:\n" "\n" "::" -#: ../../library/datetime.rst:2048 +#: ../../library/datetime.rst:2045 msgid "" "The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2056 +#: ../../library/datetime.rst:2053 msgid "" "Return the time zone name corresponding to the :class:`.datetime` object " "*dt*, as a string. Nothing about string names is defined by the :mod:" @@ -2194,13 +2194,13 @@ msgid "" "if the :class:`tzinfo` class is accounting for daylight time." msgstr "" -#: ../../library/datetime.rst:2066 +#: ../../library/datetime.rst:2063 msgid "" "The default implementation of :meth:`tzname` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2069 +#: ../../library/datetime.rst:2066 msgid "" "These methods are called by a :class:`.datetime` or :class:`.time` object, " "in response to their methods of the same names. A :class:`.datetime` object " @@ -2210,7 +2210,7 @@ msgid "" "datetime`." msgstr "" -#: ../../library/datetime.rst:2075 +#: ../../library/datetime.rst:2072 msgid "" "When ``None`` is passed, it's up to the class designer to decide the best " "response. For example, returning ``None`` is appropriate if the class wishes " @@ -2219,7 +2219,7 @@ msgid "" "offset, as there is no other convention for discovering the standard offset." msgstr "" -#: ../../library/datetime.rst:2081 +#: ../../library/datetime.rst:2078 msgid "" "When a :class:`.datetime` object is passed in response to a :class:`." "datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" @@ -2229,13 +2229,13 @@ msgid "" "timezones." msgstr "" -#: ../../library/datetime.rst:2087 +#: ../../library/datetime.rst:2084 msgid "" "There is one more :class:`tzinfo` method that a subclass may wish to " "override:" msgstr "" -#: ../../library/datetime.rst:2092 +#: ../../library/datetime.rst:2089 msgid "" "This is called from the default :class:`datetime.astimezone()` " "implementation. When called from that, ``dt.tzinfo`` is *self*, and *dt*'s " @@ -2244,7 +2244,7 @@ msgid "" "equivalent datetime in *self*'s local time." msgstr "" -#: ../../library/datetime.rst:2098 +#: ../../library/datetime.rst:2095 msgid "" "Most :class:`tzinfo` subclasses should be able to inherit the default :meth:" "`fromutc` implementation without problems. It's strong enough to handle " @@ -2258,19 +2258,19 @@ msgid "" "result is one of the hours straddling the moment the standard offset changes." msgstr "" -#: ../../library/datetime.rst:2109 +#: ../../library/datetime.rst:2106 msgid "" "Skipping code for error cases, the default :meth:`fromutc` implementation " "acts like::" msgstr "" -#: ../../library/datetime.rst:2127 +#: ../../library/datetime.rst:2124 msgid "" "In the following :download:`tzinfo_examples.py <../includes/tzinfo_examples." "py>` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2133 +#: ../../library/datetime.rst:2130 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -2279,7 +2279,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2147 +#: ../../library/datetime.rst:2144 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -2288,7 +2288,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2166 +#: ../../library/datetime.rst:2163 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -2303,13 +2303,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2188 +#: ../../library/datetime.rst:2185 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2191 +#: ../../library/datetime.rst:2188 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2319,28 +2319,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2205 +#: ../../library/datetime.rst:2202 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2200 +#: ../../library/datetime.rst:2197 msgid "" "The :mod:`datetime` module has a basic :class:`timezone` class (for handling " "arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a " "UTC timezone instance)." msgstr "" -#: ../../library/datetime.rst:2204 +#: ../../library/datetime.rst:2201 msgid "" "``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2211 +#: ../../library/datetime.rst:2208 msgid "`IANA timezone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2208 +#: ../../library/datetime.rst:2205 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -2349,24 +2349,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2218 +#: ../../library/datetime.rst:2215 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2220 +#: ../../library/datetime.rst:2217 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2224 +#: ../../library/datetime.rst:2221 msgid "" "Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2231 +#: ../../library/datetime.rst:2228 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2374,25 +2374,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2236 +#: ../../library/datetime.rst:2233 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2247 ../../library/datetime.rst:2258 +#: ../../library/datetime.rst:2244 ../../library/datetime.rst:2255 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2250 +#: ../../library/datetime.rst:2247 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2261 +#: ../../library/datetime.rst:2258 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -2401,138 +2401,144 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2267 +#: ../../library/datetime.rst:2264 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2274 +#: ../../library/datetime.rst:2271 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2278 +#: ../../library/datetime.rst:2275 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2285 +#: ../../library/datetime.rst:2282 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2294 +#: ../../library/datetime.rst:2291 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr ":meth:`strftime` 與 :meth:`strptime` 的行為" -#: ../../library/datetime.rst:2296 +#: ../../library/datetime.rst:2293 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2300 +#: ../../library/datetime.rst:2297 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2304 +#: ../../library/datetime.rst:2301 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2305 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2305 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2310 +#: ../../library/datetime.rst:2307 msgid "Usage" msgstr "" -#: ../../library/datetime.rst:2310 +#: ../../library/datetime.rst:2307 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2310 +#: ../../library/datetime.rst:2307 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2312 +#: ../../library/datetime.rst:2309 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2312 +#: ../../library/datetime.rst:2309 msgid "Instance method" msgstr "" -#: ../../library/datetime.rst:2312 +#: ../../library/datetime.rst:2309 msgid "Class method" msgstr "" -#: ../../library/datetime.rst:2314 +#: ../../library/datetime.rst:2311 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2314 +#: ../../library/datetime.rst:2311 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2314 +#: ../../library/datetime.rst:2311 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2316 +#: ../../library/datetime.rst:2313 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2316 +#: ../../library/datetime.rst:2313 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2316 +#: ../../library/datetime.rst:2313 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2318 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2320 +msgid "" +"These methods accept format codes that can be used to parse and format " +"dates::" +msgstr "" + +#: ../../library/datetime.rst:2328 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2327 ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2327 ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2327 ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2327 ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2334 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2334 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2544,11 +2550,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2339 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2339 msgid "Weekday as locale's full name." msgstr "" @@ -2560,42 +2566,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2339 +#: ../../library/datetime.rst:2344 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2339 +#: ../../library/datetime.rst:2344 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2339 +#: ../../library/datetime.rst:2344 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2343 +#: ../../library/datetime.rst:2348 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2343 +#: ../../library/datetime.rst:2348 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2343 +#: ../../library/datetime.rst:2348 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2343 ../../library/datetime.rst:2356 -#: ../../library/datetime.rst:2359 ../../library/datetime.rst:2365 -#: ../../library/datetime.rst:2368 ../../library/datetime.rst:2374 -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2348 ../../library/datetime.rst:2361 +#: ../../library/datetime.rst:2364 ../../library/datetime.rst:2370 +#: ../../library/datetime.rst:2373 ../../library/datetime.rst:2379 +#: ../../library/datetime.rst:2397 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2346 +#: ../../library/datetime.rst:2351 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2346 +#: ../../library/datetime.rst:2351 msgid "Month as locale's abbreviated name." msgstr "" @@ -2607,11 +2613,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2351 +#: ../../library/datetime.rst:2356 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2351 +#: ../../library/datetime.rst:2356 msgid "Month as locale's full name." msgstr "" @@ -2623,67 +2629,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2361 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2361 msgid "Month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2356 ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2361 ../../library/datetime.rst:2373 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2364 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2364 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2364 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2367 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2367 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2362 ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2367 ../../library/datetime.rst:2437 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2370 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2370 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2370 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2373 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2373 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2376 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2376 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2695,127 +2701,127 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2376 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2374 +#: ../../library/datetime.rst:2379 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2374 +#: ../../library/datetime.rst:2379 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2374 ../../library/datetime.rst:2377 +#: ../../library/datetime.rst:2379 ../../library/datetime.rst:2382 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2377 +#: ../../library/datetime.rst:2382 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2377 +#: ../../library/datetime.rst:2382 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2377 +#: ../../library/datetime.rst:2382 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2385 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2385 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2385 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2385 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2384 ../../library/datetime.rst:2548 +#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2553 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2389 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2389 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2384 ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2394 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2572 +#: ../../library/datetime.rst:2394 ../../library/datetime.rst:2577 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2394 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2394 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2397 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2397 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2397 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2395 +#: ../../library/datetime.rst:2400 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2395 +#: ../../library/datetime.rst:2400 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2395 ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2400 ../../library/datetime.rst:2408 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2395 ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2400 ../../library/datetime.rst:2408 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2408 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2408 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2416 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2416 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2827,11 +2833,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2421 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2421 msgid "Locale's appropriate date representation." msgstr "" @@ -2847,11 +2853,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2420 +#: ../../library/datetime.rst:2425 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2420 +#: ../../library/datetime.rst:2425 msgid "Locale's appropriate time representation." msgstr "" @@ -2863,69 +2869,69 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2428 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2428 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2428 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2426 +#: ../../library/datetime.rst:2431 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2437 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2437 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2437 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2442 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2442 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2442 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2445 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2445 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2445 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2445 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2447 +#: ../../library/datetime.rst:2452 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -2934,7 +2940,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2452 +#: ../../library/datetime.rst:2457 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -2944,40 +2950,40 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2458 +#: ../../library/datetime.rst:2463 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" -#: ../../library/datetime.rst:2462 +#: ../../library/datetime.rst:2467 msgid "Technical Detail" msgstr "" -#: ../../library/datetime.rst:2464 +#: ../../library/datetime.rst:2469 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2468 +#: ../../library/datetime.rst:2473 msgid "" "For the :meth:`datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2472 +#: ../../library/datetime.rst:2477 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2476 +#: ../../library/datetime.rst:2481 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: ../../library/datetime.rst:2480 +#: ../../library/datetime.rst:2485 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`time` objects have no such values. If they're used " @@ -2985,14 +2991,14 @@ msgid "" "day." msgstr "" -#: ../../library/datetime.rst:2484 +#: ../../library/datetime.rst:2489 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " "values. If they're used anyway, ``0`` is substituted for them." msgstr "" -#: ../../library/datetime.rst:2488 +#: ../../library/datetime.rst:2493 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -3001,7 +3007,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2502 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -3012,37 +3018,37 @@ msgid "" "to determine the current locale's encoding)." msgstr "" -#: ../../library/datetime.rst:2506 +#: ../../library/datetime.rst:2511 msgid "" "The :meth:`strptime` method can parse years in the full [1, 9999] range, but " "years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2509 +#: ../../library/datetime.rst:2514 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2513 +#: ../../library/datetime.rst:2518 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2518 +#: ../../library/datetime.rst:2523 msgid "" "When used with the :meth:`strptime` method, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/datetime.rst:2522 +#: ../../library/datetime.rst:2527 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2531 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3050,17 +3056,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2533 +#: ../../library/datetime.rst:2538 msgid "" "For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty " "strings." msgstr "" -#: ../../library/datetime.rst:2536 +#: ../../library/datetime.rst:2541 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2539 +#: ../../library/datetime.rst:2544 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3074,7 +3080,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2553 +#: ../../library/datetime.rst:2558 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3082,47 +3088,47 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2561 +#: ../../library/datetime.rst:2566 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2565 +#: ../../library/datetime.rst:2570 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2567 +#: ../../library/datetime.rst:2572 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2568 +#: ../../library/datetime.rst:2573 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2570 +#: ../../library/datetime.rst:2575 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2574 +#: ../../library/datetime.rst:2579 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, an " "aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " "result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2580 +#: ../../library/datetime.rst:2585 msgid "" "When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " "in calculations when the day of the week and the calendar year (``%Y``) are " "specified." msgstr "" -#: ../../library/datetime.rst:2585 +#: ../../library/datetime.rst:2590 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:" @@ -3130,22 +3136,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2591 +#: ../../library/datetime.rst:2596 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2596 +#: ../../library/datetime.rst:2601 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2597 +#: ../../library/datetime.rst:2602 msgid "If, that is, we ignore the effects of Relativity" msgstr "" -#: ../../library/datetime.rst:2599 +#: ../../library/datetime.rst:2604 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3154,14 +3160,14 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2605 +#: ../../library/datetime.rst:2610 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2609 +#: ../../library/datetime.rst:2614 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." diff --git a/reference/datamodel.po b/reference/datamodel.po index 8cb0086e2b..c480be2000 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-15 00:32+0000\n" +"POT-Creation-Date: 2023-04-09 00:31+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2477,46 +2477,48 @@ msgstr "" msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2088 +#: ../../reference/datamodel.rst:2090 msgid "" -"If a base that appears in class definition is not an instance of :class:" -"`type`, then an ``__mro_entries__`` method is searched on it. If found, it " -"is called with the original bases tuple. This method must return a tuple of " -"classes that will be used instead of this base. The tuple may be empty, in " -"such case the original base is ignored." +"If a base that appears in a class definition is not an instance of :class:" +"`type`, then an ``__mro_entries__`` method is searched on the base. If an " +"``__mro_entries__`` method is found, the base is substituted with the result " +"of a call to ``__mro_entries__`` when creating the class. The method is " +"called with the original bases tuple, and must return a tuple of classes " +"that will be used instead of the base. The returned tuple may be empty: in " +"these cases, the original base is ignored." msgstr "" -#: ../../reference/datamodel.rst:2096 +#: ../../reference/datamodel.rst:2100 msgid ":pep:`560` - Core support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2100 +#: ../../reference/datamodel.rst:2104 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2104 +#: ../../reference/datamodel.rst:2108 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2106 +#: ../../reference/datamodel.rst:2110 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2107 +#: ../../reference/datamodel.rst:2111 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2109 +#: ../../reference/datamodel.rst:2113 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2112 +#: ../../reference/datamodel.rst:2116 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2525,11 +2527,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2122 +#: ../../reference/datamodel.rst:2126 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2127 +#: ../../reference/datamodel.rst:2131 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2541,25 +2543,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2136 +#: ../../reference/datamodel.rst:2140 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2141 +#: ../../reference/datamodel.rst:2145 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2142 +#: ../../reference/datamodel.rst:2146 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2146 +#: ../../reference/datamodel.rst:2150 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2151 +#: ../../reference/datamodel.rst:2155 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2568,7 +2570,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2157 +#: ../../reference/datamodel.rst:2161 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2577,11 +2579,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2170 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2173 +#: ../../reference/datamodel.rst:2177 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2589,7 +2591,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2178 +#: ../../reference/datamodel.rst:2182 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2600,7 +2602,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2188 +#: ../../reference/datamodel.rst:2192 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2609,39 +2611,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2198 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2198 +#: ../../reference/datamodel.rst:2202 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2200 +#: ../../reference/datamodel.rst:2204 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2202 +#: ../../reference/datamodel.rst:2206 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2205 +#: ../../reference/datamodel.rst:2209 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2213 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2649,19 +2651,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2216 +#: ../../reference/datamodel.rst:2220 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2217 +#: ../../reference/datamodel.rst:2221 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2221 +#: ../../reference/datamodel.rst:2225 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2223 +#: ../../reference/datamodel.rst:2227 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2669,17 +2671,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2230 +#: ../../reference/datamodel.rst:2234 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2232 +#: ../../reference/datamodel.rst:2236 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2239 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2687,21 +2689,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2242 +#: ../../reference/datamodel.rst:2246 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2249 +#: ../../reference/datamodel.rst:2253 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2254 +#: ../../reference/datamodel.rst:2258 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2709,11 +2711,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2265 +#: ../../reference/datamodel.rst:2269 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2262 +#: ../../reference/datamodel.rst:2266 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2722,11 +2724,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2270 +#: ../../reference/datamodel.rst:2274 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2272 +#: ../../reference/datamodel.rst:2276 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2734,65 +2736,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2284 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2284 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2283 +#: ../../reference/datamodel.rst:2287 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2283 +#: ../../reference/datamodel.rst:2287 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2286 +#: ../../reference/datamodel.rst:2290 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2286 +#: ../../reference/datamodel.rst:2290 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2289 +#: ../../reference/datamodel.rst:2293 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2294 +#: ../../reference/datamodel.rst:2298 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2301 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2303 +#: ../../reference/datamodel.rst:2307 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2305 +#: ../../reference/datamodel.rst:2309 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2313 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2801,7 +2803,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2315 +#: ../../reference/datamodel.rst:2319 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2809,11 +2811,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2325 +#: ../../reference/datamodel.rst:2329 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2327 +#: ../../reference/datamodel.rst:2331 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2823,14 +2825,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2334 +#: ../../reference/datamodel.rst:2338 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2362 +#: ../../reference/datamodel.rst:2366 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2840,40 +2842,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2381 +#: ../../reference/datamodel.rst:2385 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2406 +#: ../../reference/datamodel.rst:2410 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2405 +#: ../../reference/datamodel.rst:2409 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2413 +#: ../../reference/datamodel.rst:2417 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2420 +#: ../../reference/datamodel.rst:2424 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2427 +#: ../../reference/datamodel.rst:2431 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2429 +#: ../../reference/datamodel.rst:2433 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2909,7 +2911,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2469 +#: ../../reference/datamodel.rst:2473 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2917,7 +2919,7 @@ msgid "" "zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2476 +#: ../../reference/datamodel.rst:2480 msgid "" "In CPython, the length is required to be at most :attr:`sys.maxsize`. If the " "length is larger than :attr:`!sys.maxsize` some features (such as :func:" @@ -2926,7 +2928,7 @@ msgid "" "`__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2485 +#: ../../reference/datamodel.rst:2489 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2936,20 +2938,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2499 +#: ../../reference/datamodel.rst:2503 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2503 +#: ../../reference/datamodel.rst:2507 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2507 +#: ../../reference/datamodel.rst:2511 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2512 +#: ../../reference/datamodel.rst:2516 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -2962,20 +2964,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2524 +#: ../../reference/datamodel.rst:2528 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2529 +#: ../../reference/datamodel.rst:2533 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2537 +#: ../../reference/datamodel.rst:2541 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2984,7 +2986,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2546 +#: ../../reference/datamodel.rst:2550 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2993,13 +2995,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2555 +#: ../../reference/datamodel.rst:2559 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2561 +#: ../../reference/datamodel.rst:2565 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3007,14 +3009,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2569 +#: ../../reference/datamodel.rst:2573 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2573 +#: ../../reference/datamodel.rst:2577 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3023,7 +3025,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2580 +#: ../../reference/datamodel.rst:2584 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3031,14 +3033,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2587 +#: ../../reference/datamodel.rst:2591 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2591 +#: ../../reference/datamodel.rst:2595 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3046,11 +3048,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2600 +#: ../../reference/datamodel.rst:2604 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2602 +#: ../../reference/datamodel.rst:2606 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3058,7 +3060,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2628 +#: ../../reference/datamodel.rst:2632 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3072,13 +3074,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2639 +#: ../../reference/datamodel.rst:2643 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2662 +#: ../../reference/datamodel.rst:2666 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3091,13 +3093,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2674 +#: ../../reference/datamodel.rst:2678 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2679 +#: ../../reference/datamodel.rst:2683 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3106,7 +3108,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2700 +#: ../../reference/datamodel.rst:2704 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3122,19 +3124,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2721 +#: ../../reference/datamodel.rst:2725 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2734 +#: ../../reference/datamodel.rst:2738 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2741 +#: ../../reference/datamodel.rst:2745 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3143,14 +3145,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2747 +#: ../../reference/datamodel.rst:2751 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2759 +#: ../../reference/datamodel.rst:2763 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3159,21 +3161,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2765 +#: ../../reference/datamodel.rst:2769 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2768 +#: ../../reference/datamodel.rst:2772 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2775 +#: ../../reference/datamodel.rst:2779 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2777 +#: ../../reference/datamodel.rst:2781 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3183,32 +3185,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2788 +#: ../../reference/datamodel.rst:2792 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2791 +#: ../../reference/datamodel.rst:2795 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2796 +#: ../../reference/datamodel.rst:2800 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2807 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2807 +#: ../../reference/datamodel.rst:2811 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3216,27 +3218,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2811 +#: ../../reference/datamodel.rst:2815 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2818 +#: ../../reference/datamodel.rst:2822 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2818 +#: ../../reference/datamodel.rst:2822 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2825 +#: ../../reference/datamodel.rst:2829 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2827 +#: ../../reference/datamodel.rst:2831 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3244,7 +3246,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2834 +#: ../../reference/datamodel.rst:2838 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3253,7 +3255,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2840 +#: ../../reference/datamodel.rst:2844 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3263,19 +3265,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2850 +#: ../../reference/datamodel.rst:2854 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2851 +#: ../../reference/datamodel.rst:2855 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2857 +#: ../../reference/datamodel.rst:2861 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2859 +#: ../../reference/datamodel.rst:2863 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3283,7 +3285,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2874 +#: ../../reference/datamodel.rst:2878 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3292,21 +3294,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2888 +#: ../../reference/datamodel.rst:2892 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:2901 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:2923 +#: ../../reference/datamodel.rst:2927 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3315,36 +3317,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:2934 +#: ../../reference/datamodel.rst:2938 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:2938 +#: ../../reference/datamodel.rst:2942 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:2940 +#: ../../reference/datamodel.rst:2944 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:2946 +#: ../../reference/datamodel.rst:2950 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:2952 +#: ../../reference/datamodel.rst:2956 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:2958 +#: ../../reference/datamodel.rst:2962 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3352,15 +3354,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:2966 +#: ../../reference/datamodel.rst:2970 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:2972 +#: ../../reference/datamodel.rst:2976 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:2974 +#: ../../reference/datamodel.rst:2978 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3371,18 +3373,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:2982 +#: ../../reference/datamodel.rst:2986 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:2986 +#: ../../reference/datamodel.rst:2990 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:2992 +#: ../../reference/datamodel.rst:2996 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3393,7 +3395,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3003 +#: ../../reference/datamodel.rst:3007 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3404,7 +3406,7 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3014 +#: ../../reference/datamodel.rst:3018 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3414,99 +3416,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3022 +#: ../../reference/datamodel.rst:3026 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3028 +#: ../../reference/datamodel.rst:3032 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3030 +#: ../../reference/datamodel.rst:3034 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3033 +#: ../../reference/datamodel.rst:3037 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3037 +#: ../../reference/datamodel.rst:3041 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3041 +#: ../../reference/datamodel.rst:3045 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3044 +#: ../../reference/datamodel.rst:3048 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3061 +#: ../../reference/datamodel.rst:3065 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3066 +#: ../../reference/datamodel.rst:3070 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3074 +#: ../../reference/datamodel.rst:3078 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3076 +#: ../../reference/datamodel.rst:3080 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3079 +#: ../../reference/datamodel.rst:3083 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3083 +#: ../../reference/datamodel.rst:3087 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3088 +#: ../../reference/datamodel.rst:3092 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3091 +#: ../../reference/datamodel.rst:3095 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3104 +#: ../../reference/datamodel.rst:3108 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3105 +#: ../../reference/datamodel.rst:3109 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3109 +#: ../../reference/datamodel.rst:3113 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3514,7 +3516,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3115 +#: ../../reference/datamodel.rst:3119 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3522,7 +3524,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3121 +#: ../../reference/datamodel.rst:3125 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " From 955e549aa02bbe0c77640ef8873af79520c869fb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 11 Apr 2023 00:32:38 +0000 Subject: [PATCH 064/130] sync with cpython b80e4c89 --- library/gc.po | 72 ++++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/library/gc.po b/library/gc.po index 4a147b3986..5f58f69d45 100644 --- a/library/gc.po +++ b/library/gc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-11 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -223,31 +223,39 @@ msgstr "" #: ../../library/gc.rst:209 msgid "" -"Freeze all the objects tracked by gc - move them to a permanent generation " -"and ignore all the future collections. This can be used before a POSIX " -"fork() call to make the gc copy-on-write friendly or to speed up collection. " -"Also collection before a POSIX fork() call may free pages for future " -"allocation which can cause copy-on-write too so it's advised to disable gc " -"in parent process and freeze before fork and enable gc in child process." +"Freeze all the objects tracked by the garbage collector; move them to a " +"permanent generation and ignore them in all the future collections." msgstr "" -#: ../../library/gc.rst:221 +#: ../../library/gc.rst:212 +msgid "" +"If a process will ``fork()`` without ``exec()``, avoiding unnecessary copy-" +"on-write in child processes will maximize memory sharing and reduce overall " +"memory usage. This requires both avoiding creation of freed \"holes\" in " +"memory pages in the parent process and ensuring that GC collections in child " +"processes won't touch the ``gc_refs`` counter of long-lived objects " +"originating in the parent process. To accomplish both, call ``gc.disable()`` " +"early in the parent process, ``gc.freeze()`` right before ``fork()``, and " +"``gc.enable()`` early in child processes." +msgstr "" + +#: ../../library/gc.rst:226 msgid "" "Unfreeze the objects in the permanent generation, put them back into the " "oldest generation." msgstr "" -#: ../../library/gc.rst:229 +#: ../../library/gc.rst:234 msgid "Return the number of objects in the permanent generation." msgstr "" -#: ../../library/gc.rst:234 +#: ../../library/gc.rst:239 msgid "" "The following variables are provided for read-only access (you can mutate " "the values but should not rebind them):" msgstr "" -#: ../../library/gc.rst:239 +#: ../../library/gc.rst:244 msgid "" "A list of objects which the collector found to be unreachable but could not " "be freed (uncollectable objects). Starting with Python 3.4, this list " @@ -255,13 +263,13 @@ msgid "" "types with a non-``NULL`` ``tp_del`` slot." msgstr "" -#: ../../library/gc.rst:244 +#: ../../library/gc.rst:249 msgid "" "If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added " "to this list rather than freed." msgstr "" -#: ../../library/gc.rst:247 +#: ../../library/gc.rst:252 msgid "" "If this list is non-empty at :term:`interpreter shutdown`, a :exc:" "`ResourceWarning` is emitted, which is silent by default. If :const:" @@ -269,105 +277,105 @@ msgid "" "printed." msgstr "" -#: ../../library/gc.rst:253 +#: ../../library/gc.rst:258 msgid "" "Following :pep:`442`, objects with a :meth:`__del__` method don't end up in :" "attr:`gc.garbage` anymore." msgstr "" -#: ../../library/gc.rst:259 +#: ../../library/gc.rst:264 msgid "" "A list of callbacks that will be invoked by the garbage collector before and " "after collection. The callbacks will be called with two arguments, *phase* " "and *info*." msgstr "" -#: ../../library/gc.rst:263 +#: ../../library/gc.rst:268 msgid "*phase* can be one of two values:" msgstr "" -#: ../../library/gc.rst:265 +#: ../../library/gc.rst:270 msgid "\"start\": The garbage collection is about to start." msgstr "" -#: ../../library/gc.rst:267 +#: ../../library/gc.rst:272 msgid "\"stop\": The garbage collection has finished." msgstr "" -#: ../../library/gc.rst:269 +#: ../../library/gc.rst:274 msgid "" "*info* is a dict providing more information for the callback. The following " "keys are currently defined:" msgstr "" -#: ../../library/gc.rst:272 +#: ../../library/gc.rst:277 msgid "\"generation\": The oldest generation being collected." msgstr "" -#: ../../library/gc.rst:274 +#: ../../library/gc.rst:279 msgid "" "\"collected\": When *phase* is \"stop\", the number of objects successfully " "collected." msgstr "" -#: ../../library/gc.rst:277 +#: ../../library/gc.rst:282 msgid "" "\"uncollectable\": When *phase* is \"stop\", the number of objects that " "could not be collected and were put in :data:`garbage`." msgstr "" -#: ../../library/gc.rst:280 +#: ../../library/gc.rst:285 msgid "" "Applications can add their own callbacks to this list. The primary use " "cases are:" msgstr "" -#: ../../library/gc.rst:283 +#: ../../library/gc.rst:288 msgid "" "Gathering statistics about garbage collection, such as how often various " "generations are collected, and how long the collection takes." msgstr "" -#: ../../library/gc.rst:287 +#: ../../library/gc.rst:292 msgid "" "Allowing applications to identify and clear their own uncollectable types " "when they appear in :data:`garbage`." msgstr "" -#: ../../library/gc.rst:293 +#: ../../library/gc.rst:298 msgid "The following constants are provided for use with :func:`set_debug`:" msgstr "" -#: ../../library/gc.rst:298 +#: ../../library/gc.rst:303 msgid "" "Print statistics during collection. This information can be useful when " "tuning the collection frequency." msgstr "" -#: ../../library/gc.rst:304 +#: ../../library/gc.rst:309 msgid "Print information on collectable objects found." msgstr "" -#: ../../library/gc.rst:309 +#: ../../library/gc.rst:314 msgid "" "Print information of uncollectable objects found (objects which are not " "reachable but cannot be freed by the collector). These objects will be " "added to the ``garbage`` list." msgstr "" -#: ../../library/gc.rst:313 +#: ../../library/gc.rst:318 msgid "" "Also print the contents of the :data:`garbage` list at :term:`interpreter " "shutdown`, if it isn't empty." msgstr "" -#: ../../library/gc.rst:319 +#: ../../library/gc.rst:324 msgid "" "When set, all unreachable objects found will be appended to *garbage* rather " "than being freed. This can be useful for debugging a leaking program." msgstr "" -#: ../../library/gc.rst:325 +#: ../../library/gc.rst:330 msgid "" "The debugging flags necessary for the collector to print information about a " "leaking program (equal to ``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | " From 0e33011eaa64d690435802548efc4c1906533ded Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 12 Apr 2023 00:31:16 +0000 Subject: [PATCH 065/130] sync with cpython e715da6d --- library/multiprocessing.po | 964 ++++++++++++++++++------------------- library/types.po | 12 +- reference/datamodel.po | 331 +++++++------ 3 files changed, 660 insertions(+), 647 deletions(-) diff --git a/library/multiprocessing.po b/library/multiprocessing.po index c2006c256e..8794312b90 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-12 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -165,7 +165,7 @@ msgid "" "pipes." msgstr "" -#: ../../library/multiprocessing.rst:142 ../../library/multiprocessing.rst:1070 +#: ../../library/multiprocessing.rst:142 ../../library/multiprocessing.rst:1072 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " @@ -399,38 +399,38 @@ msgid "" "importable by the children. This is covered in :ref:`multiprocessing-" "programming` however it is worth pointing out here. This means that some " "examples, such as the :class:`multiprocessing.pool.Pool` examples will not " -"work in the interactive interpreter. For example::" +"work in the interactive interpreter. For example:" msgstr "" -#: ../../library/multiprocessing.rst:467 +#: ../../library/multiprocessing.rst:469 msgid "" "(If you try this it will actually output three full tracebacks interleaved " "in a semi-random fashion, and then you may have to stop the parent process " "somehow.)" msgstr "" -#: ../../library/multiprocessing.rst:473 +#: ../../library/multiprocessing.rst:475 msgid "Reference" msgstr "" -#: ../../library/multiprocessing.rst:475 +#: ../../library/multiprocessing.rst:477 msgid "" "The :mod:`multiprocessing` package mostly replicates the API of the :mod:" "`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:480 +#: ../../library/multiprocessing.rst:482 msgid ":class:`Process` and exceptions" msgstr ":class:`Process` 與例外" -#: ../../library/multiprocessing.rst:485 +#: ../../library/multiprocessing.rst:487 msgid "" "Process objects represent activity that is run in a separate process. The :" "class:`Process` class has equivalents of all the methods of :class:" "`threading.Thread`." msgstr "" -#: ../../library/multiprocessing.rst:489 +#: ../../library/multiprocessing.rst:491 msgid "" "The constructor should always be called with keyword arguments. *group* " "should always be ``None``; it exists solely for compatibility with :class:" @@ -444,29 +444,29 @@ msgid "" "creating process." msgstr "" -#: ../../library/multiprocessing.rst:500 +#: ../../library/multiprocessing.rst:502 msgid "" "By default, no arguments are passed to *target*. The *args* argument, which " "defaults to ``()``, can be used to specify a list or tuple of the arguments " "to pass to *target*." msgstr "" -#: ../../library/multiprocessing.rst:504 +#: ../../library/multiprocessing.rst:506 msgid "" "If a subclass overrides the constructor, it must make sure it invokes the " "base class constructor (:meth:`Process.__init__`) before doing anything else " "to the process." msgstr "" -#: ../../library/multiprocessing.rst:508 +#: ../../library/multiprocessing.rst:510 msgid "Added the *daemon* argument." msgstr "新增 *daemon* 引數。" -#: ../../library/multiprocessing.rst:513 +#: ../../library/multiprocessing.rst:515 msgid "Method representing the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:515 +#: ../../library/multiprocessing.rst:517 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the target " @@ -474,30 +474,30 @@ msgid "" "*args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/multiprocessing.rst:520 +#: ../../library/multiprocessing.rst:522 msgid "" "Using a list or tuple as the *args* argument passed to :class:`Process` " "achieves the same effect." msgstr "" -#: ../../library/multiprocessing.rst:523 +#: ../../library/multiprocessing.rst:525 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/multiprocessing.rst:535 +#: ../../library/multiprocessing.rst:537 msgid "Start the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:537 +#: ../../library/multiprocessing.rst:539 msgid "" "This must be called at most once per process object. It arranges for the " "object's :meth:`run` method to be invoked in a separate process." msgstr "" -#: ../../library/multiprocessing.rst:542 +#: ../../library/multiprocessing.rst:544 msgid "" "If the optional argument *timeout* is ``None`` (the default), the method " "blocks until the process whose :meth:`join` method is called terminates. If " @@ -507,23 +507,23 @@ msgid "" "terminated." msgstr "" -#: ../../library/multiprocessing.rst:549 +#: ../../library/multiprocessing.rst:551 msgid "A process can be joined many times." msgstr "" -#: ../../library/multiprocessing.rst:551 +#: ../../library/multiprocessing.rst:553 msgid "" "A process cannot join itself because this would cause a deadlock. It is an " "error to attempt to join a process before it has been started." msgstr "" -#: ../../library/multiprocessing.rst:556 +#: ../../library/multiprocessing.rst:558 msgid "" "The process's name. The name is a string used for identification purposes " "only. It has no semantics. Multiple processes may be given the same name." msgstr "" -#: ../../library/multiprocessing.rst:560 +#: ../../library/multiprocessing.rst:562 msgid "" "The initial name is set by the constructor. If no explicit name is provided " "to the constructor, a name of the form 'Process-N\\ :sub:`1`:N\\ :sub:" @@ -531,33 +531,33 @@ msgid "" "child of its parent." msgstr "" -#: ../../library/multiprocessing.rst:567 +#: ../../library/multiprocessing.rst:569 msgid "Return whether the process is alive." msgstr "" -#: ../../library/multiprocessing.rst:569 +#: ../../library/multiprocessing.rst:571 msgid "" "Roughly, a process object is alive from the moment the :meth:`start` method " "returns until the child process terminates." msgstr "" -#: ../../library/multiprocessing.rst:574 +#: ../../library/multiprocessing.rst:576 msgid "" "The process's daemon flag, a Boolean value. This must be set before :meth:" "`start` is called." msgstr "" -#: ../../library/multiprocessing.rst:577 +#: ../../library/multiprocessing.rst:579 msgid "The initial value is inherited from the creating process." msgstr "" -#: ../../library/multiprocessing.rst:579 +#: ../../library/multiprocessing.rst:581 msgid "" "When a process exits, it attempts to terminate all of its daemonic child " "processes." msgstr "" -#: ../../library/multiprocessing.rst:582 +#: ../../library/multiprocessing.rst:584 msgid "" "Note that a daemonic process is not allowed to create child processes. " "Otherwise a daemonic process would leave its children orphaned if it gets " @@ -566,92 +566,92 @@ msgid "" "(and not joined) if non-daemonic processes have exited." msgstr "" -#: ../../library/multiprocessing.rst:588 +#: ../../library/multiprocessing.rst:590 msgid "" "In addition to the :class:`threading.Thread` API, :class:`Process` objects " "also support the following attributes and methods:" msgstr "" -#: ../../library/multiprocessing.rst:593 +#: ../../library/multiprocessing.rst:595 msgid "" "Return the process ID. Before the process is spawned, this will be ``None``." msgstr "" -#: ../../library/multiprocessing.rst:598 +#: ../../library/multiprocessing.rst:600 msgid "" "The child's exit code. This will be ``None`` if the process has not yet " "terminated." msgstr "" -#: ../../library/multiprocessing.rst:601 +#: ../../library/multiprocessing.rst:603 msgid "" "If the child's :meth:`run` method returned normally, the exit code will be " "0. If it terminated via :func:`sys.exit` with an integer argument *N*, the " "exit code will be *N*." msgstr "" -#: ../../library/multiprocessing.rst:605 +#: ../../library/multiprocessing.rst:607 msgid "" "If the child terminated due to an exception not caught within :meth:`run`, " "the exit code will be 1. If it was terminated by signal *N*, the exit code " "will be the negative value *-N*." msgstr "" -#: ../../library/multiprocessing.rst:611 +#: ../../library/multiprocessing.rst:613 msgid "The process's authentication key (a byte string)." msgstr "" -#: ../../library/multiprocessing.rst:613 +#: ../../library/multiprocessing.rst:615 msgid "" "When :mod:`multiprocessing` is initialized the main process is assigned a " "random string using :func:`os.urandom`." msgstr "" -#: ../../library/multiprocessing.rst:616 +#: ../../library/multiprocessing.rst:618 msgid "" "When a :class:`Process` object is created, it will inherit the " "authentication key of its parent process, although this may be changed by " "setting :attr:`authkey` to another byte string." msgstr "" -#: ../../library/multiprocessing.rst:620 +#: ../../library/multiprocessing.rst:622 msgid "See :ref:`multiprocessing-auth-keys`." msgstr "參閱 :ref:`multiprocessing-auth-keys`\\ 。" -#: ../../library/multiprocessing.rst:624 +#: ../../library/multiprocessing.rst:626 msgid "" "A numeric handle of a system object which will become \"ready\" when the " "process ends." msgstr "" -#: ../../library/multiprocessing.rst:627 +#: ../../library/multiprocessing.rst:629 msgid "" "You can use this value if you want to wait on several events at once using :" "func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join()` is " "simpler." msgstr "" -#: ../../library/multiprocessing.rst:631 +#: ../../library/multiprocessing.rst:633 msgid "" "On Windows, this is an OS handle usable with the ``WaitForSingleObject`` and " "``WaitForMultipleObjects`` family of API calls. On Unix, this is a file " "descriptor usable with primitives from the :mod:`select` module." msgstr "" -#: ../../library/multiprocessing.rst:639 +#: ../../library/multiprocessing.rst:641 msgid "" "Terminate the process. On Unix this is done using the ``SIGTERM`` signal; " "on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and " "finally clauses, etc., will not be executed." msgstr "" -#: ../../library/multiprocessing.rst:643 +#: ../../library/multiprocessing.rst:645 msgid "" "Note that descendant processes of the process will *not* be terminated -- " "they will simply become orphaned." msgstr "" -#: ../../library/multiprocessing.rst:648 +#: ../../library/multiprocessing.rst:650 msgid "" "If this method is used when the associated process is using a pipe or queue " "then the pipe or queue is liable to become corrupted and may become unusable " @@ -660,11 +660,11 @@ msgid "" "deadlock." msgstr "" -#: ../../library/multiprocessing.rst:656 +#: ../../library/multiprocessing.rst:658 msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on Unix." msgstr "" -#: ../../library/multiprocessing.rst:662 +#: ../../library/multiprocessing.rst:664 msgid "" "Close the :class:`Process` object, releasing all resources associated with " "it. :exc:`ValueError` is raised if the underlying process is still " @@ -672,59 +672,59 @@ msgid "" "attributes of the :class:`Process` object will raise :exc:`ValueError`." msgstr "" -#: ../../library/multiprocessing.rst:670 +#: ../../library/multiprocessing.rst:672 msgid "" "Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:" "`terminate` and :attr:`exitcode` methods should only be called by the " "process that created the process object." msgstr "" -#: ../../library/multiprocessing.rst:674 +#: ../../library/multiprocessing.rst:676 msgid "Example usage of some of the methods of :class:`Process`:" msgstr "" -#: ../../library/multiprocessing.rst:694 +#: ../../library/multiprocessing.rst:696 msgid "The base class of all :mod:`multiprocessing` exceptions." msgstr "" -#: ../../library/multiprocessing.rst:698 +#: ../../library/multiprocessing.rst:700 msgid "" "Exception raised by :meth:`Connection.recv_bytes_into()` when the supplied " "buffer object is too small for the message read." msgstr "" -#: ../../library/multiprocessing.rst:701 +#: ../../library/multiprocessing.rst:703 msgid "" "If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will " "give the message as a byte string." msgstr "" -#: ../../library/multiprocessing.rst:706 +#: ../../library/multiprocessing.rst:708 msgid "Raised when there is an authentication error." msgstr "" -#: ../../library/multiprocessing.rst:710 +#: ../../library/multiprocessing.rst:712 msgid "Raised by methods with a timeout when the timeout expires." msgstr "" -#: ../../library/multiprocessing.rst:713 +#: ../../library/multiprocessing.rst:715 msgid "Pipes and Queues" msgstr "" -#: ../../library/multiprocessing.rst:715 +#: ../../library/multiprocessing.rst:717 msgid "" "When using multiple processes, one generally uses message passing for " "communication between processes and avoids having to use any synchronization " "primitives like locks." msgstr "" -#: ../../library/multiprocessing.rst:719 +#: ../../library/multiprocessing.rst:721 msgid "" "For passing messages one can use :func:`Pipe` (for a connection between two " "processes) or a queue (which allows multiple producers and consumers)." msgstr "" -#: ../../library/multiprocessing.rst:722 +#: ../../library/multiprocessing.rst:724 msgid "" "The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types " "are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` queues " @@ -734,7 +734,7 @@ msgid "" "Queue` class." msgstr "" -#: ../../library/multiprocessing.rst:729 +#: ../../library/multiprocessing.rst:731 msgid "" "If you use :class:`JoinableQueue` then you **must** call :meth:" "`JoinableQueue.task_done` for each task removed from the queue or else the " @@ -742,20 +742,20 @@ msgid "" "overflow, raising an exception." msgstr "" -#: ../../library/multiprocessing.rst:734 +#: ../../library/multiprocessing.rst:736 msgid "" "Note that one can also create a shared queue by using a manager object -- " "see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:739 +#: ../../library/multiprocessing.rst:741 msgid "" ":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." "Full` exceptions to signal a timeout. They are not available in the :mod:" "`multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:746 +#: ../../library/multiprocessing.rst:748 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -764,14 +764,14 @@ msgid "" "a queue created with a :ref:`manager `." msgstr "" -#: ../../library/multiprocessing.rst:753 +#: ../../library/multiprocessing.rst:755 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -#: ../../library/multiprocessing.rst:758 +#: ../../library/multiprocessing.rst:760 msgid "" "If multiple processes are enqueuing objects, it is possible for the objects " "to be received at the other end out-of-order. However, objects enqueued by " @@ -779,7 +779,7 @@ msgid "" "other." msgstr "" -#: ../../library/multiprocessing.rst:765 +#: ../../library/multiprocessing.rst:767 msgid "" "If a process is killed using :meth:`Process.terminate` or :func:`os.kill` " "while it is trying to use a :class:`Queue`, then the data in the queue is " @@ -787,7 +787,7 @@ msgid "" "exception when it tries to use the queue later on." msgstr "" -#: ../../library/multiprocessing.rst:772 +#: ../../library/multiprocessing.rst:774 msgid "" "As mentioned above, if a child process has put items on a queue (and it has " "not used :meth:`JoinableQueue.cancel_join_thread ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1131 +#: ../../library/multiprocessing.rst:1133 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1134 +#: ../../library/multiprocessing.rst:1136 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/multiprocessing.rst:1139 +#: ../../library/multiprocessing.rst:1141 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1146 +#: ../../library/multiprocessing.rst:1148 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1150 +#: ../../library/multiprocessing.rst:1152 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1152 +#: ../../library/multiprocessing.rst:1154 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1156 +#: ../../library/multiprocessing.rst:1158 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1158 +#: ../../library/multiprocessing.rst:1160 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: ../../library/multiprocessing.rst:1162 +#: ../../library/multiprocessing.rst:1164 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1167 +#: ../../library/multiprocessing.rst:1169 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1169 +#: ../../library/multiprocessing.rst:1171 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1273,7 +1273,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1176 +#: ../../library/multiprocessing.rst:1178 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1281,19 +1281,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1181 +#: ../../library/multiprocessing.rst:1183 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: ../../library/multiprocessing.rst:1185 +#: ../../library/multiprocessing.rst:1187 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1192 +#: ../../library/multiprocessing.rst:1194 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1301,45 +1301,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1198 +#: ../../library/multiprocessing.rst:1200 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: ../../library/multiprocessing.rst:1203 +#: ../../library/multiprocessing.rst:1205 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: ../../library/multiprocessing.rst:1207 +#: ../../library/multiprocessing.rst:1209 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1211 +#: ../../library/multiprocessing.rst:1213 msgid "" "Connection objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1216 +#: ../../library/multiprocessing.rst:1218 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1241 +#: ../../library/multiprocessing.rst:1243 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1245 +#: ../../library/multiprocessing.rst:1247 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1347,73 +1347,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1252 +#: ../../library/multiprocessing.rst:1254 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1258 +#: ../../library/multiprocessing.rst:1260 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1262 +#: ../../library/multiprocessing.rst:1264 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1266 +#: ../../library/multiprocessing.rst:1268 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1271 +#: ../../library/multiprocessing.rst:1273 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1277 +#: ../../library/multiprocessing.rst:1279 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1280 -#: ../../library/multiprocessing.rst:1418 +#: ../../library/multiprocessing.rst:1282 +#: ../../library/multiprocessing.rst:1420 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1284 +#: ../../library/multiprocessing.rst:1286 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1289 +#: ../../library/multiprocessing.rst:1291 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1291 +#: ../../library/multiprocessing.rst:1293 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1294 -#: ../../library/multiprocessing.rst:1843 +#: ../../library/multiprocessing.rst:1296 +#: ../../library/multiprocessing.rst:1845 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1299 +#: ../../library/multiprocessing.rst:1301 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1304 +#: ../../library/multiprocessing.rst:1306 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -1424,25 +1424,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1312 +#: ../../library/multiprocessing.rst:1314 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1316 +#: ../../library/multiprocessing.rst:1318 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1321 -#: ../../library/multiprocessing.rst:1372 +#: ../../library/multiprocessing.rst:1323 +#: ../../library/multiprocessing.rst:1374 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1323 +#: ../../library/multiprocessing.rst:1325 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -1450,14 +1450,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1328 +#: ../../library/multiprocessing.rst:1330 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1332 +#: ../../library/multiprocessing.rst:1334 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -1471,19 +1471,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1347 +#: ../../library/multiprocessing.rst:1349 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: ../../library/multiprocessing.rst:1350 +#: ../../library/multiprocessing.rst:1352 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:1356 +#: ../../library/multiprocessing.rst:1358 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -1492,20 +1492,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1362 +#: ../../library/multiprocessing.rst:1364 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1366 +#: ../../library/multiprocessing.rst:1368 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1374 +#: ../../library/multiprocessing.rst:1376 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -1518,7 +1518,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1384 +#: ../../library/multiprocessing.rst:1386 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -1529,14 +1529,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1392 +#: ../../library/multiprocessing.rst:1394 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1399 +#: ../../library/multiprocessing.rst:1401 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -1546,7 +1546,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1407 +#: ../../library/multiprocessing.rst:1409 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -1555,17 +1555,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1416 +#: ../../library/multiprocessing.rst:1418 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1423 +#: ../../library/multiprocessing.rst:1425 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: ../../library/multiprocessing.rst:1428 +#: ../../library/multiprocessing.rst:1430 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1574,13 +1574,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1434 +#: ../../library/multiprocessing.rst:1436 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1439 +#: ../../library/multiprocessing.rst:1441 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1589,32 +1589,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1447 +#: ../../library/multiprocessing.rst:1449 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1449 +#: ../../library/multiprocessing.rst:1451 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1454 +#: ../../library/multiprocessing.rst:1456 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: ../../library/multiprocessing.rst:1458 -#: ../../library/multiprocessing.rst:1545 +#: ../../library/multiprocessing.rst:1460 +#: ../../library/multiprocessing.rst:1547 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: ../../library/multiprocessing.rst:1462 +#: ../../library/multiprocessing.rst:1464 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -1624,32 +1624,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1469 +#: ../../library/multiprocessing.rst:1471 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: ../../library/multiprocessing.rst:1475 +#: ../../library/multiprocessing.rst:1477 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1481 -#: ../../library/multiprocessing.rst:1571 -#: ../../library/multiprocessing.rst:1586 +#: ../../library/multiprocessing.rst:1483 +#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1588 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1485 +#: ../../library/multiprocessing.rst:1487 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: ../../library/multiprocessing.rst:1488 +#: ../../library/multiprocessing.rst:1490 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1659,7 +1659,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1495 +#: ../../library/multiprocessing.rst:1497 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -1669,28 +1669,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1502 +#: ../../library/multiprocessing.rst:1504 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1504 +#: ../../library/multiprocessing.rst:1506 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1509 +#: ../../library/multiprocessing.rst:1511 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1514 +#: ../../library/multiprocessing.rst:1516 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1520 +#: ../../library/multiprocessing.rst:1522 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -1699,11 +1699,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1528 +#: ../../library/multiprocessing.rst:1530 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1530 +#: ../../library/multiprocessing.rst:1532 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1713,40 +1713,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1537 +#: ../../library/multiprocessing.rst:1539 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1543 +#: ../../library/multiprocessing.rst:1545 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1549 +#: ../../library/multiprocessing.rst:1551 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1553 +#: ../../library/multiprocessing.rst:1555 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1559 +#: ../../library/multiprocessing.rst:1561 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1563 -#: ../../library/multiprocessing.rst:1579 +#: ../../library/multiprocessing.rst:1565 +#: ../../library/multiprocessing.rst:1581 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -1756,121 +1756,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1575 +#: ../../library/multiprocessing.rst:1577 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1590 +#: ../../library/multiprocessing.rst:1592 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1595 +#: ../../library/multiprocessing.rst:1597 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1599 +#: ../../library/multiprocessing.rst:1601 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1603 +#: ../../library/multiprocessing.rst:1605 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1606 +#: ../../library/multiprocessing.rst:1608 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1610 +#: ../../library/multiprocessing.rst:1612 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1617 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1617 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1617 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1619 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1619 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1619 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1618 +#: ../../library/multiprocessing.rst:1620 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1618 +#: ../../library/multiprocessing.rst:1620 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1621 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1621 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1621 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1622 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1622 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1622 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1624 +#: ../../library/multiprocessing.rst:1626 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1662 +#: ../../library/multiprocessing.rst:1664 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1675 +#: ../../library/multiprocessing.rst:1677 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1677 +#: ../../library/multiprocessing.rst:1679 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1879,7 +1879,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1686 +#: ../../library/multiprocessing.rst:1688 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1887,31 +1887,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1694 +#: ../../library/multiprocessing.rst:1696 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: ../../library/multiprocessing.rst:1700 +#: ../../library/multiprocessing.rst:1702 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1702 +#: ../../library/multiprocessing.rst:1704 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: ../../library/multiprocessing.rst:1705 +#: ../../library/multiprocessing.rst:1707 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: ../../library/multiprocessing.rst:1708 +#: ../../library/multiprocessing.rst:1710 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -1919,19 +1919,19 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1713 +#: ../../library/multiprocessing.rst:1715 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1716 +#: ../../library/multiprocessing.rst:1718 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:1719 +#: ../../library/multiprocessing.rst:1721 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -1939,54 +1939,54 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1724 +#: ../../library/multiprocessing.rst:1726 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1729 +#: ../../library/multiprocessing.rst:1731 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:1734 +#: ../../library/multiprocessing.rst:1736 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: ../../library/multiprocessing.rst:1743 +#: ../../library/multiprocessing.rst:1745 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1747 +#: ../../library/multiprocessing.rst:1749 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1755 +#: ../../library/multiprocessing.rst:1757 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: ../../library/multiprocessing.rst:1758 +#: ../../library/multiprocessing.rst:1760 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1762 +#: ../../library/multiprocessing.rst:1764 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1765 +#: ../../library/multiprocessing.rst:1767 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: ../../library/multiprocessing.rst:1768 +#: ../../library/multiprocessing.rst:1770 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -1994,14 +1994,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1774 +#: ../../library/multiprocessing.rst:1776 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1778 +#: ../../library/multiprocessing.rst:1780 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2012,7 +2012,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1787 +#: ../../library/multiprocessing.rst:1789 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -2022,22 +2022,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1794 +#: ../../library/multiprocessing.rst:1796 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1798 +#: ../../library/multiprocessing.rst:1800 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1802 +#: ../../library/multiprocessing.rst:1804 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1804 +#: ../../library/multiprocessing.rst:1806 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2045,173 +2045,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1810 +#: ../../library/multiprocessing.rst:1812 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: ../../library/multiprocessing.rst:1815 +#: ../../library/multiprocessing.rst:1817 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: ../../library/multiprocessing.rst:1819 +#: ../../library/multiprocessing.rst:1821 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: ../../library/multiprocessing.rst:1825 +#: ../../library/multiprocessing.rst:1827 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1832 +#: ../../library/multiprocessing.rst:1834 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1837 +#: ../../library/multiprocessing.rst:1839 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1840 +#: ../../library/multiprocessing.rst:1842 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: ../../library/multiprocessing.rst:1848 +#: ../../library/multiprocessing.rst:1850 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1852 +#: ../../library/multiprocessing.rst:1854 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1856 +#: ../../library/multiprocessing.rst:1858 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1860 +#: ../../library/multiprocessing.rst:1862 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1864 +#: ../../library/multiprocessing.rst:1866 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1868 +#: ../../library/multiprocessing.rst:1870 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1873 +#: ../../library/multiprocessing.rst:1875 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1877 +#: ../../library/multiprocessing.rst:1879 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1884 +#: ../../library/multiprocessing.rst:1886 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1889 +#: ../../library/multiprocessing.rst:1891 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1891 +#: ../../library/multiprocessing.rst:1893 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1898 +#: ../../library/multiprocessing.rst:1900 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1900 +#: ../../library/multiprocessing.rst:1902 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: ../../library/multiprocessing.rst:1903 +#: ../../library/multiprocessing.rst:1905 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: ../../library/multiprocessing.rst:1919 +#: ../../library/multiprocessing.rst:1921 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1921 +#: ../../library/multiprocessing.rst:1923 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: ../../library/multiprocessing.rst:1946 +#: ../../library/multiprocessing.rst:1948 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1948 +#: ../../library/multiprocessing.rst:1950 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: ../../library/multiprocessing.rst:1951 +#: ../../library/multiprocessing.rst:1953 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1963 +#: ../../library/multiprocessing.rst:1965 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1973 +#: ../../library/multiprocessing.rst:1975 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:1984 +#: ../../library/multiprocessing.rst:1986 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2009 +#: ../../library/multiprocessing.rst:2011 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2011 +#: ../../library/multiprocessing.rst:2013 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: ../../library/multiprocessing.rst:2015 +#: ../../library/multiprocessing.rst:2017 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2219,14 +2219,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2033 +#: ../../library/multiprocessing.rst:2035 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: ../../library/multiprocessing.rst:2037 +#: ../../library/multiprocessing.rst:2039 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -2234,11 +2234,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2053 +#: ../../library/multiprocessing.rst:2055 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2066 +#: ../../library/multiprocessing.rst:2068 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -2249,53 +2249,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2085 +#: ../../library/multiprocessing.rst:2087 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: ../../library/multiprocessing.rst:2091 +#: ../../library/multiprocessing.rst:2093 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2099 +#: ../../library/multiprocessing.rst:2101 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2103 +#: ../../library/multiprocessing.rst:2105 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2107 +#: ../../library/multiprocessing.rst:2109 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2109 +#: ../../library/multiprocessing.rst:2111 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2113 +#: ../../library/multiprocessing.rst:2115 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2117 +#: ../../library/multiprocessing.rst:2119 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2119 +#: ../../library/multiprocessing.rst:2121 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: ../../library/multiprocessing.rst:2123 +#: ../../library/multiprocessing.rst:2125 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -2303,79 +2303,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2128 +#: ../../library/multiprocessing.rst:2130 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2131 +#: ../../library/multiprocessing.rst:2133 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2147 +#: ../../library/multiprocessing.rst:2149 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2149 +#: ../../library/multiprocessing.rst:2151 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2153 +#: ../../library/multiprocessing.rst:2155 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2157 +#: ../../library/multiprocessing.rst:2159 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2161 +#: ../../library/multiprocessing.rst:2163 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2163 +#: ../../library/multiprocessing.rst:2165 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: ../../library/multiprocessing.rst:2166 +#: ../../library/multiprocessing.rst:2168 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2171 +#: ../../library/multiprocessing.rst:2173 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2176 +#: ../../library/multiprocessing.rst:2178 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: ../../library/multiprocessing.rst:2181 +#: ../../library/multiprocessing.rst:2183 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: ../../library/multiprocessing.rst:2185 +#: ../../library/multiprocessing.rst:2187 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2188 -#: ../../library/multiprocessing.rst:2749 +#: ../../library/multiprocessing.rst:2190 +#: ../../library/multiprocessing.rst:2751 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2191 +#: ../../library/multiprocessing.rst:2193 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -2383,7 +2383,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2196 +#: ../../library/multiprocessing.rst:2198 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2391,13 +2391,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2202 +#: ../../library/multiprocessing.rst:2204 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2206 +#: ../../library/multiprocessing.rst:2208 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -2405,22 +2405,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2211 +#: ../../library/multiprocessing.rst:2213 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2215 +#: ../../library/multiprocessing.rst:2217 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2218 +#: ../../library/multiprocessing.rst:2220 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2223 +#: ../../library/multiprocessing.rst:2225 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -2431,7 +2431,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2233 +#: ../../library/multiprocessing.rst:2235 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -2439,14 +2439,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2240 +#: ../../library/multiprocessing.rst:2242 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2243 -#: ../../library/multiprocessing.rst:2274 +#: ../../library/multiprocessing.rst:2245 +#: ../../library/multiprocessing.rst:2276 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -2454,60 +2454,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2248 -#: ../../library/multiprocessing.rst:2279 +#: ../../library/multiprocessing.rst:2250 +#: ../../library/multiprocessing.rst:2281 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: ../../library/multiprocessing.rst:2252 -#: ../../library/multiprocessing.rst:2283 +#: ../../library/multiprocessing.rst:2254 +#: ../../library/multiprocessing.rst:2285 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2257 +#: ../../library/multiprocessing.rst:2259 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: ../../library/multiprocessing.rst:2261 +#: ../../library/multiprocessing.rst:2263 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: ../../library/multiprocessing.rst:2265 +#: ../../library/multiprocessing.rst:2267 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: ../../library/multiprocessing.rst:2271 +#: ../../library/multiprocessing.rst:2273 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2288 +#: ../../library/multiprocessing.rst:2290 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2290 +#: ../../library/multiprocessing.rst:2292 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: ../../library/multiprocessing.rst:2295 +#: ../../library/multiprocessing.rst:2297 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -2515,65 +2515,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2302 +#: ../../library/multiprocessing.rst:2304 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: ../../library/multiprocessing.rst:2308 +#: ../../library/multiprocessing.rst:2310 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2312 +#: ../../library/multiprocessing.rst:2314 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2319 +#: ../../library/multiprocessing.rst:2321 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2327 +#: ../../library/multiprocessing.rst:2329 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: ../../library/multiprocessing.rst:2332 +#: ../../library/multiprocessing.rst:2334 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: ../../library/multiprocessing.rst:2338 +#: ../../library/multiprocessing.rst:2340 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2341 +#: ../../library/multiprocessing.rst:2343 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: ../../library/multiprocessing.rst:2349 +#: ../../library/multiprocessing.rst:2351 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2354 +#: ../../library/multiprocessing.rst:2356 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2581,41 +2581,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2361 +#: ../../library/multiprocessing.rst:2363 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2365 +#: ../../library/multiprocessing.rst:2367 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2369 +#: ../../library/multiprocessing.rst:2371 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2372 +#: ../../library/multiprocessing.rst:2374 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2376 +#: ../../library/multiprocessing.rst:2378 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2403 +#: ../../library/multiprocessing.rst:2405 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2408 +#: ../../library/multiprocessing.rst:2410 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: ../../library/multiprocessing.rst:2412 +#: ../../library/multiprocessing.rst:2414 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2624,46 +2624,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2421 +#: ../../library/multiprocessing.rst:2423 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2424 +#: ../../library/multiprocessing.rst:2426 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2430 +#: ../../library/multiprocessing.rst:2432 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: ../../library/multiprocessing.rst:2433 +#: ../../library/multiprocessing.rst:2435 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2438 +#: ../../library/multiprocessing.rst:2440 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2441 +#: ../../library/multiprocessing.rst:2443 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: ../../library/multiprocessing.rst:2445 -#: ../../library/multiprocessing.rst:2480 +#: ../../library/multiprocessing.rst:2447 +#: ../../library/multiprocessing.rst:2482 msgid "" "If *authkey* is given and not None, it should be a byte string and will be " "used as the secret key for an HMAC-based authentication challenge. No " @@ -2672,26 +2672,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2453 +#: ../../library/multiprocessing.rst:2455 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2456 +#: ../../library/multiprocessing.rst:2458 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2461 +#: ../../library/multiprocessing.rst:2463 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: ../../library/multiprocessing.rst:2465 +#: ../../library/multiprocessing.rst:2467 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -2705,49 +2705,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2476 +#: ../../library/multiprocessing.rst:2478 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: ../../library/multiprocessing.rst:2488 +#: ../../library/multiprocessing.rst:2490 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2495 +#: ../../library/multiprocessing.rst:2497 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: ../../library/multiprocessing.rst:2499 +#: ../../library/multiprocessing.rst:2501 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2503 +#: ../../library/multiprocessing.rst:2505 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2507 +#: ../../library/multiprocessing.rst:2509 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2510 +#: ../../library/multiprocessing.rst:2512 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:2517 +#: ../../library/multiprocessing.rst:2519 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -2756,32 +2756,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2523 +#: ../../library/multiprocessing.rst:2525 msgid "" "For both Unix and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2526 +#: ../../library/multiprocessing.rst:2528 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2527 +#: ../../library/multiprocessing.rst:2529 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2528 +#: ../../library/multiprocessing.rst:2530 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2531 +#: ../../library/multiprocessing.rst:2533 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: ../../library/multiprocessing.rst:2534 +#: ../../library/multiprocessing.rst:2536 msgid "" "**Unix**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2789,7 +2789,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2540 +#: ../../library/multiprocessing.rst:2542 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -2798,46 +2798,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2550 +#: ../../library/multiprocessing.rst:2552 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2552 +#: ../../library/multiprocessing.rst:2554 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: ../../library/multiprocessing.rst:2571 +#: ../../library/multiprocessing.rst:2573 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2588 +#: ../../library/multiprocessing.rst:2590 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2627 +#: ../../library/multiprocessing.rst:2629 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2629 +#: ../../library/multiprocessing.rst:2631 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: ../../library/multiprocessing.rst:2632 +#: ../../library/multiprocessing.rst:2634 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2635 +#: ../../library/multiprocessing.rst:2637 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -2846,17 +2846,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2640 +#: ../../library/multiprocessing.rst:2642 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: ../../library/multiprocessing.rst:2647 +#: ../../library/multiprocessing.rst:2649 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2649 +#: ../../library/multiprocessing.rst:2651 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2864,7 +2864,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2655 +#: ../../library/multiprocessing.rst:2657 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -2872,7 +2872,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2661 +#: ../../library/multiprocessing.rst:2663 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2883,17 +2883,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2669 +#: ../../library/multiprocessing.rst:2671 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2673 +#: ../../library/multiprocessing.rst:2675 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2675 +#: ../../library/multiprocessing.rst:2677 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2901,27 +2901,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2682 +#: ../../library/multiprocessing.rst:2684 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2685 +#: ../../library/multiprocessing.rst:2687 msgid "" "When first created the logger has level :data:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2689 +#: ../../library/multiprocessing.rst:2691 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: ../../library/multiprocessing.rst:2696 +#: ../../library/multiprocessing.rst:2698 msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " @@ -2930,25 +2930,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2702 +#: ../../library/multiprocessing.rst:2704 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2717 +#: ../../library/multiprocessing.rst:2719 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2721 +#: ../../library/multiprocessing.rst:2723 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2726 +#: ../../library/multiprocessing.rst:2728 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:2731 +#: ../../library/multiprocessing.rst:2733 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2956,7 +2956,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2739 +#: ../../library/multiprocessing.rst:2741 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -2966,18 +2966,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2746 +#: ../../library/multiprocessing.rst:2748 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2752 +#: ../../library/multiprocessing.rst:2754 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2756 +#: ../../library/multiprocessing.rst:2758 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -2987,7 +2987,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2763 +#: ../../library/multiprocessing.rst:2765 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -2996,69 +2996,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2773 +#: ../../library/multiprocessing.rst:2775 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2775 +#: ../../library/multiprocessing.rst:2777 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2780 +#: ../../library/multiprocessing.rst:2782 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2782 +#: ../../library/multiprocessing.rst:2784 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2784 +#: ../../library/multiprocessing.rst:2786 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2786 +#: ../../library/multiprocessing.rst:2788 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2789 +#: ../../library/multiprocessing.rst:2791 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: ../../library/multiprocessing.rst:2793 +#: ../../library/multiprocessing.rst:2795 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2795 +#: ../../library/multiprocessing.rst:2797 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2797 +#: ../../library/multiprocessing.rst:2799 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2799 +#: ../../library/multiprocessing.rst:2801 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2802 +#: ../../library/multiprocessing.rst:2804 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2804 +#: ../../library/multiprocessing.rst:2806 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2806 +#: ../../library/multiprocessing.rst:2808 msgid "" "On Unix when a process finishes but has not been joined it becomes a zombie. " "There should never be very many because each time a new process starts (or :" @@ -3069,11 +3069,11 @@ msgid "" "all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2814 +#: ../../library/multiprocessing.rst:2816 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2816 +#: ../../library/multiprocessing.rst:2818 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3083,11 +3083,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2824 +#: ../../library/multiprocessing.rst:2826 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2826 +#: ../../library/multiprocessing.rst:2828 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3095,18 +3095,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2832 +#: ../../library/multiprocessing.rst:2834 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: ../../library/multiprocessing.rst:2836 +#: ../../library/multiprocessing.rst:2838 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2838 +#: ../../library/multiprocessing.rst:2840 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -3115,7 +3115,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2844 +#: ../../library/multiprocessing.rst:2846 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -3124,21 +3124,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2850 +#: ../../library/multiprocessing.rst:2852 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2864 +#: ../../library/multiprocessing.rst:2866 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2867 +#: ../../library/multiprocessing.rst:2869 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2869 +#: ../../library/multiprocessing.rst:2871 msgid "" "On Unix using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3146,7 +3146,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2874 +#: ../../library/multiprocessing.rst:2876 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -3155,29 +3155,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2881 +#: ../../library/multiprocessing.rst:2883 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2893 +#: ../../library/multiprocessing.rst:2895 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2905 +#: ../../library/multiprocessing.rst:2907 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2907 +#: ../../library/multiprocessing.rst:2909 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2911 +#: ../../library/multiprocessing.rst:2913 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: ../../library/multiprocessing.rst:2917 +#: ../../library/multiprocessing.rst:2919 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3187,33 +3187,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2924 +#: ../../library/multiprocessing.rst:2926 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: ../../library/multiprocessing.rst:2936 +#: ../../library/multiprocessing.rst:2938 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2939 +#: ../../library/multiprocessing.rst:2941 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2941 +#: ../../library/multiprocessing.rst:2943 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2944 +#: ../../library/multiprocessing.rst:2946 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2946 +#: ../../library/multiprocessing.rst:2948 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3221,11 +3221,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2951 +#: ../../library/multiprocessing.rst:2953 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2953 +#: ../../library/multiprocessing.rst:2955 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -3233,66 +3233,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2958 +#: ../../library/multiprocessing.rst:2960 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2963 +#: ../../library/multiprocessing.rst:2965 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2965 +#: ../../library/multiprocessing.rst:2967 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such a starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:2969 +#: ../../library/multiprocessing.rst:2971 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:2981 +#: ../../library/multiprocessing.rst:2983 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2995 +#: ../../library/multiprocessing.rst:2997 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:2998 +#: ../../library/multiprocessing.rst:3000 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: ../../library/multiprocessing.rst:3001 +#: ../../library/multiprocessing.rst:3003 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3008 +#: ../../library/multiprocessing.rst:3010 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3010 +#: ../../library/multiprocessing.rst:3012 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3016 +#: ../../library/multiprocessing.rst:3018 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:3022 +#: ../../library/multiprocessing.rst:3024 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" diff --git a/library/types.po b/library/types.po index 2f4f2dd697..ac3865f499 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-28 00:33+0000\n" +"POT-Creation-Date: 2023-04-12 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -122,11 +122,11 @@ msgstr "" #: ../../library/types.rst:76 msgid "" "This function looks for items in *bases* that are not instances of :class:" -"`type`, and returns a tuple where each such object that has an " -"``__mro_entries__`` method is replaced with an unpacked result of calling " -"this method. If a *bases* item is an instance of :class:`type`, or it " -"doesn't have an ``__mro_entries__`` method, then it is included in the " -"return tuple unchanged." +"`type`, and returns a tuple where each such object that has an :meth:" +"`~object.__mro_entries__` method is replaced with an unpacked result of " +"calling this method. If a *bases* item is an instance of :class:`type`, or " +"it doesn't have an :meth:`!__mro_entries__` method, then it is included in " +"the return tuple unchanged." msgstr "" #: ../../library/types.rst:87 diff --git a/reference/datamodel.po b/reference/datamodel.po index c480be2000..3e4bbdabd4 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-09 00:31+0000\n" +"POT-Creation-Date: 2023-04-12 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2480,45 +2480,58 @@ msgstr "" #: ../../reference/datamodel.rst:2090 msgid "" "If a base that appears in a class definition is not an instance of :class:" -"`type`, then an ``__mro_entries__`` method is searched on the base. If an " -"``__mro_entries__`` method is found, the base is substituted with the result " -"of a call to ``__mro_entries__`` when creating the class. The method is " -"called with the original bases tuple, and must return a tuple of classes " -"that will be used instead of the base. The returned tuple may be empty: in " -"these cases, the original base is ignored." +"`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " +"an :meth:`!__mro_entries__` method is found, the base is substituted with " +"the result of a call to :meth:`!__mro_entries__` when creating the class. " +"The method is called with the original bases tuple passed to the *bases* " +"parameter, and must return a tuple of classes that will be used instead of " +"the base. The returned tuple may be empty: in these cases, the original base " +"is ignored." msgstr "" -#: ../../reference/datamodel.rst:2100 -msgid ":pep:`560` - Core support for typing module and generic types" +#: ../../reference/datamodel.rst:2102 +msgid ":func:`types.resolve_bases`" +msgstr "" + +#: ../../reference/datamodel.rst:2102 +msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" #: ../../reference/datamodel.rst:2104 +msgid ":pep:`560`" +msgstr "" + +#: ../../reference/datamodel.rst:2105 +msgid "Core support for typing module and generic types." +msgstr "" + +#: ../../reference/datamodel.rst:2109 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2108 +#: ../../reference/datamodel.rst:2113 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2110 +#: ../../reference/datamodel.rst:2115 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2111 +#: ../../reference/datamodel.rst:2116 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2113 +#: ../../reference/datamodel.rst:2118 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2116 +#: ../../reference/datamodel.rst:2121 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2527,11 +2540,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2126 +#: ../../reference/datamodel.rst:2131 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2131 +#: ../../reference/datamodel.rst:2136 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2543,25 +2556,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2140 +#: ../../reference/datamodel.rst:2145 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2145 +#: ../../reference/datamodel.rst:2150 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2146 +#: ../../reference/datamodel.rst:2151 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2150 +#: ../../reference/datamodel.rst:2155 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2155 +#: ../../reference/datamodel.rst:2160 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2570,7 +2583,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2161 +#: ../../reference/datamodel.rst:2166 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2579,11 +2592,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2170 +#: ../../reference/datamodel.rst:2175 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2177 +#: ../../reference/datamodel.rst:2182 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2591,7 +2604,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2182 +#: ../../reference/datamodel.rst:2187 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2602,7 +2615,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2192 +#: ../../reference/datamodel.rst:2197 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2611,39 +2624,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2198 +#: ../../reference/datamodel.rst:2203 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2202 +#: ../../reference/datamodel.rst:2207 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2204 +#: ../../reference/datamodel.rst:2209 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2206 +#: ../../reference/datamodel.rst:2211 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2214 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2213 +#: ../../reference/datamodel.rst:2218 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2651,19 +2664,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2220 +#: ../../reference/datamodel.rst:2225 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2221 +#: ../../reference/datamodel.rst:2226 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2225 +#: ../../reference/datamodel.rst:2230 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2227 +#: ../../reference/datamodel.rst:2232 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2671,17 +2684,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2234 +#: ../../reference/datamodel.rst:2239 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2236 +#: ../../reference/datamodel.rst:2241 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2239 +#: ../../reference/datamodel.rst:2244 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2689,21 +2702,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2246 +#: ../../reference/datamodel.rst:2251 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2253 +#: ../../reference/datamodel.rst:2258 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2258 +#: ../../reference/datamodel.rst:2263 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2711,11 +2724,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2269 +#: ../../reference/datamodel.rst:2274 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2266 +#: ../../reference/datamodel.rst:2271 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2724,11 +2737,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2274 +#: ../../reference/datamodel.rst:2279 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2276 +#: ../../reference/datamodel.rst:2281 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2736,65 +2749,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2289 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2289 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2287 +#: ../../reference/datamodel.rst:2292 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2287 +#: ../../reference/datamodel.rst:2292 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2290 +#: ../../reference/datamodel.rst:2295 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2290 +#: ../../reference/datamodel.rst:2295 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2293 +#: ../../reference/datamodel.rst:2298 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2298 +#: ../../reference/datamodel.rst:2303 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2301 +#: ../../reference/datamodel.rst:2306 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2307 +#: ../../reference/datamodel.rst:2312 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2314 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2313 +#: ../../reference/datamodel.rst:2318 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2803,7 +2816,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2319 +#: ../../reference/datamodel.rst:2324 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2811,11 +2824,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2334 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2336 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2825,14 +2838,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2338 +#: ../../reference/datamodel.rst:2343 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2366 +#: ../../reference/datamodel.rst:2371 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2842,40 +2855,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2385 +#: ../../reference/datamodel.rst:2390 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2410 +#: ../../reference/datamodel.rst:2415 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2409 +#: ../../reference/datamodel.rst:2414 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2417 +#: ../../reference/datamodel.rst:2422 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2424 +#: ../../reference/datamodel.rst:2429 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2431 +#: ../../reference/datamodel.rst:2436 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2433 +#: ../../reference/datamodel.rst:2438 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2911,7 +2924,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2473 +#: ../../reference/datamodel.rst:2478 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2919,7 +2932,7 @@ msgid "" "zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2480 +#: ../../reference/datamodel.rst:2485 msgid "" "In CPython, the length is required to be at most :attr:`sys.maxsize`. If the " "length is larger than :attr:`!sys.maxsize` some features (such as :func:" @@ -2928,7 +2941,7 @@ msgid "" "`__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2489 +#: ../../reference/datamodel.rst:2494 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2938,20 +2951,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2503 +#: ../../reference/datamodel.rst:2508 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2507 +#: ../../reference/datamodel.rst:2512 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2511 +#: ../../reference/datamodel.rst:2516 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2516 +#: ../../reference/datamodel.rst:2521 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -2964,20 +2977,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2528 +#: ../../reference/datamodel.rst:2533 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2533 +#: ../../reference/datamodel.rst:2538 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2541 +#: ../../reference/datamodel.rst:2546 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2986,7 +2999,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2550 +#: ../../reference/datamodel.rst:2555 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2995,13 +3008,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2559 +#: ../../reference/datamodel.rst:2564 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2565 +#: ../../reference/datamodel.rst:2570 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3009,14 +3022,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2573 +#: ../../reference/datamodel.rst:2578 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2577 +#: ../../reference/datamodel.rst:2582 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3025,7 +3038,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2584 +#: ../../reference/datamodel.rst:2589 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3033,14 +3046,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2591 +#: ../../reference/datamodel.rst:2596 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2595 +#: ../../reference/datamodel.rst:2600 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3048,11 +3061,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2604 +#: ../../reference/datamodel.rst:2609 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2606 +#: ../../reference/datamodel.rst:2611 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3060,7 +3073,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2632 +#: ../../reference/datamodel.rst:2637 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3074,13 +3087,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2643 +#: ../../reference/datamodel.rst:2648 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2666 +#: ../../reference/datamodel.rst:2671 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3093,13 +3106,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2678 +#: ../../reference/datamodel.rst:2683 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2683 +#: ../../reference/datamodel.rst:2688 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3108,7 +3121,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2704 +#: ../../reference/datamodel.rst:2709 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3124,19 +3137,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2725 +#: ../../reference/datamodel.rst:2730 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2738 +#: ../../reference/datamodel.rst:2743 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2745 +#: ../../reference/datamodel.rst:2750 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3145,14 +3158,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2751 +#: ../../reference/datamodel.rst:2756 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2763 +#: ../../reference/datamodel.rst:2768 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3161,21 +3174,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2769 +#: ../../reference/datamodel.rst:2774 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2772 +#: ../../reference/datamodel.rst:2777 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2779 +#: ../../reference/datamodel.rst:2784 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2781 +#: ../../reference/datamodel.rst:2786 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3185,32 +3198,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2792 +#: ../../reference/datamodel.rst:2797 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2795 +#: ../../reference/datamodel.rst:2800 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2800 +#: ../../reference/datamodel.rst:2805 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2807 +#: ../../reference/datamodel.rst:2812 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2811 +#: ../../reference/datamodel.rst:2816 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3218,27 +3231,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2815 +#: ../../reference/datamodel.rst:2820 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2822 +#: ../../reference/datamodel.rst:2827 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2822 +#: ../../reference/datamodel.rst:2827 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2829 +#: ../../reference/datamodel.rst:2834 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2831 +#: ../../reference/datamodel.rst:2836 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3246,7 +3259,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2838 +#: ../../reference/datamodel.rst:2843 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3255,7 +3268,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2844 +#: ../../reference/datamodel.rst:2849 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3265,19 +3278,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2854 +#: ../../reference/datamodel.rst:2859 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2855 +#: ../../reference/datamodel.rst:2860 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2861 +#: ../../reference/datamodel.rst:2866 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2863 +#: ../../reference/datamodel.rst:2868 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3285,7 +3298,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2878 +#: ../../reference/datamodel.rst:2883 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3294,21 +3307,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2892 +#: ../../reference/datamodel.rst:2897 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:2901 +#: ../../reference/datamodel.rst:2906 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:2927 +#: ../../reference/datamodel.rst:2932 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3317,36 +3330,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:2938 +#: ../../reference/datamodel.rst:2943 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:2942 +#: ../../reference/datamodel.rst:2947 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:2944 +#: ../../reference/datamodel.rst:2949 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:2950 +#: ../../reference/datamodel.rst:2955 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:2956 +#: ../../reference/datamodel.rst:2961 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:2962 +#: ../../reference/datamodel.rst:2967 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3354,15 +3367,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:2970 +#: ../../reference/datamodel.rst:2975 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:2976 +#: ../../reference/datamodel.rst:2981 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:2978 +#: ../../reference/datamodel.rst:2983 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3373,18 +3386,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:2986 +#: ../../reference/datamodel.rst:2991 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:2990 +#: ../../reference/datamodel.rst:2995 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:2996 +#: ../../reference/datamodel.rst:3001 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3395,7 +3408,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3007 +#: ../../reference/datamodel.rst:3012 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3406,7 +3419,7 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3018 +#: ../../reference/datamodel.rst:3023 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3416,99 +3429,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3026 +#: ../../reference/datamodel.rst:3031 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3032 +#: ../../reference/datamodel.rst:3037 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3034 +#: ../../reference/datamodel.rst:3039 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3037 +#: ../../reference/datamodel.rst:3042 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3041 +#: ../../reference/datamodel.rst:3046 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3045 +#: ../../reference/datamodel.rst:3050 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3048 +#: ../../reference/datamodel.rst:3053 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3065 +#: ../../reference/datamodel.rst:3070 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3070 +#: ../../reference/datamodel.rst:3075 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3078 +#: ../../reference/datamodel.rst:3083 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3080 +#: ../../reference/datamodel.rst:3085 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3083 +#: ../../reference/datamodel.rst:3088 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3087 +#: ../../reference/datamodel.rst:3092 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3092 +#: ../../reference/datamodel.rst:3097 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3095 +#: ../../reference/datamodel.rst:3100 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3108 +#: ../../reference/datamodel.rst:3113 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3109 +#: ../../reference/datamodel.rst:3114 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3113 +#: ../../reference/datamodel.rst:3118 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3516,7 +3529,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3119 +#: ../../reference/datamodel.rst:3124 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3524,7 +3537,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3125 +#: ../../reference/datamodel.rst:3130 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " From 870c97a8c203e9a6a36b0a72b804d8807bcaca3e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 13 Apr 2023 00:32:29 +0000 Subject: [PATCH 066/130] sync with cpython e643412e --- library/pdb.po | 262 +++++++++++++++++++++++++++---------------------- 1 file changed, 146 insertions(+), 116 deletions(-) diff --git a/library/pdb.po b/library/pdb.po index 291a36b075..7a11505fed 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-26 00:33+0000\n" +"POT-Creation-Date: 2023-04-13 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -64,74 +64,82 @@ msgid "" msgstr "" #: ../../library/pdb.rst:39 +msgid "The typical usage to break into the debugger is to insert::" +msgstr "" + +#: ../../library/pdb.rst:43 +msgid "Or::" +msgstr "" + +#: ../../library/pdb.rst:47 +msgid "" +"at the location you want to break into the debugger, and then run the " +"program. You can then step through the code following this statement, and " +"continue running without the debugger using the :pdbcmd:`continue` command." +msgstr "" + +#: ../../library/pdb.rst:51 msgid "" -"The debugger's prompt is ``(Pdb)``. Typical usage to run a program under " -"control of the debugger is::" +"The built-in :func:`breakpoint()`, when called with defaults, can be used " +"instead of ``import pdb; pdb.set_trace()``." msgstr "" -#: ../../library/pdb.rst:53 +#: ../../library/pdb.rst:63 +msgid "" +"The debugger's prompt is ``(Pdb)``, which is the indicator that you are in " +"debug mode::" +msgstr "" + +#: ../../library/pdb.rst:72 msgid "" "Tab-completion via the :mod:`readline` module is available for commands and " "command arguments, e.g. the current global and local names are offered as " "arguments of the ``p`` command." msgstr "" -#: ../../library/pdb.rst:58 +#: ../../library/pdb.rst:78 msgid "" -":file:`pdb.py` can also be invoked as a script to debug other scripts. For " -"example::" +"You can also invoke :mod:`pdb` from the command line to debug other " +"scripts. For example::" msgstr "" -#: ../../library/pdb.rst:63 +#: ../../library/pdb.rst:83 msgid "" -"When invoked as a script, pdb will automatically enter post-mortem debugging " +"When invoked as a module, pdb will automatically enter post-mortem debugging " "if the program being debugged exits abnormally. After post-mortem debugging " "(or after normal exit of the program), pdb will restart the program. " "Automatic restarting preserves pdb's state (such as breakpoints) and in most " "cases is more useful than quitting the debugger upon program's exit." msgstr "" -#: ../../library/pdb.rst:69 +#: ../../library/pdb.rst:89 msgid "" -":file:`pdb.py` now accepts a ``-c`` option that executes commands as if " -"given in a :file:`.pdbrc` file, see :ref:`debugger-commands`." +"``-c`` option is introduced to execute commands as if given in a :file:`." +"pdbrc` file, see :ref:`debugger-commands`." msgstr "" -#: ../../library/pdb.rst:73 +#: ../../library/pdb.rst:93 msgid "" -":file:`pdb.py` now accepts a ``-m`` option that execute modules similar to " -"the way ``python -m`` does. As with a script, the debugger will pause " -"execution just before the first line of the module." -msgstr "" - -#: ../../library/pdb.rst:79 -msgid "The typical usage to break into the debugger is to insert::" -msgstr "" - -#: ../../library/pdb.rst:83 -msgid "" -"at the location you want to break into the debugger, and then run the " -"program. You can then step through the code following this statement, and " -"continue running without the debugger using the :pdbcmd:`continue` command." +"``-m`` option is introduced to execute modules similar to the way ``python -" +"m`` does. As with a script, the debugger will pause execution just before " +"the first line of the module." msgstr "" -#: ../../library/pdb.rst:87 -msgid "" -"The built-in :func:`breakpoint()`, when called with defaults, can be used " -"instead of ``import pdb; pdb.set_trace()``." +#: ../../library/pdb.rst:98 +msgid "Typical usage to execute a statement under control of the debugger is::" msgstr "" -#: ../../library/pdb.rst:91 +#: ../../library/pdb.rst:109 msgid "The typical usage to inspect a crashed program is::" msgstr "" -#: ../../library/pdb.rst:109 +#: ../../library/pdb.rst:127 msgid "" "The module defines the following functions; each enters the debugger in a " "slightly different way:" msgstr "" -#: ../../library/pdb.rst:114 +#: ../../library/pdb.rst:132 msgid "" "Execute the *statement* (given as a string or a code object) under debugger " "control. The debugger prompt appears before any code is executed; you can " @@ -143,14 +151,14 @@ msgid "" "`exec` or :func:`eval` functions.)" msgstr "" -#: ../../library/pdb.rst:126 +#: ../../library/pdb.rst:144 msgid "" "Evaluate the *expression* (given as a string or a code object) under " "debugger control. When :func:`runeval` returns, it returns the value of the " "*expression*. Otherwise this function is similar to :func:`run`." msgstr "" -#: ../../library/pdb.rst:133 +#: ../../library/pdb.rst:151 msgid "" "Call the *function* (a function or method object, not a string) with the " "given arguments. When :func:`runcall` returns, it returns whatever the " @@ -158,7 +166,7 @@ msgid "" "is entered." msgstr "" -#: ../../library/pdb.rst:141 +#: ../../library/pdb.rst:159 msgid "" "Enter the debugger at the calling stack frame. This is useful to hard-code " "a breakpoint at a given point in a program, even if the code is not " @@ -166,11 +174,11 @@ msgid "" "is printed to the console just before debugging begins." msgstr "" -#: ../../library/pdb.rst:146 +#: ../../library/pdb.rst:164 msgid "The keyword-only argument *header*." msgstr "" -#: ../../library/pdb.rst:152 +#: ../../library/pdb.rst:170 msgid "" "Enter post-mortem debugging of the given *traceback* object. If no " "*traceback* is given, it uses the one of the exception that is currently " @@ -178,37 +186,37 @@ msgid "" "used)." msgstr "" -#: ../../library/pdb.rst:160 +#: ../../library/pdb.rst:178 msgid "" "Enter post-mortem debugging of the traceback found in :data:`sys." "last_traceback`." msgstr "" -#: ../../library/pdb.rst:164 +#: ../../library/pdb.rst:182 msgid "" "The ``run*`` functions and :func:`set_trace` are aliases for instantiating " "the :class:`Pdb` class and calling the method of the same name. If you want " "to access further features, you have to do this yourself:" msgstr "" -#: ../../library/pdb.rst:171 +#: ../../library/pdb.rst:189 msgid ":class:`Pdb` is the debugger class." msgstr "" -#: ../../library/pdb.rst:173 +#: ../../library/pdb.rst:191 msgid "" "The *completekey*, *stdin* and *stdout* arguments are passed to the " "underlying :class:`cmd.Cmd` class; see the description there." msgstr "" -#: ../../library/pdb.rst:176 +#: ../../library/pdb.rst:194 msgid "" "The *skip* argument, if given, must be an iterable of glob-style module name " "patterns. The debugger will not step into frames that originate in a module " "that matches one of these patterns. [1]_" msgstr "" -#: ../../library/pdb.rst:180 +#: ../../library/pdb.rst:198 msgid "" "By default, Pdb sets a handler for the SIGINT signal (which is sent when the " "user presses :kbd:`Ctrl-C` on the console) when you give a :pdbcmd:" @@ -217,13 +225,13 @@ msgid "" "set *nosigint* to true." msgstr "" -#: ../../library/pdb.rst:185 +#: ../../library/pdb.rst:203 msgid "" "The *readrc* argument defaults to true and controls whether Pdb will load ." "pdbrc files from the filesystem." msgstr "" -#: ../../library/pdb.rst:188 +#: ../../library/pdb.rst:206 msgid "Example call to enable tracing with *skip*::" msgstr "" @@ -232,28 +240,28 @@ msgid "" "Raises an :ref:`auditing event ` ``pdb.Pdb`` with no arguments." msgstr "" -#: ../../library/pdb.rst:194 +#: ../../library/pdb.rst:212 msgid "The *skip* argument." msgstr "" -#: ../../library/pdb.rst:197 +#: ../../library/pdb.rst:215 msgid "" "The *nosigint* argument. Previously, a SIGINT handler was never set by Pdb." msgstr "" -#: ../../library/pdb.rst:201 +#: ../../library/pdb.rst:219 msgid "The *readrc* argument." msgstr "" -#: ../../library/pdb.rst:209 +#: ../../library/pdb.rst:227 msgid "See the documentation for the functions explained above." msgstr "" -#: ../../library/pdb.rst:215 +#: ../../library/pdb.rst:233 msgid "Debugger Commands" msgstr "" -#: ../../library/pdb.rst:217 +#: ../../library/pdb.rst:235 msgid "" "The commands recognized by the debugger are listed below. Most commands can " "be abbreviated to one or two letters as indicated; e.g. ``h(elp)`` means " @@ -265,13 +273,13 @@ msgid "" "are separated by a vertical bar (``|``)." msgstr "" -#: ../../library/pdb.rst:226 +#: ../../library/pdb.rst:244 msgid "" "Entering a blank line repeats the last command entered. Exception: if the " "last command was a :pdbcmd:`list` command, the next 11 lines are listed." msgstr "" -#: ../../library/pdb.rst:229 +#: ../../library/pdb.rst:247 msgid "" "Commands that the debugger doesn't recognize are assumed to be Python " "statements and are executed in the context of the program being debugged. " @@ -282,14 +290,14 @@ msgid "" "is not changed." msgstr "" -#: ../../library/pdb.rst:237 +#: ../../library/pdb.rst:255 msgid "" "The debugger supports :ref:`aliases `. Aliases can have " "parameters which allows one a certain level of adaptability to the context " "under examination." msgstr "" -#: ../../library/pdb.rst:241 +#: ../../library/pdb.rst:259 msgid "" "Multiple commands may be entered on a single line, separated by ``;;``. (A " "single ``;`` is not used as it is the separator for multiple commands in a " @@ -300,7 +308,7 @@ msgid "" "\"\";\"``." msgstr "" -#: ../../library/pdb.rst:252 +#: ../../library/pdb.rst:270 msgid "" "If a file :file:`.pdbrc` exists in the user's home directory or in the " "current directory, it is read with ``'utf-8'`` encoding and executed as if " @@ -309,20 +317,20 @@ msgid "" "and aliases defined there can be overridden by the local file." msgstr "" -#: ../../library/pdb.rst:258 +#: ../../library/pdb.rst:276 msgid "" ":file:`.pdbrc` is now read with ``'utf-8'`` encoding. Previously, it was " "read with the system locale encoding." msgstr "" -#: ../../library/pdb.rst:262 +#: ../../library/pdb.rst:280 msgid "" ":file:`.pdbrc` can now contain commands that continue debugging, such as :" "pdbcmd:`continue` or :pdbcmd:`next`. Previously, these commands had no " "effect." msgstr "" -#: ../../library/pdb.rst:270 +#: ../../library/pdb.rst:288 msgid "" "Without argument, print the list of available commands. With a *command* as " "argument, print help about that command. ``help pdb`` displays the full " @@ -331,25 +339,26 @@ msgid "" "the ``!`` command." msgstr "" -#: ../../library/pdb.rst:278 +#: ../../library/pdb.rst:296 msgid "" "Print a stack trace, with the most recent frame at the bottom. An arrow " -"indicates the current frame, which determines the context of most commands." +"(``>``) indicates the current frame, which determines the context of most " +"commands." msgstr "" -#: ../../library/pdb.rst:283 +#: ../../library/pdb.rst:301 msgid "" "Move the current frame *count* (default one) levels down in the stack trace " "(to a newer frame)." msgstr "" -#: ../../library/pdb.rst:288 +#: ../../library/pdb.rst:306 msgid "" "Move the current frame *count* (default one) levels up in the stack trace " "(to an older frame)." msgstr "" -#: ../../library/pdb.rst:293 +#: ../../library/pdb.rst:311 msgid "" "With a *lineno* argument, set a break there in the current file. With a " "*function* argument, set a break at the first executable statement within " @@ -360,33 +369,33 @@ msgid "" "refer." msgstr "" -#: ../../library/pdb.rst:300 +#: ../../library/pdb.rst:318 msgid "" "If a second argument is present, it is an expression which must evaluate to " "true before the breakpoint is honored." msgstr "" -#: ../../library/pdb.rst:303 +#: ../../library/pdb.rst:321 msgid "" "Without argument, list all breaks, including for each breakpoint, the number " "of times that breakpoint has been hit, the current ignore count, and the " "associated condition if any." msgstr "" -#: ../../library/pdb.rst:309 +#: ../../library/pdb.rst:327 msgid "" "Temporary breakpoint, which is removed automatically when it is first hit. " "The arguments are the same as for :pdbcmd:`break`." msgstr "" -#: ../../library/pdb.rst:314 +#: ../../library/pdb.rst:332 msgid "" "With a *filename:lineno* argument, clear all the breakpoints at this line. " "With a space separated list of breakpoint numbers, clear those breakpoints. " "Without argument, clear all breaks (but first ask confirmation)." msgstr "" -#: ../../library/pdb.rst:320 +#: ../../library/pdb.rst:338 msgid "" "Disable the breakpoints given as a space separated list of breakpoint " "numbers. Disabling a breakpoint means it cannot cause the program to stop " @@ -394,11 +403,11 @@ msgid "" "breakpoints and can be (re-)enabled." msgstr "" -#: ../../library/pdb.rst:327 +#: ../../library/pdb.rst:345 msgid "Enable the breakpoints specified." msgstr "" -#: ../../library/pdb.rst:331 +#: ../../library/pdb.rst:349 msgid "" "Set the ignore count for the given breakpoint number. If *count* is " "omitted, the ignore count is set to 0. A breakpoint becomes active when the " @@ -407,39 +416,39 @@ msgid "" "associated condition evaluates to true." msgstr "" -#: ../../library/pdb.rst:339 +#: ../../library/pdb.rst:357 msgid "" "Set a new *condition* for the breakpoint, an expression which must evaluate " "to true before the breakpoint is honored. If *condition* is absent, any " "existing condition is removed; i.e., the breakpoint is made unconditional." msgstr "" -#: ../../library/pdb.rst:345 +#: ../../library/pdb.rst:363 msgid "" "Specify a list of commands for breakpoint number *bpnumber*. The commands " "themselves appear on the following lines. Type a line containing just " "``end`` to terminate the commands. An example::" msgstr "" -#: ../../library/pdb.rst:354 +#: ../../library/pdb.rst:372 msgid "" "To remove all commands from a breakpoint, type ``commands`` and follow it " "immediately with ``end``; that is, give no commands." msgstr "" -#: ../../library/pdb.rst:357 +#: ../../library/pdb.rst:375 msgid "" "With no *bpnumber* argument, ``commands`` refers to the last breakpoint set." msgstr "" -#: ../../library/pdb.rst:359 +#: ../../library/pdb.rst:377 msgid "" "You can use breakpoint commands to start your program up again. Simply use " "the :pdbcmd:`continue` command, or :pdbcmd:`step`, or any other command that " "resumes execution." msgstr "" -#: ../../library/pdb.rst:363 +#: ../../library/pdb.rst:381 msgid "" "Specifying any command resuming execution (currently :pdbcmd:`continue`, :" "pdbcmd:`step`, :pdbcmd:`next`, :pdbcmd:`return`, :pdbcmd:`jump`, :pdbcmd:" @@ -450,7 +459,7 @@ msgid "" "ambiguities about which list to execute." msgstr "" -#: ../../library/pdb.rst:372 +#: ../../library/pdb.rst:390 msgid "" "If you use the ``silent`` command in the command list, the usual message " "about stopping at a breakpoint is not printed. This may be desirable for " @@ -459,13 +468,13 @@ msgid "" "was reached." msgstr "" -#: ../../library/pdb.rst:379 +#: ../../library/pdb.rst:397 msgid "" "Execute the current line, stop at the first possible occasion (either in a " "function that is called or on the next line in the current function)." msgstr "" -#: ../../library/pdb.rst:384 +#: ../../library/pdb.rst:402 msgid "" "Continue execution until the next line in the current function is reached or " "it returns. (The difference between :pdbcmd:`next` and :pdbcmd:`step` is " @@ -474,46 +483,46 @@ msgid "" "line in the current function.)" msgstr "" -#: ../../library/pdb.rst:392 +#: ../../library/pdb.rst:410 msgid "" "Without argument, continue execution until the line with a number greater " "than the current one is reached." msgstr "" -#: ../../library/pdb.rst:395 +#: ../../library/pdb.rst:413 msgid "" "With *lineno*, continue execution until a line with a number greater or " "equal to *lineno* is reached. In both cases, also stop when the current " "frame returns." msgstr "" -#: ../../library/pdb.rst:399 +#: ../../library/pdb.rst:417 msgid "Allow giving an explicit line number." msgstr "" -#: ../../library/pdb.rst:404 +#: ../../library/pdb.rst:422 msgid "Continue execution until the current function returns." msgstr "" -#: ../../library/pdb.rst:408 +#: ../../library/pdb.rst:426 msgid "Continue execution, only stop when a breakpoint is encountered." msgstr "" -#: ../../library/pdb.rst:412 +#: ../../library/pdb.rst:430 msgid "" "Set the next line that will be executed. Only available in the bottom-most " "frame. This lets you jump back and execute code again, or jump forward to " "skip code that you don't want to run." msgstr "" -#: ../../library/pdb.rst:416 +#: ../../library/pdb.rst:434 msgid "" "It should be noted that not all jumps are allowed -- for instance it is not " "possible to jump into the middle of a :keyword:`for` loop or out of a :" "keyword:`finally` clause." msgstr "" -#: ../../library/pdb.rst:422 +#: ../../library/pdb.rst:440 msgid "" "List source code for the current file. Without arguments, list 11 lines " "around the current line or continue the previous listing. With ``.`` as " @@ -522,7 +531,7 @@ msgid "" "second argument is less than the first, it is interpreted as a count." msgstr "" -#: ../../library/pdb.rst:428 +#: ../../library/pdb.rst:446 msgid "" "The current line in the current frame is indicated by ``->``. If an " "exception is being debugged, the line where the exception was originally " @@ -530,69 +539,90 @@ msgid "" "line." msgstr "" -#: ../../library/pdb.rst:433 +#: ../../library/pdb.rst:451 msgid "The ``>>`` marker." msgstr "" -#: ../../library/pdb.rst:438 +#: ../../library/pdb.rst:456 msgid "" "List all source code for the current function or frame. Interesting lines " "are marked as for :pdbcmd:`list`." msgstr "" -#: ../../library/pdb.rst:445 -msgid "Print the argument list of the current function." +#: ../../library/pdb.rst:463 +msgid "Print the arguments of the current function and their current values." msgstr "" -#: ../../library/pdb.rst:449 +#: ../../library/pdb.rst:467 msgid "Evaluate *expression* in the current context and print its value." msgstr "" -#: ../../library/pdb.rst:453 +#: ../../library/pdb.rst:471 msgid "" "``print()`` can also be used, but is not a debugger command --- this " "executes the Python :func:`print` function." msgstr "" -#: ../../library/pdb.rst:459 +#: ../../library/pdb.rst:477 msgid "" "Like the :pdbcmd:`p` command, except the value of *expression* is pretty-" "printed using the :mod:`pprint` module." msgstr "" -#: ../../library/pdb.rst:464 +#: ../../library/pdb.rst:482 msgid "Print the type of *expression*." msgstr "" -#: ../../library/pdb.rst:468 +#: ../../library/pdb.rst:486 msgid "Try to get source code of *expression* and display it." msgstr "" -#: ../../library/pdb.rst:474 +#: ../../library/pdb.rst:492 msgid "" "Display the value of *expression* if it changed, each time execution stops " "in the current frame." msgstr "" -#: ../../library/pdb.rst:477 +#: ../../library/pdb.rst:495 msgid "" "Without *expression*, list all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:483 +#: ../../library/pdb.rst:499 +msgid "" +"Display evaluates *expression* and compares to the result of the previous " +"evaluation of *expression*, so when the result is mutable, display may not " +"be able to pick up the changes." +msgstr "" + +#: ../../library/pdb.rst:503 +msgid "Example::" +msgstr "" + +#: ../../library/pdb.rst:511 +msgid "" +"Display won't realize ``lst`` has been changed because the result of " +"evaluation is modified in place by ``lst.append(1)`` before being compared::" +msgstr "" + +#: ../../library/pdb.rst:526 +msgid "You can do some tricks with copy mechanism to make it work::" +msgstr "" + +#: ../../library/pdb.rst:545 msgid "" "Do not display *expression* anymore in the current frame. Without " "*expression*, clear all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:490 +#: ../../library/pdb.rst:552 msgid "" "Start an interactive interpreter (using the :mod:`code` module) whose global " "namespace contains all the (global and local) names found in the current " "scope." msgstr "" -#: ../../library/pdb.rst:500 +#: ../../library/pdb.rst:562 msgid "" "Create an alias called *name* that executes *command*. The *command* must " "*not* be enclosed in quotes. Replaceable parameters can be indicated by " @@ -601,7 +631,7 @@ msgid "" "arguments are given, all aliases are listed." msgstr "" -#: ../../library/pdb.rst:506 +#: ../../library/pdb.rst:568 msgid "" "Aliases may be nested and can contain anything that can be legally typed at " "the pdb prompt. Note that internal pdb commands *can* be overridden by " @@ -610,17 +640,17 @@ msgid "" "other words in the line are left alone." msgstr "" -#: ../../library/pdb.rst:512 +#: ../../library/pdb.rst:574 msgid "" "As an example, here are two useful aliases (especially when placed in the :" "file:`.pdbrc` file)::" msgstr "" -#: ../../library/pdb.rst:522 +#: ../../library/pdb.rst:584 msgid "Delete the specified alias *name*." msgstr "" -#: ../../library/pdb.rst:526 +#: ../../library/pdb.rst:588 msgid "" "Execute the (one-line) *statement* in the context of the current stack " "frame. The exclamation point can be omitted unless the first word of the " @@ -629,7 +659,7 @@ msgid "" "line, e.g.::" msgstr "" -#: ../../library/pdb.rst:538 +#: ../../library/pdb.rst:600 msgid "" "Restart the debugged Python program. If *args* is supplied, it is split " "with :mod:`shlex` and the result is used as the new :data:`sys.argv`. " @@ -637,25 +667,25 @@ msgid "" "`restart` is an alias for :pdbcmd:`run`." msgstr "" -#: ../../library/pdb.rst:545 +#: ../../library/pdb.rst:607 msgid "Quit from the debugger. The program being executed is aborted." msgstr "" -#: ../../library/pdb.rst:549 +#: ../../library/pdb.rst:611 msgid "" "Enter a recursive debugger that steps through *code* (which is an arbitrary " "expression or statement to be executed in the current environment)." msgstr "" -#: ../../library/pdb.rst:555 -msgid "Print the return value for the last return of a function." +#: ../../library/pdb.rst:617 +msgid "Print the return value for the last return of the current function." msgstr "" -#: ../../library/pdb.rst:558 +#: ../../library/pdb.rst:620 msgid "Footnotes" msgstr "註解" -#: ../../library/pdb.rst:559 +#: ../../library/pdb.rst:621 msgid "" "Whether a frame is considered to originate in a certain module is determined " "by the ``__name__`` in the frame globals." From 785217b89c326b02bee88a27d00dd8df8e52ad66 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 14 Apr 2023 00:31:30 +0000 Subject: [PATCH 067/130] sync with cpython 3b929a7b --- howto/enum.po | 208 ++++++++++++++++++++++++------------------------ library/enum.po | 92 ++++++++++----------- 2 files changed, 153 insertions(+), 147 deletions(-) diff --git a/howto/enum.po b/howto/enum.po index c531be1f56..ccf34e293c 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-07 00:27+0000\n" +"POT-Creation-Date: 2023-04-14 00:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -710,149 +710,153 @@ msgid "" msgstr "" #: ../../howto/enum.rst:840 +msgid "A ``data type`` is a mixin that defines :meth:`__new__`." +msgstr "" + +#: ../../howto/enum.rst:841 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " "``%h`` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../howto/enum.rst:843 +#: ../../howto/enum.rst:844 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:848 +#: ../../howto/enum.rst:849 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" -"`__str__` method has been reset to their data types :meth:`__str__` method." +"`__str__` method has been reset to their data types' :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:854 +#: ../../howto/enum.rst:855 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:856 +#: ../../howto/enum.rst:857 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:860 +#: ../../howto/enum.rst:861 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:887 +#: ../../howto/enum.rst:888 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:890 +#: ../../howto/enum.rst:891 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:892 +#: ../../howto/enum.rst:893 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:895 +#: ../../howto/enum.rst:896 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../howto/enum.rst:901 +#: ../../howto/enum.rst:902 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:903 +#: ../../howto/enum.rst:904 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:904 +#: ../../howto/enum.rst:905 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:906 +#: ../../howto/enum.rst:907 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:908 +#: ../../howto/enum.rst:909 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../howto/enum.rst:911 +#: ../../howto/enum.rst:912 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:913 +#: ../../howto/enum.rst:914 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:919 +#: ../../howto/enum.rst:920 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:922 +#: ../../howto/enum.rst:923 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../howto/enum.rst:925 +#: ../../howto/enum.rst:926 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:926 +#: ../../howto/enum.rst:927 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:928 +#: ../../howto/enum.rst:929 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:946 +#: ../../howto/enum.rst:947 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:951 +#: ../../howto/enum.rst:952 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:953 +#: ../../howto/enum.rst:954 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:960 +#: ../../howto/enum.rst:961 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:962 +#: ../../howto/enum.rst:963 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -860,22 +864,22 @@ msgid "" "and is supported." msgstr "" -#: ../../howto/enum.rst:971 +#: ../../howto/enum.rst:972 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:973 +#: ../../howto/enum.rst:974 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:985 +#: ../../howto/enum.rst:986 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:987 +#: ../../howto/enum.rst:988 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -884,137 +888,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:996 +#: ../../howto/enum.rst:997 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1000 +#: ../../howto/enum.rst:1001 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1002 +#: ../../howto/enum.rst:1003 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1013 +#: ../../howto/enum.rst:1014 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1015 +#: ../../howto/enum.rst:1016 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1033 +#: ../../howto/enum.rst:1034 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1035 +#: ../../howto/enum.rst:1036 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1046 +#: ../../howto/enum.rst:1047 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1048 +#: ../../howto/enum.rst:1049 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1049 +#: ../../howto/enum.rst:1050 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1050 +#: ../../howto/enum.rst:1051 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1055 +#: ../../howto/enum.rst:1056 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1064 +#: ../../howto/enum.rst:1065 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1069 +#: ../../howto/enum.rst:1070 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1080 +#: ../../howto/enum.rst:1081 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1086 +#: ../../howto/enum.rst:1087 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1095 +#: ../../howto/enum.rst:1096 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1098 +#: ../../howto/enum.rst:1099 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1099 +#: ../../howto/enum.rst:1100 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1100 +#: ../../howto/enum.rst:1101 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1104 +#: ../../howto/enum.rst:1105 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1102 +#: ../../howto/enum.rst:1103 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1103 +#: ../../howto/enum.rst:1104 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1104 +#: ../../howto/enum.rst:1105 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1106 +#: ../../howto/enum.rst:1107 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1114 +#: ../../howto/enum.rst:1115 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1117 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1121 +#: ../../howto/enum.rst:1122 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1123 +#: ../../howto/enum.rst:1124 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1025,11 +1029,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1132 +#: ../../howto/enum.rst:1133 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1134 +#: ../../howto/enum.rst:1135 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1038,11 +1042,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1140 +#: ../../howto/enum.rst:1141 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1142 +#: ../../howto/enum.rst:1143 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1051,37 +1055,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1148 +#: ../../howto/enum.rst:1149 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1150 +#: ../../howto/enum.rst:1151 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1156 +#: ../../howto/enum.rst:1157 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1158 +#: ../../howto/enum.rst:1159 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1164 +#: ../../howto/enum.rst:1165 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1174 +#: ../../howto/enum.rst:1175 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1177 +#: ../../howto/enum.rst:1178 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1089,149 +1093,149 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1184 +#: ../../howto/enum.rst:1185 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1186 +#: ../../howto/enum.rst:1187 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1189 +#: ../../howto/enum.rst:1190 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1190 +#: ../../howto/enum.rst:1191 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1191 +#: ../../howto/enum.rst:1192 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1192 +#: ../../howto/enum.rst:1193 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1195 +#: ../../howto/enum.rst:1196 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1201 +#: ../../howto/enum.rst:1202 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1203 +#: ../../howto/enum.rst:1204 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1215 +#: ../../howto/enum.rst:1216 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1217 +#: ../../howto/enum.rst:1218 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1227 +#: ../../howto/enum.rst:1228 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1243 +#: ../../howto/enum.rst:1244 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1245 +#: ../../howto/enum.rst:1246 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1257 +#: ../../howto/enum.rst:1258 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1259 +#: ../../howto/enum.rst:1260 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1276 +#: ../../howto/enum.rst:1277 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1286 +#: ../../howto/enum.rst:1287 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1305 +#: ../../howto/enum.rst:1306 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1311 +#: ../../howto/enum.rst:1312 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1313 +#: ../../howto/enum.rst:1314 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1347 +#: ../../howto/enum.rst:1348 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1349 +#: ../../howto/enum.rst:1350 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1374 +#: ../../howto/enum.rst:1375 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1380 +#: ../../howto/enum.rst:1381 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1382 +#: ../../howto/enum.rst:1383 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1411 +#: ../../howto/enum.rst:1412 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1413 +#: ../../howto/enum.rst:1414 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1432 +#: ../../howto/enum.rst:1433 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1434 +#: ../../howto/enum.rst:1435 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/library/enum.po b/library/enum.po index d7b1f024c9..228e5dcc46 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-04 00:30+0000\n" +"POT-Creation-Date: 2023-04-14 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -748,106 +748,108 @@ msgid "" msgstr "" #: ../../library/enum.rst:695 -msgid "Out-of-range values cause a :exc:`ValueError` to be raised::" +msgid "" +"Out-of-range values cause a :exc:`ValueError` to be raised. This is the " +"default for :class:`Flag`::" msgstr "" -#: ../../library/enum.rst:711 +#: ../../library/enum.rst:712 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " -"value. This is the default for :class:`Flag`::" +"value::" msgstr "" -#: ../../library/enum.rst:724 +#: ../../library/enum.rst:725 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "" -#: ../../library/enum.rst:736 +#: ../../library/enum.rst:737 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" msgstr "" -#: ../../library/enum.rst:752 +#: ../../library/enum.rst:753 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../library/enum.rst:754 +#: ../../library/enum.rst:755 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:757 +#: ../../library/enum.rst:758 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " "appropriately. Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:763 +#: ../../library/enum.rst:764 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../library/enum.rst:765 +#: ../../library/enum.rst:766 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../library/enum.rst:766 +#: ../../library/enum.rst:767 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../library/enum.rst:768 +#: ../../library/enum.rst:769 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../library/enum.rst:770 +#: ../../library/enum.rst:771 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../library/enum.rst:773 +#: ../../library/enum.rst:774 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:775 +#: ../../library/enum.rst:776 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "" -#: ../../library/enum.rst:780 +#: ../../library/enum.rst:781 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../library/enum.rst:783 +#: ../../library/enum.rst:784 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../library/enum.rst:786 +#: ../../library/enum.rst:787 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:787 +#: ../../library/enum.rst:788 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:792 +#: ../../library/enum.rst:793 msgid "Utilities and Decorators" msgstr "" -#: ../../library/enum.rst:796 +#: ../../library/enum.rst:797 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -858,58 +860,58 @@ msgid "" "manually specified values." msgstr "" -#: ../../library/enum.rst:804 +#: ../../library/enum.rst:805 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: ../../library/enum.rst:806 +#: ../../library/enum.rst:807 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: ../../library/enum.rst:807 +#: ../../library/enum.rst:808 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" -#: ../../library/enum.rst:808 +#: ../../library/enum.rst:809 msgid "used to create the ``SECOND`` enum member;" msgstr "" -#: ../../library/enum.rst:809 +#: ../../library/enum.rst:810 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:814 +#: ../../library/enum.rst:815 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "" -#: ../../library/enum.rst:817 +#: ../../library/enum.rst:818 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:820 +#: ../../library/enum.rst:821 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:826 +#: ../../library/enum.rst:827 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:830 +#: ../../library/enum.rst:831 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -917,29 +919,29 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:839 +#: ../../library/enum.rst:840 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:857 +#: ../../library/enum.rst:858 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:865 +#: ../../library/enum.rst:866 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:871 +#: ../../library/enum.rst:872 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:877 +#: ../../library/enum.rst:878 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -947,41 +949,41 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:887 +#: ../../library/enum.rst:888 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:894 +#: ../../library/enum.rst:895 msgid "Notes" msgstr "" -#: ../../library/enum.rst:896 +#: ../../library/enum.rst:897 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:898 +#: ../../library/enum.rst:899 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:901 +#: ../../library/enum.rst:902 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:903 +#: ../../library/enum.rst:904 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:906 +#: ../../library/enum.rst:907 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:913 +#: ../../library/enum.rst:914 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" From d9193c44543a33fc96cb358c1467c563fff0d716 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 17 Apr 2023 00:32:31 +0000 Subject: [PATCH 068/130] sync with cpython 4c4ef50e --- using/cmdline.po | 246 ++++++++++++++++++++++++----------------------- 1 file changed, 125 insertions(+), 121 deletions(-) diff --git a/using/cmdline.po b/using/cmdline.po index 49988ef389..911d1d2e5d 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-17 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -495,8 +495,8 @@ msgid "" "`sys.path`." msgstr "" -#: ../../using/cmdline.rst:388 ../../using/cmdline.rst:790 -#: ../../using/cmdline.rst:802 +#: ../../using/cmdline.rst:388 ../../using/cmdline.rst:793 +#: ../../using/cmdline.rst:805 msgid ":pep:`370` -- Per user site-packages directory" msgstr "" @@ -546,7 +546,7 @@ msgid "" "messages to :data:`sys.stderr`." msgstr "" -#: ../../using/cmdline.rst:430 ../../using/cmdline.rst:818 +#: ../../using/cmdline.rst:430 ../../using/cmdline.rst:821 msgid "" "The simplest settings apply a particular action unconditionally to all " "warnings emitted by a process (even those that are otherwise ignored by " @@ -619,7 +619,7 @@ msgid "" "can be used to use a regular expression on the warning message." msgstr "" -#: ../../using/cmdline.rst:480 ../../using/cmdline.rst:829 +#: ../../using/cmdline.rst:480 ../../using/cmdline.rst:832 msgid "" "See :ref:`warning-filter` and :ref:`describing-warning-filters` for more " "details." @@ -638,10 +638,12 @@ msgid "" msgstr "" #: ../../using/cmdline.rst:495 -msgid "``-X faulthandler`` to enable :mod:`faulthandler`;" +msgid "" +"``-X faulthandler`` to enable :mod:`faulthandler`. See also :envvar:" +"`PYTHONFAULTHANDLER`." msgstr "" -#: ../../using/cmdline.rst:496 +#: ../../using/cmdline.rst:497 msgid "" "``-X showrefcount`` to output the total reference count and number of used " "memory blocks when the program finishes or after each statement in the " @@ -649,23 +651,23 @@ msgid "" "build>`." msgstr "" -#: ../../using/cmdline.rst:500 +#: ../../using/cmdline.rst:501 msgid "" "``-X tracemalloc`` to start tracing Python memory allocations using the :mod:" "`tracemalloc` module. By default, only the most recent frame is stored in a " "traceback of a trace. Use ``-X tracemalloc=NFRAME`` to start tracing with a " -"traceback limit of *NFRAME* frames. See the :func:`tracemalloc.start` for " -"more information." +"traceback limit of *NFRAME* frames. See :func:`tracemalloc.start` and :" +"envvar:`PYTHONTRACEMALLOC` for more information." msgstr "" -#: ../../using/cmdline.rst:505 +#: ../../using/cmdline.rst:507 msgid "" "``-X int_max_str_digits`` configures the :ref:`integer string conversion " "length limitation `. See also :envvar:" "`PYTHONINTMAXSTRDIGITS`." msgstr "" -#: ../../using/cmdline.rst:508 +#: ../../using/cmdline.rst:510 msgid "" "``-X importtime`` to show how long each import takes. It shows module name, " "cumulative time (including nested imports) and self time (excluding nested " @@ -674,34 +676,34 @@ msgid "" "asyncio'``. See also :envvar:`PYTHONPROFILEIMPORTTIME`." msgstr "" -#: ../../using/cmdline.rst:513 +#: ../../using/cmdline.rst:515 msgid "" "``-X dev``: enable :ref:`Python Development Mode `, introducing " "additional runtime checks that are too expensive to be enabled by default." msgstr "" -#: ../../using/cmdline.rst:516 +#: ../../using/cmdline.rst:518 msgid "" "``-X utf8`` enables the :ref:`Python UTF-8 Mode `. ``-X utf8=0`` " "explicitly disables :ref:`Python UTF-8 Mode ` (even when it would " -"otherwise activate automatically)." +"otherwise activate automatically). See also :envvar:`PYTHONUTF8`." msgstr "" -#: ../../using/cmdline.rst:519 +#: ../../using/cmdline.rst:522 msgid "" "``-X pycache_prefix=PATH`` enables writing ``.pyc`` files to a parallel tree " "rooted at the given directory instead of to the code tree. See also :envvar:" "`PYTHONPYCACHEPREFIX`." msgstr "" -#: ../../using/cmdline.rst:522 +#: ../../using/cmdline.rst:525 msgid "" "``-X warn_default_encoding`` issues a :class:`EncodingWarning` when the " "locale-specific default encoding is used for opening files. See also :envvar:" "`PYTHONWARNDEFAULTENCODING`." msgstr "" -#: ../../using/cmdline.rst:525 +#: ../../using/cmdline.rst:528 msgid "" "``-X no_debug_ranges`` disables the inclusion of the tables mapping extra " "location information (end line, start column offset and end column offset) " @@ -711,7 +713,7 @@ msgid "" "envvar:`PYTHONNODEBUGRANGES`." msgstr "" -#: ../../using/cmdline.rst:531 +#: ../../using/cmdline.rst:534 msgid "" "``-X frozen_modules`` determines whether or not frozen modules are ignored " "by the import machinery. A value of \"on\" means they get imported and " @@ -722,81 +724,81 @@ msgid "" "are always used, even if this flag is set to \"off\"." msgstr "" -#: ../../using/cmdline.rst:539 +#: ../../using/cmdline.rst:542 msgid "" "It also allows passing arbitrary values and retrieving them through the :" "data:`sys._xoptions` dictionary." msgstr "" -#: ../../using/cmdline.rst:542 +#: ../../using/cmdline.rst:545 msgid "The :option:`-X` option was added." msgstr "新增 :option:`-X` 選項。" -#: ../../using/cmdline.rst:545 +#: ../../using/cmdline.rst:548 msgid "The ``-X faulthandler`` option." msgstr "``-X faulthandler`` 選項。" -#: ../../using/cmdline.rst:548 +#: ../../using/cmdline.rst:551 msgid "The ``-X showrefcount`` and ``-X tracemalloc`` options." msgstr "``-X showrefcount`` 和 ``-X tracemalloc`` 選項。" -#: ../../using/cmdline.rst:551 +#: ../../using/cmdline.rst:554 msgid "The ``-X showalloccount`` option." msgstr "``-X showalloccount`` 選項。" -#: ../../using/cmdline.rst:554 +#: ../../using/cmdline.rst:557 msgid "The ``-X importtime``, ``-X dev`` and ``-X utf8`` options." msgstr "``-X importtime``、``-X dev`` 和 ``-X utf8`` 選項。" -#: ../../using/cmdline.rst:557 +#: ../../using/cmdline.rst:560 msgid "" "The ``-X pycache_prefix`` option. The ``-X dev`` option now logs ``close()`` " "exceptions in :class:`io.IOBase` destructor." msgstr "" -#: ../../using/cmdline.rst:561 +#: ../../using/cmdline.rst:564 msgid "" "Using ``-X dev`` option, check *encoding* and *errors* arguments on string " "encoding and decoding operations." msgstr "" -#: ../../using/cmdline.rst:565 +#: ../../using/cmdline.rst:568 msgid "The ``-X showalloccount`` option has been removed." msgstr "``-X showalloccount`` 選項已被移除。" -#: ../../using/cmdline.rst:567 +#: ../../using/cmdline.rst:570 msgid "The ``-X warn_default_encoding`` option." msgstr "``-X warn_default_encoding`` 選項。" -#: ../../using/cmdline.rst:572 +#: ../../using/cmdline.rst:575 msgid "The ``-X oldparser`` option." msgstr "``-X oldparser`` 選項。" -#: ../../using/cmdline.rst:573 +#: ../../using/cmdline.rst:576 msgid "The ``-X no_debug_ranges`` option." msgstr "``-X no_debug_ranges`` 選項。" -#: ../../using/cmdline.rst:576 +#: ../../using/cmdline.rst:579 msgid "The ``-X frozen_modules`` option." msgstr "``-X frozen_modules`` 選項。" -#: ../../using/cmdline.rst:579 +#: ../../using/cmdline.rst:582 msgid "The ``-X int_max_str_digits`` option." msgstr "``-X int_max_str_digits`` 選項。" -#: ../../using/cmdline.rst:584 +#: ../../using/cmdline.rst:587 msgid "Options you shouldn't use" msgstr "你不該使用的選項" -#: ../../using/cmdline.rst:588 +#: ../../using/cmdline.rst:591 msgid "Reserved for use by Jython_." msgstr "" -#: ../../using/cmdline.rst:596 +#: ../../using/cmdline.rst:599 msgid "Environment variables" msgstr "環境變數" -#: ../../using/cmdline.rst:598 +#: ../../using/cmdline.rst:601 msgid "" "These environment variables influence Python's behavior, they are processed " "before the command-line switches other than -E or -I. It is customary that " @@ -804,7 +806,7 @@ msgid "" "conflict." msgstr "" -#: ../../using/cmdline.rst:605 +#: ../../using/cmdline.rst:608 msgid "" "Change the location of the standard Python libraries. By default, the " "libraries are searched in :file:`{prefix}/lib/python{version}` and :file:" @@ -813,14 +815,14 @@ msgid "" "file:`/usr/local`." msgstr "" -#: ../../using/cmdline.rst:611 +#: ../../using/cmdline.rst:614 msgid "" "When :envvar:`PYTHONHOME` is set to a single directory, its value replaces " "both :file:`{prefix}` and :file:`{exec_prefix}`. To specify different " "values for these, set :envvar:`PYTHONHOME` to :file:`{prefix}:{exec_prefix}`." msgstr "" -#: ../../using/cmdline.rst:618 +#: ../../using/cmdline.rst:621 msgid "" "Augment the default search path for module files. The format is the same as " "the shell's :envvar:`PATH`: one or more directory pathnames separated by :" @@ -828,21 +830,21 @@ msgid "" "existent directories are silently ignored." msgstr "" -#: ../../using/cmdline.rst:623 +#: ../../using/cmdline.rst:626 msgid "" "In addition to normal directories, individual :envvar:`PYTHONPATH` entries " "may refer to zipfiles containing pure Python modules (in either source or " "compiled form). Extension modules cannot be imported from zipfiles." msgstr "" -#: ../../using/cmdline.rst:627 +#: ../../using/cmdline.rst:630 msgid "" "The default search path is installation dependent, but generally begins " "with :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above). " "It is *always* appended to :envvar:`PYTHONPATH`." msgstr "" -#: ../../using/cmdline.rst:631 +#: ../../using/cmdline.rst:634 msgid "" "An additional directory will be inserted in the search path in front of :" "envvar:`PYTHONPATH` as described above under :ref:`using-on-interface-" @@ -850,19 +852,19 @@ msgid "" "the variable :data:`sys.path`." msgstr "" -#: ../../using/cmdline.rst:639 +#: ../../using/cmdline.rst:642 msgid "" "If this is set to a non-empty string, don't prepend a potentially unsafe " "path to :data:`sys.path`: see the :option:`-P` option for details." msgstr "" -#: ../../using/cmdline.rst:647 +#: ../../using/cmdline.rst:650 msgid "" "If this is set to a non-empty string, it overrides the :data:`sys." "platlibdir` value." msgstr "" -#: ../../using/cmdline.rst:655 +#: ../../using/cmdline.rst:658 msgid "" "If this is the name of a readable file, the Python commands in that file are " "executed before the first prompt is displayed in interactive mode. The file " @@ -879,20 +881,20 @@ msgid "" "argument ``filename``." msgstr "" -#: ../../using/cmdline.rst:664 +#: ../../using/cmdline.rst:667 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_startup`` with the " "filename as the argument when called on startup." msgstr "" -#: ../../using/cmdline.rst:670 +#: ../../using/cmdline.rst:673 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-O` option. If set to an integer, it is equivalent to specifying :" "option:`-O` multiple times." msgstr "" -#: ../../using/cmdline.rst:677 +#: ../../using/cmdline.rst:680 msgid "" "If this is set, it names a callable using dotted-path notation. The module " "containing the callable will be imported and then the callable will be run " @@ -903,52 +905,52 @@ msgid "" "breakpointhook` to do nothing but return immediately." msgstr "" -#: ../../using/cmdline.rst:689 +#: ../../using/cmdline.rst:692 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-d` option. If set to an integer, it is equivalent to specifying :" "option:`-d` multiple times." msgstr "" -#: ../../using/cmdline.rst:696 +#: ../../using/cmdline.rst:699 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-i` option." msgstr "" -#: ../../using/cmdline.rst:699 +#: ../../using/cmdline.rst:702 msgid "" "This variable can also be modified by Python code using :data:`os.environ` " "to force inspect mode on program termination." msgstr "" -#: ../../using/cmdline.rst:705 +#: ../../using/cmdline.rst:708 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-u` option." msgstr "" -#: ../../using/cmdline.rst:711 +#: ../../using/cmdline.rst:714 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-v` option. If set to an integer, it is equivalent to specifying :" "option:`-v` multiple times." msgstr "" -#: ../../using/cmdline.rst:718 +#: ../../using/cmdline.rst:721 msgid "" "If this is set, Python ignores case in :keyword:`import` statements. This " "only works on Windows and macOS." msgstr "" -#: ../../using/cmdline.rst:724 +#: ../../using/cmdline.rst:727 msgid "" "If this is set to a non-empty string, Python won't try to write ``.pyc`` " "files on the import of source modules. This is equivalent to specifying " "the :option:`-B` option." msgstr "" -#: ../../using/cmdline.rst:731 +#: ../../using/cmdline.rst:734 msgid "" "If this is set, Python will write ``.pyc`` files in a mirror directory tree " "at this path, instead of in ``__pycache__`` directories within the source " @@ -956,40 +958,40 @@ msgid "" "``pycache_prefix=PATH`` option." msgstr "" -#: ../../using/cmdline.rst:741 +#: ../../using/cmdline.rst:744 msgid "" "If this variable is not set or set to ``random``, a random value is used to " "seed the hashes of str and bytes objects." msgstr "" -#: ../../using/cmdline.rst:744 +#: ../../using/cmdline.rst:747 msgid "" "If :envvar:`PYTHONHASHSEED` is set to an integer value, it is used as a " "fixed seed for generating the hash() of the types covered by the hash " "randomization." msgstr "" -#: ../../using/cmdline.rst:748 +#: ../../using/cmdline.rst:751 msgid "" "Its purpose is to allow repeatable hashing, such as for selftests for the " "interpreter itself, or to allow a cluster of python processes to share hash " "values." msgstr "" -#: ../../using/cmdline.rst:752 +#: ../../using/cmdline.rst:755 msgid "" "The integer must be a decimal number in the range [0,4294967295]. " "Specifying the value 0 will disable hash randomization." msgstr "" -#: ../../using/cmdline.rst:759 +#: ../../using/cmdline.rst:762 msgid "" "If this variable is set to an integer, it is used to configure the " "interpreter's global :ref:`integer string conversion length limitation " "`." msgstr "" -#: ../../using/cmdline.rst:767 +#: ../../using/cmdline.rst:770 msgid "" "If this is set before running the interpreter, it overrides the encoding " "used for stdin/stdout/stderr, in the syntax ``encodingname:errorhandler``. " @@ -997,17 +999,17 @@ msgid "" "have the same meaning as in :func:`str.encode`." msgstr "" -#: ../../using/cmdline.rst:772 +#: ../../using/cmdline.rst:775 msgid "" "For stderr, the ``:errorhandler`` part is ignored; the handler will always " "be ``'backslashreplace'``." msgstr "" -#: ../../using/cmdline.rst:775 +#: ../../using/cmdline.rst:778 msgid "The ``encodingname`` part is now optional." msgstr "" -#: ../../using/cmdline.rst:778 +#: ../../using/cmdline.rst:781 msgid "" "On Windows, the encoding specified by this variable is ignored for " "interactive console buffers unless :envvar:`PYTHONLEGACYWINDOWSSTDIO` is " @@ -1015,13 +1017,13 @@ msgid "" "not affected." msgstr "" -#: ../../using/cmdline.rst:785 +#: ../../using/cmdline.rst:788 msgid "" "If this is set, Python won't add the :data:`user site-packages directory " "` to :data:`sys.path`." msgstr "" -#: ../../using/cmdline.rst:795 +#: ../../using/cmdline.rst:798 msgid "" "Defines the :data:`user base directory `, which is used to " "compute the path of the :data:`user site-packages directory ` of the :mod:`asyncio` module." msgstr "" -#: ../../using/cmdline.rst:874 +#: ../../using/cmdline.rst:879 msgid "Set the Python memory allocators and/or install debug hooks." msgstr "" -#: ../../using/cmdline.rst:876 +#: ../../using/cmdline.rst:881 msgid "Set the family of memory allocators used by Python:" msgstr "" -#: ../../using/cmdline.rst:878 +#: ../../using/cmdline.rst:883 msgid "" "``default``: use the :ref:`default memory allocators `." msgstr "" -#: ../../using/cmdline.rst:880 +#: ../../using/cmdline.rst:885 msgid "" "``malloc``: use the :c:func:`malloc` function of the C library for all " "domains (:c:data:`PYMEM_DOMAIN_RAW`, :c:data:`PYMEM_DOMAIN_MEM`, :c:data:" "`PYMEM_DOMAIN_OBJ`)." msgstr "" -#: ../../using/cmdline.rst:883 +#: ../../using/cmdline.rst:888 msgid "" "``pymalloc``: use the :ref:`pymalloc allocator ` for :c:data:" "`PYMEM_DOMAIN_MEM` and :c:data:`PYMEM_DOMAIN_OBJ` domains and use the :c:" "func:`malloc` function for the :c:data:`PYMEM_DOMAIN_RAW` domain." msgstr "" -#: ../../using/cmdline.rst:887 +#: ../../using/cmdline.rst:892 msgid "Install :ref:`debug hooks `:" msgstr "" -#: ../../using/cmdline.rst:889 +#: ../../using/cmdline.rst:894 msgid "" "``debug``: install debug hooks on top of the :ref:`default memory allocators " "`." msgstr "" -#: ../../using/cmdline.rst:891 +#: ../../using/cmdline.rst:896 msgid "``malloc_debug``: same as ``malloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:892 +#: ../../using/cmdline.rst:897 msgid "``pymalloc_debug``: same as ``pymalloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:894 +#: ../../using/cmdline.rst:899 msgid "Added the ``\"default\"`` allocator." msgstr "" -#: ../../using/cmdline.rst:902 +#: ../../using/cmdline.rst:907 msgid "" "If set to a non-empty string, Python will print statistics of the :ref:" "`pymalloc memory allocator ` every time a new pymalloc object " "arena is created, and on shutdown." msgstr "" -#: ../../using/cmdline.rst:906 +#: ../../using/cmdline.rst:911 msgid "" "This variable is ignored if the :envvar:`PYTHONMALLOC` environment variable " "is used to force the :c:func:`malloc` allocator of the C library, or if " "Python is configured without ``pymalloc`` support." msgstr "" -#: ../../using/cmdline.rst:910 +#: ../../using/cmdline.rst:915 msgid "" "This variable can now also be used on Python compiled in release mode. It " "now has no effect if set to an empty string." msgstr "" -#: ../../using/cmdline.rst:917 +#: ../../using/cmdline.rst:922 msgid "" "If set to a non-empty string, the default :term:`filesystem encoding and " "error handler` mode will revert to their pre-3.6 values of 'mbcs' and " @@ -1151,41 +1154,41 @@ msgid "" "'surrogatepass' are used." msgstr "" -#: ../../using/cmdline.rst:922 +#: ../../using/cmdline.rst:927 msgid "" "This may also be enabled at runtime with :func:`sys." "_enablelegacywindowsfsencoding()`." msgstr "" -#: ../../using/cmdline.rst:925 ../../using/cmdline.rst:939 +#: ../../using/cmdline.rst:930 ../../using/cmdline.rst:944 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../using/cmdline.rst:927 +#: ../../using/cmdline.rst:932 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../using/cmdline.rst:932 +#: ../../using/cmdline.rst:937 msgid "" "If set to a non-empty string, does not use the new console reader and " "writer. This means that Unicode characters will be encoded according to the " "active console code page, rather than using utf-8." msgstr "" -#: ../../using/cmdline.rst:936 +#: ../../using/cmdline.rst:941 msgid "" "This variable is ignored if the standard streams are redirected (to files or " "pipes) rather than referring to console buffers." msgstr "" -#: ../../using/cmdline.rst:946 +#: ../../using/cmdline.rst:951 msgid "" "If set to the value ``0``, causes the main Python command line application " "to skip coercing the legacy ASCII-based C and POSIX locales to a more " "capable UTF-8 based alternative." msgstr "" -#: ../../using/cmdline.rst:950 +#: ../../using/cmdline.rst:955 msgid "" "If this variable is *not* set (or is set to a value other than ``0``), the " "``LC_ALL`` locale override environment variable is also not set, and the " @@ -1196,19 +1199,19 @@ msgid "" "runtime:" msgstr "" -#: ../../using/cmdline.rst:958 +#: ../../using/cmdline.rst:963 msgid "``C.UTF-8``" msgstr "``C.UTF-8``" -#: ../../using/cmdline.rst:959 +#: ../../using/cmdline.rst:964 msgid "``C.utf8``" msgstr "``C.utf8``" -#: ../../using/cmdline.rst:960 +#: ../../using/cmdline.rst:965 msgid "``UTF-8``" msgstr "``UTF-8``" -#: ../../using/cmdline.rst:962 +#: ../../using/cmdline.rst:967 msgid "" "If setting one of these locale categories succeeds, then the ``LC_CTYPE`` " "environment variable will also be set accordingly in the current process " @@ -1221,7 +1224,7 @@ msgid "" "(such as Python's own :func:`locale.getdefaultlocale`)." msgstr "" -#: ../../using/cmdline.rst:972 +#: ../../using/cmdline.rst:977 msgid "" "Configuring one of these locales (either explicitly or via the above " "implicit locale coercion) automatically enables the ``surrogateescape`` :ref:" @@ -1231,7 +1234,7 @@ msgid "" "envvar:`PYTHONIOENCODING` as usual." msgstr "" -#: ../../using/cmdline.rst:979 +#: ../../using/cmdline.rst:984 msgid "" "For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause " "Python to emit warning messages on ``stderr`` if either the locale coercion " @@ -1239,7 +1242,7 @@ msgid "" "active when the Python runtime is initialized." msgstr "" -#: ../../using/cmdline.rst:984 +#: ../../using/cmdline.rst:989 msgid "" "Also note that even when locale coercion is disabled, or when it fails to " "find a suitable target locale, :envvar:`PYTHONUTF8` will still activate by " @@ -1248,46 +1251,47 @@ msgid "" "system interfaces." msgstr "" -#: ../../using/cmdline.rst:990 +#: ../../using/cmdline.rst:995 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../using/cmdline.rst:992 +#: ../../using/cmdline.rst:997 msgid "See :pep:`538` for more details." msgstr "更多細節請見 :pep:`538`\\ 。" -#: ../../using/cmdline.rst:998 +#: ../../using/cmdline.rst:1003 msgid "" "If this environment variable is set to a non-empty string, enable :ref:" "`Python Development Mode `, introducing additional runtime checks " -"that are too expensive to be enabled by default." +"that are too expensive to be enabled by default. This is equivalent to " +"setting the :option:`-X` ``dev`` option." msgstr "" -#: ../../using/cmdline.rst:1006 +#: ../../using/cmdline.rst:1012 msgid "If set to ``1``, enable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``1``,則啟用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1008 +#: ../../using/cmdline.rst:1014 msgid "If set to ``0``, disable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``0``,則停用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1010 +#: ../../using/cmdline.rst:1016 msgid "" "Setting any other non-empty string causes an error during interpreter " "initialisation." msgstr "" -#: ../../using/cmdline.rst:1017 +#: ../../using/cmdline.rst:1023 msgid "" "If this environment variable is set to a non-empty string, issue a :class:" "`EncodingWarning` when the locale-specific default encoding is used." msgstr "" -#: ../../using/cmdline.rst:1020 +#: ../../using/cmdline.rst:1026 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節請見 :ref:`io-encoding-warning`\\ 。" -#: ../../using/cmdline.rst:1026 +#: ../../using/cmdline.rst:1032 msgid "" "If this variable is set, it disables the inclusion of the tables mapping " "extra location information (end line, start column offset and end column " @@ -1296,30 +1300,30 @@ msgid "" "visual location indicators when the interpreter displays tracebacks." msgstr "" -#: ../../using/cmdline.rst:1037 +#: ../../using/cmdline.rst:1043 msgid "Debug-mode variables" msgstr "除錯模式變數" -#: ../../using/cmdline.rst:1041 +#: ../../using/cmdline.rst:1047 msgid "If set, Python will print threading debug info into stdout." msgstr "" -#: ../../using/cmdline.rst:1043 +#: ../../using/cmdline.rst:1049 msgid "Need a :ref:`debug build of Python `." msgstr "" -#: ../../using/cmdline.rst:1050 +#: ../../using/cmdline.rst:1056 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter." msgstr "" -#: ../../using/cmdline.rst:1053 ../../using/cmdline.rst:1060 +#: ../../using/cmdline.rst:1059 ../../using/cmdline.rst:1066 msgid "" "Need Python configured with the :option:`--with-trace-refs` build option." msgstr "" -#: ../../using/cmdline.rst:1057 +#: ../../using/cmdline.rst:1063 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter into a file called *FILENAME*." From f84f9ef964739326f3a99bf2112400b6148995ba Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 20 Apr 2023 00:30:44 +0000 Subject: [PATCH 069/130] sync with cpython 2b5dbd1f --- library/argparse.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/argparse.po b/library/argparse.po index 0db75ef049..08ecf5fb9b 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-26 13:06+0000\n" +"POT-Creation-Date: 2023-04-20 00:28+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -172,7 +172,7 @@ msgid "Number of times the argument can be used" msgstr "" #: ../../library/argparse.rst:70 -msgid ":class:`int`, ``'?'``, ``'*'``, ``'+'``, or ``argparse.REMAINDER``" +msgid ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" msgstr "" #: ../../library/argparse.rst:71 @@ -1904,9 +1904,9 @@ msgstr "" #: ../../library/argparse.rst:2187 msgid "" "These parsers do not support all the argparse features, and will raise " -"exceptions if unsupported features are used. In particular, subparsers, " -"``argparse.REMAINDER``, and mutually exclusive groups that include both " -"optionals and positionals are not supported." +"exceptions if unsupported features are used. In particular, subparsers, and " +"mutually exclusive groups that include both optionals and positionals are " +"not supported." msgstr "" #: ../../library/argparse.rst:2192 From 10e051001429f8dd0fb2da7b707183ccfba4d1a2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 23 Apr 2023 00:35:41 +0000 Subject: [PATCH 070/130] sync with cpython 050b6b34 --- library/functools.po | 178 +++---- library/multiprocessing.po | 964 ++++++++++++++++++------------------- 2 files changed, 575 insertions(+), 567 deletions(-) diff --git a/library/functools.po b/library/functools.po index 97b29d7a90..e373f1a9b4 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:32+0000\n" +"POT-Creation-Date: 2023-04-23 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,20 +53,28 @@ msgid "" "`lru_cache()` with a size limit." msgstr "" -#: ../../library/functools.rst:39 ../../library/functools.rst:273 +#: ../../library/functools.rst:39 ../../library/functools.rst:283 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/functools.rst:52 ../../library/functools.rst:146 +#: ../../library/functools.rst:52 ../../library/functools.rst:151 msgid "" -"The cache is threadsafe so the wrapped function can be used in multiple " -"threads." +"The cache is threadsafe so that the wrapped function can be used in multiple " +"threads. This means that the underlying data structure will remain coherent " +"during concurrent updates." msgstr "" -#: ../../library/functools.rst:60 +#: ../../library/functools.rst:56 ../../library/functools.rst:155 +msgid "" +"It is possible for the wrapped function to be called more than once if " +"another thread makes an additional call before the initial call has been " +"completed and cached." +msgstr "" + +#: ../../library/functools.rst:65 msgid "" "Transform a method of a class into a property whose value is computed once " "and then cached as a normal attribute for the life of the instance. Similar " @@ -74,22 +82,22 @@ msgid "" "computed properties of instances that are otherwise effectively immutable." msgstr "" -#: ../../library/functools.rst:65 ../../library/functools.rst:130 -#: ../../library/functools.rst:365 +#: ../../library/functools.rst:70 ../../library/functools.rst:135 +#: ../../library/functools.rst:375 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/functools.rst:76 +#: ../../library/functools.rst:81 msgid "" "The mechanics of :func:`cached_property` are somewhat different from :func:" "`property`. A regular property blocks attribute writes unless a setter is " "defined. In contrast, a *cached_property* allows writes." msgstr "" -#: ../../library/functools.rst:80 +#: ../../library/functools.rst:85 msgid "" "The *cached_property* decorator only runs on lookups and only when an " "attribute of the same name doesn't exist. When it does run, the " @@ -98,20 +106,20 @@ msgid "" "and it works like a normal attribute." msgstr "" -#: ../../library/functools.rst:86 +#: ../../library/functools.rst:91 msgid "" "The cached value can be cleared by deleting the attribute. This allows the " "*cached_property* method to run again." msgstr "" -#: ../../library/functools.rst:89 +#: ../../library/functools.rst:94 msgid "" "Note, this decorator interferes with the operation of :pep:`412` key-sharing " "dictionaries. This means that instance dictionaries can take more space " "than usual." msgstr "" -#: ../../library/functools.rst:93 +#: ../../library/functools.rst:98 msgid "" "Also, this decorator requires that the ``__dict__`` attribute on each " "instance be a mutable mapping. This means it will not work with some types, " @@ -121,14 +129,14 @@ msgid "" "such classes don't provide a ``__dict__`` attribute at all)." msgstr "" -#: ../../library/functools.rst:100 +#: ../../library/functools.rst:105 msgid "" "If a mutable mapping is not available or if space-efficient key sharing is " "desired, an effect similar to :func:`cached_property` can be achieved by a " "stacking :func:`property` on top of :func:`cache`::" msgstr "" -#: ../../library/functools.rst:118 +#: ../../library/functools.rst:123 msgid "" "Transform an old-style comparison function to a :term:`key function`. Used " "with tools that accept key functions (such as :func:`sorted`, :func:`min`, :" @@ -138,7 +146,7 @@ msgid "" "comparison functions." msgstr "" -#: ../../library/functools.rst:125 +#: ../../library/functools.rst:130 msgid "" "A comparison function is any callable that accepts two arguments, compares " "them, and returns a negative number for less-than, zero for equality, or a " @@ -146,25 +154,25 @@ msgid "" "one argument and returns another value to be used as the sort key." msgstr "" -#: ../../library/functools.rst:134 +#: ../../library/functools.rst:139 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functools.rst:142 +#: ../../library/functools.rst:147 msgid "" "Decorator to wrap a function with a memoizing callable that saves up to the " "*maxsize* most recent calls. It can save time when an expensive or I/O " "bound function is periodically called with the same arguments." msgstr "" -#: ../../library/functools.rst:149 +#: ../../library/functools.rst:159 msgid "" "Since a dictionary is used to cache results, the positional and keyword " "arguments to the function must be :term:`hashable`." msgstr "" -#: ../../library/functools.rst:152 +#: ../../library/functools.rst:162 msgid "" "Distinct argument patterns may be considered to be distinct calls with " "separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)`` " @@ -172,20 +180,20 @@ msgid "" "entries." msgstr "" -#: ../../library/functools.rst:157 +#: ../../library/functools.rst:167 msgid "" "If *user_function* is specified, it must be a callable. This allows the " "*lru_cache* decorator to be applied directly to a user function, leaving the " "*maxsize* at its default value of 128::" msgstr "" -#: ../../library/functools.rst:165 +#: ../../library/functools.rst:175 msgid "" "If *maxsize* is set to ``None``, the LRU feature is disabled and the cache " "can grow without bound." msgstr "" -#: ../../library/functools.rst:168 +#: ../../library/functools.rst:178 msgid "" "If *typed* is set to true, function arguments of different types will be " "cached separately. If *typed* is false, the implementation will usually " @@ -193,7 +201,7 @@ msgid "" "such as *str* and *int* may be cached separately even when *typed* is false.)" msgstr "" -#: ../../library/functools.rst:174 +#: ../../library/functools.rst:184 msgid "" "Note, type specificity applies only to the function's immediate arguments " "rather than their contents. The scalar arguments, ``Decimal(42)`` and " @@ -202,7 +210,7 @@ msgid "" "Fraction(42))`` are treated as equivalent." msgstr "" -#: ../../library/functools.rst:180 +#: ../../library/functools.rst:190 msgid "" "The wrapped function is instrumented with a :func:`cache_parameters` " "function that returns a new :class:`dict` showing the values for *maxsize* " @@ -210,7 +218,7 @@ msgid "" "has no effect." msgstr "" -#: ../../library/functools.rst:185 +#: ../../library/functools.rst:195 msgid "" "To help measure the effectiveness of the cache and tune the *maxsize* " "parameter, the wrapped function is instrumented with a :func:`cache_info` " @@ -218,32 +226,32 @@ msgid "" "*maxsize* and *currsize*." msgstr "" -#: ../../library/functools.rst:190 +#: ../../library/functools.rst:200 msgid "" "The decorator also provides a :func:`cache_clear` function for clearing or " "invalidating the cache." msgstr "" -#: ../../library/functools.rst:193 +#: ../../library/functools.rst:203 msgid "" "The original underlying function is accessible through the :attr:" "`__wrapped__` attribute. This is useful for introspection, for bypassing " "the cache, or for rewrapping the function with a different cache." msgstr "" -#: ../../library/functools.rst:197 +#: ../../library/functools.rst:207 msgid "" "The cache keeps references to the arguments and return values until they age " "out of the cache or until the cache is cleared." msgstr "" -#: ../../library/functools.rst:200 +#: ../../library/functools.rst:210 msgid "" "If a method is cached, the ``self`` instance argument is included in the " "cache. See :ref:`faq-cache-method-calls`" msgstr "" -#: ../../library/functools.rst:203 +#: ../../library/functools.rst:213 msgid "" "An `LRU (least recently used) cache `_ works best when the " @@ -253,7 +261,7 @@ msgid "" "long-running processes such as web servers." msgstr "" -#: ../../library/functools.rst:210 +#: ../../library/functools.rst:220 msgid "" "In general, the LRU cache should only be used when you want to reuse " "previously computed values. Accordingly, it doesn't make sense to cache " @@ -261,44 +269,44 @@ msgid "" "objects on each call, or impure functions such as time() or random()." msgstr "" -#: ../../library/functools.rst:215 +#: ../../library/functools.rst:225 msgid "Example of an LRU cache for static web content::" msgstr "" -#: ../../library/functools.rst:234 +#: ../../library/functools.rst:244 msgid "" "Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " "programming `_ technique::" msgstr "" -#: ../../library/functools.rst:254 +#: ../../library/functools.rst:264 msgid "Added the *typed* option." msgstr "新增 *typed* 選項。" -#: ../../library/functools.rst:257 +#: ../../library/functools.rst:267 msgid "Added the *user_function* option." msgstr "新增 *user_function* 選項。" -#: ../../library/functools.rst:260 +#: ../../library/functools.rst:270 msgid "Added the function :func:`cache_parameters`" msgstr "新增 :func:`cache_parameters` 函式。" -#: ../../library/functools.rst:265 +#: ../../library/functools.rst:275 msgid "" "Given a class defining one or more rich comparison ordering methods, this " "class decorator supplies the rest. This simplifies the effort involved in " "specifying all of the possible rich comparison operations:" msgstr "" -#: ../../library/functools.rst:269 +#: ../../library/functools.rst:279 msgid "" "The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, " "or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` " "method." msgstr "" -#: ../../library/functools.rst:293 +#: ../../library/functools.rst:303 msgid "" "While this decorator makes it easy to create well behaved totally ordered " "types, it *does* come at the cost of slower execution and more complex stack " @@ -307,7 +315,7 @@ msgid "" "rich comparison methods instead is likely to provide an easy speed boost." msgstr "" -#: ../../library/functools.rst:302 +#: ../../library/functools.rst:312 msgid "" "This decorator makes no attempt to override methods that have been declared " "in the class *or its superclasses*. Meaning that if a superclass defines a " @@ -315,13 +323,13 @@ msgid "" "the original method is abstract." msgstr "" -#: ../../library/functools.rst:309 +#: ../../library/functools.rst:319 msgid "" "Returning NotImplemented from the underlying comparison function for " "unrecognised types is now supported." msgstr "" -#: ../../library/functools.rst:315 +#: ../../library/functools.rst:325 msgid "" "Return a new :ref:`partial object` which when called will " "behave like *func* called with the positional arguments *args* and keyword " @@ -330,7 +338,7 @@ msgid "" "extend and override *keywords*. Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:331 +#: ../../library/functools.rst:341 msgid "" "The :func:`partial` is used for partial function application which " "\"freezes\" some portion of a function's arguments and/or keywords resulting " @@ -339,20 +347,20 @@ msgid "" "where the *base* argument defaults to two:" msgstr "" -#: ../../library/functools.rst:346 +#: ../../library/functools.rst:356 msgid "" "Return a new :class:`partialmethod` descriptor which behaves like :class:" "`partial` except that it is designed to be used as a method definition " "rather than being directly callable." msgstr "" -#: ../../library/functools.rst:350 +#: ../../library/functools.rst:360 msgid "" "*func* must be a :term:`descriptor` or a callable (objects which are both, " "like normal functions, are handled as descriptors)." msgstr "" -#: ../../library/functools.rst:353 +#: ../../library/functools.rst:363 msgid "" "When *func* is a descriptor (such as a normal Python function, :func:" "`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another " @@ -361,7 +369,7 @@ msgid "" "objects>` returned as the result." msgstr "" -#: ../../library/functools.rst:359 +#: ../../library/functools.rst:369 msgid "" "When *func* is a non-descriptor callable, an appropriate bound method is " "created dynamically. This behaves like a normal Python function when used as " @@ -370,7 +378,7 @@ msgid "" "`partialmethod` constructor." msgstr "" -#: ../../library/functools.rst:390 +#: ../../library/functools.rst:400 msgid "" "Apply *function* of two arguments cumulatively to the items of *iterable*, " "from left to right, so as to reduce the iterable to a single value. For " @@ -383,30 +391,30 @@ msgid "" "the first item is returned." msgstr "" -#: ../../library/functools.rst:399 +#: ../../library/functools.rst:409 msgid "Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:411 +#: ../../library/functools.rst:421 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " "intermediate values." msgstr "" -#: ../../library/functools.rst:416 +#: ../../library/functools.rst:426 msgid "" "Transform a function into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:419 +#: ../../library/functools.rst:429 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " "decorator. When defining a function using ``@singledispatch``, note that the " "dispatch happens on the type of the first argument::" msgstr "" -#: ../../library/functools.rst:430 +#: ../../library/functools.rst:440 msgid "" "To add overloaded implementations to the function, use the :func:`register` " "attribute of the generic function, which can be used as a decorator. For " @@ -414,36 +422,36 @@ msgid "" "first argument automatically::" msgstr "" -#: ../../library/functools.rst:448 +#: ../../library/functools.rst:458 msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::" msgstr "" -#: ../../library/functools.rst:465 +#: ../../library/functools.rst:475 msgid "" "For code which doesn't use type annotations, the appropriate type argument " "can be passed explicitly to the decorator itself::" msgstr "" -#: ../../library/functools.rst:476 +#: ../../library/functools.rst:486 msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " "the :func:`register` attribute can also be used in a functional form::" msgstr "" -#: ../../library/functools.rst:484 +#: ../../library/functools.rst:494 msgid "" "The :func:`register` attribute returns the undecorated function. This " "enables decorator stacking, :mod:`pickling`, and the creation of " "unit tests for each variant independently::" msgstr "" -#: ../../library/functools.rst:498 +#: ../../library/functools.rst:508 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "" -#: ../../library/functools.rst:518 +#: ../../library/functools.rst:528 msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " @@ -452,42 +460,42 @@ msgid "" "found." msgstr "" -#: ../../library/functools.rst:524 +#: ../../library/functools.rst:534 msgid "" "If an implementation is registered to an :term:`abstract base class`, " "virtual subclasses of the base class will be dispatched to that " "implementation::" msgstr "" -#: ../../library/functools.rst:539 +#: ../../library/functools.rst:549 msgid "" "To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" -#: ../../library/functools.rst:547 +#: ../../library/functools.rst:557 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "" -#: ../../library/functools.rst:561 +#: ../../library/functools.rst:571 msgid "The :func:`register` attribute now supports using type annotations." msgstr "" -#: ../../library/functools.rst:564 +#: ../../library/functools.rst:574 msgid "" "The :func:`register` attribute now supports :data:`types.UnionType` and :" "data:`typing.Union` as type annotations." msgstr "" -#: ../../library/functools.rst:571 +#: ../../library/functools.rst:581 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:574 +#: ../../library/functools.rst:584 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. When defining a function using ``@singledispatchmethod``, note " @@ -495,7 +503,7 @@ msgid "" "argument::" msgstr "" -#: ../../library/functools.rst:592 +#: ../../library/functools.rst:602 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" "func:`@classmethod`. Note that to allow for ``dispatcher." @@ -504,14 +512,14 @@ msgid "" "rather than an instance of the class::" msgstr "" -#: ../../library/functools.rst:614 +#: ../../library/functools.rst:624 msgid "" "The same pattern can be used for other similar decorators: :func:" "`@staticmethod`, :func:`@abstractmethod`, " "and others." msgstr "" -#: ../../library/functools.rst:623 +#: ../../library/functools.rst:633 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -525,7 +533,7 @@ msgid "" "``__dict__``, i.e. the instance dictionary)." msgstr "" -#: ../../library/functools.rst:633 +#: ../../library/functools.rst:643 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -533,7 +541,7 @@ msgid "" "that refers to the function being wrapped." msgstr "" -#: ../../library/functools.rst:638 +#: ../../library/functools.rst:648 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -542,7 +550,7 @@ msgid "" "is typically less than helpful." msgstr "" -#: ../../library/functools.rst:644 +#: ../../library/functools.rst:654 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -551,26 +559,26 @@ msgid "" "wrapper function itself is missing any attributes named in *updated*." msgstr "" -#: ../../library/functools.rst:650 +#: ../../library/functools.rst:660 msgid "Automatic addition of the ``__wrapped__`` attribute." msgstr "" -#: ../../library/functools.rst:653 +#: ../../library/functools.rst:663 msgid "Copying of the ``__annotations__`` attribute by default." msgstr "" -#: ../../library/functools.rst:656 +#: ../../library/functools.rst:666 msgid "Missing attributes no longer trigger an :exc:`AttributeError`." msgstr "" -#: ../../library/functools.rst:659 +#: ../../library/functools.rst:669 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -#: ../../library/functools.rst:667 +#: ../../library/functools.rst:677 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -578,42 +586,42 @@ msgid "" "updated=updated)``. For example::" msgstr "" -#: ../../library/functools.rst:693 +#: ../../library/functools.rst:703 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" "`example` would have been lost." msgstr "" -#: ../../library/functools.rst:701 +#: ../../library/functools.rst:711 msgid ":class:`partial` Objects" msgstr ":class:`partial` 物件" -#: ../../library/functools.rst:703 +#: ../../library/functools.rst:713 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" msgstr "" -#: ../../library/functools.rst:709 +#: ../../library/functools.rst:719 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." msgstr "" -#: ../../library/functools.rst:715 +#: ../../library/functools.rst:725 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." msgstr "" -#: ../../library/functools.rst:721 +#: ../../library/functools.rst:731 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" -#: ../../library/functools.rst:724 +#: ../../library/functools.rst:734 msgid "" ":class:`partial` objects are like :class:`function` objects in that they are " "callable, weak referencable, and can have attributes. There are some " diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 8794312b90..a3cc2f02e4 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-12 00:29+0000\n" +"POT-Creation-Date: 2023-04-23 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -165,7 +165,7 @@ msgid "" "pipes." msgstr "" -#: ../../library/multiprocessing.rst:142 ../../library/multiprocessing.rst:1072 +#: ../../library/multiprocessing.rst:142 ../../library/multiprocessing.rst:1070 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " @@ -399,38 +399,38 @@ msgid "" "importable by the children. This is covered in :ref:`multiprocessing-" "programming` however it is worth pointing out here. This means that some " "examples, such as the :class:`multiprocessing.pool.Pool` examples will not " -"work in the interactive interpreter. For example:" +"work in the interactive interpreter. For example::" msgstr "" -#: ../../library/multiprocessing.rst:469 +#: ../../library/multiprocessing.rst:467 msgid "" "(If you try this it will actually output three full tracebacks interleaved " "in a semi-random fashion, and then you may have to stop the parent process " "somehow.)" msgstr "" -#: ../../library/multiprocessing.rst:475 +#: ../../library/multiprocessing.rst:473 msgid "Reference" msgstr "" -#: ../../library/multiprocessing.rst:477 +#: ../../library/multiprocessing.rst:475 msgid "" "The :mod:`multiprocessing` package mostly replicates the API of the :mod:" "`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:482 +#: ../../library/multiprocessing.rst:480 msgid ":class:`Process` and exceptions" msgstr ":class:`Process` 與例外" -#: ../../library/multiprocessing.rst:487 +#: ../../library/multiprocessing.rst:485 msgid "" "Process objects represent activity that is run in a separate process. The :" "class:`Process` class has equivalents of all the methods of :class:" "`threading.Thread`." msgstr "" -#: ../../library/multiprocessing.rst:491 +#: ../../library/multiprocessing.rst:489 msgid "" "The constructor should always be called with keyword arguments. *group* " "should always be ``None``; it exists solely for compatibility with :class:" @@ -444,29 +444,29 @@ msgid "" "creating process." msgstr "" -#: ../../library/multiprocessing.rst:502 +#: ../../library/multiprocessing.rst:500 msgid "" "By default, no arguments are passed to *target*. The *args* argument, which " "defaults to ``()``, can be used to specify a list or tuple of the arguments " "to pass to *target*." msgstr "" -#: ../../library/multiprocessing.rst:506 +#: ../../library/multiprocessing.rst:504 msgid "" "If a subclass overrides the constructor, it must make sure it invokes the " "base class constructor (:meth:`Process.__init__`) before doing anything else " "to the process." msgstr "" -#: ../../library/multiprocessing.rst:510 +#: ../../library/multiprocessing.rst:508 msgid "Added the *daemon* argument." msgstr "新增 *daemon* 引數。" -#: ../../library/multiprocessing.rst:515 +#: ../../library/multiprocessing.rst:513 msgid "Method representing the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:517 +#: ../../library/multiprocessing.rst:515 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the target " @@ -474,30 +474,30 @@ msgid "" "*args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/multiprocessing.rst:522 +#: ../../library/multiprocessing.rst:520 msgid "" "Using a list or tuple as the *args* argument passed to :class:`Process` " "achieves the same effect." msgstr "" -#: ../../library/multiprocessing.rst:525 +#: ../../library/multiprocessing.rst:523 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/multiprocessing.rst:537 +#: ../../library/multiprocessing.rst:535 msgid "Start the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:539 +#: ../../library/multiprocessing.rst:537 msgid "" "This must be called at most once per process object. It arranges for the " "object's :meth:`run` method to be invoked in a separate process." msgstr "" -#: ../../library/multiprocessing.rst:544 +#: ../../library/multiprocessing.rst:542 msgid "" "If the optional argument *timeout* is ``None`` (the default), the method " "blocks until the process whose :meth:`join` method is called terminates. If " @@ -507,23 +507,23 @@ msgid "" "terminated." msgstr "" -#: ../../library/multiprocessing.rst:551 +#: ../../library/multiprocessing.rst:549 msgid "A process can be joined many times." msgstr "" -#: ../../library/multiprocessing.rst:553 +#: ../../library/multiprocessing.rst:551 msgid "" "A process cannot join itself because this would cause a deadlock. It is an " "error to attempt to join a process before it has been started." msgstr "" -#: ../../library/multiprocessing.rst:558 +#: ../../library/multiprocessing.rst:556 msgid "" "The process's name. The name is a string used for identification purposes " "only. It has no semantics. Multiple processes may be given the same name." msgstr "" -#: ../../library/multiprocessing.rst:562 +#: ../../library/multiprocessing.rst:560 msgid "" "The initial name is set by the constructor. If no explicit name is provided " "to the constructor, a name of the form 'Process-N\\ :sub:`1`:N\\ :sub:" @@ -531,33 +531,33 @@ msgid "" "child of its parent." msgstr "" -#: ../../library/multiprocessing.rst:569 +#: ../../library/multiprocessing.rst:567 msgid "Return whether the process is alive." msgstr "" -#: ../../library/multiprocessing.rst:571 +#: ../../library/multiprocessing.rst:569 msgid "" "Roughly, a process object is alive from the moment the :meth:`start` method " "returns until the child process terminates." msgstr "" -#: ../../library/multiprocessing.rst:576 +#: ../../library/multiprocessing.rst:574 msgid "" "The process's daemon flag, a Boolean value. This must be set before :meth:" "`start` is called." msgstr "" -#: ../../library/multiprocessing.rst:579 +#: ../../library/multiprocessing.rst:577 msgid "The initial value is inherited from the creating process." msgstr "" -#: ../../library/multiprocessing.rst:581 +#: ../../library/multiprocessing.rst:579 msgid "" "When a process exits, it attempts to terminate all of its daemonic child " "processes." msgstr "" -#: ../../library/multiprocessing.rst:584 +#: ../../library/multiprocessing.rst:582 msgid "" "Note that a daemonic process is not allowed to create child processes. " "Otherwise a daemonic process would leave its children orphaned if it gets " @@ -566,92 +566,92 @@ msgid "" "(and not joined) if non-daemonic processes have exited." msgstr "" -#: ../../library/multiprocessing.rst:590 +#: ../../library/multiprocessing.rst:588 msgid "" "In addition to the :class:`threading.Thread` API, :class:`Process` objects " "also support the following attributes and methods:" msgstr "" -#: ../../library/multiprocessing.rst:595 +#: ../../library/multiprocessing.rst:593 msgid "" "Return the process ID. Before the process is spawned, this will be ``None``." msgstr "" -#: ../../library/multiprocessing.rst:600 +#: ../../library/multiprocessing.rst:598 msgid "" "The child's exit code. This will be ``None`` if the process has not yet " "terminated." msgstr "" -#: ../../library/multiprocessing.rst:603 +#: ../../library/multiprocessing.rst:601 msgid "" "If the child's :meth:`run` method returned normally, the exit code will be " "0. If it terminated via :func:`sys.exit` with an integer argument *N*, the " "exit code will be *N*." msgstr "" -#: ../../library/multiprocessing.rst:607 +#: ../../library/multiprocessing.rst:605 msgid "" "If the child terminated due to an exception not caught within :meth:`run`, " "the exit code will be 1. If it was terminated by signal *N*, the exit code " "will be the negative value *-N*." msgstr "" -#: ../../library/multiprocessing.rst:613 +#: ../../library/multiprocessing.rst:611 msgid "The process's authentication key (a byte string)." msgstr "" -#: ../../library/multiprocessing.rst:615 +#: ../../library/multiprocessing.rst:613 msgid "" "When :mod:`multiprocessing` is initialized the main process is assigned a " "random string using :func:`os.urandom`." msgstr "" -#: ../../library/multiprocessing.rst:618 +#: ../../library/multiprocessing.rst:616 msgid "" "When a :class:`Process` object is created, it will inherit the " "authentication key of its parent process, although this may be changed by " "setting :attr:`authkey` to another byte string." msgstr "" -#: ../../library/multiprocessing.rst:622 +#: ../../library/multiprocessing.rst:620 msgid "See :ref:`multiprocessing-auth-keys`." msgstr "參閱 :ref:`multiprocessing-auth-keys`\\ 。" -#: ../../library/multiprocessing.rst:626 +#: ../../library/multiprocessing.rst:624 msgid "" "A numeric handle of a system object which will become \"ready\" when the " "process ends." msgstr "" -#: ../../library/multiprocessing.rst:629 +#: ../../library/multiprocessing.rst:627 msgid "" "You can use this value if you want to wait on several events at once using :" "func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join()` is " "simpler." msgstr "" -#: ../../library/multiprocessing.rst:633 +#: ../../library/multiprocessing.rst:631 msgid "" "On Windows, this is an OS handle usable with the ``WaitForSingleObject`` and " "``WaitForMultipleObjects`` family of API calls. On Unix, this is a file " "descriptor usable with primitives from the :mod:`select` module." msgstr "" -#: ../../library/multiprocessing.rst:641 +#: ../../library/multiprocessing.rst:639 msgid "" "Terminate the process. On Unix this is done using the ``SIGTERM`` signal; " "on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and " "finally clauses, etc., will not be executed." msgstr "" -#: ../../library/multiprocessing.rst:645 +#: ../../library/multiprocessing.rst:643 msgid "" "Note that descendant processes of the process will *not* be terminated -- " "they will simply become orphaned." msgstr "" -#: ../../library/multiprocessing.rst:650 +#: ../../library/multiprocessing.rst:648 msgid "" "If this method is used when the associated process is using a pipe or queue " "then the pipe or queue is liable to become corrupted and may become unusable " @@ -660,11 +660,11 @@ msgid "" "deadlock." msgstr "" -#: ../../library/multiprocessing.rst:658 +#: ../../library/multiprocessing.rst:656 msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on Unix." msgstr "" -#: ../../library/multiprocessing.rst:664 +#: ../../library/multiprocessing.rst:662 msgid "" "Close the :class:`Process` object, releasing all resources associated with " "it. :exc:`ValueError` is raised if the underlying process is still " @@ -672,59 +672,59 @@ msgid "" "attributes of the :class:`Process` object will raise :exc:`ValueError`." msgstr "" -#: ../../library/multiprocessing.rst:672 +#: ../../library/multiprocessing.rst:670 msgid "" "Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:" "`terminate` and :attr:`exitcode` methods should only be called by the " "process that created the process object." msgstr "" -#: ../../library/multiprocessing.rst:676 +#: ../../library/multiprocessing.rst:674 msgid "Example usage of some of the methods of :class:`Process`:" msgstr "" -#: ../../library/multiprocessing.rst:696 +#: ../../library/multiprocessing.rst:694 msgid "The base class of all :mod:`multiprocessing` exceptions." msgstr "" -#: ../../library/multiprocessing.rst:700 +#: ../../library/multiprocessing.rst:698 msgid "" "Exception raised by :meth:`Connection.recv_bytes_into()` when the supplied " "buffer object is too small for the message read." msgstr "" -#: ../../library/multiprocessing.rst:703 +#: ../../library/multiprocessing.rst:701 msgid "" "If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will " "give the message as a byte string." msgstr "" -#: ../../library/multiprocessing.rst:708 +#: ../../library/multiprocessing.rst:706 msgid "Raised when there is an authentication error." msgstr "" -#: ../../library/multiprocessing.rst:712 +#: ../../library/multiprocessing.rst:710 msgid "Raised by methods with a timeout when the timeout expires." msgstr "" -#: ../../library/multiprocessing.rst:715 +#: ../../library/multiprocessing.rst:713 msgid "Pipes and Queues" msgstr "" -#: ../../library/multiprocessing.rst:717 +#: ../../library/multiprocessing.rst:715 msgid "" "When using multiple processes, one generally uses message passing for " "communication between processes and avoids having to use any synchronization " "primitives like locks." msgstr "" -#: ../../library/multiprocessing.rst:721 +#: ../../library/multiprocessing.rst:719 msgid "" "For passing messages one can use :func:`Pipe` (for a connection between two " "processes) or a queue (which allows multiple producers and consumers)." msgstr "" -#: ../../library/multiprocessing.rst:724 +#: ../../library/multiprocessing.rst:722 msgid "" "The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types " "are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` queues " @@ -734,7 +734,7 @@ msgid "" "Queue` class." msgstr "" -#: ../../library/multiprocessing.rst:731 +#: ../../library/multiprocessing.rst:729 msgid "" "If you use :class:`JoinableQueue` then you **must** call :meth:" "`JoinableQueue.task_done` for each task removed from the queue or else the " @@ -742,20 +742,20 @@ msgid "" "overflow, raising an exception." msgstr "" -#: ../../library/multiprocessing.rst:736 +#: ../../library/multiprocessing.rst:734 msgid "" "Note that one can also create a shared queue by using a manager object -- " "see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:741 +#: ../../library/multiprocessing.rst:739 msgid "" ":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." "Full` exceptions to signal a timeout. They are not available in the :mod:" "`multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:748 +#: ../../library/multiprocessing.rst:746 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -764,14 +764,14 @@ msgid "" "a queue created with a :ref:`manager `." msgstr "" -#: ../../library/multiprocessing.rst:755 +#: ../../library/multiprocessing.rst:753 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -#: ../../library/multiprocessing.rst:760 +#: ../../library/multiprocessing.rst:758 msgid "" "If multiple processes are enqueuing objects, it is possible for the objects " "to be received at the other end out-of-order. However, objects enqueued by " @@ -779,7 +779,7 @@ msgid "" "other." msgstr "" -#: ../../library/multiprocessing.rst:767 +#: ../../library/multiprocessing.rst:765 msgid "" "If a process is killed using :meth:`Process.terminate` or :func:`os.kill` " "while it is trying to use a :class:`Queue`, then the data in the queue is " @@ -787,7 +787,7 @@ msgid "" "exception when it tries to use the queue later on." msgstr "" -#: ../../library/multiprocessing.rst:774 +#: ../../library/multiprocessing.rst:772 msgid "" "As mentioned above, if a child process has put items on a queue (and it has " "not used :meth:`JoinableQueue.cancel_join_thread ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1133 +#: ../../library/multiprocessing.rst:1131 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1136 +#: ../../library/multiprocessing.rst:1134 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/multiprocessing.rst:1141 +#: ../../library/multiprocessing.rst:1139 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1148 +#: ../../library/multiprocessing.rst:1146 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1152 +#: ../../library/multiprocessing.rst:1150 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1154 +#: ../../library/multiprocessing.rst:1152 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1158 +#: ../../library/multiprocessing.rst:1156 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1160 +#: ../../library/multiprocessing.rst:1158 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: ../../library/multiprocessing.rst:1164 +#: ../../library/multiprocessing.rst:1162 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1169 +#: ../../library/multiprocessing.rst:1167 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1171 +#: ../../library/multiprocessing.rst:1169 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1273,7 +1273,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1178 +#: ../../library/multiprocessing.rst:1176 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1281,19 +1281,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1183 +#: ../../library/multiprocessing.rst:1181 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: ../../library/multiprocessing.rst:1187 +#: ../../library/multiprocessing.rst:1185 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1194 +#: ../../library/multiprocessing.rst:1192 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1301,45 +1301,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1200 +#: ../../library/multiprocessing.rst:1198 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: ../../library/multiprocessing.rst:1205 +#: ../../library/multiprocessing.rst:1203 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: ../../library/multiprocessing.rst:1209 +#: ../../library/multiprocessing.rst:1207 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1213 +#: ../../library/multiprocessing.rst:1211 msgid "" "Connection objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1218 +#: ../../library/multiprocessing.rst:1216 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1243 +#: ../../library/multiprocessing.rst:1241 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1247 +#: ../../library/multiprocessing.rst:1245 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1347,73 +1347,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1254 +#: ../../library/multiprocessing.rst:1252 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1260 +#: ../../library/multiprocessing.rst:1258 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1264 +#: ../../library/multiprocessing.rst:1262 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1268 +#: ../../library/multiprocessing.rst:1266 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1273 +#: ../../library/multiprocessing.rst:1271 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1279 +#: ../../library/multiprocessing.rst:1277 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1282 -#: ../../library/multiprocessing.rst:1420 +#: ../../library/multiprocessing.rst:1280 +#: ../../library/multiprocessing.rst:1418 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1286 +#: ../../library/multiprocessing.rst:1284 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1291 +#: ../../library/multiprocessing.rst:1289 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1293 +#: ../../library/multiprocessing.rst:1291 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1296 -#: ../../library/multiprocessing.rst:1845 +#: ../../library/multiprocessing.rst:1294 +#: ../../library/multiprocessing.rst:1843 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1301 +#: ../../library/multiprocessing.rst:1299 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1306 +#: ../../library/multiprocessing.rst:1304 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -1424,25 +1424,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1314 +#: ../../library/multiprocessing.rst:1312 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1318 +#: ../../library/multiprocessing.rst:1316 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1323 -#: ../../library/multiprocessing.rst:1374 +#: ../../library/multiprocessing.rst:1321 +#: ../../library/multiprocessing.rst:1372 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1325 +#: ../../library/multiprocessing.rst:1323 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -1450,14 +1450,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1330 +#: ../../library/multiprocessing.rst:1328 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1334 +#: ../../library/multiprocessing.rst:1332 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -1471,19 +1471,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1349 +#: ../../library/multiprocessing.rst:1347 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: ../../library/multiprocessing.rst:1352 +#: ../../library/multiprocessing.rst:1350 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:1358 +#: ../../library/multiprocessing.rst:1356 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -1492,20 +1492,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1364 +#: ../../library/multiprocessing.rst:1362 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1368 +#: ../../library/multiprocessing.rst:1366 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1376 +#: ../../library/multiprocessing.rst:1374 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -1518,7 +1518,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1386 +#: ../../library/multiprocessing.rst:1384 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -1529,14 +1529,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1394 +#: ../../library/multiprocessing.rst:1392 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1401 +#: ../../library/multiprocessing.rst:1399 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -1546,7 +1546,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1409 +#: ../../library/multiprocessing.rst:1407 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -1555,17 +1555,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1418 +#: ../../library/multiprocessing.rst:1416 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1425 +#: ../../library/multiprocessing.rst:1423 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: ../../library/multiprocessing.rst:1430 +#: ../../library/multiprocessing.rst:1428 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1574,13 +1574,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1436 +#: ../../library/multiprocessing.rst:1434 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1441 +#: ../../library/multiprocessing.rst:1439 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1589,32 +1589,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1449 +#: ../../library/multiprocessing.rst:1447 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1451 +#: ../../library/multiprocessing.rst:1449 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1456 +#: ../../library/multiprocessing.rst:1454 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: ../../library/multiprocessing.rst:1460 -#: ../../library/multiprocessing.rst:1547 +#: ../../library/multiprocessing.rst:1458 +#: ../../library/multiprocessing.rst:1545 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: ../../library/multiprocessing.rst:1464 +#: ../../library/multiprocessing.rst:1462 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -1624,32 +1624,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1471 +#: ../../library/multiprocessing.rst:1469 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: ../../library/multiprocessing.rst:1477 +#: ../../library/multiprocessing.rst:1475 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1483 -#: ../../library/multiprocessing.rst:1573 -#: ../../library/multiprocessing.rst:1588 +#: ../../library/multiprocessing.rst:1481 +#: ../../library/multiprocessing.rst:1571 +#: ../../library/multiprocessing.rst:1586 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1487 +#: ../../library/multiprocessing.rst:1485 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: ../../library/multiprocessing.rst:1490 +#: ../../library/multiprocessing.rst:1488 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1659,7 +1659,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1497 +#: ../../library/multiprocessing.rst:1495 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -1669,28 +1669,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1504 +#: ../../library/multiprocessing.rst:1502 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1506 +#: ../../library/multiprocessing.rst:1504 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1511 +#: ../../library/multiprocessing.rst:1509 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1516 +#: ../../library/multiprocessing.rst:1514 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1522 +#: ../../library/multiprocessing.rst:1520 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -1699,11 +1699,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1530 +#: ../../library/multiprocessing.rst:1528 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1532 +#: ../../library/multiprocessing.rst:1530 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1713,40 +1713,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1539 +#: ../../library/multiprocessing.rst:1537 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1545 +#: ../../library/multiprocessing.rst:1543 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1551 +#: ../../library/multiprocessing.rst:1549 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1555 +#: ../../library/multiprocessing.rst:1553 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1561 +#: ../../library/multiprocessing.rst:1559 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1565 -#: ../../library/multiprocessing.rst:1581 +#: ../../library/multiprocessing.rst:1563 +#: ../../library/multiprocessing.rst:1579 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -1756,121 +1756,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1577 +#: ../../library/multiprocessing.rst:1575 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1592 +#: ../../library/multiprocessing.rst:1590 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1597 +#: ../../library/multiprocessing.rst:1595 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1601 +#: ../../library/multiprocessing.rst:1599 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1605 +#: ../../library/multiprocessing.rst:1603 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1608 +#: ../../library/multiprocessing.rst:1606 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1612 +#: ../../library/multiprocessing.rst:1610 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1615 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1615 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1615 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1617 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1617 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1617 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1618 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1618 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1621 +#: ../../library/multiprocessing.rst:1619 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1621 +#: ../../library/multiprocessing.rst:1619 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1621 +#: ../../library/multiprocessing.rst:1619 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1622 +#: ../../library/multiprocessing.rst:1620 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1622 +#: ../../library/multiprocessing.rst:1620 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1622 +#: ../../library/multiprocessing.rst:1620 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1626 +#: ../../library/multiprocessing.rst:1624 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1664 +#: ../../library/multiprocessing.rst:1662 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1677 +#: ../../library/multiprocessing.rst:1675 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1679 +#: ../../library/multiprocessing.rst:1677 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1879,7 +1879,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1688 +#: ../../library/multiprocessing.rst:1686 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1887,31 +1887,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1696 +#: ../../library/multiprocessing.rst:1694 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: ../../library/multiprocessing.rst:1702 +#: ../../library/multiprocessing.rst:1700 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1704 +#: ../../library/multiprocessing.rst:1702 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: ../../library/multiprocessing.rst:1707 +#: ../../library/multiprocessing.rst:1705 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: ../../library/multiprocessing.rst:1710 +#: ../../library/multiprocessing.rst:1708 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -1919,19 +1919,19 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1715 +#: ../../library/multiprocessing.rst:1713 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1718 +#: ../../library/multiprocessing.rst:1716 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:1721 +#: ../../library/multiprocessing.rst:1719 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -1939,54 +1939,54 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1726 +#: ../../library/multiprocessing.rst:1724 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1731 +#: ../../library/multiprocessing.rst:1729 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:1736 +#: ../../library/multiprocessing.rst:1734 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: ../../library/multiprocessing.rst:1745 +#: ../../library/multiprocessing.rst:1743 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1749 +#: ../../library/multiprocessing.rst:1747 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1757 +#: ../../library/multiprocessing.rst:1755 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: ../../library/multiprocessing.rst:1760 +#: ../../library/multiprocessing.rst:1758 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1764 +#: ../../library/multiprocessing.rst:1762 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1767 +#: ../../library/multiprocessing.rst:1765 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: ../../library/multiprocessing.rst:1770 +#: ../../library/multiprocessing.rst:1768 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -1994,14 +1994,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1776 +#: ../../library/multiprocessing.rst:1774 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1780 +#: ../../library/multiprocessing.rst:1778 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2012,7 +2012,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1789 +#: ../../library/multiprocessing.rst:1787 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -2022,22 +2022,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1796 +#: ../../library/multiprocessing.rst:1794 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1800 +#: ../../library/multiprocessing.rst:1798 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1804 +#: ../../library/multiprocessing.rst:1802 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1806 +#: ../../library/multiprocessing.rst:1804 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2045,173 +2045,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1812 +#: ../../library/multiprocessing.rst:1810 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: ../../library/multiprocessing.rst:1817 +#: ../../library/multiprocessing.rst:1815 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: ../../library/multiprocessing.rst:1821 +#: ../../library/multiprocessing.rst:1819 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: ../../library/multiprocessing.rst:1827 +#: ../../library/multiprocessing.rst:1825 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1832 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1839 +#: ../../library/multiprocessing.rst:1837 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1842 +#: ../../library/multiprocessing.rst:1840 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: ../../library/multiprocessing.rst:1850 +#: ../../library/multiprocessing.rst:1848 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1854 +#: ../../library/multiprocessing.rst:1852 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1858 +#: ../../library/multiprocessing.rst:1856 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1862 +#: ../../library/multiprocessing.rst:1860 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1866 +#: ../../library/multiprocessing.rst:1864 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1870 +#: ../../library/multiprocessing.rst:1868 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1875 +#: ../../library/multiprocessing.rst:1873 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1879 +#: ../../library/multiprocessing.rst:1877 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1886 +#: ../../library/multiprocessing.rst:1884 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1891 +#: ../../library/multiprocessing.rst:1889 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1893 +#: ../../library/multiprocessing.rst:1891 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1900 +#: ../../library/multiprocessing.rst:1898 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1902 +#: ../../library/multiprocessing.rst:1900 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: ../../library/multiprocessing.rst:1905 +#: ../../library/multiprocessing.rst:1903 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: ../../library/multiprocessing.rst:1921 +#: ../../library/multiprocessing.rst:1919 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1923 +#: ../../library/multiprocessing.rst:1921 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: ../../library/multiprocessing.rst:1948 +#: ../../library/multiprocessing.rst:1946 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1950 +#: ../../library/multiprocessing.rst:1948 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: ../../library/multiprocessing.rst:1953 +#: ../../library/multiprocessing.rst:1951 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1965 +#: ../../library/multiprocessing.rst:1963 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1975 +#: ../../library/multiprocessing.rst:1973 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:1986 +#: ../../library/multiprocessing.rst:1984 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2011 +#: ../../library/multiprocessing.rst:2009 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2013 +#: ../../library/multiprocessing.rst:2011 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: ../../library/multiprocessing.rst:2017 +#: ../../library/multiprocessing.rst:2015 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2219,14 +2219,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2035 +#: ../../library/multiprocessing.rst:2033 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: ../../library/multiprocessing.rst:2039 +#: ../../library/multiprocessing.rst:2037 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -2234,11 +2234,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2055 +#: ../../library/multiprocessing.rst:2053 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2068 +#: ../../library/multiprocessing.rst:2066 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -2249,53 +2249,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2087 +#: ../../library/multiprocessing.rst:2085 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: ../../library/multiprocessing.rst:2093 +#: ../../library/multiprocessing.rst:2091 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2101 +#: ../../library/multiprocessing.rst:2099 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2105 +#: ../../library/multiprocessing.rst:2103 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2109 +#: ../../library/multiprocessing.rst:2107 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2111 +#: ../../library/multiprocessing.rst:2109 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2115 +#: ../../library/multiprocessing.rst:2113 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2119 +#: ../../library/multiprocessing.rst:2117 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2121 +#: ../../library/multiprocessing.rst:2119 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: ../../library/multiprocessing.rst:2125 +#: ../../library/multiprocessing.rst:2123 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -2303,79 +2303,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2130 +#: ../../library/multiprocessing.rst:2128 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2133 +#: ../../library/multiprocessing.rst:2131 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2149 +#: ../../library/multiprocessing.rst:2147 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2151 +#: ../../library/multiprocessing.rst:2149 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2155 +#: ../../library/multiprocessing.rst:2153 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2159 +#: ../../library/multiprocessing.rst:2157 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2163 +#: ../../library/multiprocessing.rst:2161 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2165 +#: ../../library/multiprocessing.rst:2163 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: ../../library/multiprocessing.rst:2168 +#: ../../library/multiprocessing.rst:2166 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2173 +#: ../../library/multiprocessing.rst:2171 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2178 +#: ../../library/multiprocessing.rst:2176 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: ../../library/multiprocessing.rst:2183 +#: ../../library/multiprocessing.rst:2181 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: ../../library/multiprocessing.rst:2187 +#: ../../library/multiprocessing.rst:2185 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2190 -#: ../../library/multiprocessing.rst:2751 +#: ../../library/multiprocessing.rst:2188 +#: ../../library/multiprocessing.rst:2749 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2193 +#: ../../library/multiprocessing.rst:2191 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -2383,7 +2383,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2198 +#: ../../library/multiprocessing.rst:2196 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2391,13 +2391,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2204 +#: ../../library/multiprocessing.rst:2202 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2208 +#: ../../library/multiprocessing.rst:2206 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -2405,22 +2405,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2213 +#: ../../library/multiprocessing.rst:2211 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2217 +#: ../../library/multiprocessing.rst:2215 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2220 +#: ../../library/multiprocessing.rst:2218 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2225 +#: ../../library/multiprocessing.rst:2223 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -2431,7 +2431,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2235 +#: ../../library/multiprocessing.rst:2233 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -2439,14 +2439,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2242 +#: ../../library/multiprocessing.rst:2240 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2245 -#: ../../library/multiprocessing.rst:2276 +#: ../../library/multiprocessing.rst:2243 +#: ../../library/multiprocessing.rst:2274 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -2454,60 +2454,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2250 -#: ../../library/multiprocessing.rst:2281 +#: ../../library/multiprocessing.rst:2248 +#: ../../library/multiprocessing.rst:2279 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: ../../library/multiprocessing.rst:2254 -#: ../../library/multiprocessing.rst:2285 +#: ../../library/multiprocessing.rst:2252 +#: ../../library/multiprocessing.rst:2283 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2259 +#: ../../library/multiprocessing.rst:2257 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: ../../library/multiprocessing.rst:2263 +#: ../../library/multiprocessing.rst:2261 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: ../../library/multiprocessing.rst:2267 +#: ../../library/multiprocessing.rst:2265 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: ../../library/multiprocessing.rst:2273 +#: ../../library/multiprocessing.rst:2271 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2290 +#: ../../library/multiprocessing.rst:2288 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2292 +#: ../../library/multiprocessing.rst:2290 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: ../../library/multiprocessing.rst:2297 +#: ../../library/multiprocessing.rst:2295 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -2515,65 +2515,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2304 +#: ../../library/multiprocessing.rst:2302 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: ../../library/multiprocessing.rst:2310 +#: ../../library/multiprocessing.rst:2308 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2314 +#: ../../library/multiprocessing.rst:2312 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2321 +#: ../../library/multiprocessing.rst:2319 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2329 +#: ../../library/multiprocessing.rst:2327 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: ../../library/multiprocessing.rst:2334 +#: ../../library/multiprocessing.rst:2332 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: ../../library/multiprocessing.rst:2340 +#: ../../library/multiprocessing.rst:2338 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2343 +#: ../../library/multiprocessing.rst:2341 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: ../../library/multiprocessing.rst:2351 +#: ../../library/multiprocessing.rst:2349 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2356 +#: ../../library/multiprocessing.rst:2354 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2581,41 +2581,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2363 +#: ../../library/multiprocessing.rst:2361 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2367 +#: ../../library/multiprocessing.rst:2365 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2371 +#: ../../library/multiprocessing.rst:2369 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2374 +#: ../../library/multiprocessing.rst:2372 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2378 +#: ../../library/multiprocessing.rst:2376 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2405 +#: ../../library/multiprocessing.rst:2403 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2410 +#: ../../library/multiprocessing.rst:2408 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: ../../library/multiprocessing.rst:2414 +#: ../../library/multiprocessing.rst:2412 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2624,46 +2624,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2423 +#: ../../library/multiprocessing.rst:2421 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2426 +#: ../../library/multiprocessing.rst:2424 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2432 +#: ../../library/multiprocessing.rst:2430 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: ../../library/multiprocessing.rst:2435 +#: ../../library/multiprocessing.rst:2433 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2440 +#: ../../library/multiprocessing.rst:2438 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2443 +#: ../../library/multiprocessing.rst:2441 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: ../../library/multiprocessing.rst:2447 -#: ../../library/multiprocessing.rst:2482 +#: ../../library/multiprocessing.rst:2445 +#: ../../library/multiprocessing.rst:2480 msgid "" "If *authkey* is given and not None, it should be a byte string and will be " "used as the secret key for an HMAC-based authentication challenge. No " @@ -2672,26 +2672,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2455 +#: ../../library/multiprocessing.rst:2453 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2458 +#: ../../library/multiprocessing.rst:2456 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2463 +#: ../../library/multiprocessing.rst:2461 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: ../../library/multiprocessing.rst:2467 +#: ../../library/multiprocessing.rst:2465 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -2705,49 +2705,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2478 +#: ../../library/multiprocessing.rst:2476 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: ../../library/multiprocessing.rst:2490 +#: ../../library/multiprocessing.rst:2488 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2497 +#: ../../library/multiprocessing.rst:2495 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: ../../library/multiprocessing.rst:2501 +#: ../../library/multiprocessing.rst:2499 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2505 +#: ../../library/multiprocessing.rst:2503 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2509 +#: ../../library/multiprocessing.rst:2507 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2512 +#: ../../library/multiprocessing.rst:2510 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:2519 +#: ../../library/multiprocessing.rst:2517 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -2756,32 +2756,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2525 +#: ../../library/multiprocessing.rst:2523 msgid "" "For both Unix and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2528 +#: ../../library/multiprocessing.rst:2526 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2529 +#: ../../library/multiprocessing.rst:2527 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2530 +#: ../../library/multiprocessing.rst:2528 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2533 +#: ../../library/multiprocessing.rst:2531 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: ../../library/multiprocessing.rst:2536 +#: ../../library/multiprocessing.rst:2534 msgid "" "**Unix**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2789,7 +2789,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2542 +#: ../../library/multiprocessing.rst:2540 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -2798,46 +2798,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2552 +#: ../../library/multiprocessing.rst:2550 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2554 +#: ../../library/multiprocessing.rst:2552 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: ../../library/multiprocessing.rst:2573 +#: ../../library/multiprocessing.rst:2571 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2590 +#: ../../library/multiprocessing.rst:2588 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2629 +#: ../../library/multiprocessing.rst:2627 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2631 +#: ../../library/multiprocessing.rst:2629 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: ../../library/multiprocessing.rst:2634 +#: ../../library/multiprocessing.rst:2632 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2637 +#: ../../library/multiprocessing.rst:2635 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -2846,17 +2846,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2642 +#: ../../library/multiprocessing.rst:2640 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: ../../library/multiprocessing.rst:2649 +#: ../../library/multiprocessing.rst:2647 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2651 +#: ../../library/multiprocessing.rst:2649 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2864,7 +2864,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2657 +#: ../../library/multiprocessing.rst:2655 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -2872,7 +2872,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2663 +#: ../../library/multiprocessing.rst:2661 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2883,17 +2883,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2671 +#: ../../library/multiprocessing.rst:2669 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2675 +#: ../../library/multiprocessing.rst:2673 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2677 +#: ../../library/multiprocessing.rst:2675 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2901,27 +2901,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2684 +#: ../../library/multiprocessing.rst:2682 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2687 +#: ../../library/multiprocessing.rst:2685 msgid "" "When first created the logger has level :data:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2691 +#: ../../library/multiprocessing.rst:2689 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: ../../library/multiprocessing.rst:2698 +#: ../../library/multiprocessing.rst:2696 msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " @@ -2930,25 +2930,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2704 +#: ../../library/multiprocessing.rst:2702 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2719 +#: ../../library/multiprocessing.rst:2717 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2723 +#: ../../library/multiprocessing.rst:2721 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2728 +#: ../../library/multiprocessing.rst:2726 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:2733 +#: ../../library/multiprocessing.rst:2731 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2956,7 +2956,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2741 +#: ../../library/multiprocessing.rst:2739 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -2966,18 +2966,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2748 +#: ../../library/multiprocessing.rst:2746 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2754 +#: ../../library/multiprocessing.rst:2752 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2758 +#: ../../library/multiprocessing.rst:2756 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -2987,7 +2987,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2765 +#: ../../library/multiprocessing.rst:2763 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -2996,69 +2996,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2775 +#: ../../library/multiprocessing.rst:2773 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2777 +#: ../../library/multiprocessing.rst:2775 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2782 +#: ../../library/multiprocessing.rst:2780 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2784 +#: ../../library/multiprocessing.rst:2782 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2786 +#: ../../library/multiprocessing.rst:2784 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2788 +#: ../../library/multiprocessing.rst:2786 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2791 +#: ../../library/multiprocessing.rst:2789 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: ../../library/multiprocessing.rst:2795 +#: ../../library/multiprocessing.rst:2793 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2797 +#: ../../library/multiprocessing.rst:2795 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2799 +#: ../../library/multiprocessing.rst:2797 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2801 +#: ../../library/multiprocessing.rst:2799 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2804 +#: ../../library/multiprocessing.rst:2802 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2806 +#: ../../library/multiprocessing.rst:2804 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2808 +#: ../../library/multiprocessing.rst:2806 msgid "" "On Unix when a process finishes but has not been joined it becomes a zombie. " "There should never be very many because each time a new process starts (or :" @@ -3069,11 +3069,11 @@ msgid "" "all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2816 +#: ../../library/multiprocessing.rst:2814 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2818 +#: ../../library/multiprocessing.rst:2816 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3083,11 +3083,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2826 +#: ../../library/multiprocessing.rst:2824 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2828 +#: ../../library/multiprocessing.rst:2826 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3095,18 +3095,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2834 +#: ../../library/multiprocessing.rst:2832 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: ../../library/multiprocessing.rst:2838 +#: ../../library/multiprocessing.rst:2836 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2840 +#: ../../library/multiprocessing.rst:2838 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -3115,7 +3115,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2846 +#: ../../library/multiprocessing.rst:2844 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -3124,21 +3124,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2852 +#: ../../library/multiprocessing.rst:2850 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2866 +#: ../../library/multiprocessing.rst:2864 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2869 +#: ../../library/multiprocessing.rst:2867 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2871 +#: ../../library/multiprocessing.rst:2869 msgid "" "On Unix using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3146,7 +3146,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2876 +#: ../../library/multiprocessing.rst:2874 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -3155,29 +3155,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2883 +#: ../../library/multiprocessing.rst:2881 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2895 +#: ../../library/multiprocessing.rst:2893 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2907 +#: ../../library/multiprocessing.rst:2905 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2909 +#: ../../library/multiprocessing.rst:2907 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2913 +#: ../../library/multiprocessing.rst:2911 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: ../../library/multiprocessing.rst:2919 +#: ../../library/multiprocessing.rst:2917 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3187,33 +3187,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2926 +#: ../../library/multiprocessing.rst:2924 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: ../../library/multiprocessing.rst:2938 +#: ../../library/multiprocessing.rst:2936 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2941 +#: ../../library/multiprocessing.rst:2939 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2943 +#: ../../library/multiprocessing.rst:2941 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2946 +#: ../../library/multiprocessing.rst:2944 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2948 +#: ../../library/multiprocessing.rst:2946 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3221,11 +3221,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2953 +#: ../../library/multiprocessing.rst:2951 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2955 +#: ../../library/multiprocessing.rst:2953 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -3233,66 +3233,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2960 +#: ../../library/multiprocessing.rst:2958 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2965 +#: ../../library/multiprocessing.rst:2963 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2967 +#: ../../library/multiprocessing.rst:2965 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such a starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:2971 +#: ../../library/multiprocessing.rst:2969 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:2983 +#: ../../library/multiprocessing.rst:2981 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2997 +#: ../../library/multiprocessing.rst:2995 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:3000 +#: ../../library/multiprocessing.rst:2998 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: ../../library/multiprocessing.rst:3003 +#: ../../library/multiprocessing.rst:3001 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3010 +#: ../../library/multiprocessing.rst:3008 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3012 +#: ../../library/multiprocessing.rst:3010 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3018 +#: ../../library/multiprocessing.rst:3016 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:3024 +#: ../../library/multiprocessing.rst:3022 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" From f32680acbb3a31ae03e7270bb4b789bacd7f8423 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 24 Apr 2023 00:32:53 +0000 Subject: [PATCH 071/130] sync with cpython 7b2ac6cf --- c-api/file.po | 4 +-- c-api/init.po | 8 ++--- c-api/sys.po | 8 ++--- distributing/index.po | 24 ++++++------- faq/library.po | 10 +++--- howto/functional.po | 18 +++++----- howto/urllib2.po | 18 +++++----- library/array.po | 4 +-- library/ctypes.po | 24 ++++++------- library/ensurepip.po | 4 +-- library/fcntl.po | 10 +++--- library/ftplib.po | 6 ++-- library/functions.po | 16 ++++----- library/gc.po | 8 ++--- library/glob.po | 6 ++-- library/http.client.po | 6 ++-- library/imaplib.po | 6 ++-- library/io.po | 16 ++++----- library/marshal.po | 12 +++---- library/mmap.po | 4 +-- library/msvcrt.po | 8 ++--- library/nntplib.po | 6 ++-- library/os.po | 76 ++++++++++++++++++++------------------- library/pathlib.po | 6 ++-- library/pdb.po | 4 +-- library/pickle.po | 8 ++--- library/pkgutil.po | 16 ++++----- library/poplib.po | 6 ++-- library/pty.po | 4 +-- library/readline.po | 9 ++--- library/resource.po | 6 ++-- library/shutil.po | 21 +++++------ library/signal.po | 4 +-- library/smtplib.po | 6 ++-- library/socket.po | 28 +++++++-------- library/sqlite3.po | 10 +++--- library/subprocess.po | 4 +-- library/sys.po | 24 ++++++------- library/syslog.po | 10 +++--- library/telnetlib.po | 6 ++-- library/tempfile.po | 8 ++--- library/types.po | 6 ++-- library/urllib.request.po | 4 +-- library/webbrowser.po | 4 +-- library/winreg.po | 44 +++++++++++------------ reference/datamodel.po | 8 ++--- using/cmdline.po | 12 +++---- whatsnew/2.6.po | 26 +++++++------- whatsnew/2.7.po | 33 ++++++++--------- 49 files changed, 312 insertions(+), 307 deletions(-) diff --git a/c-api/file.po b/c-api/file.po index b1a5e88e1d..4ebb3e47c4 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -116,7 +116,7 @@ msgstr "" msgid "This function is safe to call before :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/file.rst:21 +#: ../../c-api/file.rst:85 msgid "" "Raises an :ref:`auditing event ` ``setopencodehook`` with no " "arguments." diff --git a/c-api/init.po b/c-api/init.po index bc1e22e9c4..305a32e40c 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-16 00:34+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -464,7 +464,7 @@ msgid "" "than once." msgstr "" -#: ../../c-api/init.rst:29 +#: ../../c-api/init.rst:305 msgid "" "Raises an :ref:`auditing event ` ``cpython." "_PySys_ClearAuditHooks`` with no arguments." @@ -1259,7 +1259,7 @@ msgid "" "function." msgstr "" -#: ../../c-api/init.rst:5 +#: ../../c-api/init.rst:1109 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1271,7 +1271,7 @@ msgid "" "interpreter lock must be held." msgstr "" -#: ../../c-api/init.rst:4 +#: ../../c-api/init.rst:1117 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." diff --git a/c-api/sys.po b/c-api/sys.po index d638f9b2c2..60a7b1bced 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -154,8 +154,8 @@ msgstr "" msgid "" "Decode a byte string from the :term:`filesystem encoding and error handler`. " "If the error handler is :ref:`surrogateescape error handler " -"`, undecodable bytes are decoded as characters in range U" -"+DC80..U+DCFF; and if a byte sequence can be decoded as a surrogate " +"`, undecodable bytes are decoded as characters in range " +"U+DC80..U+DCFF; and if a byte sequence can be decoded as a surrogate " "character, the bytes are escaped using the surrogateescape error handler " "instead of decoding them." msgstr "" @@ -454,7 +454,7 @@ msgid "" "events table `. Details are in each function's documentation." msgstr "" -#: ../../c-api/sys.rst:26 +#: ../../c-api/sys.rst:390 msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " "arguments." diff --git a/distributing/index.po b/distributing/index.po index f58138e68f..dca6e88393 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-02 17:19+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2021-07-04 18:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -255,27 +255,27 @@ msgstr "`上傳專案至 Python 套件索引 (Python Package Index)`_" msgid "`The .pypirc file`_" msgstr "`.pypirc 檔案`_" -#: ../../distributing/index.rst:144 +#: ../../distributing/index.rst:140 msgid "How do I...?" msgstr "我該如何...?" -#: ../../distributing/index.rst:146 +#: ../../distributing/index.rst:142 msgid "These are quick answers or links for some common tasks." msgstr "接下來是關於一些常見任務的快速解答或連結。" -#: ../../distributing/index.rst:149 +#: ../../distributing/index.rst:145 msgid "... choose a name for my project?" msgstr "...為我的專案選擇一個名稱?" -#: ../../distributing/index.rst:151 +#: ../../distributing/index.rst:147 msgid "This isn't an easy topic, but here are a few tips:" msgstr "這不是一個簡單的題目,但這裡有一些提示:" -#: ../../distributing/index.rst:153 +#: ../../distributing/index.rst:149 msgid "check the Python Package Index to see if the name is already in use" msgstr "檢查 Python 套件索引,看看該名稱是否已被使用" -#: ../../distributing/index.rst:154 +#: ../../distributing/index.rst:150 msgid "" "check popular hosting sites like GitHub, Bitbucket, etc to see if there is " "already a project with that name" @@ -283,11 +283,11 @@ msgstr "" "檢查常用的代管網站,像是 GitHub、Bitbucket 等,看看是否已經有一個使用該名稱的" "專案" -#: ../../distributing/index.rst:156 +#: ../../distributing/index.rst:152 msgid "check what comes up in a web search for the name you're considering" msgstr "檢查您正在考慮的名稱在網路搜尋中會出現的內容" -#: ../../distributing/index.rst:157 +#: ../../distributing/index.rst:153 msgid "" "avoid particularly common words, especially ones with multiple meanings, as " "they can make it difficult for users to find your software when searching " @@ -296,11 +296,11 @@ msgstr "" "避免使用特別常見的單字,尤其是那些有多重含義的單字,因為它們會讓使用者在搜尋" "你的軟體時時很難找到它" -#: ../../distributing/index.rst:163 +#: ../../distributing/index.rst:159 msgid "... create and distribute binary extensions?" msgstr "...建立和發布二進制擴充?" -#: ../../distributing/index.rst:165 +#: ../../distributing/index.rst:161 msgid "" "This is actually quite a complex topic, with a variety of alternatives " "available depending on exactly what you're aiming to achieve. See the Python " @@ -309,7 +309,7 @@ msgstr "" "實際上這是一個非常複雜的題目,因為有各式各樣的替代方案可使用,取決於您確實想" "要達成的目標。更多的資訊和建議,請參閱 Python 封裝使用者指南。" -#: ../../distributing/index.rst:171 +#: ../../distributing/index.rst:167 msgid "" "`Python Packaging User Guide: Binary Extensions `__" diff --git a/faq/library.po b/faq/library.po index 1ab8f01196..5668b3a993 100644 --- a/faq/library.po +++ b/faq/library.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -522,8 +522,8 @@ msgid "" "The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note " "that on Windows NTFS volumes, it does not copy `alternate data streams " "`_ nor " -"`resource forks `__ on macOS HFS" -"+ volumes, though both are now rarely used. It also doesn't copy file " +"`resource forks `__ on macOS " +"HFS+ volumes, though both are now rarely used. It also doesn't copy file " "permissions and metadata, though using :func:`shutil.copy2` instead will " "preserve most (though not all) of it." msgstr "" @@ -755,8 +755,8 @@ msgstr "" msgid "" "The :mod:`asyncio` module provides a general purpose single-threaded and " "concurrent asynchronous library, which can be used for writing non-blocking " -"network code. The third-party `Twisted `_ " -"library is a popular and feature-rich alternative." +"network code. The third-party `Twisted `_ library is a " +"popular and feature-rich alternative." msgstr "" #: ../../faq/library.rst:788 diff --git a/howto/functional.po b/howto/functional.po index 43e8526a9c..dd42913c98 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-02 00:20+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -348,8 +348,8 @@ msgstr "" #: ../../howto/functional.rst:246 msgid "" "Built-in functions such as :func:`max` and :func:`min` can take a single " -"iterator argument and will return the largest or smallest element. The ``" -"\"in\"`` and ``\"not in\"`` operators also support iterators: ``X in " +"iterator argument and will return the largest or smallest element. The " +"``\"in\"`` and ``\"not in\"`` operators also support iterators: ``X in " "iterator`` is true if X is found in the stream returned by the iterator. " "You'll run into obvious problems if the iterator is infinite; :func:`max`, :" "func:`min` will never return, and if the element X never appears in the " @@ -1307,12 +1307,12 @@ msgstr "" #: ../../howto/functional.rst:1210 msgid "" "**Structure and Interpretation of Computer Programs**, by Harold Abelson and " -"Gerald Jay Sussman with Julie Sussman. Full text at https://mitpress.mit." -"edu/sicp/. In this classic textbook of computer science, chapters 2 and 3 " -"discuss the use of sequences and streams to organize the data flow inside a " -"program. The book uses Scheme for its examples, but many of the design " -"approaches described in these chapters are applicable to functional-style " -"Python code." +"Gerald Jay Sussman with Julie Sussman. The book can be found at https://" +"mitpress.mit.edu/sicp. In this classic textbook of computer science, " +"chapters 2 and 3 discuss the use of sequences and streams to organize the " +"data flow inside a program. The book uses Scheme for its examples, but many " +"of the design approaches described in these chapters are applicable to " +"functional-style Python code." msgstr "" #: ../../howto/functional.rst:1218 diff --git a/howto/urllib2.po b/howto/urllib2.po index b2f82af3a8..08fd413edd 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -150,8 +150,8 @@ msgid "" "In the case of HTTP, there are two extra things that Request objects allow " "you to do: First, you can pass data to be sent to the server. Second, you " "can pass extra information (\"metadata\") *about* the data or about the " -"request itself, to the server - this information is sent as HTTP \"headers" -"\". Let's look at each of these in turn." +"request itself, to the server - this information is sent as HTTP " +"\"headers\". Let's look at each of these in turn." msgstr "" #: ../../howto/urllib2.rst:105 @@ -445,8 +445,8 @@ msgid "" "To illustrate creating and installing a handler we will use the " "``HTTPBasicAuthHandler``. For a more detailed discussion of this subject -- " "including an explanation of how Basic Authentication works - see the `Basic " -"Authentication Tutorial `_." +"Authentication Tutorial `__." msgstr "" #: ../../howto/urllib2.rst:463 @@ -501,10 +501,10 @@ msgstr "" #: ../../howto/urllib2.rst:522 msgid "" "``top_level_url`` is in fact *either* a full URL (including the 'http:' " -"scheme component and the hostname and optionally the port number) e.g. ``" -"\"http://example.com/\"`` *or* an \"authority\" (i.e. the hostname, " -"optionally including the port number) e.g. ``\"example.com\"`` or ``" -"\"example.com:8080\"`` (the latter example includes a port number). The " +"scheme component and the hostname and optionally the port number) e.g. " +"``\"http://example.com/\"`` *or* an \"authority\" (i.e. the hostname, " +"optionally including the port number) e.g. ``\"example.com\"`` or " +"``\"example.com:8080\"`` (the latter example includes a port number). The " "authority, if present, must NOT contain the \"userinfo\" component - for " "example ``\"joe:password@example.com\"`` is not correct." msgstr "" diff --git a/library/array.po b/library/array.po index 21b51d4890..ff021b95fb 100644 --- a/library/array.po +++ b/library/array.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-03 00:34+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2021-11-23 18:40+0800\n" "Last-Translator: Benson Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -278,7 +278,7 @@ msgstr "" "實作了緩衝區介面,可以在任何支援 :term:`bytes-like objects ` 的地方使用。" -#: ../../library/array.rst:17 +#: ../../library/array.rst:94 msgid "" "Raises an :ref:`auditing event ` ``array.__new__`` with arguments " "``typecode``, ``initializer``." diff --git a/library/ctypes.po b/library/ctypes.po index ff09c324fd..753a100b8e 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-26 00:33+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1862,7 +1862,7 @@ msgid "" "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:4 +#: ../../library/ctypes.rst:1848 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -1920,7 +1920,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:12 +#: ../../library/ctypes.rst:1892 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -1947,7 +1947,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:13 +#: ../../library/ctypes.rst:1909 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -2009,7 +2009,7 @@ msgid "" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:4 +#: ../../library/ctypes.rst:1967 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." @@ -2021,7 +2021,7 @@ msgid "" "system :data:`LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:4 +#: ../../library/ctypes.rst:1974 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." @@ -2074,7 +2074,7 @@ msgid "" "variable in the calling thread to *value* and return the previous value." msgstr "" -#: ../../library/ctypes.rst:4 +#: ../../library/ctypes.rst:2019 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -2087,7 +2087,7 @@ msgid "" "return the previous value." msgstr "" -#: ../../library/ctypes.rst:5 +#: ../../library/ctypes.rst:2028 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -2106,7 +2106,7 @@ msgid "" "is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:5 +#: ../../library/ctypes.rst:2043 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``address``, ``size``." @@ -2133,7 +2133,7 @@ msgid "" "terminated." msgstr "" -#: ../../library/ctypes.rst:6 +#: ../../library/ctypes.rst:2065 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``address``, ``size``." @@ -2168,7 +2168,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:7 +#: ../../library/ctypes.rst:2094 ../../library/ctypes.rst:2104 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -2188,7 +2188,7 @@ msgid "" "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:4 +#: ../../library/ctypes.rst:2111 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " "``address``." diff --git a/library/ensurepip.po b/library/ensurepip.po index a0fe3fd7ea..856e757b41 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -208,7 +208,7 @@ msgid "" "bootstrapping operation." msgstr "" -#: ../../library/ensurepip.rst:27 +#: ../../library/ensurepip.rst:136 msgid "" "Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with " "argument ``root``." diff --git a/library/fcntl.po b/library/fcntl.po index 4c112f7b7d..1d783e7c7c 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -112,7 +112,7 @@ msgstr "" msgid "If the :c:func:`fcntl` fails, an :exc:`OSError` is raised." msgstr "" -#: ../../library/fcntl.rst:20 +#: ../../library/fcntl.rst:90 msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " "``fd``, ``cmd``, ``arg``." @@ -181,7 +181,7 @@ msgstr "" "\n" "::" -#: ../../library/fcntl.rst:47 +#: ../../library/fcntl.rst:141 msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " "``fd``, ``request``, ``arg``." @@ -199,7 +199,7 @@ msgstr "" msgid "If the :c:func:`flock` fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/fcntl.rst:8 +#: ../../library/fcntl.rst:153 msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " "``fd``, ``operation``." @@ -264,7 +264,7 @@ msgid "" "file. The default for *whence* is also 0." msgstr "" -#: ../../library/fcntl.rst:31 +#: ../../library/fcntl.rst:188 msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." diff --git a/library/ftplib.po b/library/ftplib.po index 87e3fca402..d5d0569b4e 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,7 +210,7 @@ msgid "" "port)`` for the socket to bind to as its source address before connecting." msgstr "" -#: ../../library/ftplib.rst:13 +#: ../../library/ftplib.rst:223 msgid "" "Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments " "``self``, ``host``, ``port``." @@ -246,7 +246,7 @@ msgid "" "Send a simple command string to the server and return the response string." msgstr "" -#: ../../library/ftplib.rst:3 ../../library/ftplib.rst:5 +#: ../../library/ftplib.rst:258 ../../library/ftplib.rst:267 msgid "" "Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments " "``self``, ``cmd``." diff --git a/library/functions.po b/library/functions.po index 6e61533af5..57acdbef5b 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-06 00:29+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2023-01-04 14:53+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -520,7 +520,7 @@ msgid "" "not accessible, this function will raise :exc:`RuntimeError`." msgstr "" -#: ../../library/functions.rst:13 +#: ../../library/functions.rst:171 msgid "" "Raises an :ref:`auditing event ` ``builtins.breakpoint`` with " "argument ``breakpointhook``." @@ -798,7 +798,7 @@ msgid "" "parse`." msgstr "如果您想解析 Python 程式碼為 AST 運算式,請參閱 :func:`ast.parse`。" -#: ../../library/functions.rst:47 +#: ../../library/functions.rst:334 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source``, ``filename``." @@ -1126,7 +1126,7 @@ msgstr "" "另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的運算式字" "串。" -#: ../../library/functions.rst:33 ../../library/functions.rst:43 +#: ../../library/functions.rst:559 ../../library/functions.rst:600 msgid "" "Raises an :ref:`auditing event ` ``exec`` with argument " "``code_object``." @@ -1526,7 +1526,7 @@ msgstr "" msgid "This is the address of the object in memory." msgstr "" -#: ../../library/functions.rst:8 +#: ../../library/functions.rst:854 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." @@ -1553,7 +1553,7 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:14 +#: ../../library/functions.rst:873 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt``." @@ -1565,7 +1565,7 @@ msgid "" "``prompt`` before reading input" msgstr "" -#: ../../library/functions.rst:19 +#: ../../library/functions.rst:878 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "argument ``result``." @@ -2225,7 +2225,7 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:191 +#: ../../library/functions.rst:1348 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " "``mode``, ``flags``." diff --git a/library/gc.po b/library/gc.po index 5f58f69d45..4cb7f8fc8b 100644 --- a/library/gc.po +++ b/library/gc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-11 00:30+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -90,7 +90,7 @@ msgstr "" msgid "New *generation* parameter." msgstr "" -#: ../../library/gc.rst:8 +#: ../../library/gc.rst:75 msgid "" "Raises an :ref:`auditing event ` ``gc.get_objects`` with argument " "``generation``." @@ -181,7 +181,7 @@ msgid "" "other than debugging." msgstr "" -#: ../../library/gc.rst:17 +#: ../../library/gc.rst:146 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referrers`` with " "argument ``objs``." @@ -199,7 +199,7 @@ msgid "" "object may or may not appear in the result list." msgstr "" -#: ../../library/gc.rst:9 +#: ../../library/gc.rst:159 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referents`` with " "argument ``objs``." diff --git a/library/glob.po b/library/glob.po index 6873244ea1..b4ac2edb63 100644 --- a/library/glob.po +++ b/library/glob.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -94,13 +94,13 @@ msgid "" "directories." msgstr "" -#: ../../library/glob.rst:4 ../../library/glob.rst:29 +#: ../../library/glob.rst:73 ../../library/glob.rst:96 msgid "" "Raises an :ref:`auditing event ` ``glob.glob`` with arguments " "``pathname``, ``recursive``." msgstr "" -#: ../../library/glob.rst:5 ../../library/glob.rst:30 +#: ../../library/glob.rst:74 ../../library/glob.rst:97 msgid "" "Raises an :ref:`auditing event ` ``glob.glob/2`` with arguments " "``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." diff --git a/library/http.client.po b/library/http.client.po index ce8d78faab..0c31f7b75c 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -410,7 +410,7 @@ msgid "" "already have a connection." msgstr "" -#: ../../library/http.client.rst:5 +#: ../../library/http.client.rst:384 msgid "" "Raises an :ref:`auditing event ` ``http.client.connect`` with " "arguments ``self``, ``host``, ``port``." @@ -486,7 +486,7 @@ msgid "" "`endheaders` method has been called and before :meth:`getresponse` is called." msgstr "" -#: ../../library/http.client.rst:5 +#: ../../library/http.client.rst:455 msgid "" "Raises an :ref:`auditing event ` ``http.client.send`` with " "arguments ``self``, ``data``." diff --git a/library/imaplib.po b/library/imaplib.po index 27c3cc24cd..96e6744672 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -429,7 +429,7 @@ msgid "" "method." msgstr "" -#: ../../library/imaplib.rst:11 +#: ../../library/imaplib.rst:392 msgid "" "Raises an :ref:`auditing event ` ``imaplib.open`` with arguments " "``self``, ``host``, ``port``." @@ -504,7 +504,7 @@ msgstr "" msgid "Sends ``data`` to the remote server. You may override this method." msgstr "" -#: ../../library/imaplib.rst:3 +#: ../../library/imaplib.rst:465 msgid "" "Raises an :ref:`auditing event ` ``imaplib.send`` with arguments " "``self``, ``data``." diff --git a/library/io.po b/library/io.po index b46f38074c..b0cd8728a7 100644 --- a/library/io.po +++ b/library/io.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -167,8 +167,8 @@ msgstr "" msgid "" "Accordingly, it is highly recommended that you specify the encoding " "explicitly when opening text files. If you want to use UTF-8, pass " -"``encoding=\"utf-8\"``. To use the current locale encoding, ``encoding=" -"\"locale\"`` is supported since Python 3.10." +"``encoding=\"utf-8\"``. To use the current locale encoding, " +"``encoding=\"locale\"`` is supported since Python 3.10." msgstr "" #: ../../library/io.rst:135 @@ -229,7 +229,7 @@ msgstr "" msgid "This is an alias for the builtin :func:`open` function." msgstr "" -#: ../../library/io.rst:3 +#: ../../library/io.rst:175 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -1293,8 +1293,8 @@ msgstr "" #: ../../library/io.rst:952 msgid "" "*encoding* gives the name of the encoding that the stream will be decoded or " -"encoded with. It defaults to :func:`locale.getencoding()`. ``encoding=" -"\"locale\"`` can be used to specify the current locale's encoding " +"encoded with. It defaults to :func:`locale.getencoding()`. " +"``encoding=\"locale\"`` can be used to specify the current locale's encoding " "explicitly. See :ref:`io-text-encoding` for more information." msgstr "" @@ -1308,8 +1308,8 @@ msgid "" "marker (such as ``'?'``) to be inserted where there is malformed data. " "``'backslashreplace'`` causes malformed data to be replaced by a backslashed " "escape sequence. When writing, ``'xmlcharrefreplace'`` (replace with the " -"appropriate XML character reference) or ``'namereplace'`` (replace with ``" -"\\N{...}`` escape sequences) can be used. Any other error handling name " +"appropriate XML character reference) or ``'namereplace'`` (replace with " +"``\\N{...}`` escape sequences) can be used. Any other error handling name " "that has been registered with :func:`codecs.register_error` is also valid." msgstr "" diff --git a/library/marshal.po b/library/marshal.po index ace4774866..97f9b8f47f 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2021-12-15 12:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -130,7 +130,7 @@ msgid "" "(see below)." msgstr "*version* 引數指明 ``dump`` 應該使用的資料格式(見下文)。" -#: ../../library/marshal.rst:8 ../../library/marshal.rst:11 +#: ../../library/marshal.rst:69 ../../library/marshal.rst:101 msgid "" "Raises an :ref:`auditing event ` ``marshal.dumps`` with arguments " "``value``, ``version``." @@ -149,7 +149,7 @@ msgstr "" "Python 版本的不相容 marshal 格式),則會引發 :exc:`EOFError`\\ 、\\ :exc:" "`ValueError` 或 :exc:`TypeError`。檔案必須為可讀取的 :term:`binary file`\\ 。" -#: ../../library/marshal.rst:6 +#: ../../library/marshal.rst:79 msgid "" "Raises an :ref:`auditing event ` ``marshal.load`` with no " "arguments." @@ -198,13 +198,13 @@ msgstr "" "`EOFError`\\ 、\\ :exc:`ValueError` 或 :exc:`TypeError`\\ 。輸入中額外的位元" "組串會被忽略。" -#: ../../library/marshal.rst:5 +#: ../../library/marshal.rst:110 msgid "" "Raises an :ref:`auditing event ` ``marshal.loads`` with argument " "``bytes``." msgstr "" -"引發一個附帶引數 ``bytes`` 的\\ :ref:`稽核事件 ` ``marshal.loads``" -"\\ 。" +"引發一個附帶引數 ``bytes`` 的\\ :ref:`稽核事件 ` ``marshal." +"loads``\\ 。" #: ../../library/marshal.rst:114 msgid "" diff --git a/library/mmap.po b/library/mmap.po index b817322cab..1cc765d65c 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -119,7 +119,7 @@ msgid "" "`ALLOCATIONGRANULARITY`." msgstr "" -#: ../../library/mmap.rst:20 ../../library/mmap.rst:87 +#: ../../library/mmap.rst:83 ../../library/mmap.rst:174 msgid "" "Raises an :ref:`auditing event ` ``mmap.__new__`` with arguments " "``fileno``, ``length``, ``access``, ``offset``." diff --git a/library/msvcrt.po b/library/msvcrt.po index 0f88d7da3e..6b58160633 100644 --- a/library/msvcrt.po +++ b/library/msvcrt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -65,7 +65,7 @@ msgid "" "individually." msgstr "" -#: ../../library/msvcrt.rst:8 +#: ../../library/msvcrt.rst:45 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.locking`` with arguments " "``fd``, ``mode``, ``nbytes``." @@ -103,7 +103,7 @@ msgid "" "as a parameter to :func:`os.fdopen` to create a file object." msgstr "" -#: ../../library/msvcrt.rst:6 +#: ../../library/msvcrt.rst:82 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.open_osfhandle`` with " "arguments ``handle``, ``flags``." @@ -115,7 +115,7 @@ msgid "" "if *fd* is not recognized." msgstr "" -#: ../../library/msvcrt.rst:4 +#: ../../library/msvcrt.rst:90 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.get_osfhandle`` with " "argument ``fd``." diff --git a/library/nntplib.po b/library/nntplib.po index fdef783158..3c99595c58 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -83,13 +83,13 @@ msgid "" "close the NNTP connection when done, e.g.:" msgstr "" -#: ../../library/nntplib.rst:13 ../../library/nntplib.rst:24 +#: ../../library/nntplib.rst:99 ../../library/nntplib.rst:131 msgid "" "Raises an :ref:`auditing event ` ``nntplib.connect`` with " "arguments ``self``, ``host``, ``port``." msgstr "" -#: ../../library/nntplib.rst:15 ../../library/nntplib.rst:26 +#: ../../library/nntplib.rst:101 ../../library/nntplib.rst:133 msgid "" "Raises an :ref:`auditing event ` ``nntplib.putline`` with " "arguments ``self``, ``line``." diff --git a/library/os.po b/library/os.po index 0ca9e7d4f0..fc14a2233c 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-22 00:29+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -685,7 +685,7 @@ msgid "" "cause memory leaks. Refer to the system documentation for :c:func:`putenv`." msgstr "" -#: ../../library/os.rst:18 +#: ../../library/os.rst:558 msgid "" "Raises an :ref:`auditing event ` ``os.putenv`` with arguments " "``key``, ``value``." @@ -860,7 +860,7 @@ msgid "" "items of :data:`os.environ`." msgstr "" -#: ../../library/os.rst:12 +#: ../../library/os.rst:758 msgid "" "Raises an :ref:`auditing event ` ``os.unsetenv`` with argument " "``key``." @@ -1020,7 +1020,7 @@ msgid "" "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:5 ../../library/os.rst:6 ../../library/os.rst:38 +#: ../../library/os.rst:896 ../../library/os.rst:1914 ../../library/os.rst:2008 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -1041,7 +1041,7 @@ msgid "" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:5 ../../library/os.rst:6 ../../library/os.rst:11 +#: ../../library/os.rst:911 ../../library/os.rst:1936 ../../library/os.rst:2021 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." @@ -1122,7 +1122,7 @@ msgid "" "truncate(fd, length)``." msgstr "" -#: ../../library/os.rst:5 +#: ../../library/os.rst:989 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``fd``, ``length``." @@ -1157,7 +1157,7 @@ msgid "" "specifies the section of the file to lock." msgstr "" -#: ../../library/os.rst:7 +#: ../../library/os.rst:1026 msgid "" "Raises an :ref:`auditing event ` ``os.lockf`` with arguments " "``fd``, ``cmd``, ``len``." @@ -1218,7 +1218,7 @@ msgid "" "` with the *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:14 +#: ../../library/os.rst:1092 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -1948,7 +1948,7 @@ msgid "" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:5 ../../library/os.rst:11 +#: ../../library/os.rst:1834 ../../library/os.rst:1967 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." @@ -2019,7 +2019,7 @@ msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:5 ../../library/os.rst:19 +#: ../../library/os.rst:1864 ../../library/os.rst:1993 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." @@ -2208,7 +2208,7 @@ msgid "" "`not following symlinks `." msgstr "" -#: ../../library/os.rst:7 +#: ../../library/os.rst:2037 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2250,7 +2250,7 @@ msgid "" "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:15 +#: ../../library/os.rst:2067 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." @@ -2344,7 +2344,7 @@ msgid "" "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:20 ../../library/os.rst:24 +#: ../../library/os.rst:2144 ../../library/os.rst:2178 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -2529,7 +2529,8 @@ msgstr "" msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:6 ../../library/os.rst:12 ../../library/os.rst:14 +#: ../../library/os.rst:2346 ../../library/os.rst:2368 +#: ../../library/os.rst:3157 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -2584,7 +2585,8 @@ msgid "" "`replace`." msgstr "" -#: ../../library/os.rst:10 ../../library/os.rst:11 ../../library/os.rst:22 +#: ../../library/os.rst:2397 ../../library/os.rst:2418 +#: ../../library/os.rst:2435 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2630,7 +2632,7 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:9 +#: ../../library/os.rst:2453 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." @@ -2671,7 +2673,7 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:27 +#: ../../library/os.rst:2490 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." @@ -3404,7 +3406,7 @@ msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:23 +#: ../../library/os.rst:3100 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -3430,7 +3432,7 @@ msgid "" "bytes in size." msgstr "" -#: ../../library/os.rst:6 +#: ../../library/os.rst:3137 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -3485,7 +3487,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:29 +#: ../../library/os.rst:3196 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -3588,7 +3590,7 @@ msgid "" "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:88 +#: ../../library/os.rst:3295 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -3633,7 +3635,7 @@ msgid "" "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:50 +#: ../../library/os.rst:3356 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -3783,7 +3785,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:9 +#: ../../library/os.rst:3528 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -3802,7 +3804,7 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:9 +#: ../../library/os.rst:3544 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." @@ -3816,7 +3818,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:9 +#: ../../library/os.rst:3560 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -3840,7 +3842,7 @@ msgid "" "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:18 +#: ../../library/os.rst:3585 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -3916,7 +3918,7 @@ msgid "" "DLLs are loaded." msgstr "" -#: ../../library/os.rst:14 +#: ../../library/os.rst:3649 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -3998,7 +4000,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:43 +#: ../../library/os.rst:3717 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4133,7 +4135,7 @@ msgid "" "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:7 +#: ../../library/os.rst:3884 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "" @@ -4157,7 +4159,7 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:7 +#: ../../library/os.rst:3905 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "" @@ -4188,7 +4190,7 @@ msgstr "" msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:18 +#: ../../library/os.rst:3933 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4202,7 +4204,7 @@ msgstr "" msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:7 +#: ../../library/os.rst:3949 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4405,7 +4407,7 @@ msgid "" "`POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:7 ../../library/os.rst:77 +#: ../../library/os.rst:4102 ../../library/os.rst:4118 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4547,7 +4549,7 @@ msgid "" "are equivalent::" msgstr "" -#: ../../library/os.rst:54 +#: ../../library/os.rst:4222 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -4648,13 +4650,13 @@ msgid "" "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:37 +#: ../../library/os.rst:4307 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." msgstr "" -#: ../../library/os.rst:39 +#: ../../library/os.rst:4309 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -4707,7 +4709,7 @@ msgid "" "code." msgstr "" -#: ../../library/os.rst:27 +#: ../../library/os.rst:4346 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." diff --git a/library/pathlib.po b/library/pathlib.po index c5c5fe6197..2c00aabca9 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:32+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -585,7 +585,7 @@ msgid "" "inordinate amount of time." msgstr "" -#: ../../library/pathlib.rst:24 +#: ../../library/pathlib.rst:849 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.glob`` with " "arguments ``self``, ``pattern``." @@ -834,7 +834,7 @@ msgid "" "the given relative *pattern*::" msgstr "" -#: ../../library/pathlib.rst:11 +#: ../../library/pathlib.rst:1144 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." diff --git a/library/pdb.po b/library/pdb.po index 7a11505fed..e7970946a9 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-13 00:30+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -235,7 +235,7 @@ msgstr "" msgid "Example call to enable tracing with *skip*::" msgstr "" -#: ../../library/pdb.rst:22 +#: ../../library/pdb.rst:210 msgid "" "Raises an :ref:`auditing event ` ``pdb.Pdb`` with no arguments." msgstr "" diff --git a/library/pickle.po b/library/pickle.po index 84757fc6a0..2225cbf6da 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,8 +30,8 @@ msgstr "**原始碼:**\\ :source:`Lib/pickle.py`" msgid "" "The :mod:`pickle` module implements binary protocols for serializing and de-" "serializing a Python object structure. *\"Pickling\"* is the process " -"whereby a Python object hierarchy is converted into a byte stream, and *" -"\"unpickling\"* is the inverse operation, whereby a byte stream (from a :" +"whereby a Python object hierarchy is converted into a byte stream, and " +"*\"unpickling\"* is the inverse operation, whereby a byte stream (from a :" "term:`binary file` or :term:`bytes-like object`) is converted back into an " "object hierarchy. Pickling (and unpickling) is alternatively known as " "\"serialization\", \"marshalling,\" [#]_ or \"flattening\"; however, to " @@ -616,7 +616,7 @@ msgid "" "`pickle-restrict` for details." msgstr "" -#: ../../library/pickle.rst:10 +#: ../../library/pickle.rst:460 msgid "" "Raises an :ref:`auditing event ` ``pickle.find_class`` with " "arguments ``module``, ``name``." diff --git a/library/pkgutil.po b/library/pkgutil.po index a9977c78fc..87f1684b57 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-08 00:15+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,10 +44,10 @@ msgstr "" #: ../../library/pkgutil.rst:28 msgid "" -"This will add to the package's ``__path__`` all subdirectories of " -"directories on :data:`sys.path` named after the package. This is useful if " -"one wants to distribute different parts of a single logical package as " -"multiple directories." +"For each directory on :data:`sys.path` that has a subdirectory that matches " +"the package name, add the subdirectory to the package's :attr:`__path__`. " +"This is useful if one wants to distribute different parts of a single " +"logical package as multiple directories." msgstr "" #: ../../library/pkgutil.rst:33 @@ -220,9 +220,9 @@ msgstr "" msgid "" "*onerror* is a function which gets called with one argument (the name of the " "package which was being imported) if any exception occurs while trying to " -"import a package. If no *onerror* function is supplied, :exc:`ImportError`" -"\\s are caught and ignored, while all other exceptions are propagated, " -"terminating the search." +"import a package. If no *onerror* function is supplied, :exc:" +"`ImportError`\\s are caught and ignored, while all other exceptions are " +"propagated, terminating the search." msgstr "" #: ../../library/pkgutil.rst:185 diff --git a/library/poplib.po b/library/poplib.po index e2f1a19dec..a3764f5e2f 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -75,13 +75,13 @@ msgid "" "timeout setting will be used)." msgstr "" -#: ../../library/poplib.rst:7 ../../library/poplib.rst:13 +#: ../../library/poplib.rst:55 ../../library/poplib.rst:81 msgid "" "Raises an :ref:`auditing event ` ``poplib.connect`` with arguments " "``self``, ``host``, ``port``." msgstr "" -#: ../../library/poplib.rst:9 ../../library/poplib.rst:15 +#: ../../library/poplib.rst:57 ../../library/poplib.rst:83 msgid "" "Raises an :ref:`auditing event ` ``poplib.putline`` with arguments " "``self``, ``line``." diff --git a/library/pty.po b/library/pty.po index 9a098648b0..67f58b0611 100644 --- a/library/pty.po +++ b/library/pty.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -114,7 +114,7 @@ msgid "" "an exit code." msgstr "" -#: ../../library/pty.rst:34 +#: ../../library/pty.rst:77 msgid "" "Raises an :ref:`auditing event ` ``pty.spawn`` with argument " "``argv``." diff --git a/library/readline.po b/library/readline.po index 849a920c0c..0d5abc93af 100644 --- a/library/readline.po +++ b/library/readline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-03 00:22+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,9 +37,10 @@ msgstr "" msgid "" "Readline keybindings may be configured via an initialization file, typically " "``.inputrc`` in your home directory. See `Readline Init File `_ in the GNU Readline " -"manual for information about the format and allowable constructs of that " -"file, and the capabilities of the Readline library in general." +"tiswww.cwru.edu/php/chet/readline/rluserman.html#Readline-Init-File>`_ in " +"the GNU Readline manual for information about the format and allowable " +"constructs of that file, and the capabilities of the Readline library in " +"general." msgstr "" #: ../../library/readline.rst:29 diff --git a/library/resource.po b/library/resource.po index efae249b7e..abb349de08 100644 --- a/library/resource.po +++ b/library/resource.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -121,7 +121,7 @@ msgstr "" msgid "VxWorks only supports setting :data:`RLIMIT_NOFILE`." msgstr "" -#: ../../library/resource.rst:20 +#: ../../library/resource.rst:94 msgid "" "Raises an :ref:`auditing event ` ``resource.setrlimit`` with " "arguments ``resource``, ``limits``." @@ -150,7 +150,7 @@ msgid "" "process." msgstr "" -#: ../../library/resource.rst:15 +#: ../../library/resource.rst:113 msgid "" "Raises an :ref:`auditing event ` ``resource.prlimit`` with " "arguments ``pid``, ``resource``, ``limits``." diff --git a/library/shutil.po b/library/shutil.po index 90b35cde0d..92fc9af44d 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -92,7 +92,8 @@ msgid "" "link will be created instead of copying the file *src* points to." msgstr "" -#: ../../library/shutil.rst:17 ../../library/shutil.rst:18 +#: ../../library/shutil.rst:70 ../../library/shutil.rst:177 +#: ../../library/shutil.rst:208 msgid "" "Raises an :ref:`auditing event ` ``shutil.copyfile`` with " "arguments ``src``, ``dst``." @@ -137,7 +138,7 @@ msgid "" "platform, and it is asked to do so, it will do nothing and return." msgstr "" -#: ../../library/shutil.rst:11 ../../library/shutil.rst:20 +#: ../../library/shutil.rst:106 ../../library/shutil.rst:179 msgid "" "Raises an :ref:`auditing event ` ``shutil.copymode`` with " "arguments ``src``, ``dst``." @@ -200,7 +201,7 @@ msgstr "" msgid "Please see :data:`os.supports_follow_symlinks` for more information." msgstr "更多資訊請見 :data:`os.supports_follow_symlinks`\\ 。" -#: ../../library/shutil.rst:19 ../../library/shutil.rst:41 +#: ../../library/shutil.rst:153 ../../library/shutil.rst:210 msgid "" "Raises an :ref:`auditing event ` ``shutil.copystat`` with " "arguments ``src``, ``dst``." @@ -343,7 +344,7 @@ msgid "" "*src* tree." msgstr "" -#: ../../library/shutil.rst:43 +#: ../../library/shutil.rst:275 msgid "" "Raises an :ref:`auditing event ` ``shutil.copytree`` with " "arguments ``src``, ``dst``." @@ -405,7 +406,7 @@ msgid "" "exc_info`. Exceptions raised by *onerror* will not be caught." msgstr "" -#: ../../library/shutil.rst:31 +#: ../../library/shutil.rst:327 msgid "" "Raises an :ref:`auditing event ` ``shutil.rmtree`` with arguments " "``path``, ``dir_fd``." @@ -466,7 +467,7 @@ msgid "" "the expense of not copying any of the metadata." msgstr "" -#: ../../library/shutil.rst:21 +#: ../../library/shutil.rst:371 msgid "" "Raises an :ref:`auditing event ` ``shutil.move`` with arguments " "``src``, ``dst``." @@ -515,7 +516,7 @@ msgstr "" msgid "See also :func:`os.chown`, the underlying function." msgstr "" -#: ../../library/shutil.rst:8 +#: ../../library/shutil.rst:412 msgid "" "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " "``path``, ``user``, ``group``." @@ -701,7 +702,7 @@ msgstr "" msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:32 +#: ../../library/shutil.rst:573 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." @@ -811,7 +812,7 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:13 +#: ../../library/shutil.rst:643 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." diff --git a/library/signal.po b/library/signal.po index 2f4a7925aa..13e2737ecd 100644 --- a/library/signal.po +++ b/library/signal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -493,7 +493,7 @@ msgid "" "performed; this can be used to check if the target thread is still running." msgstr "" -#: ../../library/signal.rst:16 +#: ../../library/signal.rst:433 msgid "" "Raises an :ref:`auditing event ` ``signal.pthread_kill`` with " "arguments ``thread_id``, ``signalnum``." diff --git a/library/smtplib.po b/library/smtplib.po index 55d19a9c15..a44773603e 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -78,7 +78,7 @@ msgid "" "keyword:`!with` statement exits. E.g.::" msgstr "" -#: ../../library/smtplib.rst:34 +#: ../../library/smtplib.rst:70 msgid "" "Raises an :ref:`auditing event ` ``smtplib.send`` with arguments " "``self``, ``data``." @@ -310,7 +310,7 @@ msgid "" "connection response." msgstr "" -#: ../../library/smtplib.rst:9 +#: ../../library/smtplib.rst:273 msgid "" "Raises an :ref:`auditing event ` ``smtplib.connect`` with " "arguments ``self``, ``host``, ``port``." diff --git a/library/socket.po b/library/socket.po index f2abdf4044..78f628157c 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-05 00:26+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+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-" @@ -774,7 +774,7 @@ msgstr "" msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:22 +#: ../../library/socket.rst:637 msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." @@ -1010,7 +1010,7 @@ msgid "" "be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:30 +#: ../../library/socket.rst:848 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." @@ -1054,7 +1054,7 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:7 ../../library/socket.rst:10 +#: ../../library/socket.rst:886 ../../library/socket.rst:902 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." @@ -1089,7 +1089,7 @@ msgid "" "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:4 +#: ../../library/socket.rst:912 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." @@ -1112,7 +1112,7 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:9 +#: ../../library/socket.rst:930 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." @@ -1137,7 +1137,7 @@ msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:11 +#: ../../library/socket.rst:947 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." @@ -1159,7 +1159,7 @@ msgid "" "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:5 +#: ../../library/socket.rst:969 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." @@ -1172,7 +1172,7 @@ msgid "" "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:5 +#: ../../library/socket.rst:980 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." @@ -1362,7 +1362,7 @@ msgid "" "you don't have enough rights." msgstr "" -#: ../../library/socket.rst:4 +#: ../../library/socket.rst:1167 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." @@ -1505,7 +1505,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:4 +#: ../../library/socket.rst:1304 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." @@ -1557,7 +1557,7 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:8 ../../library/socket.rst:11 +#: ../../library/socket.rst:1345 ../../library/socket.rst:1365 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." @@ -1895,7 +1895,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:7 +#: ../../library/socket.rst:1720 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -1933,7 +1933,7 @@ msgstr "" msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/socket.rst:34 +#: ../../library/socket.rst:1763 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." diff --git a/library/sqlite3.po b/library/sqlite3.po index 34d44525d3..af42c74244 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-23 00:31+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -335,13 +335,13 @@ msgstr "" msgid "Return type" msgstr "" -#: ../../library/sqlite3.rst:67 +#: ../../library/sqlite3.rst:330 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -#: ../../library/sqlite3.rst:68 +#: ../../library/sqlite3.rst:331 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." @@ -999,7 +999,7 @@ msgid "" "program:`configure`." msgstr "" -#: ../../library/sqlite3.rst:17 +#: ../../library/sqlite3.rst:955 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." @@ -1016,7 +1016,7 @@ msgid "" "method." msgstr "" -#: ../../library/sqlite3.rst:5 +#: ../../library/sqlite3.rst:1006 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." diff --git a/library/subprocess.po b/library/subprocess.po index 410e8fa7fa..995bb27222 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-13 00:33+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -875,7 +875,7 @@ msgid "" "waited for. ::" msgstr "" -#: ../../library/subprocess.rst:334 +#: ../../library/subprocess.rst:707 msgid "" "Raises an :ref:`auditing event ` ``subprocess.Popen`` with " "arguments ``executable``, ``args``, ``cwd``, ``env``." diff --git a/library/sys.po b/library/sys.po index 8084625db0..1797877370 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-06 00:29+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,7 +69,7 @@ msgid "" "mod:`ctypes`) should be completely removed or closely monitored." msgstr "" -#: ../../library/sys.rst:20 +#: ../../library/sys.rst:47 msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " "arguments." @@ -255,7 +255,7 @@ msgid "" "by the time calling code examines the frame." msgstr "" -#: ../../library/sys.rst:14 +#: ../../library/sys.rst:208 msgid "" "Raises an :ref:`auditing event ` ``sys._current_frames`` with no " "arguments." @@ -273,7 +273,7 @@ msgstr "" msgid "This is most useful for statistical profiling." msgstr "" -#: ../../library/sys.rst:10 +#: ../../library/sys.rst:221 msgid "" "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " "no arguments." @@ -482,7 +482,7 @@ msgid "" "excepthook``." msgstr "" -#: ../../library/sys.rst:10 +#: ../../library/sys.rst:386 msgid "" "Raises an :ref:`auditing event ` ``sys.excepthook`` with arguments " "``hook``, ``type``, ``value``, ``traceback``." @@ -1193,7 +1193,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:6 +#: ../../library/sys.rst:803 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1545,7 +1545,7 @@ msgid "" "`." msgstr "" -#: ../../library/sys.rst:7 +#: ../../library/sys.rst:1059 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1973,7 +1973,7 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:21 +#: ../../library/sys.rst:1379 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." @@ -2183,7 +2183,7 @@ msgstr "" msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:78 +#: ../../library/sys.rst:1513 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." @@ -2212,13 +2212,13 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:7 +#: ../../library/sys.rst:1535 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." msgstr "" -#: ../../library/sys.rst:9 +#: ../../library/sys.rst:1537 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2553,7 +2553,7 @@ msgstr "" msgid "See also :func:`excepthook` which handles uncaught exceptions." msgstr "" -#: ../../library/sys.rst:32 +#: ../../library/sys.rst:1766 msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " "arguments ``hook``, ``unraisable``." diff --git a/library/syslog.po b/library/syslog.po index fcab4d18ba..8cdd14eeb8 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -67,7 +67,7 @@ msgid "" "func:`openlog` will be called with no arguments." msgstr "" -#: ../../library/syslog.rst:11 +#: ../../library/syslog.rst:47 msgid "" "Raises an :ref:`auditing event ` ``syslog.syslog`` with arguments " "``priority``, ``message``." @@ -97,7 +97,7 @@ msgid "" "for messages which do not have a facility explicitly encoded." msgstr "" -#: ../../library/syslog.rst:12 +#: ../../library/syslog.rst:68 msgid "" "Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments " "``ident``, ``logoption``, ``facility``." @@ -122,7 +122,7 @@ msgid "" "`openlog` parameters are reset to defaults." msgstr "" -#: ../../library/syslog.rst:8 +#: ../../library/syslog.rst:84 msgid "" "Raises an :ref:`auditing event ` ``syslog.closelog`` with no " "arguments." @@ -138,7 +138,7 @@ msgid "" "and including *pri*." msgstr "" -#: ../../library/syslog.rst:8 +#: ../../library/syslog.rst:96 msgid "" "Raises an :ref:`auditing event ` ``syslog.setlogmask`` with " "argument ``maskpri``." diff --git a/library/telnetlib.po b/library/telnetlib.po index a7fcd0d429..182939aa8e 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2022-05-22 02:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -194,7 +194,7 @@ msgstr "" msgid "Do not try to reopen an already connected instance." msgstr "" -#: ../../library/telnetlib.rst:8 +#: ../../library/telnetlib.rst:161 msgid "" "Raises an :ref:`auditing event ` ``telnetlib.Telnet.open`` with " "arguments ``self``, ``host``, ``port``." @@ -232,7 +232,7 @@ msgid "" "connection is closed." msgstr "" -#: ../../library/telnetlib.rst:5 +#: ../../library/telnetlib.rst:198 msgid "" "Raises an :ref:`auditing event ` ``telnetlib.Telnet.write`` with " "arguments ``self``, ``buffer``." diff --git a/library/tempfile.po b/library/tempfile.po index 6c9afc8090..14010ec75b 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -134,8 +134,8 @@ msgid "" msgstr "" "在不是 Posix 或 Cygwin 的平臺上,TemporaryFile 是 NamedTemporaryFile 的別名。" -#: ../../library/tempfile.rst:17 ../../library/tempfile.rst:33 -#: ../../library/tempfile.rst:42 +#: ../../library/tempfile.rst:68 ../../library/tempfile.rst:96 +#: ../../library/tempfile.rst:205 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkstemp`` with " "argument ``fullpath``." @@ -263,7 +263,7 @@ msgstr "" "被引發(:func:`cleanup` 呼叫、退出情境管理器、物件被作為垃圾回收或直譯器關閉" "等)。" -#: ../../library/tempfile.rst:13 ../../library/tempfile.rst:21 +#: ../../library/tempfile.rst:154 ../../library/tempfile.rst:231 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkdtemp`` with " "argument ``fullpath``." diff --git a/library/types.po b/library/types.po index ac3865f499..e1595e4ade 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-12 00:29+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -171,7 +171,7 @@ msgid "" "`lambda` expressions." msgstr "" -#: ../../library/types.rst:4 +#: ../../library/types.rst:119 msgid "" "Raises an :ref:`auditing event ` ``function.__new__`` with " "argument ``code``." @@ -205,7 +205,7 @@ msgstr "" msgid "The type for code objects such as returned by :func:`compile`." msgstr "" -#: ../../library/types.rst:5 +#: ../../library/types.rst:153 msgid "" "Raises an :ref:`auditing event ` ``code.__new__`` with arguments " "``code``, ``filename``, ``name``, ``argcount``, ``posonlyargcount``, " diff --git a/library/urllib.request.po b/library/urllib.request.po index 205c041793..a179b31946 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -194,7 +194,7 @@ msgstr "" "的處理,以往是透過傳遞 dictionary(字典)參數給 ``urllib.urlopen`` 來取得的," "現在則可以透過 :class:`ProxyHandler` 物件來取得。" -#: ../../library/urllib.request.rst:61 +#: ../../library/urllib.request.rst:102 msgid "" "Raises an :ref:`auditing event ` ``urllib.Request`` with arguments " "``fullurl``, ``data``, ``headers``, ``method``." diff --git a/library/webbrowser.po b/library/webbrowser.po index 61eb1a3727..cd8c44293a 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -109,7 +109,7 @@ msgid "" "is neither supported nor portable." msgstr "" -#: ../../library/webbrowser.rst:12 +#: ../../library/webbrowser.rst:80 msgid "" "Raises an :ref:`auditing event ` ``webbrowser.open`` with argument " "``url``." diff --git a/library/winreg.po b/library/winreg.po index 44a722e6c0..19684b210c 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -79,7 +79,7 @@ msgid "" "exc:`OSError` exception is raised." msgstr "" -#: ../../library/winreg.rst:12 +#: ../../library/winreg.rst:56 msgid "" "Raises an :ref:`auditing event ` ``winreg.ConnectRegistry`` with " "arguments ``computer_name``, ``key``." @@ -126,14 +126,14 @@ msgstr "" msgid "If the key already exists, this function opens the existing key." msgstr "" -#: ../../library/winreg.rst:17 ../../library/winreg.rst:23 +#: ../../library/winreg.rst:80 ../../library/winreg.rst:112 msgid "" "Raises an :ref:`auditing event ` ``winreg.CreateKey`` with " "arguments ``key``, ``sub_key``, ``access``." msgstr "" -#: ../../library/winreg.rst:19 ../../library/winreg.rst:20 -#: ../../library/winreg.rst:25 +#: ../../library/winreg.rst:82 ../../library/winreg.rst:114 +#: ../../library/winreg.rst:324 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey/result`` with " "argument ``key``." @@ -172,7 +172,7 @@ msgid "" "removed. If the method fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/winreg.rst:14 ../../library/winreg.rst:24 +#: ../../library/winreg.rst:137 ../../library/winreg.rst:168 msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteKey`` with " "arguments ``key``, ``sub_key``, ``access``." @@ -205,7 +205,7 @@ msgstr "" msgid "*value* is a string that identifies the value to remove." msgstr "" -#: ../../library/winreg.rst:8 +#: ../../library/winreg.rst:185 msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteValue`` with " "arguments ``key``, ``value``." @@ -226,7 +226,7 @@ msgid "" "indicating, no more values are available." msgstr "" -#: ../../library/winreg.rst:12 +#: ../../library/winreg.rst:201 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumKey`` with arguments " "``key``, ``index``." @@ -292,7 +292,7 @@ msgid "" "for :meth:`SetValueEx`)" msgstr "" -#: ../../library/winreg.rst:28 +#: ../../library/winreg.rst:236 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumValue`` with " "arguments ``key``, ``index``." @@ -304,7 +304,7 @@ msgid "" "`REG_EXPAND_SZ`::" msgstr "" -#: ../../library/winreg.rst:7 +#: ../../library/winreg.rst:253 msgid "" "Raises an :ref:`auditing event ` ``winreg." "ExpandEnvironmentStrings`` with argument ``str``." @@ -368,7 +368,7 @@ msgid "" "specified in *file_name* is relative to the remote computer." msgstr "" -#: ../../library/winreg.rst:22 +#: ../../library/winreg.rst:299 msgid "" "Raises an :ref:`auditing event ` ``winreg.LoadKey`` with arguments " "``key``, ``sub_key``, ``file_name``." @@ -403,7 +403,7 @@ msgstr "" msgid "If the function fails, :exc:`OSError` is raised." msgstr "" -#: ../../library/winreg.rst:18 +#: ../../library/winreg.rst:322 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey`` with arguments " "``key``, ``sub_key``, ``access``." @@ -431,7 +431,7 @@ msgid "" "nanoseconds since Jan 1, 1601." msgstr "" -#: ../../library/winreg.rst:22 +#: ../../library/winreg.rst:356 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryInfoKey`` with " "argument ``key``." @@ -457,7 +457,7 @@ msgid "" "`QueryValueEx` if possible." msgstr "" -#: ../../library/winreg.rst:15 ../../library/winreg.rst:21 +#: ../../library/winreg.rst:375 ../../library/winreg.rst:400 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryValue`` with " "arguments ``key``, ``sub_key``, ``value_name``." @@ -513,7 +513,7 @@ msgstr "" msgid "This function passes ``NULL`` for *security_attributes* to the API." msgstr "" -#: ../../library/winreg.rst:21 +#: ../../library/winreg.rst:425 msgid "" "Raises an :ref:`auditing event ` ``winreg.SaveKey`` with arguments " "``key``, ``file_name``." @@ -559,7 +559,7 @@ msgid "" "`KEY_SET_VALUE` access." msgstr "" -#: ../../library/winreg.rst:24 ../../library/winreg.rst:26 +#: ../../library/winreg.rst:453 ../../library/winreg.rst:483 msgid "" "Raises an :ref:`auditing event ` ``winreg.SetValue`` with " "arguments ``key``, ``sub_key``, ``type``, ``value``." @@ -616,7 +616,7 @@ msgid "" "subkeys." msgstr "" -#: ../../library/winreg.rst:14 +#: ../../library/winreg.rst:501 msgid "" "Raises an :ref:`auditing event ` ``winreg.DisableReflectionKey`` " "with argument ``key``." @@ -631,7 +631,7 @@ msgid "" "Restoring reflection for a key does not affect reflection of any subkeys." msgstr "" -#: ../../library/winreg.rst:11 +#: ../../library/winreg.rst:516 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnableReflectionKey`` " "with argument ``key``." @@ -645,7 +645,7 @@ msgstr "" msgid "Returns ``True`` if reflection is disabled." msgstr "" -#: ../../library/winreg.rst:11 +#: ../../library/winreg.rst:531 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryReflectionKey`` " "with argument ``key``." @@ -821,8 +821,8 @@ msgstr "" #: ../../library/winreg.rst:689 msgid "" -"Null-terminated string containing references to environment variables (``" -"%PATH%``)." +"Null-terminated string containing references to environment variables " +"(``%PATH%``)." msgstr "" #: ../../library/winreg.rst:694 @@ -936,7 +936,7 @@ msgid "" "underlying Win32 handle to exist beyond the lifetime of the handle object." msgstr "" -#: ../../library/winreg.rst:11 +#: ../../library/winreg.rst:784 msgid "" "Raises an :ref:`auditing event ` ``winreg.PyHKEY.Detach`` with " "argument ``key``." diff --git a/reference/datamodel.po b/reference/datamodel.po index 3e4bbdabd4..03bdb2c864 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-12 00:29+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1944,7 +1944,7 @@ msgid "" "See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:16 +#: ../../reference/datamodel.rst:1638 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -1970,7 +1970,7 @@ msgid "" "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:9 +#: ../../reference/datamodel.rst:1655 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -1990,7 +1990,7 @@ msgid "" "object." msgstr "" -#: ../../reference/datamodel.rst:4 +#: ../../reference/datamodel.rst:1667 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." diff --git a/using/cmdline.po b/using/cmdline.po index 911d1d2e5d..1f371926a8 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-17 00:30+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -118,7 +118,7 @@ msgid "" "modules)." msgstr "" -#: ../../using/cmdline.rst:10 +#: ../../using/cmdline.rst:73 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_command`` with " "argument ``command``." @@ -177,7 +177,7 @@ msgid "" "execution as a script. An example is the :mod:`timeit` module::" msgstr "" -#: ../../using/cmdline.rst:39 +#: ../../using/cmdline.rst:115 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_module`` with " "argument ``module-name``." @@ -216,7 +216,7 @@ msgid "" "path`." msgstr "" -#: ../../using/cmdline.rst:8 +#: ../../using/cmdline.rst:140 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no " "arguments." @@ -258,7 +258,7 @@ msgid "" "too." msgstr "" -#: ../../using/cmdline.rst:22 +#: ../../using/cmdline.rst:167 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_file`` with " "argument ``filename``." @@ -875,7 +875,7 @@ msgid "" "file." msgstr "" -#: ../../using/cmdline.rst:8 +#: ../../using/cmdline.rst:665 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_startup`` with " "argument ``filename``." diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 656b33d763..32e9d9f8b1 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -187,7 +187,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:174 msgid "" "Hosting of the Python bug tracker is kindly provided by `Upfront Systems " -"`__ of Stellenbosch, South Africa. Martin " +"`__ of Stellenbosch, South Africa. Martin " "von Löwis put a lot of effort into importing existing bugs and patches from " "SourceForge; his scripts for this import operation are at ``https://svn." "python.org/view/tracker/importer/`` and may be useful to other projects " @@ -1028,9 +1028,9 @@ msgstr "" #: ../../whatsnew/2.6.rst:920 msgid "" -"Python 3.0 makes this unambiguous by replacing the comma with the word \"as" -"\". To catch an exception and store the exception object in the variable " -"``exc``, you must write::" +"Python 3.0 makes this unambiguous by replacing the comma with the word " +"\"as\". To catch an exception and store the exception object in the " +"variable ``exc``, you must write::" msgstr "" #: ../../whatsnew/2.6.rst:929 @@ -1454,10 +1454,10 @@ msgstr "" #: ../../whatsnew/2.6.rst:1337 msgid "" -"The :func:`int` and :func:`long` builtins will now accept the \"0o\" and \"0b" -"\" prefixes when base-8 or base-2 are requested, or when the *base* argument " -"is zero (signalling that the base used should be determined from the " -"string)::" +"The :func:`int` and :func:`long` builtins will now accept the \"0o\" and " +"\"0b\" prefixes when base-8 or base-2 are requested, or when the *base* " +"argument is zero (signalling that the base used should be determined from " +"the string)::" msgstr "" #: ../../whatsnew/2.6.rst:1355 @@ -1709,8 +1709,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:1598 msgid "" "Many floating-point features were added. The :func:`float` function will " -"now turn the string ``nan`` into an IEEE 754 Not A Number value, and ``" -"+inf`` and ``-inf`` into positive or negative infinity. This works on any " +"now turn the string ``nan`` into an IEEE 754 Not A Number value, and " +"``+inf`` and ``-inf`` into positive or negative infinity. This works on any " "platform with IEEE 754 semantics. (Contributed by Christian Heimes; :issue:" "`1635`.)" msgstr "" @@ -2617,8 +2617,8 @@ msgid "" "The :func:`setitimer` and :func:`getitimer` functions have also been added " "(where they're available). :func:`setitimer` allows setting interval timers " "that will cause a signal to be delivered to the process after a specified " -"time, measured in wall-clock time, consumed process time, or combined process" -"+system time. (Contributed by Guilherme Polo; :issue:`2240`.)" +"time, measured in wall-clock time, consumed process time, or combined " +"process+system time. (Contributed by Guilherme Polo; :issue:`2240`.)" msgstr "" #: ../../whatsnew/2.6.rst:2348 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 32c8745257..26c116a784 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -179,9 +179,9 @@ msgstr "" msgid "" "You can re-enable display of :exc:`DeprecationWarning` messages by running " "Python with the :option:`-Wdefault <-W>` (short form: :option:`-Wd <-W>`) " -"switch, or by setting the :envvar:`PYTHONWARNINGS` environment variable to ``" -"\"default\"`` (or ``\"d\"``) before running Python. Python code can also re-" -"enable them by calling ``warnings.simplefilter('default')``." +"switch, or by setting the :envvar:`PYTHONWARNINGS` environment variable to " +"``\"default\"`` (or ``\"d\"``) before running Python. Python code can also " +"re-enable them by calling ``warnings.simplefilter('default')``." msgstr "" #: ../../whatsnew/2.7.rst:165 @@ -2376,8 +2376,8 @@ msgid "" "ElementTree's code for converting trees to a string has been significantly " "reworked, making it roughly twice as fast in many cases. The :meth:" "`ElementTree.write() ` and :meth:" -"`Element.write` methods now have a *method* parameter that can be \"xml" -"\" (the default), \"html\", or \"text\". HTML mode will output empty " +"`Element.write` methods now have a *method* parameter that can be " +"\"xml\" (the default), \"html\", or \"text\". HTML mode will output empty " "elements as ```` instead of ````, and text mode will " "skip over elements and only output the text chunks. If you set the :attr:" "`tag` attribute of an element to ``None`` but leave its children in place, " @@ -2448,14 +2448,15 @@ msgstr "" #: ../../whatsnew/2.7.rst:2104 msgid "" "The latest release of the GNU Debugger, GDB 7, can be `scripted using Python " -"`__. When you " -"begin debugging an executable program P, GDB will look for a file named ``P-" -"gdb.py`` and automatically read it. Dave Malcolm contributed a :file:" -"`python-gdb.py` that adds a number of commands useful when debugging Python " -"itself. For example, ``py-up`` and ``py-down`` go up or down one Python " -"stack frame, which usually corresponds to several C stack frames. ``py-" -"print`` prints the value of a Python variable, and ``py-bt`` prints the " -"Python stack trace. (Added as a result of :issue:`8032`.)" +"`__. When you begin debugging an " +"executable program P, GDB will look for a file named ``P-gdb.py`` and " +"automatically read it. Dave Malcolm contributed a :file:`python-gdb.py` " +"that adds a number of commands useful when debugging Python itself. For " +"example, ``py-up`` and ``py-down`` go up or down one Python stack frame, " +"which usually corresponds to several C stack frames. ``py-print`` prints " +"the value of a Python variable, and ``py-bt`` prints the Python stack " +"trace. (Added as a result of :issue:`8032`.)" msgstr "" #: ../../whatsnew/2.7.rst:2116 @@ -2574,8 +2575,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:2202 msgid "" "New format codes: the :c:func:`PyFormat_FromString`, :c:func:" -"`PyFormat_FromStringV`, and :c:func:`PyErr_Format` functions now accept ``" -"%lld`` and ``%llu`` format codes for displaying C's :c:expr:`long long` " +"`PyFormat_FromStringV`, and :c:func:`PyErr_Format` functions now accept " +"``%lld`` and ``%llu`` format codes for displaying C's :c:expr:`long long` " "types. (Contributed by Mark Dickinson; :issue:`7228`.)" msgstr "" From 39565d73478614e66109de3764abe151d685920c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 25 Apr 2023 00:32:19 +0000 Subject: [PATCH 072/130] sync with cpython 56d50dd9 --- howto/argparse.po | 208 +++++++++-------- howto/descriptor.po | 63 +++-- library/argparse.po | 36 ++- library/asyncio-task.po | 176 +++++++------- library/dataclasses.po | 340 ++++++++++++++------------- library/optparse.po | 498 ++++++++++++++++++++++------------------ library/pkgutil.po | 5 +- using/windows.po | 4 +- 8 files changed, 720 insertions(+), 610 deletions(-) diff --git a/howto/argparse.po b/howto/argparse.po index 54ab71668a..1f409343bd 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-04-25 00:30+0000\n" "PO-Revision-Date: 2022-01-31 17:33+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -24,7 +24,7 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.0.1\n" -#: ../../howto/argparse.rst:3 +#: ../../howto/argparse.rst:5 msgid "Argparse Tutorial" msgstr "Argparse 教學" @@ -32,11 +32,11 @@ msgstr "Argparse 教學" msgid "author" msgstr "作者" -#: ../../howto/argparse.rst:5 +#: ../../howto/argparse.rst:7 msgid "Tshepang Lekhonkhobe" msgstr "Tshepang Lekhonkhobe" -#: ../../howto/argparse.rst:9 +#: ../../howto/argparse.rst:11 msgid "" "This tutorial is intended to be a gentle introduction to :mod:`argparse`, " "the recommended command-line parsing module in the Python standard library." @@ -44,39 +44,40 @@ msgstr "" "這個教學傾向簡介 Python 官方標準含式庫中推薦的命令列剖析模組 :mod:" "`argparse`。" -#: ../../howto/argparse.rst:14 +#: ../../howto/argparse.rst:16 +#, fuzzy msgid "" "There are two other modules that fulfill the same task, namely :mod:`getopt` " -"(an equivalent for :c:func:`getopt` from the C language) and the deprecated :" -"mod:`optparse`. Note also that :mod:`argparse` is based on :mod:`optparse`, " -"and therefore very similar in terms of usage." +"(an equivalent for ``getopt()`` from the C language) and the deprecated :mod:" +"`optparse`. Note also that :mod:`argparse` is based on :mod:`optparse`, and " +"therefore very similar in terms of usage." msgstr "" "另外兩個具有同樣功能的模組 :mod:`getopt`\\ (一個相等於 C 語言中的 :c:func:" "`getopt`\\ )以及被棄用的 :mod:`optparse`\\ 。而 :mod:`argparse` 也是根據 :" "mod:`optparse` 為基礎發展而來,因此有非常近似的使用方式。" -#: ../../howto/argparse.rst:22 +#: ../../howto/argparse.rst:24 msgid "Concepts" msgstr "概念" -#: ../../howto/argparse.rst:24 +#: ../../howto/argparse.rst:26 msgid "" "Let's show the sort of functionality that we are going to explore in this " "introductory tutorial by making use of the :command:`ls` command:" msgstr "藉由命令 :command:`ls` 的使用開始這些功能的介紹:" -#: ../../howto/argparse.rst:46 +#: ../../howto/argparse.rst:48 msgid "A few concepts we can learn from the four commands:" msgstr "我們可以從四個命令中可以學到的幾個概念:" -#: ../../howto/argparse.rst:48 +#: ../../howto/argparse.rst:50 msgid "" "The :command:`ls` command is useful when run without any options at all. It " "defaults to displaying the contents of the current directory." msgstr "" "命令 :command:`ls` 在執行時不用其他參數就可以顯示出當前目錄底下的內容。" -#: ../../howto/argparse.rst:51 +#: ../../howto/argparse.rst:53 msgid "" "If we want beyond what it provides by default, we tell it a bit more. In " "this case, we want it to display a different directory, ``pypy``. What we " @@ -93,7 +94,7 @@ msgstr "" "用方式是 ``cp SRC DEST``\\ 。第一個位置參數代表的是\\ *想要複製的目標*\\,第" "二個位置的參數代表的則是\\ *想要複製到的地方*\\ 。" -#: ../../howto/argparse.rst:60 +#: ../../howto/argparse.rst:62 msgid "" "Now, say we want to change behaviour of the program. In our example, we " "display more info for each file instead of just showing the file names. The " @@ -102,7 +103,7 @@ msgstr "" "現在我們想再增加一些,要顯示除了檔名之外更多的資訊。在這裡就可以選擇加上 ``-" "l`` 這個參數。" -#: ../../howto/argparse.rst:64 +#: ../../howto/argparse.rst:66 msgid "" "That's a snippet of the help text. It's very useful in that you can come " "across a program you have never used before, and can figure out how it works " @@ -111,28 +112,28 @@ msgstr "" "這是 help 文件的片段。對於以前從未使用過的程序來說非常有用,可以透過這些 " "help 文件來了解這些該怎麼使用。" -#: ../../howto/argparse.rst:70 +#: ../../howto/argparse.rst:72 msgid "The basics" msgstr "基本用法" -#: ../../howto/argparse.rst:72 +#: ../../howto/argparse.rst:74 msgid "Let us start with a very simple example which does (almost) nothing::" msgstr "" "我們以一個很簡單的例子開始下面的介紹:\n" "\n" "::" -#: ../../howto/argparse.rst:78 ../../howto/argparse.rst:186 -#: ../../howto/argparse.rst:207 +#: ../../howto/argparse.rst:80 ../../howto/argparse.rst:188 +#: ../../howto/argparse.rst:209 msgid "Following is a result of running the code:" msgstr "下面是運行這些代碼的結果:" -#: ../../howto/argparse.rst:95 ../../howto/argparse.rst:252 -#: ../../howto/argparse.rst:296 +#: ../../howto/argparse.rst:97 ../../howto/argparse.rst:254 +#: ../../howto/argparse.rst:298 msgid "Here is what is happening:" msgstr "接者是發生的情況:" -#: ../../howto/argparse.rst:97 +#: ../../howto/argparse.rst:99 msgid "" "Running the script without any options results in nothing displayed to " "stdout. Not so useful." @@ -140,7 +141,7 @@ msgstr "" "運行這個腳本而沒有給與任何參數時就不會顯示任何東西至標準輸出畫面上。這裡並不" "是這麼的有用。" -#: ../../howto/argparse.rst:100 +#: ../../howto/argparse.rst:102 msgid "" "The second one starts to display the usefulness of the :mod:`argparse` " "module. We have done almost nothing, but already we get a nice help message." @@ -148,7 +149,7 @@ msgstr "" "第二個我們呈現出了 :mod:`argparse` 模組的用處。我們幾乎沒有做什麼事情,但已經" "得到一個很好的幫助信息。" -#: ../../howto/argparse.rst:103 +#: ../../howto/argparse.rst:105 msgid "" "The ``--help`` option, which can also be shortened to ``-h``, is the only " "option we get for free (i.e. no need to specify it). Specifying anything " @@ -159,47 +160,50 @@ msgstr "" "的(意即,沒有必要在這個參數後加上任何數值)。如果指定其他參數給他會造成錯" "誤。也因為這樣,我們得到了一個免費的信息。" -#: ../../howto/argparse.rst:110 +#: ../../howto/argparse.rst:112 msgid "Introducing Positional arguments" msgstr "介紹位置參數" -#: ../../howto/argparse.rst:112 +#: ../../howto/argparse.rst:114 msgid "An example::" msgstr "" "例如:\n" "\n" "::" -#: ../../howto/argparse.rst:120 +#: ../../howto/argparse.rst:122 msgid "And running the code:" msgstr "運行這段代碼:" -#: ../../howto/argparse.rst:138 +#: ../../howto/argparse.rst:140 msgid "Here is what's happening:" msgstr "接者是發生的情況:" -#: ../../howto/argparse.rst:140 +#: ../../howto/argparse.rst:142 +#, fuzzy msgid "" -"We've added the :meth:`add_argument` method, which is what we use to specify " -"which command-line options the program is willing to accept. In this case, " -"I've named it ``echo`` so that it's in line with its function." +"We've added the :meth:`~ArgumentParser.add_argument` method, which is what " +"we use to specify which command-line options the program is willing to " +"accept. In this case, I've named it ``echo`` so that it's in line with its " +"function." msgstr "" "我們增加了 :meth:`add_argument` ,利用這個方法可以指名讓我們的程式接受哪些命" "令列參數。" -#: ../../howto/argparse.rst:144 +#: ../../howto/argparse.rst:146 msgid "Calling our program now requires us to specify an option." msgstr "現在呼叫我們的程序時需要指定一個參數選項。" -#: ../../howto/argparse.rst:146 +#: ../../howto/argparse.rst:148 +#, fuzzy msgid "" -"The :meth:`parse_args` method actually returns some data from the options " -"specified, in this case, ``echo``." +"The :meth:`~ArgumentParser.parse_args` method actually returns some data " +"from the options specified, in this case, ``echo``." msgstr "" "在這個例子中, :meth:`parse_args` 這個方法確實根據了 ``echo`` 這個選項回傳了" "資料。" -#: ../../howto/argparse.rst:149 +#: ../../howto/argparse.rst:151 msgid "" "The variable is some form of 'magic' that :mod:`argparse` performs for free " "(i.e. no need to specify which variable that value is stored in). You will " @@ -207,7 +211,7 @@ msgid "" "``echo``." msgstr "" -#: ../../howto/argparse.rst:154 +#: ../../howto/argparse.rst:156 msgid "" "Note however that, although the help display looks nice and all, it " "currently is not as helpful as it can be. For example we see that we got " @@ -221,18 +225,18 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:165 +#: ../../howto/argparse.rst:167 msgid "And we get:" msgstr "然後我們得到:" -#: ../../howto/argparse.rst:178 +#: ../../howto/argparse.rst:180 msgid "Now, how about doing something even more useful::" msgstr "" "現在來做一些更有用處的事情:\n" "\n" "::" -#: ../../howto/argparse.rst:196 +#: ../../howto/argparse.rst:198 msgid "" "That didn't go so well. That's because :mod:`argparse` treats the options we " "give it as strings, unless we tell it otherwise. So, let's tell :mod:" @@ -244,29 +248,29 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:217 +#: ../../howto/argparse.rst:219 msgid "" "That went well. The program now even helpfully quits on bad illegal input " "before proceeding." msgstr "" "這樣很順利。現在程序在開始之前會因為錯誤的輸入而回報有用的訊息並結束掉。" -#: ../../howto/argparse.rst:222 +#: ../../howto/argparse.rst:224 msgid "Introducing Optional arguments" msgstr "介紹選項參數" -#: ../../howto/argparse.rst:224 +#: ../../howto/argparse.rst:226 msgid "" "So far we have been playing with positional arguments. Let us have a look on " "how to add optional ones::" msgstr "" -#: ../../howto/argparse.rst:234 ../../howto/argparse.rst:280 -#: ../../howto/argparse.rst:396 ../../howto/argparse.rst:430 +#: ../../howto/argparse.rst:236 ../../howto/argparse.rst:282 +#: ../../howto/argparse.rst:398 ../../howto/argparse.rst:432 msgid "And the output:" msgstr "接者是結果:" -#: ../../howto/argparse.rst:254 +#: ../../howto/argparse.rst:256 msgid "" "The program is written so as to display something when ``--verbosity`` is " "specified and display nothing when not." @@ -274,26 +278,26 @@ msgstr "" "這個程式是寫成如果有指名 ``--verbosity`` 這個參數選項那才顯示些資訊,反之亦" "然。" -#: ../../howto/argparse.rst:257 +#: ../../howto/argparse.rst:259 msgid "" "To show that the option is actually optional, there is no error when running " "the program without it. Note that by default, if an optional argument isn't " -"used, the relevant variable, in this case :attr:`args.verbosity`, is given " +"used, the relevant variable, in this case ``args.verbosity``, is given " "``None`` as a value, which is the reason it fails the truth test of the :" "keyword:`if` statement." msgstr "" -#: ../../howto/argparse.rst:263 +#: ../../howto/argparse.rst:265 msgid "The help message is a bit different." msgstr "Help 訊息稍微有些不一樣。" -#: ../../howto/argparse.rst:265 +#: ../../howto/argparse.rst:267 msgid "" "When using the ``--verbosity`` option, one must also specify some value, any " "value." msgstr "當使用 ``--verbosity`` 參數選項時必須要指定一個數值。" -#: ../../howto/argparse.rst:268 +#: ../../howto/argparse.rst:270 msgid "" "The above example accepts arbitrary integer values for ``--verbosity``, but " "for our simple program, only two values are actually useful, ``True`` or " @@ -304,30 +308,30 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:298 +#: ../../howto/argparse.rst:300 msgid "" "The option is now more of a flag than something that requires a value. We " "even changed the name of the option to match that idea. Note that we now " "specify a new keyword, ``action``, and give it the value ``\"store_true\"``. " -"This means that, if the option is specified, assign the value ``True`` to :" -"data:`args.verbose`. Not specifying it implies ``False``." +"This means that, if the option is specified, assign the value ``True`` to " +"``args.verbose``. Not specifying it implies ``False``." msgstr "" -#: ../../howto/argparse.rst:305 +#: ../../howto/argparse.rst:307 msgid "" "It complains when you specify a value, in true spirit of what flags actually " "are." msgstr "" -#: ../../howto/argparse.rst:308 +#: ../../howto/argparse.rst:310 msgid "Notice the different help text." msgstr "注意不同的 help 文件。" -#: ../../howto/argparse.rst:312 +#: ../../howto/argparse.rst:314 msgid "Short options" msgstr "" -#: ../../howto/argparse.rst:314 +#: ../../howto/argparse.rst:316 msgid "" "If you are familiar with command line usage, you will notice that I haven't " "yet touched on the topic of short versions of the options. It's quite " @@ -338,135 +342,135 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:326 +#: ../../howto/argparse.rst:328 msgid "And here goes:" msgstr "" -#: ../../howto/argparse.rst:339 +#: ../../howto/argparse.rst:341 msgid "Note that the new ability is also reflected in the help text." msgstr "注意新的表示對於幫助文件也是一樣的" -#: ../../howto/argparse.rst:343 +#: ../../howto/argparse.rst:345 msgid "Combining Positional and Optional arguments" msgstr "現在結合位置與選項參數" -#: ../../howto/argparse.rst:345 +#: ../../howto/argparse.rst:347 msgid "Our program keeps growing in complexity::" msgstr "" "我們的程式成長的越來越複雜:\n" "\n" "::" -#: ../../howto/argparse.rst:360 +#: ../../howto/argparse.rst:362 msgid "And now the output:" msgstr "然後現在的輸出結果:" -#: ../../howto/argparse.rst:374 +#: ../../howto/argparse.rst:376 msgid "We've brought back a positional argument, hence the complaint." msgstr "" -#: ../../howto/argparse.rst:376 +#: ../../howto/argparse.rst:378 msgid "Note that the order does not matter." msgstr "注意現在的順序對於程式來說已經不再重要了." -#: ../../howto/argparse.rst:378 +#: ../../howto/argparse.rst:380 msgid "" "How about we give this program of ours back the ability to have multiple " "verbosity values, and actually get to use them::" msgstr "" -#: ../../howto/argparse.rst:412 +#: ../../howto/argparse.rst:414 msgid "" "These all look good except the last one, which exposes a bug in our program. " "Let's fix it by restricting the values the ``--verbosity`` option can " "accept::" msgstr "" -#: ../../howto/argparse.rst:448 +#: ../../howto/argparse.rst:450 msgid "" "Note that the change also reflects both in the error message as well as the " "help string." msgstr "" -#: ../../howto/argparse.rst:451 +#: ../../howto/argparse.rst:453 msgid "" "Now, let's use a different approach of playing with verbosity, which is " "pretty common. It also matches the way the CPython executable handles its " "own verbosity argument (check the output of ``python --help``)::" msgstr "" -#: ../../howto/argparse.rst:470 +#: ../../howto/argparse.rst:472 msgid "" "We have introduced another action, \"count\", to count the number of " "occurrences of specific options." msgstr "我們已經介紹過另一個操作 \"count\" 用來計算指定的選項出現的次數。" -#: ../../howto/argparse.rst:499 +#: ../../howto/argparse.rst:501 msgid "" "Yes, it's now more of a flag (similar to ``action=\"store_true\"``) in the " "previous version of our script. That should explain the complaint." msgstr "" -#: ../../howto/argparse.rst:502 +#: ../../howto/argparse.rst:504 msgid "It also behaves similar to \"store_true\" action." msgstr "" -#: ../../howto/argparse.rst:504 +#: ../../howto/argparse.rst:506 msgid "" "Now here's a demonstration of what the \"count\" action gives. You've " "probably seen this sort of usage before." msgstr "" "現在來秀一下 \"count\" 這個動作會給予什麼。你可能之前就有見過這種用法。" -#: ../../howto/argparse.rst:507 +#: ../../howto/argparse.rst:509 msgid "" "And if you don't specify the ``-v`` flag, that flag is considered to have " "``None`` value." msgstr "" -#: ../../howto/argparse.rst:510 +#: ../../howto/argparse.rst:512 msgid "" "As should be expected, specifying the long form of the flag, we should get " "the same output." msgstr "應該要如預期那樣,就算給予長選項我們也要獲得一樣的輸出結果。" -#: ../../howto/argparse.rst:513 +#: ../../howto/argparse.rst:515 msgid "" "Sadly, our help output isn't very informative on the new ability our script " "has acquired, but that can always be fixed by improving the documentation " "for our script (e.g. via the ``help`` keyword argument)." msgstr "" -#: ../../howto/argparse.rst:517 +#: ../../howto/argparse.rst:519 msgid "That last output exposes a bug in our program." msgstr "" -#: ../../howto/argparse.rst:520 +#: ../../howto/argparse.rst:522 msgid "Let's fix::" msgstr "讓我們來解決問題" -#: ../../howto/argparse.rst:539 +#: ../../howto/argparse.rst:541 msgid "And this is what it gives:" msgstr "而這也正是它給的:" -#: ../../howto/argparse.rst:554 +#: ../../howto/argparse.rst:556 msgid "" "First output went well, and fixes the bug we had before. That is, we want " "any value >= 2 to be as verbose as possible." msgstr "" -#: ../../howto/argparse.rst:557 +#: ../../howto/argparse.rst:559 msgid "Third output not so good." msgstr "第三個輸出不是這麼的好。" -#: ../../howto/argparse.rst:559 +#: ../../howto/argparse.rst:561 msgid "Let's fix that bug::" msgstr "" "我們來修復這個錯誤:\n" "\n" "::" -#: ../../howto/argparse.rst:576 +#: ../../howto/argparse.rst:578 msgid "" "We've just introduced yet another keyword, ``default``. We've set it to " "``0`` in order to make it comparable to the other int values. Remember that " @@ -475,22 +479,22 @@ msgid "" "`TypeError` exception)." msgstr "" -#: ../../howto/argparse.rst:583 +#: ../../howto/argparse.rst:585 msgid "And:" msgstr "而且" -#: ../../howto/argparse.rst:590 +#: ../../howto/argparse.rst:592 msgid "" "You can go quite far just with what we've learned so far, and we have only " "scratched the surface. The :mod:`argparse` module is very powerful, and " "we'll explore a bit more of it before we end this tutorial." msgstr "" -#: ../../howto/argparse.rst:597 +#: ../../howto/argparse.rst:599 msgid "Getting a little more advanced" msgstr "" -#: ../../howto/argparse.rst:599 +#: ../../howto/argparse.rst:601 msgid "" "What if we wanted to expand our tiny program to perform other powers, not " "just squares::" @@ -499,45 +503,45 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:616 ../../howto/argparse.rst:654 +#: ../../howto/argparse.rst:618 ../../howto/argparse.rst:656 msgid "Output:" msgstr "結果:" -#: ../../howto/argparse.rst:637 +#: ../../howto/argparse.rst:639 msgid "" "Notice that so far we've been using verbosity level to *change* the text " "that gets displayed. The following example instead uses verbosity level to " "display *more* text instead::" msgstr "" -#: ../../howto/argparse.rst:668 +#: ../../howto/argparse.rst:670 msgid "Conflicting options" msgstr "" -#: ../../howto/argparse.rst:670 +#: ../../howto/argparse.rst:672 msgid "" "So far, we have been working with two methods of an :class:`argparse." "ArgumentParser` instance. Let's introduce a third one, :meth:" -"`add_mutually_exclusive_group`. It allows for us to specify options that " -"conflict with each other. Let's also change the rest of the program so that " -"the new functionality makes more sense: we'll introduce the ``--quiet`` " -"option, which will be the opposite of the ``--verbose`` one::" +"`~ArgumentParser.add_mutually_exclusive_group`. It allows for us to specify " +"options that conflict with each other. Let's also change the rest of the " +"program so that the new functionality makes more sense: we'll introduce the " +"``--quiet`` option, which will be the opposite of the ``--verbose`` one::" msgstr "" -#: ../../howto/argparse.rst:696 +#: ../../howto/argparse.rst:698 msgid "" "Our program is now simpler, and we've lost some functionality for the sake " "of demonstration. Anyways, here's the output:" msgstr "" -#: ../../howto/argparse.rst:714 +#: ../../howto/argparse.rst:716 msgid "" "That should be easy to follow. I've added that last output so you can see " "the sort of flexibility you get, i.e. mixing long form options with short " "form ones." msgstr "" -#: ../../howto/argparse.rst:718 +#: ../../howto/argparse.rst:720 msgid "" "Before we conclude, you probably want to tell your users the main purpose of " "your program, just in case they don't know::" @@ -547,18 +551,18 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:739 +#: ../../howto/argparse.rst:741 msgid "" "Note that slight difference in the usage text. Note the ``[-v | -q]``, which " "tells us that we can either use ``-v`` or ``-q``, but not both at the same " "time:" msgstr "" -#: ../../howto/argparse.rst:761 +#: ../../howto/argparse.rst:763 msgid "Conclusion" msgstr "結論" -#: ../../howto/argparse.rst:763 +#: ../../howto/argparse.rst:765 msgid "" "The :mod:`argparse` module offers a lot more than shown here. Its docs are " "quite detailed and thorough, and full of examples. Having gone through this " diff --git a/howto/descriptor.po b/howto/descriptor.po index ec495bab26..0007e29fb2 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-04-25 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -697,8 +697,8 @@ msgstr "" msgid "" "The descriptor protocol is simple and offers exciting possibilities. " "Several use cases are so common that they have been prepackaged into built-" -"in tools. Properties, bound methods, static methods, class methods, and \\_" -"\\_slots\\_\\_ are all based on the descriptor protocol." +"in tools. Properties, bound methods, static methods, class methods, and " +"\\_\\_slots\\_\\_ are all based on the descriptor protocol." msgstr "" #: ../../howto/descriptor.rst:957 @@ -924,18 +924,26 @@ msgid "" "`staticmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1310 +#: ../../howto/descriptor.rst:1291 +msgid "" +"The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " +"that refers to the underlying function. Also it carries forward the " +"attributes necessary to make the wrapper look like the wrapped function: " +"``__name__``, ``__qualname__``, ``__doc__``, and ``__annotations__``." +msgstr "" + +#: ../../howto/descriptor.rst:1359 msgid "Class methods" msgstr "" -#: ../../howto/descriptor.rst:1312 +#: ../../howto/descriptor.rst:1361 msgid "" "Unlike static methods, class methods prepend the class reference to the " "argument list before calling the function. This format is the same for " "whether the caller is an object or a class:" msgstr "" -#: ../../howto/descriptor.rst:1330 +#: ../../howto/descriptor.rst:1379 msgid "" "This behavior is useful whenever the method only needs to have a class " "reference and does not rely on data stored in a specific instance. One use " @@ -944,17 +952,17 @@ msgid "" "of keys. The pure Python equivalent is:" msgstr "" -#: ../../howto/descriptor.rst:1347 +#: ../../howto/descriptor.rst:1396 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "" -#: ../../howto/descriptor.rst:1357 +#: ../../howto/descriptor.rst:1406 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1408 +#: ../../howto/descriptor.rst:1484 msgid "" "The code path for ``hasattr(type(self.f), '__get__')`` was added in Python " "3.9 and makes it possible for :func:`classmethod` to support chained " @@ -962,30 +970,39 @@ msgid "" "together. In Python 3.11, this functionality was deprecated." msgstr "" -#: ../../howto/descriptor.rst:1428 +#: ../../howto/descriptor.rst:1502 +msgid "" +"The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " +"``__wrapped__`` attribute that refers to the underlying function. Also it " +"carries forward the attributes necessary to make the wrapper look like the " +"wrapped function: ``__name__``, ``__qualname__``, ``__doc__``, and " +"``__annotations__``." +msgstr "" + +#: ../../howto/descriptor.rst:1510 msgid "Member objects and __slots__" msgstr "" -#: ../../howto/descriptor.rst:1430 +#: ../../howto/descriptor.rst:1512 msgid "" "When a class defines ``__slots__``, it replaces instance dictionaries with a " "fixed-length array of slot values. From a user point of view that has " "several effects:" msgstr "" -#: ../../howto/descriptor.rst:1434 +#: ../../howto/descriptor.rst:1516 msgid "" "1. Provides immediate detection of bugs due to misspelled attribute " "assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" -#: ../../howto/descriptor.rst:1450 +#: ../../howto/descriptor.rst:1532 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" msgstr "" -#: ../../howto/descriptor.rst:1485 +#: ../../howto/descriptor.rst:1567 msgid "" "3. Saves memory. On a 64-bit Linux build, an instance with two attributes " "takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " @@ -993,19 +1010,19 @@ msgid "" "only matters when a large number of instances are going to be created." msgstr "" -#: ../../howto/descriptor.rst:1490 +#: ../../howto/descriptor.rst:1572 msgid "" "4. Improves speed. Reading instance variables is 35% faster with " "``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." msgstr "" -#: ../../howto/descriptor.rst:1493 +#: ../../howto/descriptor.rst:1575 msgid "" "5. Blocks tools like :func:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" -#: ../../howto/descriptor.rst:1515 +#: ../../howto/descriptor.rst:1597 msgid "" "It is not possible to create an exact drop-in pure Python version of " "``__slots__`` because it requires direct access to C structures and control " @@ -1015,36 +1032,36 @@ msgid "" "managed by member descriptors:" msgstr "" -#: ../../howto/descriptor.rst:1560 +#: ../../howto/descriptor.rst:1642 msgid "" "The :meth:`type.__new__` method takes care of adding member objects to class " "variables:" msgstr "" -#: ../../howto/descriptor.rst:1576 +#: ../../howto/descriptor.rst:1658 msgid "" "The :meth:`object.__new__` method takes care of creating instances that have " "slots instead of an instance dictionary. Here is a rough simulation in pure " "Python:" msgstr "" -#: ../../howto/descriptor.rst:1611 +#: ../../howto/descriptor.rst:1693 msgid "" "To use the simulation in a real class, just inherit from :class:`Object` and " "set the :term:`metaclass` to :class:`Type`:" msgstr "" -#: ../../howto/descriptor.rst:1625 +#: ../../howto/descriptor.rst:1707 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" -#: ../../howto/descriptor.rst:1646 +#: ../../howto/descriptor.rst:1728 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" -#: ../../howto/descriptor.rst:1658 +#: ../../howto/descriptor.rst:1740 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" diff --git a/library/argparse.po b/library/argparse.po index 08ecf5fb9b..8da538c75e 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-20 00:28+0000\n" +"POT-Creation-Date: 2023-04-25 00:30+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-" @@ -1110,7 +1110,7 @@ msgstr "" msgid "" "For example, JSON or YAML conversions have complex error cases that require " "better reporting than can be given by the ``type`` keyword. A :exc:`~json." -"JSONDecodeError` would not be well formatted and a :exc:`FileNotFound` " +"JSONDecodeError` would not be well formatted and a :exc:`FileNotFoundError` " "exception would not be handled at all." msgstr "" @@ -1299,7 +1299,8 @@ msgstr "" msgid "" "Action classes implement the Action API, a callable which returns a callable " "which processes arguments from the command-line. Any object which follows " -"this API may be passed as the ``action`` parameter to :meth:`add_argument`." +"this API may be passed as the ``action`` parameter to :meth:`~ArgumentParser." +"add_argument`." msgstr "" #: ../../library/argparse.rst:1444 @@ -1529,7 +1530,7 @@ msgid "" "arguments. :class:`ArgumentParser` supports the creation of such sub-" "commands with the :meth:`add_subparsers` method. The :meth:`add_subparsers` " "method is normally called with no arguments and returns a special action " -"object. This object has a single method, :meth:`~ArgumentParser." +"object. This object has a single method, :meth:`~_SubParsersAction." "add_parser`, which takes a command name and any :class:`ArgumentParser` " "constructor arguments, and returns an :class:`ArgumentParser` object that " "can be modified as usual." @@ -1616,7 +1617,7 @@ msgid "" "for that particular parser will be printed. The help message will not " "include parent parser or sibling parser messages. (A help message for each " "subparser command, however, can be given by supplying the ``help=`` argument " -"to :meth:`add_parser` as above.)" +"to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" #: ../../library/argparse.rst:1811 @@ -1842,9 +1843,9 @@ msgstr "" #: ../../library/argparse.rst:2127 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" -"`parse_known_args`. The parser may consume an option even if it's just a " -"prefix of one of its known options, instead of leaving it in the remaining " -"arguments list." +"`~ArgumentParser.parse_known_args`. The parser may consume an option even if " +"it's just a prefix of one of its known options, instead of leaving it in the " +"remaining arguments list." msgstr "" #: ../../library/argparse.rst:2134 @@ -2026,3 +2027,22 @@ msgid "" "``parser.add_argument('--version', action='version', version='')``." msgstr "" + +#: ../../library/argparse.rst:2268 +msgid "Exceptions" +msgstr "" + +#: ../../library/argparse.rst:2272 +msgid "An error from creating or using an argument (optional or positional)." +msgstr "" + +#: ../../library/argparse.rst:2274 +msgid "" +"The string value of this exception is the message, augmented with " +"information about the argument that caused it." +msgstr "" + +#: ../../library/argparse.rst:2279 +msgid "" +"Raised when something goes wrong converting a command line string to a type." +msgstr "" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index cd1262bb54..84233e679c 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-26 00:33+0000\n" +"POT-Creation-Date: 2023-04-25 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -241,7 +241,7 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1011 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1012 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" @@ -305,7 +305,7 @@ msgstr "" #: ../../library/asyncio-task.rst:337 ../../library/asyncio-task.rst:467 #: ../../library/asyncio-task.rst:595 ../../library/asyncio-task.rst:653 #: ../../library/asyncio-task.rst:679 ../../library/asyncio-task.rst:722 -#: ../../library/asyncio-task.rst:815 +#: ../../library/asyncio-task.rst:816 msgid "Example::" msgstr "" "範例:\n" @@ -396,7 +396,7 @@ msgstr "" #: ../../library/asyncio-task.rst:425 ../../library/asyncio-task.rst:516 #: ../../library/asyncio-task.rst:570 ../../library/asyncio-task.rst:717 #: ../../library/asyncio-task.rst:747 ../../library/asyncio-task.rst:799 -#: ../../library/asyncio-task.rst:821 +#: ../../library/asyncio-task.rst:822 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" @@ -683,7 +683,9 @@ msgid "" msgstr "" #: ../../library/asyncio-task.rst:760 -msgid "The *aws* iterable must not be empty." +msgid "" +"The *aws* iterable must not be empty and generators yielding tasks are not " +"accepted." msgstr "" #: ../../library/asyncio-task.rst:762 @@ -764,31 +766,31 @@ msgstr "" #: ../../library/asyncio-task.rst:807 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " -"concurrently. Return an iterator of coroutines. Each coroutine returned can " -"be awaited to get the earliest next result from the iterable of the " -"remaining awaitables." +"concurrently. Generators yielding tasks are not accepted as *aws* iterable. " +"Return an iterator of coroutines. Each coroutine returned can be awaited to " +"get the earliest next result from the iterable of the remaining awaitables." msgstr "" -#: ../../library/asyncio-task.rst:812 +#: ../../library/asyncio-task.rst:813 msgid "" "Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." msgstr "" -#: ../../library/asyncio-task.rst:824 +#: ../../library/asyncio-task.rst:825 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:830 +#: ../../library/asyncio-task.rst:831 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:834 +#: ../../library/asyncio-task.rst:835 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:836 +#: ../../library/asyncio-task.rst:837 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -796,19 +798,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:841 +#: ../../library/asyncio-task.rst:842 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:843 +#: ../../library/asyncio-task.rst:844 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were run in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:873 +#: ../../library/asyncio-task.rst:874 msgid "" "Directly calling ``blocking_io()`` in any coroutine would block the event " "loop for its duration, resulting in an additional 1 second of run time. " @@ -816,7 +818,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:880 +#: ../../library/asyncio-task.rst:881 msgid "" "Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used " "to make IO-bound functions non-blocking. However, for extension modules that " @@ -824,85 +826,85 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:889 +#: ../../library/asyncio-task.rst:890 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:893 +#: ../../library/asyncio-task.rst:894 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:895 +#: ../../library/asyncio-task.rst:896 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:898 +#: ../../library/asyncio-task.rst:899 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: ../../library/asyncio-task.rst:910 +#: ../../library/asyncio-task.rst:911 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: ../../library/asyncio-task.rst:924 +#: ../../library/asyncio-task.rst:925 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:927 +#: ../../library/asyncio-task.rst:928 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:934 +#: ../../library/asyncio-task.rst:935 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:939 +#: ../../library/asyncio-task.rst:940 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:942 +#: ../../library/asyncio-task.rst:943 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:950 +#: ../../library/asyncio-task.rst:951 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:953 +#: ../../library/asyncio-task.rst:954 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:961 +#: ../../library/asyncio-task.rst:962 msgid "Return ``True`` if *obj* is a coroutine object." msgstr "" -#: ../../library/asyncio-task.rst:967 +#: ../../library/asyncio-task.rst:968 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:971 +#: ../../library/asyncio-task.rst:972 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:974 +#: ../../library/asyncio-task.rst:975 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -910,21 +912,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:980 +#: ../../library/asyncio-task.rst:981 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:985 +#: ../../library/asyncio-task.rst:986 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:990 +#: ../../library/asyncio-task.rst:991 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -932,112 +934,112 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:995 +#: ../../library/asyncio-task.rst:996 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1000 +#: ../../library/asyncio-task.rst:1001 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:1004 +#: ../../library/asyncio-task.rst:1005 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:1008 +#: ../../library/asyncio-task.rst:1009 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1014 +#: ../../library/asyncio-task.rst:1015 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1020 +#: ../../library/asyncio-task.rst:1021 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1022 +#: ../../library/asyncio-task.rst:1023 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1027 +#: ../../library/asyncio-task.rst:1028 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1029 +#: ../../library/asyncio-task.rst:1030 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:1033 ../../library/asyncio-task.rst:1047 +#: ../../library/asyncio-task.rst:1034 ../../library/asyncio-task.rst:1048 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1036 +#: ../../library/asyncio-task.rst:1037 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1041 +#: ../../library/asyncio-task.rst:1042 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1043 +#: ../../library/asyncio-task.rst:1044 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1050 +#: ../../library/asyncio-task.rst:1051 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1055 +#: ../../library/asyncio-task.rst:1056 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1057 ../../library/asyncio-task.rst:1066 +#: ../../library/asyncio-task.rst:1058 ../../library/asyncio-task.rst:1067 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1059 +#: ../../library/asyncio-task.rst:1060 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1064 +#: ../../library/asyncio-task.rst:1065 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1068 +#: ../../library/asyncio-task.rst:1069 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1073 +#: ../../library/asyncio-task.rst:1074 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1075 +#: ../../library/asyncio-task.rst:1076 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1045,15 +1047,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1081 +#: ../../library/asyncio-task.rst:1082 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1083 +#: ../../library/asyncio-task.rst:1084 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1085 +#: ../../library/asyncio-task.rst:1086 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1062,66 +1064,66 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1094 +#: ../../library/asyncio-task.rst:1095 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1096 +#: ../../library/asyncio-task.rst:1097 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1099 +#: ../../library/asyncio-task.rst:1100 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1101 +#: ../../library/asyncio-task.rst:1102 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" -#: ../../library/asyncio-task.rst:1106 +#: ../../library/asyncio-task.rst:1107 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1112 +#: ../../library/asyncio-task.rst:1113 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1114 +#: ../../library/asyncio-task.rst:1115 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:1122 +#: ../../library/asyncio-task.rst:1123 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1124 +#: ../../library/asyncio-task.rst:1125 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1127 +#: ../../library/asyncio-task.rst:1128 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1134 +#: ../../library/asyncio-task.rst:1135 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1136 +#: ../../library/asyncio-task.rst:1137 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1139 +#: ../../library/asyncio-task.rst:1140 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1133,46 +1135,46 @@ msgid "" "addition to catching the exception." msgstr "" -#: ../../library/asyncio-task.rst:1149 +#: ../../library/asyncio-task.rst:1150 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1152 +#: ../../library/asyncio-task.rst:1153 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1157 +#: ../../library/asyncio-task.rst:1158 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1196 +#: ../../library/asyncio-task.rst:1197 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1198 +#: ../../library/asyncio-task.rst:1199 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:1204 +#: ../../library/asyncio-task.rst:1205 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1206 +#: ../../library/asyncio-task.rst:1207 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1208 +#: ../../library/asyncio-task.rst:1209 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1213 +#: ../../library/asyncio-task.rst:1214 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1181,7 +1183,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1231 +#: ../../library/asyncio-task.rst:1232 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1190,20 +1192,20 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1237 +#: ../../library/asyncio-task.rst:1238 msgid "" "If end-user code is, for some reason, suppresing cancellation by catching :" "exc:`CancelledError`, it needs to call this method to remove the " "cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:1243 +#: ../../library/asyncio-task.rst:1244 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: ../../library/asyncio-task.rst:1247 +#: ../../library/asyncio-task.rst:1248 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1212,7 +1214,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1253 +#: ../../library/asyncio-task.rst:1254 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." diff --git a/library/dataclasses.po b/library/dataclasses.po index 55431d8f40..2c919350d3 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-07 00:15+0000\n" +"POT-Creation-Date: 2023-04-25 00:30+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,9 +26,9 @@ msgstr "**原始碼:**\\ :source:`Lib/dataclasses.py`" #: ../../library/dataclasses.rst:14 msgid "" "This module provides a decorator and functions for automatically adding " -"generated :term:`special method`\\s such as :meth:`__init__` and :meth:" -"`__repr__` to user-defined classes. It was originally described in :pep:" -"`557`." +"generated :term:`special method`\\s such as :meth:`~object.__init__` and :" +"meth:`~object.__repr__` to user-defined classes. It was originally " +"described in :pep:`557`." msgstr "" #: ../../library/dataclasses.rst:19 @@ -38,7 +38,8 @@ msgid "" msgstr "" #: ../../library/dataclasses.rst:34 -msgid "will add, among other things, a :meth:`__init__` that looks like::" +msgid "" +"will add, among other things, a :meth:`~object.__init__` that looks like::" msgstr "" #: ../../library/dataclasses.rst:41 @@ -93,17 +94,19 @@ msgstr "" #: ../../library/dataclasses.rst:89 msgid "" -"``init``: If true (the default), a :meth:`__init__` method will be generated." +"``init``: If true (the default), a :meth:`~object.__init__` method will be " +"generated." msgstr "" #: ../../library/dataclasses.rst:92 msgid "" -"If the class already defines :meth:`__init__`, this parameter is ignored." +"If the class already defines :meth:`~object.__init__`, this parameter is " +"ignored." msgstr "" #: ../../library/dataclasses.rst:95 msgid "" -"``repr``: If true (the default), a :meth:`__repr__` method will be " +"``repr``: If true (the default), a :meth:`~object.__repr__` method will be " "generated. The generated repr string will have the class name and the name " "and repr of each field, in the order they are defined in the class. Fields " "that are marked as being excluded from the repr are not included. For " @@ -113,123 +116,131 @@ msgstr "" #: ../../library/dataclasses.rst:102 msgid "" -"If the class already defines :meth:`__repr__`, this parameter is ignored." +"If the class already defines :meth:`~object.__repr__`, this parameter is " +"ignored." msgstr "" #: ../../library/dataclasses.rst:105 msgid "" -"``eq``: If true (the default), an :meth:`__eq__` method will be generated. " -"This method compares the class as if it were a tuple of its fields, in " -"order. Both instances in the comparison must be of the identical type." +"``eq``: If true (the default), an :meth:`~object.__eq__` method will be " +"generated. This method compares the class as if it were a tuple of its " +"fields, in order. Both instances in the comparison must be of the identical " +"type." msgstr "" #: ../../library/dataclasses.rst:110 -msgid "If the class already defines :meth:`__eq__`, this parameter is ignored." +msgid "" +"If the class already defines :meth:`~object.__eq__`, this parameter is " +"ignored." msgstr "" #: ../../library/dataclasses.rst:113 msgid "" -"``order``: If true (the default is ``False``), :meth:`__lt__`, :meth:" -"`__le__`, :meth:`__gt__`, and :meth:`__ge__` methods will be generated. " -"These compare the class as if it were a tuple of its fields, in order. Both " -"instances in the comparison must be of the identical type. If ``order`` is " -"true and ``eq`` is false, a :exc:`ValueError` is raised." +"``order``: If true (the default is ``False``), :meth:`~object.__lt__`, :meth:" +"`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` methods " +"will be generated. These compare the class as if it were a tuple of its " +"fields, in order. Both instances in the comparison must be of the identical " +"type. If ``order`` is true and ``eq`` is false, a :exc:`ValueError` is " +"raised." msgstr "" #: ../../library/dataclasses.rst:120 msgid "" -"If the class already defines any of :meth:`__lt__`, :meth:`__le__`, :meth:" -"`__gt__`, or :meth:`__ge__`, then :exc:`TypeError` is raised." +"If the class already defines any of :meth:`~object.__lt__`, :meth:`~object." +"__le__`, :meth:`~object.__gt__`, or :meth:`~object.__ge__`, then :exc:" +"`TypeError` is raised." msgstr "" #: ../../library/dataclasses.rst:124 msgid "" -"``unsafe_hash``: If ``False`` (the default), a :meth:`__hash__` method is " -"generated according to how ``eq`` and ``frozen`` are set." +"``unsafe_hash``: If ``False`` (the default), a :meth:`~object.__hash__` " +"method is generated according to how ``eq`` and ``frozen`` are set." msgstr "" #: ../../library/dataclasses.rst:127 msgid "" -":meth:`__hash__` is used by built-in :meth:`hash()`, and when objects are " -"added to hashed collections such as dictionaries and sets. Having a :meth:" -"`__hash__` implies that instances of the class are immutable. Mutability is " -"a complicated property that depends on the programmer's intent, the " -"existence and behavior of :meth:`__eq__`, and the values of the ``eq`` and " -"``frozen`` flags in the :func:`dataclass` decorator." +":meth:`~object.__hash__` is used by built-in :meth:`hash()`, and when " +"objects are added to hashed collections such as dictionaries and sets. " +"Having a :meth:`~object.__hash__` implies that instances of the class are " +"immutable. Mutability is a complicated property that depends on the " +"programmer's intent, the existence and behavior of :meth:`~object.__eq__`, " +"and the values of the ``eq`` and ``frozen`` flags in the :func:`dataclass` " +"decorator." msgstr "" #: ../../library/dataclasses.rst:134 msgid "" -"By default, :func:`dataclass` will not implicitly add a :meth:`__hash__` " -"method unless it is safe to do so. Neither will it add or change an " -"existing explicitly defined :meth:`__hash__` method. Setting the class " -"attribute ``__hash__ = None`` has a specific meaning to Python, as described " -"in the :meth:`__hash__` documentation." +"By default, :func:`dataclass` will not implicitly add a :meth:`~object." +"__hash__` method unless it is safe to do so. Neither will it add or change " +"an existing explicitly defined :meth:`~object.__hash__` method. Setting the " +"class attribute ``__hash__ = None`` has a specific meaning to Python, as " +"described in the :meth:`~object.__hash__` documentation." msgstr "" #: ../../library/dataclasses.rst:140 msgid "" -"If :meth:`__hash__` is not explicitly defined, or if it is set to ``None``, " -"then :func:`dataclass` *may* add an implicit :meth:`__hash__` method. " -"Although not recommended, you can force :func:`dataclass` to create a :meth:" -"`__hash__` method with ``unsafe_hash=True``. This might be the case if your " -"class is logically immutable but can nonetheless be mutated. This is a " -"specialized use case and should be considered carefully." +"If :meth:`~object.__hash__` is not explicitly defined, or if it is set to " +"``None``, then :func:`dataclass` *may* add an implicit :meth:`~object." +"__hash__` method. Although not recommended, you can force :func:`dataclass` " +"to create a :meth:`~object.__hash__` method with ``unsafe_hash=True``. This " +"might be the case if your class is logically immutable but can nonetheless " +"be mutated. This is a specialized use case and should be considered " +"carefully." msgstr "" #: ../../library/dataclasses.rst:147 msgid "" -"Here are the rules governing implicit creation of a :meth:`__hash__` " -"method. Note that you cannot both have an explicit :meth:`__hash__` method " -"in your dataclass and set ``unsafe_hash=True``; this will result in a :exc:" -"`TypeError`." +"Here are the rules governing implicit creation of a :meth:`~object.__hash__` " +"method. Note that you cannot both have an explicit :meth:`~object.__hash__` " +"method in your dataclass and set ``unsafe_hash=True``; this will result in " +"a :exc:`TypeError`." msgstr "" #: ../../library/dataclasses.rst:152 msgid "" "If ``eq`` and ``frozen`` are both true, by default :func:`dataclass` will " -"generate a :meth:`__hash__` method for you. If ``eq`` is true and " -"``frozen`` is false, :meth:`__hash__` will be set to ``None``, marking it " -"unhashable (which it is, since it is mutable). If ``eq`` is false, :meth:" -"`__hash__` will be left untouched meaning the :meth:`__hash__` method of the " -"superclass will be used (if the superclass is :class:`object`, this means it " -"will fall back to id-based hashing)." +"generate a :meth:`~object.__hash__` method for you. If ``eq`` is true and " +"``frozen`` is false, :meth:`~object.__hash__` will be set to ``None``, " +"marking it unhashable (which it is, since it is mutable). If ``eq`` is " +"false, :meth:`~object.__hash__` will be left untouched meaning the :meth:" +"`~object.__hash__` method of the superclass will be used (if the superclass " +"is :class:`object`, this means it will fall back to id-based hashing)." msgstr "" #: ../../library/dataclasses.rst:160 msgid "" "``frozen``: If true (the default is ``False``), assigning to fields will " "generate an exception. This emulates read-only frozen instances. If :meth:" -"`__setattr__` or :meth:`__delattr__` is defined in the class, then :exc:" -"`TypeError` is raised. See the discussion below." +"`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the " +"class, then :exc:`TypeError` is raised. See the discussion below." msgstr "" #: ../../library/dataclasses.rst:165 msgid "" "``match_args``: If true (the default is ``True``), the ``__match_args__`` " "tuple will be created from the list of parameters to the generated :meth:" -"`__init__` method (even if :meth:`__init__` is not generated, see above). " -"If false, or if ``__match_args__`` is already defined in the class, then " -"``__match_args__`` will not be generated." +"`~object.__init__` method (even if :meth:`~object.__init__` is not " +"generated, see above). If false, or if ``__match_args__`` is already " +"defined in the class, then ``__match_args__`` will not be generated." msgstr "" #: ../../library/dataclasses.rst:174 msgid "" "``kw_only``: If true (the default value is ``False``), then all fields will " "be marked as keyword-only. If a field is marked as keyword-only, then the " -"only effect is that the :meth:`__init__` parameter generated from a keyword-" -"only field must be specified with a keyword when :meth:`__init__` is " -"called. There is no effect on any other aspect of dataclasses. See the :" -"term:`parameter` glossary entry for details. Also see the :const:`KW_ONLY` " -"section." +"only effect is that the :meth:`~object.__init__` parameter generated from a " +"keyword-only field must be specified with a keyword when :meth:`~object." +"__init__` is called. There is no effect on any other aspect of " +"dataclasses. See the :term:`parameter` glossary entry for details. Also " +"see the :const:`KW_ONLY` section." msgstr "" #: ../../library/dataclasses.rst:185 msgid "" -"``slots``: If true (the default is ``False``), :attr:`__slots__` attribute " -"will be generated and new class will be returned instead of the original " -"one. If :attr:`__slots__` is already defined in the class, then :exc:" -"`TypeError` is raised." +"``slots``: If true (the default is ``False``), :attr:`~object.__slots__` " +"attribute will be generated and new class will be returned instead of the " +"original one. If :attr:`~object.__slots__` is already defined in the class, " +"then :exc:`TypeError` is raised." msgstr "" #: ../../library/dataclasses.rst:192 @@ -259,7 +270,7 @@ msgstr "" #: ../../library/dataclasses.rst:217 msgid "" "In this example, both ``a`` and ``b`` will be included in the added :meth:" -"`__init__` method, which will be defined as::" +"`~object.__init__` method, which will be defined as::" msgstr "" #: ../../library/dataclasses.rst:222 @@ -309,22 +320,23 @@ msgstr "" #: ../../library/dataclasses.rst:258 msgid "" "``init``: If true (the default), this field is included as a parameter to " -"the generated :meth:`__init__` method." +"the generated :meth:`~object.__init__` method." msgstr "" #: ../../library/dataclasses.rst:261 msgid "" "``repr``: If true (the default), this field is included in the string " -"returned by the generated :meth:`__repr__` method." +"returned by the generated :meth:`~object.__repr__` method." msgstr "" #: ../../library/dataclasses.rst:264 msgid "" "``hash``: This can be a bool or ``None``. If true, this field is included " -"in the generated :meth:`__hash__` method. If ``None`` (the default), use " -"the value of ``compare``: this would normally be the expected behavior. A " -"field should be considered in the hash if it's used for comparisons. " -"Setting this value to anything other than ``None`` is discouraged." +"in the generated :meth:`~object.__hash__` method. If ``None`` (the " +"default), use the value of ``compare``: this would normally be the expected " +"behavior. A field should be considered in the hash if it's used for " +"comparisons. Setting this value to anything other than ``None`` is " +"discouraged." msgstr "" #: ../../library/dataclasses.rst:271 @@ -339,7 +351,8 @@ msgstr "" #: ../../library/dataclasses.rst:277 msgid "" "``compare``: If true (the default), this field is included in the generated " -"equality and comparison methods (:meth:`__eq__`, :meth:`__gt__`, et al.)." +"equality and comparison methods (:meth:`~object.__eq__`, :meth:`~object." +"__gt__`, et al.)." msgstr "" #: ../../library/dataclasses.rst:281 @@ -355,7 +368,8 @@ msgstr "" #: ../../library/dataclasses.rst:289 msgid "" "``kw_only``: If true, this field will be marked as keyword-only. This is " -"used when the generated :meth:`__init__` method's parameters are computed." +"used when the generated :meth:`~object.__init__` method's parameters are " +"computed." msgstr "" #: ../../library/dataclasses.rst:295 @@ -486,16 +500,16 @@ msgstr "" #: ../../library/dataclasses.rst:434 msgid "" -"The newly returned object is created by calling the :meth:`__init__` method " -"of the dataclass. This ensures that :meth:`__post_init__`, if present, is " -"also called." +"The newly returned object is created by calling the :meth:`~object.__init__` " +"method of the dataclass. This ensures that :ref:`__post_init__ `, if present, is also called." msgstr "" #: ../../library/dataclasses.rst:438 msgid "" "Init-only variables without default values, if any exist, must be specified " -"on the call to :func:`replace` so that they can be passed to :meth:" -"`__init__` and :meth:`__post_init__`." +"on the call to :func:`replace` so that they can be passed to :meth:`~object." +"__init__` and :ref:`__post_init__ `." msgstr "" #: ../../library/dataclasses.rst:442 @@ -508,11 +522,11 @@ msgstr "" msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:" "`replace`. They are not copied from the source object, but rather are " -"initialized in :meth:`__post_init__`, if they're initialized at all. It is " -"expected that ``init=False`` fields will be rarely and judiciously used. If " -"they are used, it might be wise to have alternate class constructors, or " -"perhaps a custom ``replace()`` (or similarly named) method which handles " -"instance copying." +"initialized in :ref:`__post_init__ `, if they're " +"initialized at all. It is expected that ``init=False`` fields will be " +"rarely and judiciously used. If they are used, it might be wise to have " +"alternate class constructors, or perhaps a custom ``replace()`` (or " +"similarly named) method which handles instance copying." msgstr "" #: ../../library/dataclasses.rst:457 @@ -539,8 +553,8 @@ msgid "" "that a pseudo-field of type :const:`KW_ONLY` is otherwise completely " "ignored. This includes the name of such a field. By convention, a name of " "``_`` is used for a :const:`KW_ONLY` field. Keyword-only fields signify :" -"meth:`__init__` parameters that must be specified as keywords when the class " -"is instantiated." +"meth:`~object.__init__` parameters that must be specified as keywords when " +"the class is instantiated." msgstr "" #: ../../library/dataclasses.rst:482 @@ -557,58 +571,60 @@ msgstr "" #: ../../library/dataclasses.rst:500 msgid "" -"Raised when an implicitly defined :meth:`__setattr__` or :meth:`__delattr__` " -"is called on a dataclass which was defined with ``frozen=True``. It is a " -"subclass of :exc:`AttributeError`." +"Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" +"`~object.__delattr__` is called on a dataclass which was defined with " +"``frozen=True``. It is a subclass of :exc:`AttributeError`." msgstr "" -#: ../../library/dataclasses.rst:505 +#: ../../library/dataclasses.rst:507 msgid "Post-init processing" msgstr "" -#: ../../library/dataclasses.rst:507 +#: ../../library/dataclasses.rst:509 msgid "" -"The generated :meth:`__init__` code will call a method named :meth:" -"`__post_init__`, if :meth:`__post_init__` is defined on the class. It will " +"The generated :meth:`~object.__init__` code will call a method named :meth:`!" +"__post_init__`, if :meth:`!__post_init__` is defined on the class. It will " "normally be called as ``self.__post_init__()``. However, if any ``InitVar`` " -"fields are defined, they will also be passed to :meth:`__post_init__` in the " -"order they were defined in the class. If no :meth:`__init__` method is " -"generated, then :meth:`__post_init__` will not automatically be called." +"fields are defined, they will also be passed to :meth:`!__post_init__` in " +"the order they were defined in the class. If no :meth:`~object.__init__` " +"method is generated, then :meth:`!__post_init__` will not automatically be " +"called." msgstr "" -#: ../../library/dataclasses.rst:515 +#: ../../library/dataclasses.rst:517 msgid "" "Among other uses, this allows for initializing field values that depend on " "one or more other fields. For example::" msgstr "" -#: ../../library/dataclasses.rst:527 +#: ../../library/dataclasses.rst:529 msgid "" -"The :meth:`__init__` method generated by :func:`dataclass` does not call " -"base class :meth:`__init__` methods. If the base class has an :meth:" -"`__init__` method that has to be called, it is common to call this method in " -"a :meth:`__post_init__` method::" +"The :meth:`~object.__init__` method generated by :func:`dataclass` does not " +"call base class :meth:`~object.__init__` methods. If the base class has an :" +"meth:`~object.__init__` method that has to be called, it is common to call " +"this method in a :meth:`!__post_init__` method::" msgstr "" -#: ../../library/dataclasses.rst:544 +#: ../../library/dataclasses.rst:546 msgid "" -"Note, however, that in general the dataclass-generated :meth:`__init__` " -"methods don't need to be called, since the derived dataclass will take care " -"of initializing all fields of any base class that is a dataclass itself." +"Note, however, that in general the dataclass-generated :meth:`~object." +"__init__` methods don't need to be called, since the derived dataclass will " +"take care of initializing all fields of any base class that is a dataclass " +"itself." msgstr "" -#: ../../library/dataclasses.rst:548 +#: ../../library/dataclasses.rst:550 msgid "" "See the section below on init-only variables for ways to pass parameters to :" -"meth:`__post_init__`. Also see the warning about how :func:`replace` " +"meth:`!__post_init__`. Also see the warning about how :func:`replace` " "handles ``init=False`` fields." msgstr "" -#: ../../library/dataclasses.rst:553 +#: ../../library/dataclasses.rst:555 msgid "Class variables" msgstr "" -#: ../../library/dataclasses.rst:555 +#: ../../library/dataclasses.rst:557 msgid "" "One of the few places where :func:`dataclass` actually inspects the type of " "a field is to determine if a field is a class variable as defined in :pep:" @@ -618,11 +634,11 @@ msgid "" "pseudo-fields are not returned by the module-level :func:`fields` function." msgstr "" -#: ../../library/dataclasses.rst:564 +#: ../../library/dataclasses.rst:566 msgid "Init-only variables" msgstr "" -#: ../../library/dataclasses.rst:566 +#: ../../library/dataclasses.rst:568 msgid "" "Another place where :func:`dataclass` inspects a type annotation is to " "determine if a field is an init-only variable. It does this by seeing if " @@ -630,47 +646,48 @@ msgid "" "``InitVar``, it is considered a pseudo-field called an init-only field. As " "it is not a true field, it is not returned by the module-level :func:" "`fields` function. Init-only fields are added as parameters to the " -"generated :meth:`__init__` method, and are passed to the optional :meth:" -"`__post_init__` method. They are not otherwise used by dataclasses." +"generated :meth:`~object.__init__` method, and are passed to the optional :" +"ref:`__post_init__ ` method. They are not otherwise " +"used by dataclasses." msgstr "" -#: ../../library/dataclasses.rst:576 +#: ../../library/dataclasses.rst:578 msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "" -#: ../../library/dataclasses.rst:591 +#: ../../library/dataclasses.rst:593 msgid "" "In this case, :func:`fields` will return :class:`Field` objects for ``i`` " "and ``j``, but not for ``database``." msgstr "" -#: ../../library/dataclasses.rst:595 +#: ../../library/dataclasses.rst:597 msgid "Frozen instances" msgstr "" -#: ../../library/dataclasses.rst:597 +#: ../../library/dataclasses.rst:599 msgid "" "It is not possible to create truly immutable Python objects. However, by " "passing ``frozen=True`` to the :meth:`dataclass` decorator you can emulate " -"immutability. In that case, dataclasses will add :meth:`__setattr__` and :" -"meth:`__delattr__` methods to the class. These methods will raise a :exc:" -"`FrozenInstanceError` when invoked." +"immutability. In that case, dataclasses will add :meth:`~object." +"__setattr__` and :meth:`~object.__delattr__` methods to the class. These " +"methods will raise a :exc:`FrozenInstanceError` when invoked." msgstr "" -#: ../../library/dataclasses.rst:603 +#: ../../library/dataclasses.rst:605 msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" -"`__init__` cannot use simple assignment to initialize fields, and must use :" -"meth:`object.__setattr__`." +"`~object.__init__` cannot use simple assignment to initialize fields, and " +"must use :meth:`~object.__setattr__`." msgstr "" -#: ../../library/dataclasses.rst:608 +#: ../../library/dataclasses.rst:610 msgid "Inheritance" msgstr "" -#: ../../library/dataclasses.rst:610 +#: ../../library/dataclasses.rst:612 msgid "" "When the dataclass is being created by the :meth:`dataclass` decorator, it " "looks through all of the class's base classes in reverse MRO (that is, " @@ -682,95 +699,98 @@ msgid "" "derived classes override base classes. An example::" msgstr "" -#: ../../library/dataclasses.rst:630 +#: ../../library/dataclasses.rst:632 msgid "" "The final list of fields is, in order, ``x``, ``y``, ``z``. The final type " "of ``x`` is ``int``, as specified in class ``C``." msgstr "" -#: ../../library/dataclasses.rst:633 -msgid "The generated :meth:`__init__` method for ``C`` will look like::" +#: ../../library/dataclasses.rst:635 +msgid "" +"The generated :meth:`~object.__init__` method for ``C`` will look like::" msgstr "" -#: ../../library/dataclasses.rst:638 -msgid "Re-ordering of keyword-only parameters in :meth:`__init__`" +#: ../../library/dataclasses.rst:640 +msgid "Re-ordering of keyword-only parameters in :meth:`~object.__init__`" msgstr "" -#: ../../library/dataclasses.rst:640 +#: ../../library/dataclasses.rst:642 msgid "" -"After the parameters needed for :meth:`__init__` are computed, any keyword-" -"only parameters are moved to come after all regular (non-keyword-only) " -"parameters. This is a requirement of how keyword-only parameters are " +"After the parameters needed for :meth:`~object.__init__` are computed, any " +"keyword-only parameters are moved to come after all regular (non-keyword-" +"only) parameters. This is a requirement of how keyword-only parameters are " "implemented in Python: they must come after non-keyword-only parameters." msgstr "" -#: ../../library/dataclasses.rst:646 +#: ../../library/dataclasses.rst:648 msgid "" "In this example, ``Base.y``, ``Base.w``, and ``D.t`` are keyword-only " "fields, and ``Base.x`` and ``D.z`` are regular fields::" msgstr "" -#: ../../library/dataclasses.rst:661 -msgid "The generated :meth:`__init__` method for ``D`` will look like::" +#: ../../library/dataclasses.rst:663 +msgid "" +"The generated :meth:`~object.__init__` method for ``D`` will look like::" msgstr "" -#: ../../library/dataclasses.rst:665 +#: ../../library/dataclasses.rst:667 msgid "" "Note that the parameters have been re-ordered from how they appear in the " "list of fields: parameters derived from regular fields are followed by " "parameters derived from keyword-only fields." msgstr "" -#: ../../library/dataclasses.rst:669 +#: ../../library/dataclasses.rst:671 msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" -"ordered :meth:`__init__` parameter list." +"ordered :meth:`~object.__init__` parameter list." msgstr "" -#: ../../library/dataclasses.rst:674 +#: ../../library/dataclasses.rst:676 msgid "Default factory functions" msgstr "" -#: ../../library/dataclasses.rst:676 +#: ../../library/dataclasses.rst:678 msgid "" "If a :func:`field` specifies a ``default_factory``, it is called with zero " "arguments when a default value for the field is needed. For example, to " "create a new instance of a list, use::" msgstr "" -#: ../../library/dataclasses.rst:682 +#: ../../library/dataclasses.rst:684 msgid "" -"If a field is excluded from :meth:`__init__` (using ``init=False``) and the " -"field also specifies ``default_factory``, then the default factory function " -"will always be called from the generated :meth:`__init__` function. This " -"happens because there is no other way to give the field an initial value." +"If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " +"and the field also specifies ``default_factory``, then the default factory " +"function will always be called from the generated :meth:`~object.__init__` " +"function. This happens because there is no other way to give the field an " +"initial value." msgstr "" -#: ../../library/dataclasses.rst:689 +#: ../../library/dataclasses.rst:691 msgid "Mutable default values" msgstr "" -#: ../../library/dataclasses.rst:691 +#: ../../library/dataclasses.rst:693 msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" msgstr "" -#: ../../library/dataclasses.rst:706 +#: ../../library/dataclasses.rst:708 msgid "" "Note that the two instances of class ``C`` share the same class variable " "``x``, as expected." msgstr "" -#: ../../library/dataclasses.rst:709 +#: ../../library/dataclasses.rst:711 msgid "Using dataclasses, *if* this code was valid::" msgstr "" -#: ../../library/dataclasses.rst:717 +#: ../../library/dataclasses.rst:719 msgid "it would generate code similar to::" msgstr "" -#: ../../library/dataclasses.rst:728 +#: ../../library/dataclasses.rst:730 msgid "" "This has the same issue as the original example using class ``C``. That is, " "two instances of class ``D`` that do not specify a value for ``x`` when " @@ -783,44 +803,44 @@ msgid "" "solution, but it does protect against many common errors." msgstr "" -#: ../../library/dataclasses.rst:739 +#: ../../library/dataclasses.rst:741 msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "" -#: ../../library/dataclasses.rst:748 +#: ../../library/dataclasses.rst:750 msgid "" "Instead of looking for and disallowing objects of type ``list``, ``dict``, " "or ``set``, unhashable objects are now not allowed as default values. " "Unhashability is used to approximate mutability." msgstr "" -#: ../../library/dataclasses.rst:755 +#: ../../library/dataclasses.rst:757 msgid "Descriptor-typed fields" msgstr "" -#: ../../library/dataclasses.rst:757 +#: ../../library/dataclasses.rst:759 msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " "default value have the following special behaviors:" msgstr "" -#: ../../library/dataclasses.rst:760 +#: ../../library/dataclasses.rst:762 msgid "" "The value for the field passed to the dataclass's ``__init__`` method is " "passed to the descriptor's ``__set__`` method rather than overwriting the " "descriptor object." msgstr "" -#: ../../library/dataclasses.rst:763 +#: ../../library/dataclasses.rst:765 msgid "" "Similarly, when getting or setting the field, the descriptor's ``__get__`` " "or ``__set__`` method is called rather than returning or overwriting the " "descriptor object." msgstr "" -#: ../../library/dataclasses.rst:766 +#: ../../library/dataclasses.rst:768 msgid "" "To determine whether a field contains a default value, ``dataclasses`` will " "call the descriptor's ``__get__`` method using its class access form (i.e. " @@ -830,7 +850,7 @@ msgid "" "default value will be provided for the field." msgstr "" -#: ../../library/dataclasses.rst:801 +#: ../../library/dataclasses.rst:803 msgid "" "Note that if a field is annotated with a descriptor type, but is not " "assigned a descriptor object as its default value, the field will act like a " diff --git a/library/optparse.po b/library/optparse.po index d5803d16c8..e16f5b0631 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-21 00:16+0000\n" +"POT-Creation-Date: 2023-04-25 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -717,7 +717,7 @@ msgstr "" msgid "An option group is obtained using the class :class:`OptionGroup`:" msgstr "" -#: ../../library/optparse.rst:568 ../../library/optparse.rst:1620 +#: ../../library/optparse.rst:568 ../../library/optparse.rst:1637 msgid "where" msgstr "" @@ -1126,7 +1126,7 @@ msgstr "``\"append_const\"``" msgid "append a constant value to a list, pre-set via :attr:`Option.const`" msgstr "" -#: ../../library/optparse.rst:949 ../../library/optparse.rst:1226 +#: ../../library/optparse.rst:949 ../../library/optparse.rst:1243 msgid "``\"help\"``" msgstr "``\"help\"``" @@ -1146,50 +1146,70 @@ msgstr "" msgid "" "As you can see, most actions involve storing or updating a value somewhere. :" "mod:`optparse` always creates a special object for this, conventionally " -"called ``options`` (it happens to be an instance of :class:`optparse." -"Values`). Option arguments (and various other values) are stored as " -"attributes of this object, according to the :attr:`~Option.dest` " -"(destination) option attribute." +"called ``options``, which is an instance of :class:`optparse.Values`." msgstr "" #: ../../library/optparse.rst:961 +msgid "" +"An object holding parsed argument names and values as attributes. Normally " +"created by calling when calling :meth:`OptionParser.parse_args`, and can be " +"overridden by a custom subclass passed to the *values* argument of :meth:" +"`OptionParser.parse_args` (as described in :ref:`optparse-parsing-" +"arguments`)." +msgstr "" + +#: ../../library/optparse.rst:966 +msgid "" +"Option arguments (and various other values) are stored as attributes of this " +"object, according to the :attr:`~Option.dest` (destination) option attribute." +msgstr "" + +#: ../../library/optparse.rst:970 msgid "For example, when you call ::" msgstr "" "例如說,當你呼叫:\n" "\n" "::" -#: ../../library/optparse.rst:965 +#: ../../library/optparse.rst:974 msgid "" "one of the first things :mod:`optparse` does is create the ``options`` " "object::" msgstr "" -#: ../../library/optparse.rst:969 +#: ../../library/optparse.rst:978 msgid "If one of the options in this parser is defined with ::" msgstr "" -#: ../../library/optparse.rst:973 +#: ../../library/optparse.rst:982 msgid "and the command-line being parsed includes any of the following::" msgstr "" -#: ../../library/optparse.rst:980 +#: ../../library/optparse.rst:989 msgid "" "then :mod:`optparse`, on seeing this option, will do the equivalent of ::" msgstr "" -#: ../../library/optparse.rst:984 +#: ../../library/optparse.rst:993 msgid "" "The :attr:`~Option.type` and :attr:`~Option.dest` option attributes are " "almost as important as :attr:`~Option.action`, but :attr:`~Option.action` is " "the only one that makes sense for *all* options." msgstr "" -#: ../../library/optparse.rst:992 +#: ../../library/optparse.rst:1001 msgid "Option attributes" msgstr "" -#: ../../library/optparse.rst:994 +#: ../../library/optparse.rst:1005 +msgid "" +"A single command line argument, with various attributes passed by keyword to " +"the constructor. Normally created with :meth:`OptionParser.add_option` " +"rather than directly, and can be overridden by a custom class via the " +"*option_class* argument to :class:`OptionParser`." +msgstr "" + +#: ../../library/optparse.rst:1011 msgid "" "The following option attributes may be passed as keyword arguments to :meth:" "`OptionParser.add_option`. If you pass an option attribute that is not " @@ -1197,33 +1217,33 @@ msgid "" "attribute, :mod:`optparse` raises :exc:`OptionError`." msgstr "" -#: ../../library/optparse.rst:1001 +#: ../../library/optparse.rst:1018 msgid "(default: ``\"store\"``)" msgstr "" -#: ../../library/optparse.rst:1003 +#: ../../library/optparse.rst:1020 msgid "" "Determines :mod:`optparse`'s behaviour when this option is seen on the " "command line; the available options are documented :ref:`here `." msgstr "" -#: ../../library/optparse.rst:1009 +#: ../../library/optparse.rst:1026 msgid "(default: ``\"string\"``)" msgstr "" -#: ../../library/optparse.rst:1011 +#: ../../library/optparse.rst:1028 msgid "" "The argument type expected by this option (e.g., ``\"string\"`` or " "``\"int\"``); the available option types are documented :ref:`here `." msgstr "" -#: ../../library/optparse.rst:1017 ../../library/optparse.rst:1067 +#: ../../library/optparse.rst:1034 ../../library/optparse.rst:1084 msgid "(default: derived from option strings)" msgstr "" -#: ../../library/optparse.rst:1019 +#: ../../library/optparse.rst:1036 msgid "" "If the option's action implies writing or modifying a value somewhere, this " "tells :mod:`optparse` where to write it: :attr:`~Option.dest` names an " @@ -1231,47 +1251,47 @@ msgid "" "the command line." msgstr "" -#: ../../library/optparse.rst:1026 +#: ../../library/optparse.rst:1043 msgid "" "The value to use for this option's destination if the option is not seen on " "the command line. See also :meth:`OptionParser.set_defaults`." msgstr "" -#: ../../library/optparse.rst:1031 +#: ../../library/optparse.rst:1048 msgid "(default: 1)" msgstr "" -#: ../../library/optparse.rst:1033 +#: ../../library/optparse.rst:1050 msgid "" "How many arguments of type :attr:`~Option.type` should be consumed when this " "option is seen. If > 1, :mod:`optparse` will store a tuple of values to :" "attr:`~Option.dest`." msgstr "" -#: ../../library/optparse.rst:1039 +#: ../../library/optparse.rst:1056 msgid "For actions that store a constant value, the constant value to store." msgstr "" -#: ../../library/optparse.rst:1043 +#: ../../library/optparse.rst:1060 msgid "" "For options of type ``\"choice\"``, the list of strings the user may choose " "from." msgstr "" -#: ../../library/optparse.rst:1048 +#: ../../library/optparse.rst:1065 msgid "" "For options with action ``\"callback\"``, the callable to call when this " "option is seen. See section :ref:`optparse-option-callbacks` for detail on " "the arguments passed to the callable." msgstr "" -#: ../../library/optparse.rst:1055 +#: ../../library/optparse.rst:1072 msgid "" "Additional positional and keyword arguments to pass to ``callback`` after " "the four standard callback arguments." msgstr "" -#: ../../library/optparse.rst:1060 +#: ../../library/optparse.rst:1077 msgid "" "Help text to print for this option when listing all available options after " "the user supplies a :attr:`~Option.help` option (such as ``--help``). If no " @@ -1279,17 +1299,17 @@ msgid "" "this option, use the special value :data:`optparse.SUPPRESS_HELP`." msgstr "" -#: ../../library/optparse.rst:1069 +#: ../../library/optparse.rst:1086 msgid "" "Stand-in for the option argument(s) to use when printing help text. See " "section :ref:`optparse-tutorial` for an example." msgstr "" -#: ../../library/optparse.rst:1076 +#: ../../library/optparse.rst:1093 msgid "Standard option actions" msgstr "" -#: ../../library/optparse.rst:1078 +#: ../../library/optparse.rst:1095 msgid "" "The various option actions all have slightly different requirements and " "effects. Most actions have several relevant option attributes which you may " @@ -1297,13 +1317,13 @@ msgid "" "attributes, which you must specify for any option using that action." msgstr "" -#: ../../library/optparse.rst:1083 +#: ../../library/optparse.rst:1100 msgid "" "``\"store\"`` [relevant: :attr:`~Option.type`, :attr:`~Option.dest`, :attr:" "`~Option.nargs`, :attr:`~Option.choices`]" msgstr "" -#: ../../library/optparse.rst:1086 +#: ../../library/optparse.rst:1103 msgid "" "The option must be followed by an argument, which is converted to a value " "according to :attr:`~Option.type` and stored in :attr:`~Option.dest`. If :" @@ -1313,17 +1333,17 @@ msgid "" "option-types` section." msgstr "" -#: ../../library/optparse.rst:1093 +#: ../../library/optparse.rst:1110 msgid "" "If :attr:`~Option.choices` is supplied (a list or tuple of strings), the " "type defaults to ``\"choice\"``." msgstr "" -#: ../../library/optparse.rst:1096 +#: ../../library/optparse.rst:1113 msgid "If :attr:`~Option.type` is not supplied, it defaults to ``\"string\"``." msgstr "" -#: ../../library/optparse.rst:1098 +#: ../../library/optparse.rst:1115 msgid "" "If :attr:`~Option.dest` is not supplied, :mod:`optparse` derives a " "destination from the first long option string (e.g., ``--foo-bar`` implies " @@ -1331,62 +1351,62 @@ msgid "" "destination from the first short option string (e.g., ``-f`` implies ``f``)." msgstr "" -#: ../../library/optparse.rst:1103 ../../library/optparse.rst:1123 -#: ../../library/optparse.rst:1145 ../../library/optparse.rst:1163 -#: ../../library/optparse.rst:1202 ../../library/optparse.rst:1240 +#: ../../library/optparse.rst:1120 ../../library/optparse.rst:1140 +#: ../../library/optparse.rst:1162 ../../library/optparse.rst:1180 +#: ../../library/optparse.rst:1219 ../../library/optparse.rst:1257 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/optparse.rst:1108 +#: ../../library/optparse.rst:1125 msgid "As it parses the command line ::" msgstr "" -#: ../../library/optparse.rst:1112 +#: ../../library/optparse.rst:1129 msgid ":mod:`optparse` will set ::" msgstr "" -#: ../../library/optparse.rst:1118 +#: ../../library/optparse.rst:1135 msgid "" "``\"store_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1121 +#: ../../library/optparse.rst:1138 msgid "The value :attr:`~Option.const` is stored in :attr:`~Option.dest`." msgstr "" -#: ../../library/optparse.rst:1132 +#: ../../library/optparse.rst:1149 msgid "If ``--noisy`` is seen, :mod:`optparse` will set ::" msgstr "" -#: ../../library/optparse.rst:1136 +#: ../../library/optparse.rst:1153 msgid "``\"store_true\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1138 +#: ../../library/optparse.rst:1155 msgid "" "A special case of ``\"store_const\"`` that stores ``True`` to :attr:`~Option." "dest`." msgstr "" -#: ../../library/optparse.rst:1141 +#: ../../library/optparse.rst:1158 msgid "``\"store_false\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1143 +#: ../../library/optparse.rst:1160 msgid "Like ``\"store_true\"``, but stores ``False``." msgstr "" -#: ../../library/optparse.rst:1150 +#: ../../library/optparse.rst:1167 msgid "" "``\"append\"`` [relevant: :attr:`~Option.type`, :attr:`~Option.dest`, :attr:" "`~Option.nargs`, :attr:`~Option.choices`]" msgstr "" -#: ../../library/optparse.rst:1153 +#: ../../library/optparse.rst:1170 msgid "" "The option must be followed by an argument, which is appended to the list " "in :attr:`~Option.dest`. If no default value for :attr:`~Option.dest` is " @@ -1396,23 +1416,23 @@ msgid "" "is appended to :attr:`~Option.dest`." msgstr "" -#: ../../library/optparse.rst:1160 +#: ../../library/optparse.rst:1177 msgid "" "The defaults for :attr:`~Option.type` and :attr:`~Option.dest` are the same " "as for the ``\"store\"`` action." msgstr "" -#: ../../library/optparse.rst:1167 +#: ../../library/optparse.rst:1184 msgid "" "If ``-t3`` is seen on the command-line, :mod:`optparse` does the equivalent " "of::" msgstr "" -#: ../../library/optparse.rst:1173 +#: ../../library/optparse.rst:1190 msgid "If, a little later on, ``--tracks=4`` is seen, it does::" msgstr "" -#: ../../library/optparse.rst:1177 +#: ../../library/optparse.rst:1194 msgid "" "The ``append`` action calls the ``append`` method on the current value of " "the option. This means that any default value specified must have an " @@ -1421,13 +1441,13 @@ msgid "" "with any values from the command line appended after those default values::" msgstr "" -#: ../../library/optparse.rst:1188 +#: ../../library/optparse.rst:1205 msgid "" "``\"append_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1191 +#: ../../library/optparse.rst:1208 msgid "" "Like ``\"store_const\"``, but the value :attr:`~Option.const` is appended " "to :attr:`~Option.dest`; as with ``\"append\"``, :attr:`~Option.dest` " @@ -1435,45 +1455,45 @@ msgid "" "time the option is encountered." msgstr "" -#: ../../library/optparse.rst:1196 +#: ../../library/optparse.rst:1213 msgid "``\"count\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1198 +#: ../../library/optparse.rst:1215 msgid "" "Increment the integer stored at :attr:`~Option.dest`. If no default value " "is supplied, :attr:`~Option.dest` is set to zero before being incremented " "the first time." msgstr "" -#: ../../library/optparse.rst:1206 +#: ../../library/optparse.rst:1223 msgid "" "The first time ``-v`` is seen on the command line, :mod:`optparse` does the " "equivalent of::" msgstr "" -#: ../../library/optparse.rst:1212 +#: ../../library/optparse.rst:1229 msgid "Every subsequent occurrence of ``-v`` results in ::" msgstr "" -#: ../../library/optparse.rst:1216 +#: ../../library/optparse.rst:1233 msgid "" "``\"callback\"`` [required: :attr:`~Option.callback`; relevant: :attr:" "`~Option.type`, :attr:`~Option.nargs`, :attr:`~Option.callback_args`, :attr:" "`~Option.callback_kwargs`]" msgstr "" -#: ../../library/optparse.rst:1220 +#: ../../library/optparse.rst:1237 msgid "" "Call the function specified by :attr:`~Option.callback`, which is called " "as ::" msgstr "" -#: ../../library/optparse.rst:1224 +#: ../../library/optparse.rst:1241 msgid "See section :ref:`optparse-option-callbacks` for more detail." msgstr "更多細節請見 :ref:`optparse-option-callbacks`\\ 。" -#: ../../library/optparse.rst:1228 +#: ../../library/optparse.rst:1245 msgid "" "Prints a complete help message for all the options in the current option " "parser. The help message is constructed from the ``usage`` string passed to " @@ -1481,37 +1501,37 @@ msgid "" "every option." msgstr "" -#: ../../library/optparse.rst:1233 +#: ../../library/optparse.rst:1250 msgid "" "If no :attr:`~Option.help` string is supplied for an option, it will still " "be listed in the help message. To omit an option entirely, use the special " "value :data:`optparse.SUPPRESS_HELP`." msgstr "" -#: ../../library/optparse.rst:1237 +#: ../../library/optparse.rst:1254 msgid "" ":mod:`optparse` automatically adds a :attr:`~Option.help` option to all " "OptionParsers, so you do not normally need to create one." msgstr "" -#: ../../library/optparse.rst:1255 +#: ../../library/optparse.rst:1272 msgid "" "If :mod:`optparse` sees either ``-h`` or ``--help`` on the command line, it " "will print something like the following help message to stdout (assuming " "``sys.argv[0]`` is ``\"foo.py\"``):" msgstr "" -#: ../../library/optparse.rst:1268 +#: ../../library/optparse.rst:1285 msgid "" "After printing the help message, :mod:`optparse` terminates your process " "with ``sys.exit(0)``." msgstr "" -#: ../../library/optparse.rst:1271 +#: ../../library/optparse.rst:1288 msgid "``\"version\"``" msgstr "``\"version\"``" -#: ../../library/optparse.rst:1273 +#: ../../library/optparse.rst:1290 msgid "" "Prints the version number supplied to the OptionParser to stdout and exits. " "The version number is actually formatted and printed by the " @@ -1521,58 +1541,58 @@ msgid "" "since :mod:`optparse` automatically adds them when needed." msgstr "" -#: ../../library/optparse.rst:1284 +#: ../../library/optparse.rst:1301 msgid "Standard option types" msgstr "" -#: ../../library/optparse.rst:1286 +#: ../../library/optparse.rst:1303 msgid "" ":mod:`optparse` has five built-in option types: ``\"string\"``, ``\"int\"``, " "``\"choice\"``, ``\"float\"`` and ``\"complex\"``. If you need to add new " "option types, see section :ref:`optparse-extending-optparse`." msgstr "" -#: ../../library/optparse.rst:1290 +#: ../../library/optparse.rst:1307 msgid "" "Arguments to string options are not checked or converted in any way: the " "text on the command line is stored in the destination (or passed to the " "callback) as-is." msgstr "" -#: ../../library/optparse.rst:1293 +#: ../../library/optparse.rst:1310 msgid "Integer arguments (type ``\"int\"``) are parsed as follows:" msgstr "" -#: ../../library/optparse.rst:1295 +#: ../../library/optparse.rst:1312 msgid "if the number starts with ``0x``, it is parsed as a hexadecimal number" msgstr "" -#: ../../library/optparse.rst:1297 +#: ../../library/optparse.rst:1314 msgid "if the number starts with ``0``, it is parsed as an octal number" msgstr "" -#: ../../library/optparse.rst:1299 +#: ../../library/optparse.rst:1316 msgid "if the number starts with ``0b``, it is parsed as a binary number" msgstr "" -#: ../../library/optparse.rst:1301 +#: ../../library/optparse.rst:1318 msgid "otherwise, the number is parsed as a decimal number" msgstr "" -#: ../../library/optparse.rst:1304 +#: ../../library/optparse.rst:1321 msgid "" "The conversion is done by calling :func:`int` with the appropriate base (2, " "8, 10, or 16). If this fails, so will :mod:`optparse`, although with a more " "useful error message." msgstr "" -#: ../../library/optparse.rst:1308 +#: ../../library/optparse.rst:1325 msgid "" "``\"float\"`` and ``\"complex\"`` option arguments are converted directly " "with :func:`float` and :func:`complex`, with similar error-handling." msgstr "" -#: ../../library/optparse.rst:1311 +#: ../../library/optparse.rst:1328 msgid "" "``\"choice\"`` options are a subtype of ``\"string\"`` options. The :attr:" "`~Option.choices` option attribute (a sequence of strings) defines the set " @@ -1581,59 +1601,59 @@ msgid "" "`OptionValueError` if an invalid string is given." msgstr "" -#: ../../library/optparse.rst:1321 +#: ../../library/optparse.rst:1338 msgid "Parsing arguments" msgstr "" -#: ../../library/optparse.rst:1323 +#: ../../library/optparse.rst:1340 msgid "" "The whole point of creating and populating an OptionParser is to call its :" "meth:`parse_args` method::" msgstr "" -#: ../../library/optparse.rst:1328 +#: ../../library/optparse.rst:1345 msgid "where the input parameters are" msgstr "" -#: ../../library/optparse.rst:1331 ../../library/optparse.rst:1345 -#: ../../library/optparse.rst:1664 +#: ../../library/optparse.rst:1348 ../../library/optparse.rst:1362 +#: ../../library/optparse.rst:1681 msgid "``args``" msgstr "``args``" -#: ../../library/optparse.rst:1331 +#: ../../library/optparse.rst:1348 msgid "the list of arguments to process (default: ``sys.argv[1:]``)" msgstr "" -#: ../../library/optparse.rst:1336 +#: ../../library/optparse.rst:1353 msgid "``values``" msgstr "``values``" -#: ../../library/optparse.rst:1334 +#: ../../library/optparse.rst:1351 msgid "" "an :class:`optparse.Values` object to store option arguments in (default: a " "new instance of :class:`Values`) -- if you give an existing object, the " "option defaults will not be initialized on it" msgstr "" -#: ../../library/optparse.rst:1338 +#: ../../library/optparse.rst:1355 msgid "and the return values are" msgstr "" -#: ../../library/optparse.rst:1342 +#: ../../library/optparse.rst:1359 msgid "``options``" msgstr "``options``" -#: ../../library/optparse.rst:1341 +#: ../../library/optparse.rst:1358 msgid "" "the same object that was passed in as ``values``, or the optparse.Values " "instance created by :mod:`optparse`" msgstr "" -#: ../../library/optparse.rst:1345 +#: ../../library/optparse.rst:1362 msgid "the leftover positional arguments after all options have been processed" msgstr "" -#: ../../library/optparse.rst:1347 +#: ../../library/optparse.rst:1364 msgid "" "The most common usage is to supply neither keyword argument. If you supply " "``values``, it will be modified with repeated :func:`setattr` calls (roughly " @@ -1641,7 +1661,7 @@ msgid "" "by :meth:`parse_args`." msgstr "" -#: ../../library/optparse.rst:1352 +#: ../../library/optparse.rst:1369 msgid "" "If :meth:`parse_args` encounters any errors in the argument list, it calls " "the OptionParser's :meth:`error` method with an appropriate end-user error " @@ -1649,61 +1669,61 @@ msgid "" "(the traditional Unix exit status for command-line errors)." msgstr "" -#: ../../library/optparse.rst:1361 +#: ../../library/optparse.rst:1378 msgid "Querying and manipulating your option parser" msgstr "" -#: ../../library/optparse.rst:1363 +#: ../../library/optparse.rst:1380 msgid "" "The default behavior of the option parser can be customized slightly, and " "you can also poke around your option parser and see what's there. " "OptionParser provides several methods to help you out:" msgstr "" -#: ../../library/optparse.rst:1369 +#: ../../library/optparse.rst:1386 msgid "" "Set parsing to stop on the first non-option. For example, if ``-a`` and ``-" "b`` are both simple options that take no arguments, :mod:`optparse` normally " "accepts this syntax::" msgstr "" -#: ../../library/optparse.rst:1375 +#: ../../library/optparse.rst:1392 msgid "and treats it as equivalent to ::" msgstr "" -#: ../../library/optparse.rst:1379 +#: ../../library/optparse.rst:1396 msgid "" "To disable this feature, call :meth:`disable_interspersed_args`. This " "restores traditional Unix syntax, where option parsing stops with the first " "non-option argument." msgstr "" -#: ../../library/optparse.rst:1383 +#: ../../library/optparse.rst:1400 msgid "" "Use this if you have a command processor which runs another command which " "has options of its own and you want to make sure these options don't get " "confused. For example, each command might have a different set of options." msgstr "" -#: ../../library/optparse.rst:1389 +#: ../../library/optparse.rst:1406 msgid "" "Set parsing to not stop on the first non-option, allowing interspersing " "switches with command arguments. This is the default behavior." msgstr "" -#: ../../library/optparse.rst:1394 +#: ../../library/optparse.rst:1411 msgid "" "Returns the Option instance with the option string *opt_str*, or ``None`` if " "no options have that option string." msgstr "" -#: ../../library/optparse.rst:1399 +#: ../../library/optparse.rst:1416 msgid "" "Return ``True`` if the OptionParser has an option with option string " "*opt_str* (e.g., ``-q`` or ``--verbose``)." msgstr "" -#: ../../library/optparse.rst:1404 +#: ../../library/optparse.rst:1421 msgid "" "If the :class:`OptionParser` has an option corresponding to *opt_str*, that " "option is removed. If that option provided any other option strings, all of " @@ -1711,23 +1731,23 @@ msgid "" "option belonging to this :class:`OptionParser`, raises :exc:`ValueError`." msgstr "" -#: ../../library/optparse.rst:1413 +#: ../../library/optparse.rst:1430 msgid "Conflicts between options" msgstr "" -#: ../../library/optparse.rst:1415 +#: ../../library/optparse.rst:1432 msgid "" "If you're not careful, it's easy to define options with conflicting option " "strings::" msgstr "" -#: ../../library/optparse.rst:1422 +#: ../../library/optparse.rst:1439 msgid "" "(This is particularly true if you've defined your own OptionParser subclass " "with some standard options.)" msgstr "" -#: ../../library/optparse.rst:1425 +#: ../../library/optparse.rst:1442 msgid "" "Every time you add an option, :mod:`optparse` checks for conflicts with " "existing options. If it finds any, it invokes the current conflict-handling " @@ -1735,39 +1755,39 @@ msgid "" "constructor::" msgstr "" -#: ../../library/optparse.rst:1431 +#: ../../library/optparse.rst:1448 msgid "or with a separate call::" msgstr "" -#: ../../library/optparse.rst:1435 +#: ../../library/optparse.rst:1452 msgid "The available conflict handlers are:" msgstr "" -#: ../../library/optparse.rst:1439 +#: ../../library/optparse.rst:1456 msgid "``\"error\"`` (default)" msgstr "" -#: ../../library/optparse.rst:1438 +#: ../../library/optparse.rst:1455 msgid "" "assume option conflicts are a programming error and raise :exc:" "`OptionConflictError`" msgstr "" -#: ../../library/optparse.rst:1443 +#: ../../library/optparse.rst:1460 msgid "``\"resolve\"``" msgstr "``\"resolve\"``" -#: ../../library/optparse.rst:1442 +#: ../../library/optparse.rst:1459 msgid "resolve option conflicts intelligently (see below)" msgstr "" -#: ../../library/optparse.rst:1445 +#: ../../library/optparse.rst:1462 msgid "" "As an example, let's define an :class:`OptionParser` that resolves conflicts " "intelligently and add conflicting options to it::" msgstr "" -#: ../../library/optparse.rst:1452 +#: ../../library/optparse.rst:1469 msgid "" "At this point, :mod:`optparse` detects that a previously added option is " "already using the ``-n`` option string. Since ``conflict_handler`` is " @@ -1777,7 +1797,7 @@ msgid "" "message will reflect that::" msgstr "" -#: ../../library/optparse.rst:1463 +#: ../../library/optparse.rst:1480 msgid "" "It's possible to whittle away the option strings for a previously added " "option until there are none left, and the user has no way of invoking that " @@ -1786,17 +1806,17 @@ msgid "" "Carrying on with our existing OptionParser::" msgstr "" -#: ../../library/optparse.rst:1471 +#: ../../library/optparse.rst:1488 msgid "" "At this point, the original ``-n``/``--dry-run`` option is no longer " "accessible, so :mod:`optparse` removes it, leaving this help text::" msgstr "" -#: ../../library/optparse.rst:1483 +#: ../../library/optparse.rst:1500 msgid "Cleanup" msgstr "" -#: ../../library/optparse.rst:1485 +#: ../../library/optparse.rst:1502 msgid "" "OptionParser instances have several cyclic references. This should not be a " "problem for Python's garbage collector, but you may wish to break the cyclic " @@ -1806,15 +1826,15 @@ msgid "" "OptionParser." msgstr "" -#: ../../library/optparse.rst:1496 +#: ../../library/optparse.rst:1513 msgid "Other methods" msgstr "" -#: ../../library/optparse.rst:1498 +#: ../../library/optparse.rst:1515 msgid "OptionParser supports several other public methods:" msgstr "" -#: ../../library/optparse.rst:1502 +#: ../../library/optparse.rst:1519 msgid "" "Set the usage string according to the rules described above for the " "``usage`` constructor keyword argument. Passing ``None`` sets the default " @@ -1822,7 +1842,7 @@ msgid "" "message." msgstr "" -#: ../../library/optparse.rst:1508 +#: ../../library/optparse.rst:1525 msgid "" "Print the usage message for the current program (``self.usage``) to *file* " "(default stdout). Any occurrence of the string ``%prog`` in ``self.usage`` " @@ -1830,13 +1850,13 @@ msgid "" "usage`` is empty or not defined." msgstr "" -#: ../../library/optparse.rst:1515 +#: ../../library/optparse.rst:1532 msgid "" "Same as :meth:`print_usage` but returns the usage string instead of printing " "it." msgstr "" -#: ../../library/optparse.rst:1520 +#: ../../library/optparse.rst:1537 msgid "" "Set default values for several option destinations at once. Using :meth:" "`set_defaults` is the preferred way to set default values for options, since " @@ -1845,15 +1865,15 @@ msgid "" "default, and the last one wins::" msgstr "" -#: ../../library/optparse.rst:1533 +#: ../../library/optparse.rst:1550 msgid "To avoid this confusion, use :meth:`set_defaults`::" msgstr "" -#: ../../library/optparse.rst:1545 +#: ../../library/optparse.rst:1562 msgid "Option Callbacks" msgstr "" -#: ../../library/optparse.rst:1547 +#: ../../library/optparse.rst:1564 msgid "" "When :mod:`optparse`'s built-in actions and types aren't quite enough for " "your needs, you have two choices: extend :mod:`optparse` or define a " @@ -1861,25 +1881,25 @@ msgid "" "a lot of simple cases. Quite often a simple callback is all you need." msgstr "" -#: ../../library/optparse.rst:1552 +#: ../../library/optparse.rst:1569 msgid "There are two steps to defining a callback option:" msgstr "" -#: ../../library/optparse.rst:1554 +#: ../../library/optparse.rst:1571 msgid "define the option itself using the ``\"callback\"`` action" msgstr "" -#: ../../library/optparse.rst:1556 +#: ../../library/optparse.rst:1573 msgid "" "write the callback; this is a function (or method) that takes at least four " "arguments, as described below" msgstr "" -#: ../../library/optparse.rst:1563 +#: ../../library/optparse.rst:1580 msgid "Defining a callback option" msgstr "" -#: ../../library/optparse.rst:1565 +#: ../../library/optparse.rst:1582 msgid "" "As always, the easiest way to define a callback option is by using the :meth:" "`OptionParser.add_option` method. Apart from :attr:`~Option.action`, the " @@ -1887,7 +1907,7 @@ msgid "" "call::" msgstr "" -#: ../../library/optparse.rst:1571 +#: ../../library/optparse.rst:1588 msgid "" "``callback`` is a function (or other callable object), so you must have " "already defined ``my_callback()`` when you create this callback option. In " @@ -1899,7 +1919,7 @@ msgid "" "tricky; it's covered later in this section." msgstr "" -#: ../../library/optparse.rst:1580 +#: ../../library/optparse.rst:1597 msgid "" ":mod:`optparse` always passes four particular arguments to your callback, " "and it will only pass additional arguments if you specify them via :attr:" @@ -1907,21 +1927,21 @@ msgid "" "minimal callback function signature is::" msgstr "" -#: ../../library/optparse.rst:1587 +#: ../../library/optparse.rst:1604 msgid "The four arguments to a callback are described below." msgstr "" -#: ../../library/optparse.rst:1589 +#: ../../library/optparse.rst:1606 msgid "" "There are several other option attributes that you can supply when you " "define a callback option:" msgstr "" -#: ../../library/optparse.rst:1596 +#: ../../library/optparse.rst:1613 msgid ":attr:`~Option.type`" msgstr ":attr:`~Option.type`" -#: ../../library/optparse.rst:1593 +#: ../../library/optparse.rst:1610 msgid "" "has its usual meaning: as with the ``\"store\"`` or ``\"append\"`` actions, " "it instructs :mod:`optparse` to consume one argument and convert it to :attr:" @@ -1929,11 +1949,11 @@ msgid "" "though, :mod:`optparse` passes it to your callback function." msgstr "" -#: ../../library/optparse.rst:1602 +#: ../../library/optparse.rst:1619 msgid ":attr:`~Option.nargs`" msgstr ":attr:`~Option.nargs`" -#: ../../library/optparse.rst:1599 +#: ../../library/optparse.rst:1616 msgid "" "also has its usual meaning: if it is supplied and > 1, :mod:`optparse` will " "consume :attr:`~Option.nargs` arguments, each of which must be convertible " @@ -1941,43 +1961,43 @@ msgid "" "callback." msgstr "" -#: ../../library/optparse.rst:1605 +#: ../../library/optparse.rst:1622 msgid ":attr:`~Option.callback_args`" msgstr ":attr:`~Option.callback_args`" -#: ../../library/optparse.rst:1605 +#: ../../library/optparse.rst:1622 msgid "a tuple of extra positional arguments to pass to the callback" msgstr "" -#: ../../library/optparse.rst:1609 +#: ../../library/optparse.rst:1626 msgid ":attr:`~Option.callback_kwargs`" msgstr ":attr:`~Option.callback_kwargs`" -#: ../../library/optparse.rst:1608 +#: ../../library/optparse.rst:1625 msgid "a dictionary of extra keyword arguments to pass to the callback" msgstr "" -#: ../../library/optparse.rst:1614 +#: ../../library/optparse.rst:1631 msgid "How callbacks are called" msgstr "" -#: ../../library/optparse.rst:1616 +#: ../../library/optparse.rst:1633 msgid "All callbacks are called as follows::" msgstr "" -#: ../../library/optparse.rst:1623 +#: ../../library/optparse.rst:1640 msgid "``option``" msgstr "``option``" -#: ../../library/optparse.rst:1623 +#: ../../library/optparse.rst:1640 msgid "is the Option instance that's calling the callback" msgstr "" -#: ../../library/optparse.rst:1630 +#: ../../library/optparse.rst:1647 msgid "``opt_str``" msgstr "``opt_str``" -#: ../../library/optparse.rst:1626 +#: ../../library/optparse.rst:1643 msgid "" "is the option string seen on the command-line that's triggering the " "callback. (If an abbreviated long option was used, ``opt_str`` will be the " @@ -1986,11 +2006,11 @@ msgid "" "``\"--foobar\"``.)" msgstr "" -#: ../../library/optparse.rst:1637 +#: ../../library/optparse.rst:1654 msgid "``value``" msgstr "``value``" -#: ../../library/optparse.rst:1633 +#: ../../library/optparse.rst:1650 msgid "" "is the argument to this option seen on the command-line. :mod:`optparse` " "will only expect an argument if :attr:`~Option.type` is set; the type of " @@ -2000,21 +2020,21 @@ msgid "" "of values of the appropriate type." msgstr "" -#: ../../library/optparse.rst:1660 +#: ../../library/optparse.rst:1677 msgid "``parser``" msgstr "``parser``" -#: ../../library/optparse.rst:1640 +#: ../../library/optparse.rst:1657 msgid "" "is the OptionParser instance driving the whole thing, mainly useful because " "you can access some other interesting data through its instance attributes:" msgstr "" -#: ../../library/optparse.rst:1647 +#: ../../library/optparse.rst:1664 msgid "``parser.largs``" msgstr "``parser.largs``" -#: ../../library/optparse.rst:1644 +#: ../../library/optparse.rst:1661 msgid "" "the current list of leftover arguments, ie. arguments that have been " "consumed but are neither options nor option arguments. Feel free to modify " @@ -2022,22 +2042,22 @@ msgid "" "become ``args``, the second return value of :meth:`parse_args`.)" msgstr "" -#: ../../library/optparse.rst:1653 +#: ../../library/optparse.rst:1670 msgid "``parser.rargs``" msgstr "``parser.rargs``" -#: ../../library/optparse.rst:1650 +#: ../../library/optparse.rst:1667 msgid "" "the current list of remaining arguments, ie. with ``opt_str`` and ``value`` " "(if applicable) removed, and only the arguments following them still there. " "Feel free to modify ``parser.rargs``, e.g. by consuming more arguments." msgstr "" -#: ../../library/optparse.rst:1660 +#: ../../library/optparse.rst:1677 msgid "``parser.values``" msgstr "``parser.values``" -#: ../../library/optparse.rst:1656 +#: ../../library/optparse.rst:1673 msgid "" "the object where option values are by default stored (an instance of " "optparse.OptionValues). This lets callbacks use the same mechanism as the " @@ -2046,27 +2066,27 @@ msgid "" "of any options already encountered on the command-line." msgstr "" -#: ../../library/optparse.rst:1663 +#: ../../library/optparse.rst:1680 msgid "" "is a tuple of arbitrary positional arguments supplied via the :attr:`~Option." "callback_args` option attribute." msgstr "" -#: ../../library/optparse.rst:1669 +#: ../../library/optparse.rst:1686 msgid "``kwargs``" msgstr "``kwargs``" -#: ../../library/optparse.rst:1667 +#: ../../library/optparse.rst:1684 msgid "" "is a dictionary of arbitrary keyword arguments supplied via :attr:`~Option." "callback_kwargs`." msgstr "" -#: ../../library/optparse.rst:1674 +#: ../../library/optparse.rst:1691 msgid "Raising errors in a callback" msgstr "" -#: ../../library/optparse.rst:1676 +#: ../../library/optparse.rst:1693 msgid "" "The callback function should raise :exc:`OptionValueError` if there are any " "problems with the option or its argument(s). :mod:`optparse` catches this " @@ -2076,46 +2096,46 @@ msgid "" "they did wrong." msgstr "" -#: ../../library/optparse.rst:1686 +#: ../../library/optparse.rst:1703 msgid "Callback example 1: trivial callback" msgstr "" -#: ../../library/optparse.rst:1688 +#: ../../library/optparse.rst:1705 msgid "" "Here's an example of a callback option that takes no arguments, and simply " "records that the option was seen::" msgstr "" -#: ../../library/optparse.rst:1696 +#: ../../library/optparse.rst:1713 msgid "Of course, you could do that with the ``\"store_true\"`` action." msgstr "" -#: ../../library/optparse.rst:1702 +#: ../../library/optparse.rst:1719 msgid "Callback example 2: check option order" msgstr "" -#: ../../library/optparse.rst:1704 +#: ../../library/optparse.rst:1721 msgid "" "Here's a slightly more interesting example: record the fact that ``-a`` is " "seen, but blow up if it comes after ``-b`` in the command-line. ::" msgstr "" -#: ../../library/optparse.rst:1719 +#: ../../library/optparse.rst:1736 msgid "Callback example 3: check option order (generalized)" msgstr "" -#: ../../library/optparse.rst:1721 +#: ../../library/optparse.rst:1738 msgid "" "If you want to re-use this callback for several similar options (set a flag, " "but blow up if ``-b`` has already been seen), it needs a bit of work: the " "error message and the flag that it sets must be generalized. ::" msgstr "" -#: ../../library/optparse.rst:1738 +#: ../../library/optparse.rst:1755 msgid "Callback example 4: check arbitrary condition" msgstr "" -#: ../../library/optparse.rst:1740 +#: ../../library/optparse.rst:1757 msgid "" "Of course, you could put any condition in there---you're not limited to " "checking the values of already-defined options. For example, if you have " @@ -2123,16 +2143,16 @@ msgid "" "is this::" msgstr "" -#: ../../library/optparse.rst:1753 +#: ../../library/optparse.rst:1770 msgid "" "(The definition of ``is_moon_full()`` is left as an exercise for the reader.)" msgstr "" -#: ../../library/optparse.rst:1759 +#: ../../library/optparse.rst:1776 msgid "Callback example 5: fixed arguments" msgstr "" -#: ../../library/optparse.rst:1761 +#: ../../library/optparse.rst:1778 msgid "" "Things get slightly more interesting when you define callback options that " "take a fixed number of arguments. Specifying that a callback option takes " @@ -2142,23 +2162,23 @@ msgid "" "nargs`, then the option takes :attr:`~Option.nargs` arguments." msgstr "" -#: ../../library/optparse.rst:1768 +#: ../../library/optparse.rst:1785 msgid "" "Here's an example that just emulates the standard ``\"store\"`` action::" msgstr "" -#: ../../library/optparse.rst:1777 +#: ../../library/optparse.rst:1794 msgid "" "Note that :mod:`optparse` takes care of consuming 3 arguments and converting " "them to integers for you; all you have to do is store them. (Or whatever; " "obviously you don't need a callback for this example.)" msgstr "" -#: ../../library/optparse.rst:1785 +#: ../../library/optparse.rst:1802 msgid "Callback example 6: variable arguments" msgstr "" -#: ../../library/optparse.rst:1787 +#: ../../library/optparse.rst:1804 msgid "" "Things get hairy when you want an option to take a variable number of " "arguments. For this case, you must write a callback, as :mod:`optparse` " @@ -2168,23 +2188,23 @@ msgid "" "implement the conventional rules for bare ``--`` and ``-`` arguments:" msgstr "" -#: ../../library/optparse.rst:1794 +#: ../../library/optparse.rst:1811 msgid "either ``--`` or ``-`` can be option arguments" msgstr "" -#: ../../library/optparse.rst:1796 +#: ../../library/optparse.rst:1813 msgid "" "bare ``--`` (if not the argument to some option): halt command-line " "processing and discard the ``--``" msgstr "" -#: ../../library/optparse.rst:1799 +#: ../../library/optparse.rst:1816 msgid "" "bare ``-`` (if not the argument to some option): halt command-line " "processing but keep the ``-`` (append it to ``parser.largs``)" msgstr "" -#: ../../library/optparse.rst:1802 +#: ../../library/optparse.rst:1819 msgid "" "If you want an option that takes a variable number of arguments, there are " "several subtle, tricky issues to worry about. The exact implementation you " @@ -2193,28 +2213,28 @@ msgid "" "directly)." msgstr "" -#: ../../library/optparse.rst:1808 +#: ../../library/optparse.rst:1825 msgid "" "Nevertheless, here's a stab at a callback for an option with variable " "arguments::" msgstr "" -#: ../../library/optparse.rst:1842 +#: ../../library/optparse.rst:1859 msgid "Extending :mod:`optparse`" msgstr "" -#: ../../library/optparse.rst:1844 +#: ../../library/optparse.rst:1861 msgid "" "Since the two major controlling factors in how :mod:`optparse` interprets " "command-line options are the action and type of each option, the most likely " "direction of extension is to add new actions and new types." msgstr "" -#: ../../library/optparse.rst:1852 +#: ../../library/optparse.rst:1869 msgid "Adding new types" msgstr "" -#: ../../library/optparse.rst:1854 +#: ../../library/optparse.rst:1871 msgid "" "To add new types, you need to define your own subclass of :mod:`optparse`'s :" "class:`Option` class. This class has a couple of attributes that define :" @@ -2222,19 +2242,19 @@ msgid "" "TYPE_CHECKER`." msgstr "" -#: ../../library/optparse.rst:1860 +#: ../../library/optparse.rst:1877 msgid "" "A tuple of type names; in your subclass, simply define a new tuple :attr:" "`TYPES` that builds on the standard one." msgstr "" -#: ../../library/optparse.rst:1865 +#: ../../library/optparse.rst:1882 msgid "" "A dictionary mapping type names to type-checking functions. A type-checking " "function has the following signature::" msgstr "" -#: ../../library/optparse.rst:1870 +#: ../../library/optparse.rst:1887 msgid "" "where ``option`` is an :class:`Option` instance, ``opt`` is an option string " "(e.g., ``-f``), and ``value`` is the string from the command line that must " @@ -2245,7 +2265,7 @@ msgid "" "``value`` parameter." msgstr "" -#: ../../library/optparse.rst:1878 +#: ../../library/optparse.rst:1895 msgid "" "Your type-checking function should raise :exc:`OptionValueError` if it " "encounters any problems. :exc:`OptionValueError` takes a single string " @@ -2254,7 +2274,7 @@ msgid "" "\"`` and prints everything to stderr before terminating the process." msgstr "" -#: ../../library/optparse.rst:1884 +#: ../../library/optparse.rst:1901 msgid "" "Here's a silly example that demonstrates adding a ``\"complex\"`` option " "type to parse Python-style complex numbers on the command line. (This is " @@ -2262,21 +2282,21 @@ msgid "" "support for complex numbers, but never mind.)" msgstr "" -#: ../../library/optparse.rst:1889 +#: ../../library/optparse.rst:1906 msgid "First, the necessary imports::" msgstr "" -#: ../../library/optparse.rst:1894 +#: ../../library/optparse.rst:1911 msgid "" "You need to define your type-checker first, since it's referred to later (in " "the :attr:`~Option.TYPE_CHECKER` class attribute of your Option subclass)::" msgstr "" -#: ../../library/optparse.rst:1904 +#: ../../library/optparse.rst:1921 msgid "Finally, the Option subclass::" msgstr "" -#: ../../library/optparse.rst:1911 +#: ../../library/optparse.rst:1928 msgid "" "(If we didn't make a :func:`copy` of :attr:`Option.TYPE_CHECKER`, we would " "end up modifying the :attr:`~Option.TYPE_CHECKER` attribute of :mod:" @@ -2284,46 +2304,46 @@ msgid "" "that except good manners and common sense.)" msgstr "" -#: ../../library/optparse.rst:1916 +#: ../../library/optparse.rst:1933 msgid "" "That's it! Now you can write a script that uses the new option type just " "like any other :mod:`optparse`\\ -based script, except you have to instruct " "your OptionParser to use MyOption instead of Option::" msgstr "" -#: ../../library/optparse.rst:1923 +#: ../../library/optparse.rst:1940 msgid "" "Alternately, you can build your own option list and pass it to OptionParser; " "if you don't use :meth:`add_option` in the above way, you don't need to tell " "OptionParser which option class to use::" msgstr "" -#: ../../library/optparse.rst:1934 +#: ../../library/optparse.rst:1951 msgid "Adding new actions" msgstr "" -#: ../../library/optparse.rst:1936 +#: ../../library/optparse.rst:1953 msgid "" "Adding new actions is a bit trickier, because you have to understand that :" "mod:`optparse` has a couple of classifications for actions:" msgstr "" -#: ../../library/optparse.rst:1942 +#: ../../library/optparse.rst:1959 msgid "\"store\" actions" msgstr "" -#: ../../library/optparse.rst:1940 +#: ../../library/optparse.rst:1957 msgid "" "actions that result in :mod:`optparse` storing a value to an attribute of " "the current OptionValues instance; these options require a :attr:`~Option." "dest` attribute to be supplied to the Option constructor." msgstr "" -#: ../../library/optparse.rst:1948 +#: ../../library/optparse.rst:1965 msgid "\"typed\" actions" msgstr "" -#: ../../library/optparse.rst:1945 +#: ../../library/optparse.rst:1962 msgid "" "actions that take a value from the command line and expect it to be of a " "certain type; or rather, a string that can be converted to a certain type. " @@ -2331,7 +2351,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/optparse.rst:1950 +#: ../../library/optparse.rst:1967 msgid "" "These are overlapping sets: some default \"store\" actions are " "``\"store\"``, ``\"store_const\"``, ``\"append\"``, and ``\"count\"``, while " @@ -2339,25 +2359,25 @@ msgid "" "``\"callback\"``." msgstr "" -#: ../../library/optparse.rst:1954 +#: ../../library/optparse.rst:1971 msgid "" "When you add an action, you need to categorize it by listing it in at least " "one of the following class attributes of Option (all are lists of strings):" msgstr "" -#: ../../library/optparse.rst:1959 +#: ../../library/optparse.rst:1976 msgid "All actions must be listed in ACTIONS." msgstr "" -#: ../../library/optparse.rst:1963 +#: ../../library/optparse.rst:1980 msgid "\"store\" actions are additionally listed here." msgstr "" -#: ../../library/optparse.rst:1967 +#: ../../library/optparse.rst:1984 msgid "\"typed\" actions are additionally listed here." msgstr "" -#: ../../library/optparse.rst:1971 +#: ../../library/optparse.rst:1988 msgid "" "Actions that always take a type (i.e. whose options always take a value) are " "additionally listed here. The only effect of this is that :mod:`optparse` " @@ -2365,13 +2385,13 @@ msgid "" "whose action is listed in :attr:`ALWAYS_TYPED_ACTIONS`." msgstr "" -#: ../../library/optparse.rst:1976 +#: ../../library/optparse.rst:1993 msgid "" "In order to actually implement your new action, you must override Option's :" "meth:`take_action` method and add a case that recognizes your action." msgstr "" -#: ../../library/optparse.rst:1979 +#: ../../library/optparse.rst:1996 msgid "" "For example, let's add an ``\"extend\"`` action. This is similar to the " "standard ``\"append\"`` action, but instead of taking a single value from " @@ -2381,47 +2401,47 @@ msgid "" "option of type ``\"string\"``, the command line ::" msgstr "" -#: ../../library/optparse.rst:1988 +#: ../../library/optparse.rst:2005 msgid "would result in a list ::" msgstr "" -#: ../../library/optparse.rst:1992 +#: ../../library/optparse.rst:2009 msgid "Again we define a subclass of Option::" msgstr "" -#: ../../library/optparse.rst:2009 +#: ../../library/optparse.rst:2026 msgid "Features of note:" msgstr "" -#: ../../library/optparse.rst:2011 +#: ../../library/optparse.rst:2028 msgid "" "``\"extend\"`` both expects a value on the command-line and stores that " "value somewhere, so it goes in both :attr:`~Option.STORE_ACTIONS` and :attr:" "`~Option.TYPED_ACTIONS`." msgstr "" -#: ../../library/optparse.rst:2015 +#: ../../library/optparse.rst:2032 msgid "" "to ensure that :mod:`optparse` assigns the default type of ``\"string\"`` to " "``\"extend\"`` actions, we put the ``\"extend\"`` action in :attr:`~Option." "ALWAYS_TYPED_ACTIONS` as well." msgstr "" -#: ../../library/optparse.rst:2019 +#: ../../library/optparse.rst:2036 msgid "" ":meth:`MyOption.take_action` implements just this one new action, and passes " "control back to :meth:`Option.take_action` for the standard :mod:`optparse` " "actions." msgstr "" -#: ../../library/optparse.rst:2023 +#: ../../library/optparse.rst:2040 msgid "" "``values`` is an instance of the optparse_parser.Values class, which " "provides the very useful :meth:`ensure_value` method. :meth:`ensure_value` " "is essentially :func:`getattr` with a safety valve; it is called as ::" msgstr "" -#: ../../library/optparse.rst:2029 +#: ../../library/optparse.rst:2046 msgid "" "If the ``attr`` attribute of ``values`` doesn't exist or is ``None``, then " "ensure_value() first sets it to ``value``, and then returns 'value. This is " @@ -2433,3 +2453,29 @@ msgid "" "destinations in question; they can just leave the default as ``None`` and :" "meth:`ensure_value` will take care of getting it right when it's needed." msgstr "" + +#: ../../library/optparse.rst:2057 +msgid "Exceptions" +msgstr "" + +#: ../../library/optparse.rst:2061 +msgid "" +"Raised if an :class:`Option` instance is created with invalid or " +"inconsistent arguments." +msgstr "" + +#: ../../library/optparse.rst:2066 +msgid "Raised if conflicting options are added to an :class:`OptionParser`." +msgstr "" + +#: ../../library/optparse.rst:2070 +msgid "Raised if an invalid option value is encountered on the command line." +msgstr "" + +#: ../../library/optparse.rst:2074 +msgid "Raised if an invalid option is passed on the command line." +msgstr "" + +#: ../../library/optparse.rst:2078 +msgid "Raised if an ambiguous option is passed on the command line." +msgstr "" diff --git a/library/pkgutil.po b/library/pkgutil.po index 87f1684b57..322378c12a 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-04-25 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -114,7 +114,8 @@ msgstr "" msgid "" "This is a backwards compatibility wrapper around :func:`importlib.util." "find_spec` that converts most failures to :exc:`ImportError` and only " -"returns the loader rather than the full :class:`ModuleSpec`." +"returns the loader rather than the full :class:`importlib.machinery." +"ModuleSpec`." msgstr "" #: ../../library/pkgutil.rst:87 ../../library/pkgutil.rst:104 diff --git a/using/windows.po b/using/windows.po index 3dcfeee787..1c3a4135e6 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-02 00:33+0000\n" +"POT-Creation-Date: 2023-04-25 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -818,7 +818,7 @@ msgid "" "settings, and installed packages. The standard library is included as pre-" "compiled and optimized ``.pyc`` files in a ZIP, and ``python3.dll``, " "``python37.dll``, ``python.exe`` and ``pythonw.exe`` are all provided. Tcl/" -"tk (including all dependants, such as Idle), pip and the Python " +"tk (including all dependents, such as Idle), pip and the Python " "documentation are not included." msgstr "" From 83bf796bf416cb1f61392351d6612a105941c11f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 26 Apr 2023 00:32:37 +0000 Subject: [PATCH 073/130] sync with cpython d9aafe24 --- library/ctypes.po | 6 +- library/subprocess.po | 256 +++++++++++++++++++++--------------------- library/types.po | 82 ++++++++------ 3 files changed, 183 insertions(+), 161 deletions(-) diff --git a/library/ctypes.po b/library/ctypes.po index 753a100b8e..f3399f397f 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-04-26 00:30+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -512,8 +512,8 @@ msgstr "" #: ../../library/ctypes.rst:392 msgid "" -"Because specifying the attribute does inhibit portability it is advised to " -"always specify ``argtypes`` for all variadic functions." +"Because specifying the attribute does not inhibit portability it is advised " +"to always specify ``argtypes`` for all variadic functions." msgstr "" #: ../../library/ctypes.rst:399 diff --git a/library/subprocess.po b/library/subprocess.po index 995bb27222..d594421690 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-04-26 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -153,8 +153,8 @@ msgid "" msgstr "" #: ../../library/subprocess.rst:116 ../../library/subprocess.rst:501 -#: ../../library/subprocess.rst:1181 ../../library/subprocess.rst:1221 -#: ../../library/subprocess.rst:1284 +#: ../../library/subprocess.rst:1184 ../../library/subprocess.rst:1224 +#: ../../library/subprocess.rst:1287 msgid "" "Changed Windows shell search order for ``shell=True``. The current directory " "and ``%PATH%`` are replaced with ``%COMSPEC%`` and ``%SystemRoot%" @@ -178,7 +178,7 @@ msgid "" "that it ran successfully." msgstr "" -#: ../../library/subprocess.rst:135 ../../library/subprocess.rst:928 +#: ../../library/subprocess.rst:135 ../../library/subprocess.rst:931 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." @@ -797,7 +797,7 @@ msgstr "" msgid "*encoding* and *errors* were added." msgstr "新增 *encoding* 與 *errors*\\ 。" -#: ../../library/subprocess.rst:661 ../../library/subprocess.rst:1279 +#: ../../library/subprocess.rst:661 ../../library/subprocess.rst:1282 msgid "*text* was added as a more readable alias for *universal_newlines*." msgstr "" @@ -1017,8 +1017,8 @@ msgid "" msgstr "" #: ../../library/subprocess.rst:797 ../../library/subprocess.rst:838 -#: ../../library/subprocess.rst:1176 ../../library/subprocess.rst:1216 -#: ../../library/subprocess.rst:1270 +#: ../../library/subprocess.rst:1179 ../../library/subprocess.rst:1219 +#: ../../library/subprocess.rst:1273 msgid "*timeout* was added." msgstr "新增 *timeout*\\ 。" @@ -1155,22 +1155,28 @@ msgstr "" #: ../../library/subprocess.rst:924 msgid "" -"The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly " -"by :meth:`communicate`). A ``None`` value indicates that the process hasn't " -"terminated yet." +"The child return code. Initially ``None``, :attr:`returncode` is set by a " +"call to the :meth:`poll`, :meth:`wait`, or :meth:`communicate` methods if " +"they detect that the process has terminated." +msgstr "" + +#: ../../library/subprocess.rst:928 +msgid "" +"A ``None`` value indicates that the process hadn't yet terminated at the " +"time of the last method call." msgstr "" -#: ../../library/subprocess.rst:933 +#: ../../library/subprocess.rst:936 msgid "Windows Popen Helpers" msgstr "" -#: ../../library/subprocess.rst:935 +#: ../../library/subprocess.rst:938 msgid "" "The :class:`STARTUPINFO` class and following constants are only available on " "Windows." msgstr "" -#: ../../library/subprocess.rst:941 +#: ../../library/subprocess.rst:944 msgid "" "Partial support of the Windows `STARTUPINFO `__ structure is used for :class:`Popen` " @@ -1178,38 +1184,38 @@ msgid "" "only arguments." msgstr "" -#: ../../library/subprocess.rst:946 +#: ../../library/subprocess.rst:949 msgid "Keyword-only argument support was added." msgstr "" -#: ../../library/subprocess.rst:951 +#: ../../library/subprocess.rst:954 msgid "" "A bit field that determines whether certain :class:`STARTUPINFO` attributes " "are used when the process creates a window. ::" msgstr "" -#: ../../library/subprocess.rst:959 +#: ../../library/subprocess.rst:962 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard input handle for the process. If :data:`STARTF_USESTDHANDLES` " "is not specified, the default for standard input is the keyboard buffer." msgstr "" -#: ../../library/subprocess.rst:966 +#: ../../library/subprocess.rst:969 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard output handle for the process. Otherwise, this attribute is " "ignored and the default for standard output is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:973 +#: ../../library/subprocess.rst:976 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard error handle for the process. Otherwise, this attribute is " "ignored and the default for standard error is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:979 +#: ../../library/subprocess.rst:982 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute " "can be any of the values that can be specified in the ``nCmdShow`` parameter " @@ -1218,34 +1224,34 @@ msgid "" "Otherwise, this attribute is ignored." msgstr "" -#: ../../library/subprocess.rst:986 +#: ../../library/subprocess.rst:989 msgid "" ":data:`SW_HIDE` is provided for this attribute. It is used when :class:" "`Popen` is called with ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:991 +#: ../../library/subprocess.rst:994 msgid "" "A dictionary of additional attributes for process creation as given in " "``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." msgstr "" -#: ../../library/subprocess.rst:995 +#: ../../library/subprocess.rst:998 msgid "Supported attributes:" msgstr "" -#: ../../library/subprocess.rst:1013 +#: ../../library/subprocess.rst:1016 msgid "**handle_list**" msgstr "**handle_list**" -#: ../../library/subprocess.rst:998 +#: ../../library/subprocess.rst:1001 msgid "" "Sequence of handles that will be inherited. *close_fds* must be true if non-" "empty." msgstr "" -#: ../../library/subprocess.rst:1001 +#: ../../library/subprocess.rst:1004 msgid "" "The handles must be temporarily made inheritable by :func:`os." "set_handle_inheritable` when passed to the :class:`Popen` constructor, else :" @@ -1253,7 +1259,7 @@ msgid "" "``ERROR_INVALID_PARAMETER`` (87)." msgstr "" -#: ../../library/subprocess.rst:1008 +#: ../../library/subprocess.rst:1011 msgid "" "In a multithreaded process, use caution to avoid leaking handles that are " "marked inheritable when combining this feature with concurrent calls to " @@ -1262,97 +1268,97 @@ msgid "" "temporarily creates inheritable handles." msgstr "" -#: ../../library/subprocess.rst:1018 +#: ../../library/subprocess.rst:1021 msgid "Windows Constants" msgstr "" -#: ../../library/subprocess.rst:1020 +#: ../../library/subprocess.rst:1023 msgid "The :mod:`subprocess` module exposes the following constants." msgstr "" -#: ../../library/subprocess.rst:1024 +#: ../../library/subprocess.rst:1027 msgid "" "The standard input device. Initially, this is the console input buffer, " "``CONIN$``." msgstr "" -#: ../../library/subprocess.rst:1029 +#: ../../library/subprocess.rst:1032 msgid "" "The standard output device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1034 +#: ../../library/subprocess.rst:1037 msgid "" "The standard error device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1039 +#: ../../library/subprocess.rst:1042 msgid "Hides the window. Another window will be activated." msgstr "" -#: ../../library/subprocess.rst:1043 +#: ../../library/subprocess.rst:1046 msgid "" "Specifies that the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO." "hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes contain additional " "information." msgstr "" -#: ../../library/subprocess.rst:1049 +#: ../../library/subprocess.rst:1052 msgid "" "Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains " "additional information." msgstr "" -#: ../../library/subprocess.rst:1054 +#: ../../library/subprocess.rst:1057 msgid "" "The new process has a new console, instead of inheriting its parent's " "console (the default)." msgstr "" -#: ../../library/subprocess.rst:1059 +#: ../../library/subprocess.rst:1062 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "group will be created. This flag is necessary for using :func:`os.kill` on " "the subprocess." msgstr "" -#: ../../library/subprocess.rst:1063 +#: ../../library/subprocess.rst:1066 msgid "This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified." msgstr "" -#: ../../library/subprocess.rst:1067 +#: ../../library/subprocess.rst:1070 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an above average priority." msgstr "" -#: ../../library/subprocess.rst:1074 +#: ../../library/subprocess.rst:1077 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a below average priority." msgstr "" -#: ../../library/subprocess.rst:1081 +#: ../../library/subprocess.rst:1084 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a high priority." msgstr "" -#: ../../library/subprocess.rst:1088 +#: ../../library/subprocess.rst:1091 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an idle (lowest) priority." msgstr "" -#: ../../library/subprocess.rst:1095 +#: ../../library/subprocess.rst:1098 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an normal priority. (default)" msgstr "" -#: ../../library/subprocess.rst:1102 +#: ../../library/subprocess.rst:1105 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have realtime priority. You should almost never use " @@ -1362,20 +1368,20 @@ msgid "" "perform brief tasks that should have limited interruptions." msgstr "" -#: ../../library/subprocess.rst:1113 +#: ../../library/subprocess.rst:1116 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not create a window." msgstr "" -#: ../../library/subprocess.rst:1120 +#: ../../library/subprocess.rst:1123 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not inherit its parent's console. This value cannot be used with " "CREATE_NEW_CONSOLE." msgstr "" -#: ../../library/subprocess.rst:1128 +#: ../../library/subprocess.rst:1131 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "does not inherit the error mode of the calling process. Instead, the new " @@ -1383,39 +1389,39 @@ msgid "" "multithreaded shell applications that run with hard errors disabled." msgstr "" -#: ../../library/subprocess.rst:1138 +#: ../../library/subprocess.rst:1141 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "is not associated with the job." msgstr "" -#: ../../library/subprocess.rst:1146 +#: ../../library/subprocess.rst:1149 msgid "Older high-level API" msgstr "" -#: ../../library/subprocess.rst:1148 +#: ../../library/subprocess.rst:1151 msgid "" "Prior to Python 3.5, these three functions comprised the high level API to " "subprocess. You can now use :func:`run` in many cases, but lots of existing " "code calls these functions." msgstr "" -#: ../../library/subprocess.rst:1155 +#: ../../library/subprocess.rst:1158 msgid "" "Run the command described by *args*. Wait for command to complete, then " "return the :attr:`~Popen.returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:1158 ../../library/subprocess.rst:1198 +#: ../../library/subprocess.rst:1161 ../../library/subprocess.rst:1201 msgid "" "Code needing to capture stdout or stderr should use :func:`run` instead::" msgstr "" -#: ../../library/subprocess.rst:1162 ../../library/subprocess.rst:1202 +#: ../../library/subprocess.rst:1165 ../../library/subprocess.rst:1205 msgid "To suppress stdout or stderr, supply a value of :data:`DEVNULL`." msgstr "" -#: ../../library/subprocess.rst:1164 ../../library/subprocess.rst:1204 +#: ../../library/subprocess.rst:1167 ../../library/subprocess.rst:1207 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is the same as that of the :class:`Popen` constructor - this " @@ -1423,14 +1429,14 @@ msgid "" "to that interface." msgstr "" -#: ../../library/subprocess.rst:1171 ../../library/subprocess.rst:1211 +#: ../../library/subprocess.rst:1174 ../../library/subprocess.rst:1214 msgid "" "Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. The child " "process will block if it generates enough output to a pipe to fill up the OS " "pipe buffer as the pipes are not being read from." msgstr "" -#: ../../library/subprocess.rst:1191 +#: ../../library/subprocess.rst:1194 msgid "" "Run command with arguments. Wait for command to complete. If the return " "code was zero then return, otherwise raise :exc:`CalledProcessError`. The :" @@ -1439,11 +1445,11 @@ msgid "" "to start the process it will propagate the exception that was raised." msgstr "" -#: ../../library/subprocess.rst:1233 +#: ../../library/subprocess.rst:1236 msgid "Run command with arguments and return its output." msgstr "" -#: ../../library/subprocess.rst:1235 +#: ../../library/subprocess.rst:1238 msgid "" "If the return code was non-zero it raises a :exc:`CalledProcessError`. The :" "exc:`CalledProcessError` object will have the return code in the :attr:" @@ -1451,11 +1457,11 @@ msgid "" "`~CalledProcessError.output` attribute." msgstr "" -#: ../../library/subprocess.rst:1240 +#: ../../library/subprocess.rst:1243 msgid "This is equivalent to::" msgstr "" -#: ../../library/subprocess.rst:1244 +#: ../../library/subprocess.rst:1247 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is largely the same as that of :func:`run` - most arguments are " @@ -1465,52 +1471,52 @@ msgid "" "using the parent's standard input file handle." msgstr "" -#: ../../library/subprocess.rst:1251 +#: ../../library/subprocess.rst:1254 msgid "" "By default, this function will return the data as encoded bytes. The actual " "encoding of the output data may depend on the command being invoked, so the " "decoding to text will often need to be handled at the application level." msgstr "" -#: ../../library/subprocess.rst:1255 +#: ../../library/subprocess.rst:1258 msgid "" "This behaviour may be overridden by setting *text*, *encoding*, *errors*, or " "*universal_newlines* to ``True`` as described in :ref:`frequently-used-" "arguments` and :func:`run`." msgstr "" -#: ../../library/subprocess.rst:1259 +#: ../../library/subprocess.rst:1262 msgid "" "To also capture standard error in the result, use ``stderr=subprocess." "STDOUT``::" msgstr "" -#: ../../library/subprocess.rst:1273 +#: ../../library/subprocess.rst:1276 msgid "Support for the *input* keyword argument was added." msgstr "新增 *input* 關鍵字引數的支援。" -#: ../../library/subprocess.rst:1276 +#: ../../library/subprocess.rst:1279 msgid "*encoding* and *errors* were added. See :func:`run` for details." msgstr "新增 *encoding* 與 *errors*\\ 。細節請見 :func:`run`\\ 。" -#: ../../library/subprocess.rst:1294 +#: ../../library/subprocess.rst:1297 msgid "Replacing Older Functions with the :mod:`subprocess` Module" msgstr "" -#: ../../library/subprocess.rst:1296 +#: ../../library/subprocess.rst:1299 msgid "" "In this section, \"a becomes b\" means that b can be used as a replacement " "for a." msgstr "" -#: ../../library/subprocess.rst:1300 +#: ../../library/subprocess.rst:1303 msgid "" "All \"a\" functions in this section fail (more or less) silently if the " "executed program cannot be found; the \"b\" replacements raise :exc:" "`OSError` instead." msgstr "" -#: ../../library/subprocess.rst:1304 +#: ../../library/subprocess.rst:1307 msgid "" "In addition, the replacements using :func:`check_output` will fail with a :" "exc:`CalledProcessError` if the requested operation produces a non-zero " @@ -1518,143 +1524,143 @@ msgid "" "output` attribute of the raised exception." msgstr "" -#: ../../library/subprocess.rst:1309 +#: ../../library/subprocess.rst:1312 msgid "" "In the following examples, we assume that the relevant functions have " "already been imported from the :mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1314 +#: ../../library/subprocess.rst:1317 msgid "Replacing :program:`/bin/sh` shell command substitution" msgstr "" -#: ../../library/subprocess.rst:1320 ../../library/subprocess.rst:1331 -#: ../../library/subprocess.rst:1348 +#: ../../library/subprocess.rst:1323 ../../library/subprocess.rst:1334 +#: ../../library/subprocess.rst:1351 msgid "becomes::" msgstr "" "變成:\n" "\n" "::" -#: ../../library/subprocess.rst:1325 +#: ../../library/subprocess.rst:1328 msgid "Replacing shell pipeline" msgstr "" -#: ../../library/subprocess.rst:1338 +#: ../../library/subprocess.rst:1341 msgid "" "The ``p1.stdout.close()`` call after starting the p2 is important in order " "for p1 to receive a SIGPIPE if p2 exits before p1." msgstr "" -#: ../../library/subprocess.rst:1341 +#: ../../library/subprocess.rst:1344 msgid "" "Alternatively, for trusted input, the shell's own pipeline support may still " "be used directly:" msgstr "" -#: ../../library/subprocess.rst:1354 +#: ../../library/subprocess.rst:1357 msgid "Replacing :func:`os.system`" msgstr "" -#: ../../library/subprocess.rst:1362 +#: ../../library/subprocess.rst:1365 msgid "Notes:" msgstr "註解:" -#: ../../library/subprocess.rst:1364 +#: ../../library/subprocess.rst:1367 msgid "Calling the program through the shell is usually not required." msgstr "" -#: ../../library/subprocess.rst:1365 +#: ../../library/subprocess.rst:1368 msgid "" "The :func:`call` return value is encoded differently to that of :func:`os." "system`." msgstr "" -#: ../../library/subprocess.rst:1368 +#: ../../library/subprocess.rst:1371 msgid "" "The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the " "command is running, but the caller must do this separately when using the :" "mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1372 +#: ../../library/subprocess.rst:1375 msgid "A more realistic example would look like this::" msgstr "" -#: ../../library/subprocess.rst:1385 +#: ../../library/subprocess.rst:1388 msgid "Replacing the :func:`os.spawn ` family" msgstr "" -#: ../../library/subprocess.rst:1387 +#: ../../library/subprocess.rst:1390 msgid "P_NOWAIT example::" msgstr "" "P_NOWAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1393 +#: ../../library/subprocess.rst:1396 msgid "P_WAIT example::" msgstr "" "P_WAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1399 +#: ../../library/subprocess.rst:1402 msgid "Vector example::" msgstr "" -#: ../../library/subprocess.rst:1405 +#: ../../library/subprocess.rst:1408 msgid "Environment example::" msgstr "" -#: ../../library/subprocess.rst:1414 +#: ../../library/subprocess.rst:1417 msgid "Replacing :func:`os.popen`, :func:`os.popen2`, :func:`os.popen3`" msgstr "" -#: ../../library/subprocess.rst:1444 +#: ../../library/subprocess.rst:1447 msgid "Return code handling translates as follows::" msgstr "" -#: ../../library/subprocess.rst:1460 +#: ../../library/subprocess.rst:1463 msgid "Replacing functions from the :mod:`popen2` module" msgstr "" -#: ../../library/subprocess.rst:1464 +#: ../../library/subprocess.rst:1467 msgid "" "If the cmd argument to popen2 functions is a string, the command is executed " "through /bin/sh. If it is a list, the command is directly executed." msgstr "" -#: ../../library/subprocess.rst:1483 +#: ../../library/subprocess.rst:1486 msgid "" ":class:`popen2.Popen3` and :class:`popen2.Popen4` basically work as :class:" "`subprocess.Popen`, except that:" msgstr "" -#: ../../library/subprocess.rst:1486 +#: ../../library/subprocess.rst:1489 msgid ":class:`Popen` raises an exception if the execution fails." msgstr "" -#: ../../library/subprocess.rst:1488 +#: ../../library/subprocess.rst:1491 msgid "The *capturestderr* argument is replaced with the *stderr* argument." msgstr "" -#: ../../library/subprocess.rst:1490 +#: ../../library/subprocess.rst:1493 msgid "``stdin=PIPE`` and ``stdout=PIPE`` must be specified." msgstr "" -#: ../../library/subprocess.rst:1492 +#: ../../library/subprocess.rst:1495 msgid "" "popen2 closes all file descriptors by default, but you have to specify " "``close_fds=True`` with :class:`Popen` to guarantee this behavior on all " "platforms or past Python versions." msgstr "" -#: ../../library/subprocess.rst:1498 +#: ../../library/subprocess.rst:1501 msgid "Legacy Shell Invocation Functions" msgstr "" -#: ../../library/subprocess.rst:1500 +#: ../../library/subprocess.rst:1503 msgid "" "This module also provides the following legacy functions from the 2.x " "``commands`` module. These operations implicitly invoke the system shell and " @@ -1662,11 +1668,11 @@ msgid "" "handling consistency are valid for these functions." msgstr "" -#: ../../library/subprocess.rst:1507 +#: ../../library/subprocess.rst:1510 msgid "Return ``(exitcode, output)`` of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1509 +#: ../../library/subprocess.rst:1512 msgid "" "Execute the string *cmd* in a shell with :meth:`Popen.check_output` and " "return a 2-tuple ``(exitcode, output)``. *encoding* and *errors* are used to " @@ -1674,85 +1680,85 @@ msgid "" "details." msgstr "" -#: ../../library/subprocess.rst:1514 +#: ../../library/subprocess.rst:1517 msgid "" "A trailing newline is stripped from the output. The exit code for the " "command can be interpreted as the return code of subprocess. Example::" msgstr "" -#: ../../library/subprocess.rst:1527 ../../library/subprocess.rst:1549 +#: ../../library/subprocess.rst:1530 ../../library/subprocess.rst:1552 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix 和 Windows。" -#: ../../library/subprocess.rst:1529 +#: ../../library/subprocess.rst:1532 msgid "Windows support was added." msgstr "" -#: ../../library/subprocess.rst:1532 +#: ../../library/subprocess.rst:1535 msgid "" "The function now returns (exitcode, output) instead of (status, output) as " "it did in Python 3.3.3 and earlier. exitcode has the same value as :attr:" "`~Popen.returncode`." msgstr "" -#: ../../library/subprocess.rst:1536 ../../library/subprocess.rst:1554 +#: ../../library/subprocess.rst:1539 ../../library/subprocess.rst:1557 msgid "Added *encoding* and *errors* arguments." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/subprocess.rst:1541 +#: ../../library/subprocess.rst:1544 msgid "Return output (stdout and stderr) of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1543 +#: ../../library/subprocess.rst:1546 msgid "" "Like :func:`getstatusoutput`, except the exit code is ignored and the return " "value is a string containing the command's output. Example::" msgstr "" -#: ../../library/subprocess.rst:1551 +#: ../../library/subprocess.rst:1554 msgid "Windows support added" msgstr "" -#: ../../library/subprocess.rst:1559 +#: ../../library/subprocess.rst:1562 msgid "Notes" msgstr "註解" -#: ../../library/subprocess.rst:1564 +#: ../../library/subprocess.rst:1567 msgid "Converting an argument sequence to a string on Windows" msgstr "" -#: ../../library/subprocess.rst:1566 +#: ../../library/subprocess.rst:1569 msgid "" "On Windows, an *args* sequence is converted to a string that can be parsed " "using the following rules (which correspond to the rules used by the MS C " "runtime):" msgstr "" -#: ../../library/subprocess.rst:1570 +#: ../../library/subprocess.rst:1573 msgid "" "Arguments are delimited by white space, which is either a space or a tab." msgstr "" -#: ../../library/subprocess.rst:1573 +#: ../../library/subprocess.rst:1576 msgid "" "A string surrounded by double quotation marks is interpreted as a single " "argument, regardless of white space contained within. A quoted string can " "be embedded in an argument." msgstr "" -#: ../../library/subprocess.rst:1578 +#: ../../library/subprocess.rst:1581 msgid "" "A double quotation mark preceded by a backslash is interpreted as a literal " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1581 +#: ../../library/subprocess.rst:1584 msgid "" "Backslashes are interpreted literally, unless they immediately precede a " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1584 +#: ../../library/subprocess.rst:1587 msgid "" "If backslashes immediately precede a double quotation mark, every pair of " "backslashes is interpreted as a literal backslash. If the number of " @@ -1760,33 +1766,33 @@ msgid "" "mark as described in rule 3." msgstr "" -#: ../../library/subprocess.rst:1593 +#: ../../library/subprocess.rst:1596 msgid ":mod:`shlex`" msgstr ":mod:`shlex`" -#: ../../library/subprocess.rst:1594 +#: ../../library/subprocess.rst:1597 msgid "Module which provides function to parse and escape command lines." msgstr "" -#: ../../library/subprocess.rst:1601 +#: ../../library/subprocess.rst:1604 msgid "Disabling use of ``vfork()`` or ``posix_spawn()``" msgstr "" -#: ../../library/subprocess.rst:1603 +#: ../../library/subprocess.rst:1606 msgid "" "On Linux, :mod:`subprocess` defaults to using the ``vfork()`` system call " "internally when it is safe to do so rather than ``fork()``. This greatly " "improves performance." msgstr "" -#: ../../library/subprocess.rst:1607 +#: ../../library/subprocess.rst:1610 msgid "" "If you ever encounter a presumed highly unusual situation where you need to " "prevent ``vfork()`` from being used by Python, you can set the :attr:" "`subprocess._USE_VFORK` attribute to a false value." msgstr "" -#: ../../library/subprocess.rst:1615 +#: ../../library/subprocess.rst:1618 msgid "" "Setting this has no impact on use of ``posix_spawn()`` which could use " "``vfork()`` internally within its libc implementation. There is a similar :" @@ -1794,7 +1800,7 @@ msgid "" "that." msgstr "" -#: ../../library/subprocess.rst:1624 +#: ../../library/subprocess.rst:1627 msgid "" "It is safe to set these to false on any Python version. They will have no " "effect on older versions when unsupported. Do not assume the attributes are " @@ -1802,17 +1808,17 @@ msgid "" "the corresponding function will be used, only that it may be." msgstr "" -#: ../../library/subprocess.rst:1629 +#: ../../library/subprocess.rst:1632 msgid "" "Please file issues any time you have to use these private knobs with a way " "to reproduce the issue you were seeing. Link to that issue from a comment in " "your code." msgstr "" -#: ../../library/subprocess.rst:1633 +#: ../../library/subprocess.rst:1636 msgid "``_USE_POSIX_SPAWN``" msgstr "``_USE_POSIX_SPAWN``" -#: ../../library/subprocess.rst:1634 +#: ../../library/subprocess.rst:1637 msgid "``_USE_VFORK``" msgstr "``_USE_VFORK``" diff --git a/library/types.po b/library/types.po index e1595e4ade..327dc5f3d4 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-04-26 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -362,35 +362,51 @@ msgid "This type can now be subclassed." msgstr "" #: ../../library/types.rst:317 +msgid ":ref:`Generic Alias Types`" +msgstr "" + +#: ../../library/types.rst:317 +msgid "In-depth documentation on instances of :class:`!types.GenericAlias`" +msgstr "" + +#: ../../library/types.rst:319 +msgid ":pep:`585` - Type Hinting Generics In Standard Collections" +msgstr "" + +#: ../../library/types.rst:320 +msgid "Introducing the :class:`!types.GenericAlias` class" +msgstr "" + +#: ../../library/types.rst:324 msgid "The type of :ref:`union type expressions`." msgstr "" -#: ../../library/types.rst:323 +#: ../../library/types.rst:330 msgid "" "The type of traceback objects such as found in ``sys.exception()." "__traceback__``." msgstr "" -#: ../../library/types.rst:325 +#: ../../library/types.rst:332 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations, and guidance on creating tracebacks " "dynamically." msgstr "" -#: ../../library/types.rst:332 +#: ../../library/types.rst:339 msgid "" "The type of frame objects such as found in ``tb.tb_frame`` if ``tb`` is a " "traceback object." msgstr "" -#: ../../library/types.rst:335 +#: ../../library/types.rst:342 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations." msgstr "" -#: ../../library/types.rst:341 +#: ../../library/types.rst:348 msgid "" "The type of objects defined in extension modules with ``PyGetSetDef``, such " "as ``FrameType.f_locals`` or ``array.array.typecode``. This type is used as " @@ -398,7 +414,7 @@ msgid "" "`property` type, but for classes defined in extension modules." msgstr "" -#: ../../library/types.rst:349 +#: ../../library/types.rst:356 msgid "" "The type of objects defined in extension modules with ``PyMemberDef``, such " "as ``datetime.timedelta.days``. This type is used as descriptor for simple " @@ -407,113 +423,113 @@ msgid "" "modules." msgstr "" -#: ../../library/types.rst:356 +#: ../../library/types.rst:363 msgid "" "In other implementations of Python, this type may be identical to " "``GetSetDescriptorType``." msgstr "" -#: ../../library/types.rst:361 +#: ../../library/types.rst:368 msgid "" "Read-only proxy of a mapping. It provides a dynamic view on the mapping's " "entries, which means that when the mapping changes, the view reflects these " "changes." msgstr "" -#: ../../library/types.rst:369 +#: ../../library/types.rst:376 msgid "" "Updated to support the new union (``|``) operator from :pep:`584`, which " "simply delegates to the underlying mapping." msgstr "" -#: ../../library/types.rst:374 +#: ../../library/types.rst:381 msgid "" "Return ``True`` if the underlying mapping has a key *key*, else ``False``." msgstr "" -#: ../../library/types.rst:379 +#: ../../library/types.rst:386 msgid "" "Return the item of the underlying mapping with key *key*. Raises a :exc:" "`KeyError` if *key* is not in the underlying mapping." msgstr "" -#: ../../library/types.rst:384 +#: ../../library/types.rst:391 msgid "" "Return an iterator over the keys of the underlying mapping. This is a " "shortcut for ``iter(proxy.keys())``." msgstr "" -#: ../../library/types.rst:389 +#: ../../library/types.rst:396 msgid "Return the number of items in the underlying mapping." msgstr "" -#: ../../library/types.rst:393 +#: ../../library/types.rst:400 msgid "Return a shallow copy of the underlying mapping." msgstr "" -#: ../../library/types.rst:397 +#: ../../library/types.rst:404 msgid "" "Return the value for *key* if *key* is in the underlying mapping, else " "*default*. If *default* is not given, it defaults to ``None``, so that this " "method never raises a :exc:`KeyError`." msgstr "" -#: ../../library/types.rst:403 +#: ../../library/types.rst:410 msgid "" "Return a new view of the underlying mapping's items (``(key, value)`` pairs)." msgstr "" -#: ../../library/types.rst:408 +#: ../../library/types.rst:415 msgid "Return a new view of the underlying mapping's keys." msgstr "" -#: ../../library/types.rst:412 +#: ../../library/types.rst:419 msgid "Return a new view of the underlying mapping's values." msgstr "" -#: ../../library/types.rst:416 +#: ../../library/types.rst:423 msgid "Return a reverse iterator over the keys of the underlying mapping." msgstr "" -#: ../../library/types.rst:422 +#: ../../library/types.rst:429 msgid "Additional Utility Classes and Functions" msgstr "" -#: ../../library/types.rst:426 +#: ../../library/types.rst:433 msgid "" "A simple :class:`object` subclass that provides attribute access to its " "namespace, as well as a meaningful repr." msgstr "" -#: ../../library/types.rst:429 +#: ../../library/types.rst:436 msgid "" "Unlike :class:`object`, with ``SimpleNamespace`` you can add and remove " "attributes. If a ``SimpleNamespace`` object is initialized with keyword " "arguments, those are directly added to the underlying namespace." msgstr "" -#: ../../library/types.rst:433 +#: ../../library/types.rst:440 msgid "The type is roughly equivalent to the following code::" msgstr "" -#: ../../library/types.rst:448 +#: ../../library/types.rst:455 msgid "" "``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``. " "However, for a structured record type use :func:`~collections.namedtuple` " "instead." msgstr "" -#: ../../library/types.rst:454 +#: ../../library/types.rst:461 msgid "" "Attribute order in the repr changed from alphabetical to insertion (like " "``dict``)." msgstr "" -#: ../../library/types.rst:460 +#: ../../library/types.rst:467 msgid "Route attribute access on a class to __getattr__." msgstr "" -#: ../../library/types.rst:462 +#: ../../library/types.rst:469 msgid "" "This is a descriptor, used to define attributes that act differently when " "accessed through an instance and through a class. Instance access remains " @@ -521,18 +537,18 @@ msgid "" "class's __getattr__ method; this is done by raising AttributeError." msgstr "" -#: ../../library/types.rst:467 +#: ../../library/types.rst:474 msgid "" "This allows one to have properties active on an instance, and have virtual " "attributes on the class with the same name (see :class:`enum.Enum` for an " "example)." msgstr "" -#: ../../library/types.rst:474 +#: ../../library/types.rst:481 msgid "Coroutine Utility Functions" msgstr "" -#: ../../library/types.rst:478 +#: ../../library/types.rst:485 msgid "" "This function transforms a :term:`generator` function into a :term:" "`coroutine function` which returns a generator-based coroutine. The " @@ -542,11 +558,11 @@ msgid "" "method." msgstr "" -#: ../../library/types.rst:485 +#: ../../library/types.rst:492 msgid "If *gen_func* is a generator function, it will be modified in-place." msgstr "" -#: ../../library/types.rst:487 +#: ../../library/types.rst:494 msgid "" "If *gen_func* is not a generator function, it will be wrapped. If it returns " "an instance of :class:`collections.abc.Generator`, the instance will be " From 84ae4a36b2e8f2c37bba89bdfa0caba218ba4f23 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 27 Apr 2023 00:35:35 +0000 Subject: [PATCH 074/130] sync with cpython c0b538b0 --- library/asyncio-eventloop.po | 62 +++++++++++++++++++----------------- library/datetime.po | 15 ++++++--- library/smtplib.po | 14 ++++---- 3 files changed, 49 insertions(+), 42 deletions(-) diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index ed37d8ad75..80fa7c820e 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-26 00:38+0000\n" +"POT-Creation-Date: 2023-04-27 00:32+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1914,7 +1914,7 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:1541 -msgid "Do not instantiate the class directly." +msgid "Do not instantiate the :class:`Server` class directly." msgstr "" #: ../../library/asyncio-eventloop.rst:1545 @@ -1990,75 +1990,77 @@ msgid "Wait until the :meth:`close` method completes." msgstr "" #: ../../library/asyncio-eventloop.rst:1632 -msgid "List of :class:`socket.socket` objects the server is listening on." +msgid "" +"List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " +"server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1634 +#: ../../library/asyncio-eventloop.rst:1635 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1644 +#: ../../library/asyncio-eventloop.rst:1645 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1646 +#: ../../library/asyncio-eventloop.rst:1647 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1649 +#: ../../library/asyncio-eventloop.rst:1650 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1655 +#: ../../library/asyncio-eventloop.rst:1656 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1657 +#: ../../library/asyncio-eventloop.rst:1658 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1672 +#: ../../library/asyncio-eventloop.rst:1673 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1677 +#: ../../library/asyncio-eventloop.rst:1678 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1679 +#: ../../library/asyncio-eventloop.rst:1680 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1683 +#: ../../library/asyncio-eventloop.rst:1684 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1689 +#: ../../library/asyncio-eventloop.rst:1690 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1691 +#: ../../library/asyncio-eventloop.rst:1692 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1697 +#: ../../library/asyncio-eventloop.rst:1698 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1699 +#: ../../library/asyncio-eventloop.rst:1700 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2066,70 +2068,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1709 +#: ../../library/asyncio-eventloop.rst:1710 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1711 +#: ../../library/asyncio-eventloop.rst:1712 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1735 +#: ../../library/asyncio-eventloop.rst:1736 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1742 +#: ../../library/asyncio-eventloop.rst:1743 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1744 +#: ../../library/asyncio-eventloop.rst:1745 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1772 +#: ../../library/asyncio-eventloop.rst:1773 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1779 +#: ../../library/asyncio-eventloop.rst:1780 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1781 +#: ../../library/asyncio-eventloop.rst:1782 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1819 +#: ../../library/asyncio-eventloop.rst:1820 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1823 +#: ../../library/asyncio-eventloop.rst:1824 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1831 +#: ../../library/asyncio-eventloop.rst:1832 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1833 +#: ../../library/asyncio-eventloop.rst:1834 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1835 +#: ../../library/asyncio-eventloop.rst:1836 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/datetime.po b/library/datetime.po index c1f70ae4a8..7945d19c7f 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-09 00:31+0000\n" +"POT-Creation-Date: 2023-04-27 00:32+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1314,11 +1314,10 @@ msgid "" msgstr "" #: ../../library/datetime.rst:1046 -msgid "This is equivalent to::" +msgid "" +"If *format* does not contain microseconds or timezone information, this is " +"equivalent to::" msgstr "" -"這等價於:\n" -"\n" -"::" #: ../../library/datetime.rst:1050 msgid "" @@ -3172,3 +3171,9 @@ msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." msgstr "" + +#~ msgid "This is equivalent to::" +#~ msgstr "" +#~ "這等價於:\n" +#~ "\n" +#~ "::" diff --git a/library/smtplib.po b/library/smtplib.po index a44773603e..64dee19da5 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-04-27 00:32+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-" @@ -49,7 +49,7 @@ msgstr "" msgid "" "An :class:`SMTP` instance encapsulates an SMTP connection. It has methods " "that support a full repertoire of SMTP and ESMTP operations. If the optional " -"host and port parameters are given, the SMTP :meth:`connect` method is " +"*host* and *port* parameters are given, the SMTP :meth:`connect` method is " "called with those parameters during initialization. If specified, " "*local_hostname* is used as the FQDN of the local host in the HELO/EHLO " "command. Otherwise, the local hostname is found using :func:`socket." @@ -58,11 +58,11 @@ msgid "" "specifies a timeout in seconds for blocking operations like the connection " "attempt (if not specified, the global default timeout setting will be " "used). If the timeout expires, :exc:`TimeoutError` is raised. The optional " -"source_address parameter allows binding to some specific source address in a " -"machine with multiple network interfaces, and/or to some specific source TCP " -"port. It takes a 2-tuple (host, port), for the socket to bind to as its " -"source address before connecting. If omitted (or if host or port are ``''`` " -"and/or 0 respectively) the OS default behavior will be used." +"*source_address* parameter allows binding to some specific source address in " +"a machine with multiple network interfaces, and/or to some specific source " +"TCP port. It takes a 2-tuple ``(host, port)``, for the socket to bind to as " +"its source address before connecting. If omitted (or if *host* or *port* are " +"``''`` and/or ``0`` respectively) the OS default behavior will be used." msgstr "" #: ../../library/smtplib.rst:44 From bbba201f7ba664530c000dc06eaab3975b40ca2e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 28 Apr 2023 00:33:53 +0000 Subject: [PATCH 075/130] sync with cpython 294398c1 --- c-api/unicode.po | 120 ++++++++++++++++++++++---------------------- library/__main__.po | 4 +- library/tempfile.po | 69 +++++++++++++------------ 3 files changed, 100 insertions(+), 93 deletions(-) diff --git a/c-api/unicode.po b/c-api/unicode.po index 1abe565e63..b443595f14 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-04-28 00:31+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -204,9 +204,9 @@ msgstr "" #: ../../c-api/unicode.rst:195 msgid "" -"Read a character from a Unicode object *o*, which must be in the \"canonical" -"\" representation. This is less efficient than :c:func:`PyUnicode_READ` if " -"you do multiple consecutive reads." +"Read a character from a Unicode object *o*, which must be in the " +"\"canonical\" representation. This is less efficient than :c:func:" +"`PyUnicode_READ` if you do multiple consecutive reads." msgstr "" #: ../../c-api/unicode.rst:204 @@ -224,7 +224,7 @@ msgid "" msgstr "" #: ../../c-api/unicode.rst:219 ../../c-api/unicode.rst:229 -#: ../../c-api/unicode.rst:752 +#: ../../c-api/unicode.rst:761 msgid "" "Part of the old-style Unicode API, please migrate to using :c:func:" "`PyUnicode_GET_LENGTH`." @@ -664,9 +664,9 @@ msgstr "const void\\*" #: ../../c-api/unicode.rst:518 msgid "" -"The hex representation of a C pointer. Mostly equivalent to ``printf(\"%p" -"\")`` except that it is guaranteed to start with the literal ``0x`` " -"regardless of what the platform's ``printf`` yields." +"The hex representation of a C pointer. Mostly equivalent to " +"``printf(\"%p\")`` except that it is guaranteed to start with the literal " +"``0x`` regardless of what the platform's ``printf`` yields." msgstr "" #: ../../c-api/unicode.rst:526 @@ -752,8 +752,8 @@ msgstr "" #: ../../c-api/unicode.rst:564 msgid "" -"Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, ``\"%U" -"\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." +"Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, " +"``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." msgstr "" #: ../../c-api/unicode.rst:571 @@ -762,11 +762,23 @@ msgid "" "arguments." msgstr "" -#: ../../c-api/unicode.rst:578 +#: ../../c-api/unicode.rst:577 +msgid "" +"Copy an instance of a Unicode subtype to a new true Unicode object if " +"necessary. If *obj* is already a true Unicode object (not a subtype), return " +"the reference with incremented refcount." +msgstr "" + +#: ../../c-api/unicode.rst:581 +msgid "" +"Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." +msgstr "" + +#: ../../c-api/unicode.rst:587 msgid "Decode an encoded object *obj* to a Unicode object." msgstr "" -#: ../../c-api/unicode.rst:580 +#: ../../c-api/unicode.rst:589 msgid "" ":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects " "` are decoded according to the given *encoding* and using " @@ -774,23 +786,23 @@ msgid "" "interface use the default values (see :ref:`builtincodecs` for details)." msgstr "" -#: ../../c-api/unicode.rst:586 +#: ../../c-api/unicode.rst:595 msgid "" "All other objects, including Unicode objects, cause a :exc:`TypeError` to be " "set." msgstr "" -#: ../../c-api/unicode.rst:589 +#: ../../c-api/unicode.rst:598 msgid "" "The API returns ``NULL`` if there was an error. The caller is responsible " "for decref'ing the returned objects." msgstr "" -#: ../../c-api/unicode.rst:595 +#: ../../c-api/unicode.rst:604 msgid "Return the length of the Unicode object, in code points." msgstr "" -#: ../../c-api/unicode.rst:606 +#: ../../c-api/unicode.rst:615 msgid "" "Copy characters from one Unicode object into another. This function " "performs character conversion when necessary and falls back to :c:func:" @@ -798,52 +810,52 @@ msgid "" "otherwise returns the number of copied characters." msgstr "" -#: ../../c-api/unicode.rst:617 +#: ../../c-api/unicode.rst:626 msgid "" -"Fill a string with a character: write *fill_char* into ``unicode[start:start" -"+length]``." +"Fill a string with a character: write *fill_char* into ``unicode[start:" +"start+length]``." msgstr "" -#: ../../c-api/unicode.rst:620 +#: ../../c-api/unicode.rst:629 msgid "" "Fail if *fill_char* is bigger than the string maximum character, or if the " "string has more than 1 reference." msgstr "" -#: ../../c-api/unicode.rst:623 +#: ../../c-api/unicode.rst:632 msgid "" "Return the number of written character, or return ``-1`` and raise an " "exception on error." msgstr "" -#: ../../c-api/unicode.rst:632 +#: ../../c-api/unicode.rst:641 msgid "" "Write a character to a string. The string must have been created through :c:" "func:`PyUnicode_New`. Since Unicode strings are supposed to be immutable, " "the string must not be shared, or have been hashed yet." msgstr "" -#: ../../c-api/unicode.rst:636 +#: ../../c-api/unicode.rst:645 msgid "" "This function checks that *unicode* is a Unicode object, that the index is " "not out of bounds, and that the object can be modified safely (i.e. that it " "its reference count is one)." msgstr "" -#: ../../c-api/unicode.rst:645 +#: ../../c-api/unicode.rst:654 msgid "" "Read a character from a string. This function checks that *unicode* is a " "Unicode object and the index is not out of bounds, in contrast to :c:func:" "`PyUnicode_READ_CHAR`, which performs no error checking." msgstr "" -#: ../../c-api/unicode.rst:655 +#: ../../c-api/unicode.rst:664 msgid "" "Return a substring of *str*, from character index *start* (included) to " "character index *end* (excluded). Negative indices are not supported." msgstr "" -#: ../../c-api/unicode.rst:664 +#: ../../c-api/unicode.rst:673 msgid "" "Copy the string *u* into a UCS4 buffer, including a null character, if " "*copy_null* is set. Returns ``NULL`` and sets an exception on error (in " @@ -851,7 +863,7 @@ msgid "" "*u*). *buffer* is returned on success." msgstr "" -#: ../../c-api/unicode.rst:674 +#: ../../c-api/unicode.rst:683 msgid "" "Copy the string *u* into a new UCS4 buffer that is allocated using :c:func:" "`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" @@ -859,11 +871,11 @@ msgid "" "appended." msgstr "" -#: ../../c-api/unicode.rst:683 +#: ../../c-api/unicode.rst:692 msgid "Deprecated Py_UNICODE APIs" msgstr "" -#: ../../c-api/unicode.rst:687 +#: ../../c-api/unicode.rst:696 msgid "" "These API functions are deprecated with the implementation of :pep:`393`. " "Extension modules can continue using them, as they will not be removed in " @@ -871,7 +883,7 @@ msgid "" "and memory hits." msgstr "" -#: ../../c-api/unicode.rst:694 +#: ../../c-api/unicode.rst:703 msgid "" "Create a Unicode object from the Py_UNICODE buffer *u* of the given size. " "*u* may be ``NULL`` which causes the contents to be undefined. It is the " @@ -879,28 +891,28 @@ msgid "" "the new object." msgstr "" -#: ../../c-api/unicode.rst:699 +#: ../../c-api/unicode.rst:708 msgid "" "If the buffer is not ``NULL``, the return value might be a shared object. " "Therefore, modification of the resulting Unicode object is only allowed when " "*u* is ``NULL``." msgstr "" -#: ../../c-api/unicode.rst:703 +#: ../../c-api/unicode.rst:712 msgid "" "If the buffer is ``NULL``, :c:func:`PyUnicode_READY` must be called once the " "string content has been filled before using any of the access macros such " "as :c:func:`PyUnicode_KIND`." msgstr "" -#: ../../c-api/unicode.rst:710 +#: ../../c-api/unicode.rst:719 msgid "" "Part of the old-style Unicode API, please migrate to using :c:func:" "`PyUnicode_FromKindAndData`, :c:func:`PyUnicode_FromWideChar`, or :c:func:" "`PyUnicode_New`." msgstr "" -#: ../../c-api/unicode.rst:715 +#: ../../c-api/unicode.rst:724 msgid "" "Return a read-only pointer to the Unicode object's internal :c:type:" "`Py_UNICODE` buffer, or ``NULL`` on error. This will create the :c:expr:" @@ -911,14 +923,14 @@ msgid "" "functions." msgstr "" -#: ../../c-api/unicode.rst:726 ../../c-api/unicode.rst:742 +#: ../../c-api/unicode.rst:735 ../../c-api/unicode.rst:751 msgid "" "Part of the old-style Unicode API, please migrate to using :c:func:" "`PyUnicode_AsUCS4`, :c:func:`PyUnicode_AsWideChar`, :c:func:" "`PyUnicode_ReadChar` or similar new APIs." msgstr "" -#: ../../c-api/unicode.rst:731 +#: ../../c-api/unicode.rst:740 msgid "" "Like :c:func:`PyUnicode_AsUnicode`, but also saves the :c:func:`Py_UNICODE` " "array length (excluding the extra null terminator) in *size*. Note that the " @@ -927,24 +939,12 @@ msgid "" "functions." msgstr "" -#: ../../c-api/unicode.rst:747 +#: ../../c-api/unicode.rst:756 msgid "" "Return the size of the deprecated :c:type:`Py_UNICODE` representation, in " "code units (this includes surrogate pairs as 2 units)." msgstr "" -#: ../../c-api/unicode.rst:757 -msgid "" -"Copy an instance of a Unicode subtype to a new true Unicode object if " -"necessary. If *obj* is already a true Unicode object (not a subtype), return " -"the reference with incremented refcount." -msgstr "" - -#: ../../c-api/unicode.rst:761 -msgid "" -"Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." -msgstr "" - #: ../../c-api/unicode.rst:765 msgid "Locale Encoding" msgstr "" @@ -958,9 +958,9 @@ msgstr "" #: ../../c-api/unicode.rst:774 msgid "" "Decode a string from UTF-8 on Android and VxWorks, or from the current " -"locale encoding on other platforms. The supported error handlers are ``" -"\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The decoder uses ``" -"\"strict\"`` error handler if *errors* is ``NULL``. *str* must end with a " +"locale encoding on other platforms. The supported error handlers are " +"``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The decoder uses " +"``\"strict\"`` error handler if *errors* is ``NULL``. *str* must end with a " "null character but cannot contain embedded null characters." msgstr "" @@ -996,10 +996,10 @@ msgstr "" #: ../../c-api/unicode.rst:810 msgid "" "Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current " -"locale encoding on other platforms. The supported error handlers are ``" -"\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The encoder uses ``" -"\"strict\"`` error handler if *errors* is ``NULL``. Return a :class:`bytes` " -"object. *unicode* cannot contain embedded null characters." +"locale encoding on other platforms. The supported error handlers are " +"``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The encoder uses " +"``\"strict\"`` error handler if *errors* is ``NULL``. Return a :class:" +"`bytes` object. *unicode* cannot contain embedded null characters." msgstr "" #: ../../c-api/unicode.rst:817 @@ -1155,8 +1155,8 @@ msgstr "" #: ../../c-api/unicode.rst:971 msgid "" "Returns a buffer allocated by :c:func:`PyMem_Alloc` (use :c:func:" -"`PyMem_Free` to free it) on success. On error, returns ``NULL`` and *" -"\\*size* is undefined. Raises a :exc:`MemoryError` if memory allocation is " +"`PyMem_Free` to free it) on success. On error, returns ``NULL`` and " +"*\\*size* is undefined. Raises a :exc:`MemoryError` if memory allocation is " "failed." msgstr "" @@ -1789,8 +1789,8 @@ msgstr "" msgid "" "Intern the argument *\\*string* in place. The argument must be the address " "of a pointer variable pointing to a Python Unicode string object. If there " -"is an existing interned string that is the same as *\\*string*, it sets *" -"\\*string* to it (decrementing the reference count of the old string object " +"is an existing interned string that is the same as *\\*string*, it sets " +"*\\*string* to it (decrementing the reference count of the old string object " "and incrementing the reference count of the interned string object), " "otherwise it leaves *\\*string* alone and interns it (incrementing its " "reference count). (Clarification: even though there is a lot of talk about " diff --git a/library/__main__.po b/library/__main__.po index bf7eace40b..fb5bab00fe 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-15 00:32+0000\n" +"POT-Creation-Date: 2023-04-28 00:31+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -150,7 +150,7 @@ msgstr "" #: ../../library/__main__.rst:127 msgid "" -"Putting as few statements as possible in the block below ``if __name___ == " +"Putting as few statements as possible in the block below ``if __name__ == " "'__main__'`` can improve code clarity and correctness. Most often, a " "function named ``main`` encapsulates the program's primary behavior::" msgstr "" diff --git a/library/tempfile.po b/library/tempfile.po index 14010ec75b..92a5e07eaa 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-04-28 00:31+0000\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -263,7 +263,7 @@ msgstr "" "被引發(:func:`cleanup` 呼叫、退出情境管理器、物件被作為垃圾回收或直譯器關閉" "等)。" -#: ../../library/tempfile.rst:154 ../../library/tempfile.rst:231 +#: ../../library/tempfile.rst:154 ../../library/tempfile.rst:234 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkdtemp`` with " "argument ``fullpath``." @@ -364,7 +364,7 @@ msgstr "" "level) 控制代碼,指向一個開啟的檔案(如同 :func:`os.open` 的回傳值),第二元" "素是該檔案的絕對路徑。" -#: ../../library/tempfile.rst:207 ../../library/tempfile.rst:233 +#: ../../library/tempfile.rst:207 ../../library/tempfile.rst:236 msgid "" "*suffix*, *prefix*, and *dir* may now be supplied in bytes in order to " "obtain a bytes return value. Prior to this, only str was allowed. *suffix* " @@ -375,7 +375,7 @@ msgstr "" "串型別的回傳值。在之前只允許使用字串。*suffix* 和 *prefix* 現在可以接受 " "``None``,並且預設為 ``None`` 以使用合適的預設值。" -#: ../../library/tempfile.rst:213 ../../library/tempfile.rst:239 +#: ../../library/tempfile.rst:213 ../../library/tempfile.rst:242 msgid "The *dir* parameter now accepts a :term:`path-like object`." msgstr "*dir* 參數現在可接受一個類路徑物件 (:term:`path-like object`)。" @@ -402,40 +402,44 @@ msgstr "" "引數 *prefix*、*suffix* 和 *dir* 的含義與它們在 :func:`mkstemp` 中相同。" #: ../../library/tempfile.rst:229 -msgid ":func:`mkdtemp` returns the absolute pathname of the new directory." -msgstr ":func:`mkdtemp` 回傳新目錄的絕對路徑。" +msgid "" +":func:`mkdtemp` returns the absolute pathname of the new directory if *dir* " +"is ``None`` or is an absolute path. If *dir* is a relative path, :func:" +"`mkdtemp` returns a relative path on Python 3.11 and lower. However, on 3.12 " +"it will return an absolute path in all situations." +msgstr "" -#: ../../library/tempfile.rst:245 +#: ../../library/tempfile.rst:248 msgid "" "Return the name of the directory used for temporary files. This defines the " "default value for the *dir* argument to all functions in this module." msgstr "" "回傳儲存臨時檔案的目錄名稱。這設定了此 module 所有函式 *dir* 引數的預設值。" -#: ../../library/tempfile.rst:249 +#: ../../library/tempfile.rst:252 msgid "" "Python searches a standard list of directories to find one which the calling " "user can create files in. The list is:" msgstr "" "Python 搜尋標準目錄列表來找到呼叫者可以在其中建立檔案的目錄。這個列表是:" -#: ../../library/tempfile.rst:252 +#: ../../library/tempfile.rst:255 msgid "The directory named by the :envvar:`TMPDIR` environment variable." msgstr ":envvar:`TMPDIR` 環境變數指向的目錄。" -#: ../../library/tempfile.rst:254 +#: ../../library/tempfile.rst:257 msgid "The directory named by the :envvar:`TEMP` environment variable." msgstr ":envvar:`TEMP` 環境變數指向的目錄。" -#: ../../library/tempfile.rst:256 +#: ../../library/tempfile.rst:259 msgid "The directory named by the :envvar:`TMP` environment variable." msgstr ":envvar:`TMP` 環境變數指向的目錄。" -#: ../../library/tempfile.rst:258 +#: ../../library/tempfile.rst:261 msgid "A platform-specific location:" msgstr "與平臺相關的位置:" -#: ../../library/tempfile.rst:260 +#: ../../library/tempfile.rst:263 msgid "" "On Windows, the directories :file:`C:\\\\TEMP`, :file:`C:\\\\TMP`, :file:`\\" "\\TEMP`, and :file:`\\\\TMP`, in that order." @@ -443,7 +447,7 @@ msgstr "" "在 Windows 上,目錄依次為 :file:`C:\\\\TEMP`、:file:`C:\\\\TMP`、:file:`\\" "\\TEMP` 和 :file:`\\\\TMP`。" -#: ../../library/tempfile.rst:263 +#: ../../library/tempfile.rst:266 msgid "" "On all other platforms, the directories :file:`/tmp`, :file:`/var/tmp`, and :" "file:`/usr/tmp`, in that order." @@ -451,17 +455,17 @@ msgstr "" "在所有其他平臺上,目錄依次為 :file:`/tmp`、:file:`/var/tmp` 和 :file:`/usr/" "tmp`。" -#: ../../library/tempfile.rst:266 +#: ../../library/tempfile.rst:269 msgid "As a last resort, the current working directory." msgstr "不得已時,使用當前工作目錄。" -#: ../../library/tempfile.rst:268 +#: ../../library/tempfile.rst:271 msgid "" "The result of this search is cached, see the description of :data:`tempdir` " "below." msgstr "搜尋的結果會被 cache(快取)起來,請見下面 :data:`tempdir` 的描述。" -#: ../../library/tempfile.rst:273 +#: ../../library/tempfile.rst:276 msgid "" "Always returns a str. Previously it would return any :data:`tempdir` value " "regardless of type so long as it was not ``None``." @@ -469,21 +473,21 @@ msgstr "" "回傳一個字串。在之前的版本中它會回傳任意 :data:`tempdir` 的值而不考慮它的型" "別,只要它不為 ``None``。" -#: ../../library/tempfile.rst:278 +#: ../../library/tempfile.rst:281 msgid "Same as :func:`gettempdir` but the return value is in bytes." msgstr "與 :func:`gettempdir` 相同,但回傳值為位元組串型別。" -#: ../../library/tempfile.rst:284 +#: ../../library/tempfile.rst:287 msgid "" "Return the filename prefix used to create temporary files. This does not " "contain the directory component." msgstr "回傳用於建立臨時檔案的檔名前綴,它不包含目錄部分。" -#: ../../library/tempfile.rst:289 +#: ../../library/tempfile.rst:292 msgid "Same as :func:`gettempprefix` but the return value is in bytes." msgstr "與 :func:`gettempprefix` 相同,但回傳值為位元組串型別。" -#: ../../library/tempfile.rst:293 +#: ../../library/tempfile.rst:296 msgid "" "The module uses a global variable to store the name of the directory used " "for temporary files returned by :func:`gettempdir`. It can be set directly " @@ -497,7 +501,7 @@ msgstr "" "式都接受一個 *dir* 引數,它可被用於指定目錄。這是個推薦的做法,它不會透過改變" "全域性 API 行為而對其他不預期此行為的程式造成影響。" -#: ../../library/tempfile.rst:302 +#: ../../library/tempfile.rst:305 msgid "" "When set to a value other than ``None``, this variable defines the default " "value for the *dir* argument to the functions defined in this module, " @@ -507,7 +511,7 @@ msgstr "" "預設值,包括確定其型別為位元組串還是字串。它不可以為 :term:`path-like " "object`。" -#: ../../library/tempfile.rst:307 +#: ../../library/tempfile.rst:310 msgid "" "If ``tempdir`` is ``None`` (the default) at any call to any of the above " "functions except :func:`gettempprefix` it is initialized following the " @@ -516,7 +520,7 @@ msgstr "" "如果在呼叫除 :func:`gettempprefix` 外的上述任何函式時 ``tempdir`` 為 " "``None`` (預設值) 則它會按照 :func:`gettempdir` 中所描述的演算法來初始化。" -#: ../../library/tempfile.rst:313 +#: ../../library/tempfile.rst:316 msgid "" "Beware that if you set ``tempdir`` to a bytes value, there is a nasty side " "effect: The global default return type of :func:`mkstemp` and :func:" @@ -530,22 +534,22 @@ msgstr "" "``prefix``、``suffix`` 或 ``dir`` 時被改為位元組串。請不要編寫預期此行為或依" "賴於此行為的程式。這個奇怪的行為是為了維持與以往實作版本的相容性。" -#: ../../library/tempfile.rst:324 +#: ../../library/tempfile.rst:327 msgid "Examples" msgstr "範例" -#: ../../library/tempfile.rst:326 +#: ../../library/tempfile.rst:329 msgid "Here are some examples of typical usage of the :mod:`tempfile` module::" msgstr "" "以下是 :mod:`tempfile` module 的一些常見用法範例:\n" "\n" "::" -#: ../../library/tempfile.rst:358 +#: ../../library/tempfile.rst:361 msgid "Deprecated functions and variables" msgstr "已棄用的函式和變數" -#: ../../library/tempfile.rst:360 +#: ../../library/tempfile.rst:363 msgid "" "A historical way to create temporary files was to first generate a file name " "with the :func:`mktemp` function and then create a file using this name. " @@ -560,11 +564,11 @@ msgstr "" "之間的時間裡,其他程式可能會使用該名稱建立檔案。解決方案是將兩個步驟結合起" "來,並立即建立檔案。這個方案目前被 :func:`mkstemp` 和上述其他函式所採用。" -#: ../../library/tempfile.rst:371 +#: ../../library/tempfile.rst:374 msgid "Use :func:`mkstemp` instead." msgstr "使用 :func:`mkstemp` 代替。" -#: ../../library/tempfile.rst:374 +#: ../../library/tempfile.rst:377 msgid "" "Return an absolute pathname of a file that did not exist at the time the " "call is made. The *prefix*, *suffix*, and *dir* arguments are similar to " @@ -575,7 +579,7 @@ msgstr "" "與 :func:`mkstemp` 中所用的類似,除了在於不支援位元組串型別的檔名且不支援 " "``suffix=None`` 和 ``prefix=None``。" -#: ../../library/tempfile.rst:381 +#: ../../library/tempfile.rst:384 msgid "" "Use of this function may introduce a security hole in your program. By the " "time you get around to doing anything with the file name it returns, someone " @@ -588,3 +592,6 @@ msgstr "" "``delete=False`` 參數的 :func:`NamedTemporaryFile` 代替:\n" "\n" "::" + +#~ msgid ":func:`mkdtemp` returns the absolute pathname of the new directory." +#~ msgstr ":func:`mkdtemp` 回傳新目錄的絕對路徑。" From 1520f7f85c44720fdee53812135c6581d8c0bc6e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 29 Apr 2023 00:30:52 +0000 Subject: [PATCH 076/130] sync with cpython fee3c91a --- library/shutil.po | 99 ++++-- library/sqlite3.po | 277 +++++++-------- library/tarfile.po | 822 +++++++++++++++++++++++++++++++++++++-------- whatsnew/3.11.po | 21 +- 4 files changed, 909 insertions(+), 310 deletions(-) diff --git a/library/shutil.po b/library/shutil.po index 92fc9af44d..85a281540a 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-04-29 00:29+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-" @@ -733,7 +733,7 @@ msgid "" "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:595 ../../library/shutil.rst:683 +#: ../../library/shutil.rst:595 ../../library/shutil.rst:698 msgid "By default :mod:`shutil` provides these formats:" msgstr "" @@ -746,15 +746,15 @@ msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:599 ../../library/shutil.rst:688 +#: ../../library/shutil.rst:599 ../../library/shutil.rst:703 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:600 ../../library/shutil.rst:689 +#: ../../library/shutil.rst:600 ../../library/shutil.rst:704 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:601 ../../library/shutil.rst:690 +#: ../../library/shutil.rst:601 ../../library/shutil.rst:705 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" @@ -814,11 +814,21 @@ msgstr "" #: ../../library/shutil.rst:643 msgid "" +"The keyword-only *filter* argument, which was added in Python 3.11.4, is " +"passed to the underlying unpacking function. For zip files, *filter* is not " +"accepted. For tar files, it is recommended to set it to ``'data'``, unless " +"using features specific to tar and UNIX-like filesystems. (See :ref:`tarfile-" +"extraction-filter` for details.) The ``'data'`` filter will become the " +"default for tar files in Python 3.14." +msgstr "" + +#: ../../library/shutil.rst:652 +msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." msgstr "" -#: ../../library/shutil.rst:647 +#: ../../library/shutil.rst:656 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -826,120 +836,139 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: ../../library/shutil.rst:652 +#: ../../library/shutil.rst:661 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:657 +#: ../../library/shutil.rst:664 +#, fuzzy +msgid "Added the *filter* argument." +msgstr "新增 *copy_function* 關鍵字引數。" + +#: ../../library/shutil.rst:669 msgid "" "Registers an unpack format. *name* is the name of the format and " "*extensions* is a list of extensions corresponding to the format, like ``." "zip`` for Zip files." msgstr "" -#: ../../library/shutil.rst:661 +#: ../../library/shutil.rst:673 msgid "" "*function* is the callable that will be used to unpack archives. The " -"callable will receive the path of the archive, followed by the directory the " -"archive must be extracted to." +"callable will receive:" +msgstr "" + +#: ../../library/shutil.rst:676 +msgid "the path of the archive, as a positional argument;" +msgstr "" + +#: ../../library/shutil.rst:677 +msgid "" +"the directory the archive must be extracted to, as a positional argument;" +msgstr "" + +#: ../../library/shutil.rst:678 +msgid "" +"possibly a *filter* keyword argument, if it was given to :func:" +"`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:665 +#: ../../library/shutil.rst:680 msgid "" -"When provided, *extra_args* is a sequence of ``(name, value)`` tuples that " -"will be passed as keywords arguments to the callable." +"additional keyword arguments, specified by *extra_args* as a sequence of " +"``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:668 +#: ../../library/shutil.rst:683 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:674 +#: ../../library/shutil.rst:689 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:679 +#: ../../library/shutil.rst:694 msgid "" "Return a list of all registered formats for unpacking. Each element of the " "returned sequence is a tuple ``(name, extensions, description)``." msgstr "" -#: ../../library/shutil.rst:685 +#: ../../library/shutil.rst:700 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:687 +#: ../../library/shutil.rst:702 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:692 +#: ../../library/shutil.rst:707 msgid "" "You can register new formats or provide your own unpacker for any existing " "formats, by using :func:`register_unpack_format`." msgstr "" -#: ../../library/shutil.rst:699 +#: ../../library/shutil.rst:714 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:701 +#: ../../library/shutil.rst:716 msgid "" "In this example, we create a gzip'ed tar-file archive containing all files " "found in the :file:`.ssh` directory of the user::" msgstr "" -#: ../../library/shutil.rst:711 +#: ../../library/shutil.rst:726 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:729 +#: ../../library/shutil.rst:744 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:731 +#: ../../library/shutil.rst:746 msgid "" "In this example, similar to the `one above `_, we " "show how to use :func:`make_archive`, but this time with the usage of " "*base_dir*. We now have the following directory structure:" msgstr "" -#: ../../library/shutil.rst:745 +#: ../../library/shutil.rst:760 msgid "" "In the final archive, :file:`please_add.txt` should be included, but :file:" "`do_not_add.txt` should not. Therefore we use the following::" msgstr "" -#: ../../library/shutil.rst:759 +#: ../../library/shutil.rst:774 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:769 +#: ../../library/shutil.rst:784 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:773 +#: ../../library/shutil.rst:788 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:775 +#: ../../library/shutil.rst:790 msgid "" "For each of the two dimensions, the environment variable, ``COLUMNS`` and " "``LINES`` respectively, is checked. If the variable is defined and the value " "is a positive integer, it is used." msgstr "" -#: ../../library/shutil.rst:779 +#: ../../library/shutil.rst:794 msgid "" "When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the " "terminal connected to :data:`sys.__stdout__` is queried by invoking :func:" "`os.get_terminal_size`." msgstr "" -#: ../../library/shutil.rst:783 +#: ../../library/shutil.rst:798 msgid "" "If the terminal size cannot be successfully queried, either because the " "system doesn't support querying, or because we are not connected to a " @@ -948,17 +977,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:789 +#: ../../library/shutil.rst:804 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:791 +#: ../../library/shutil.rst:806 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:796 +#: ../../library/shutil.rst:811 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/library/sqlite3.po b/library/sqlite3.po index af42c74244..8e5d32cb93 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-04-29 00:29+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-" @@ -749,7 +749,7 @@ msgstr "新增 *deterministic* 參數。" #: ../../library/sqlite3.rst:667 ../../library/sqlite3.rst:705 #: ../../library/sqlite3.rst:768 ../../library/sqlite3.rst:1019 #: ../../library/sqlite3.rst:1256 ../../library/sqlite3.rst:1383 -#: ../../library/sqlite3.rst:1404 +#: ../../library/sqlite3.rst:1411 msgid "Example:" msgstr "範例:" @@ -1215,8 +1215,8 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1246 ../../library/sqlite3.rst:1528 -#: ../../library/sqlite3.rst:1551 +#: ../../library/sqlite3.rst:1246 ../../library/sqlite3.rst:1535 +#: ../../library/sqlite3.rst:1558 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "" @@ -1293,7 +1293,8 @@ msgstr "" #: ../../library/sqlite3.rst:1364 msgid "" "For every item in *parameters*, repeatedly execute the :ref:`parameterized " -"` SQL statement *sql*." +"` :abbr:`DML (Data Manipulation Language)` SQL " +"statement *sql*." msgstr "" #: ../../library/sqlite3.rst:1368 @@ -1301,7 +1302,7 @@ msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." msgstr "" #: ../../library/sqlite3.rst:1370 -msgid "A single SQL :abbr:`DML (Data Manipulation Language)` statement." +msgid "A single SQL DML statement." msgstr "" #: ../../library/sqlite3.rst:1373 @@ -1317,30 +1318,36 @@ msgstr "" #: ../../library/sqlite3.rst:1396 msgid "" +"Any resulting rows are discarded, including DML statements with `RETURNING " +"clauses`_." +msgstr "" + +#: ../../library/sqlite3.rst:1403 +msgid "" "Execute the SQL statements in *sql_script*. If 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:1402 +#: ../../library/sqlite3.rst:1409 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1420 +#: ../../library/sqlite3.rst:1427 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1428 +#: ../../library/sqlite3.rst:1435 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1431 +#: ../../library/sqlite3.rst:1438 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1348,7 +1355,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1437 +#: ../../library/sqlite3.rst:1444 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1356,36 +1363,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1444 +#: ../../library/sqlite3.rst:1451 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1451 +#: ../../library/sqlite3.rst:1458 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1453 +#: ../../library/sqlite3.rst:1460 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." msgstr "" -#: ../../library/sqlite3.rst:1458 ../../library/sqlite3.rst:1462 +#: ../../library/sqlite3.rst:1465 ../../library/sqlite3.rst:1469 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1466 +#: ../../library/sqlite3.rst:1473 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." msgstr "" -#: ../../library/sqlite3.rst:1471 +#: ../../library/sqlite3.rst:1478 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1393,18 +1400,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1485 +#: ../../library/sqlite3.rst:1492 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1489 +#: ../../library/sqlite3.rst:1496 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1493 +#: ../../library/sqlite3.rst:1500 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1414,15 +1421,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1501 +#: ../../library/sqlite3.rst:1508 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1503 +#: ../../library/sqlite3.rst:1510 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1508 +#: ../../library/sqlite3.rst:1515 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1431,7 +1438,7 @@ msgid "" "methods." msgstr "" -#: ../../library/sqlite3.rst:1516 +#: ../../library/sqlite3.rst:1523 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1440,18 +1447,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1523 +#: ../../library/sqlite3.rst:1530 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." msgstr "" -#: ../../library/sqlite3.rst:1539 +#: ../../library/sqlite3.rst:1546 msgid "Row objects" msgstr "" -#: ../../library/sqlite3.rst:1543 +#: ../../library/sqlite3.rst:1550 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1459,28 +1466,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1548 +#: ../../library/sqlite3.rst:1555 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1555 +#: ../../library/sqlite3.rst:1562 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`." msgstr "" -#: ../../library/sqlite3.rst:1559 +#: ../../library/sqlite3.rst:1566 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:1566 +#: ../../library/sqlite3.rst:1573 msgid "Blob objects" msgstr "" -#: ../../library/sqlite3.rst:1572 +#: ../../library/sqlite3.rst:1579 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:" @@ -1488,24 +1495,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1577 +#: ../../library/sqlite3.rst:1584 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1607 +#: ../../library/sqlite3.rst:1614 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1609 +#: ../../library/sqlite3.rst:1616 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." msgstr "" -#: ../../library/sqlite3.rst:1615 +#: ../../library/sqlite3.rst:1622 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)` " @@ -1513,18 +1520,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1623 +#: ../../library/sqlite3.rst:1630 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`." msgstr "" -#: ../../library/sqlite3.rst:1629 +#: ../../library/sqlite3.rst:1636 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1633 +#: ../../library/sqlite3.rst:1640 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :data:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1532,26 +1539,26 @@ msgid "" "position) and :data:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1641 +#: ../../library/sqlite3.rst:1648 msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:1645 +#: ../../library/sqlite3.rst:1652 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1653 +#: ../../library/sqlite3.rst:1660 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1655 +#: ../../library/sqlite3.rst:1662 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1659 +#: ../../library/sqlite3.rst:1666 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1559,39 +1566,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1666 +#: ../../library/sqlite3.rst:1673 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1670 +#: ../../library/sqlite3.rst:1677 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1675 +#: ../../library/sqlite3.rst:1682 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1682 +#: ../../library/sqlite3.rst:1689 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1689 +#: ../../library/sqlite3.rst:1696 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1696 +#: ../../library/sqlite3.rst:1703 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1599,14 +1606,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1703 +#: ../../library/sqlite3.rst:1710 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1709 +#: ../../library/sqlite3.rst:1716 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1614,20 +1621,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1717 +#: ../../library/sqlite3.rst:1724 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1722 +#: ../../library/sqlite3.rst:1729 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1729 +#: ../../library/sqlite3.rst:1736 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 " @@ -1635,7 +1642,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1736 +#: ../../library/sqlite3.rst:1743 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1644,78 +1651,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1746 +#: ../../library/sqlite3.rst:1753 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1748 +#: ../../library/sqlite3.rst:1755 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1751 +#: ../../library/sqlite3.rst:1758 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1754 ../../library/sqlite3.rst:1771 +#: ../../library/sqlite3.rst:1761 ../../library/sqlite3.rst:1778 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1754 ../../library/sqlite3.rst:1771 +#: ../../library/sqlite3.rst:1761 ../../library/sqlite3.rst:1778 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1756 ../../library/sqlite3.rst:1773 +#: ../../library/sqlite3.rst:1763 ../../library/sqlite3.rst:1780 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1756 ../../library/sqlite3.rst:1773 +#: ../../library/sqlite3.rst:1763 ../../library/sqlite3.rst:1780 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1758 ../../library/sqlite3.rst:1775 +#: ../../library/sqlite3.rst:1765 ../../library/sqlite3.rst:1782 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1758 ../../library/sqlite3.rst:1775 +#: ../../library/sqlite3.rst:1765 ../../library/sqlite3.rst:1782 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1760 ../../library/sqlite3.rst:1777 +#: ../../library/sqlite3.rst:1767 ../../library/sqlite3.rst:1784 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1760 ../../library/sqlite3.rst:1777 +#: ../../library/sqlite3.rst:1767 ../../library/sqlite3.rst:1784 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1762 +#: ../../library/sqlite3.rst:1769 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1762 ../../library/sqlite3.rst:1779 +#: ../../library/sqlite3.rst:1769 ../../library/sqlite3.rst:1786 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1764 ../../library/sqlite3.rst:1782 +#: ../../library/sqlite3.rst:1771 ../../library/sqlite3.rst:1789 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1764 ../../library/sqlite3.rst:1782 +#: ../../library/sqlite3.rst:1771 ../../library/sqlite3.rst:1789 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1768 +#: ../../library/sqlite3.rst:1775 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1779 +#: ../../library/sqlite3.rst:1786 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1785 +#: ../../library/sqlite3.rst:1792 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1724,42 +1731,42 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1795 +#: ../../library/sqlite3.rst:1802 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1797 +#: ../../library/sqlite3.rst:1804 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1800 +#: ../../library/sqlite3.rst:1807 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1804 +#: ../../library/sqlite3.rst:1811 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1808 +#: ../../library/sqlite3.rst:1815 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1812 +#: ../../library/sqlite3.rst:1819 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1818 +#: ../../library/sqlite3.rst:1825 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1767,15 +1774,15 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1827 +#: ../../library/sqlite3.rst:1834 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:1832 +#: ../../library/sqlite3.rst:1839 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:1834 +#: ../../library/sqlite3.rst:1841 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1783,7 +1790,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:1847 +#: ../../library/sqlite3.rst:1854 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1791,7 +1798,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:1852 +#: ../../library/sqlite3.rst:1859 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -1802,24 +1809,24 @@ msgid "" "are ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1889 +#: ../../library/sqlite3.rst:1896 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:1896 +#: ../../library/sqlite3.rst:1903 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1898 +#: ../../library/sqlite3.rst:1905 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1902 +#: ../../library/sqlite3.rst:1909 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1829,11 +1836,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1914 +#: ../../library/sqlite3.rst:1921 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1916 +#: ../../library/sqlite3.rst:1923 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1843,84 +1850,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1947 +#: ../../library/sqlite3.rst:1954 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1949 +#: ../../library/sqlite3.rst:1956 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1979 +#: ../../library/sqlite3.rst:1986 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1981 +#: ../../library/sqlite3.rst:1988 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1986 +#: ../../library/sqlite3.rst:1993 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1989 +#: ../../library/sqlite3.rst:1996 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1994 +#: ../../library/sqlite3.rst:2001 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2003 +#: ../../library/sqlite3.rst:2010 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:2007 +#: ../../library/sqlite3.rst:2014 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2008 +#: ../../library/sqlite3.rst:2015 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2009 +#: ../../library/sqlite3.rst:2016 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2013 +#: ../../library/sqlite3.rst:2020 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2064 +#: ../../library/sqlite3.rst:2071 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2066 +#: ../../library/sqlite3.rst:2073 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2128 +#: ../../library/sqlite3.rst:2135 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2130 +#: ../../library/sqlite3.rst:2137 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1932,11 +1939,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2171 +#: ../../library/sqlite3.rst:2178 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2173 +#: ../../library/sqlite3.rst:2180 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1946,58 +1953,58 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2182 +#: ../../library/sqlite3.rst:2189 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2187 +#: ../../library/sqlite3.rst:2194 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2220 +#: ../../library/sqlite3.rst:2227 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2222 +#: ../../library/sqlite3.rst:2229 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2224 +#: ../../library/sqlite3.rst:2231 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2233 +#: ../../library/sqlite3.rst:2240 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2243 +#: ../../library/sqlite3.rst:2250 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2257 +#: ../../library/sqlite3.rst:2264 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2266 +#: ../../library/sqlite3.rst:2273 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2268 +#: ../../library/sqlite3.rst:2275 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`." msgstr "" -#: ../../library/sqlite3.rst:2273 +#: ../../library/sqlite3.rst:2280 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -2005,7 +2012,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2278 +#: ../../library/sqlite3.rst:2285 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -2013,51 +2020,51 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2288 +#: ../../library/sqlite3.rst:2295 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2303 +#: ../../library/sqlite3.rst:2310 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2312 +#: ../../library/sqlite3.rst:2319 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2322 +#: ../../library/sqlite3.rst:2329 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2333 +#: ../../library/sqlite3.rst:2340 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2348 +#: ../../library/sqlite3.rst:2355 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`." msgstr "" -#: ../../library/sqlite3.rst:2356 +#: ../../library/sqlite3.rst:2363 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2361 +#: ../../library/sqlite3.rst:2368 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2363 +#: ../../library/sqlite3.rst:2370 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2366 +#: ../../library/sqlite3.rst:2373 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2071,7 +2078,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2379 +#: ../../library/sqlite3.rst:2386 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2081,14 +2088,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2387 +#: ../../library/sqlite3.rst:2394 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2391 +#: ../../library/sqlite3.rst:2398 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." diff --git a/library/tarfile.po b/library/tarfile.po index dced3c99dd..636ce90cde 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-04-29 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -334,12 +334,12 @@ msgstr "``'w|xz'``" msgid "Open an lzma compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:149 ../../library/tarfile.rst:336 +#: ../../library/tarfile.rst:149 ../../library/tarfile.rst:365 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: ../../library/tarfile.rst:152 ../../library/tarfile.rst:339 -#: ../../library/tarfile.rst:508 +#: ../../library/tarfile.rst:152 ../../library/tarfile.rst:368 +#: ../../library/tarfile.rst:605 msgid "The *name* parameter accepts a :term:`path-like object`." msgstr "" @@ -396,80 +396,113 @@ msgstr "" msgid "Is raised by :meth:`TarInfo.frombuf` if the buffer it gets is invalid." msgstr "" -#: ../../library/tarfile.rst:209 +#: ../../library/tarfile.rst:211 +msgid "" +"Base class for members :ref:`refused ` by filters." +msgstr "" + +#: ../../library/tarfile.rst:216 +msgid "" +"Information about the member that the filter refused to extract, as :ref:" +"`TarInfo `." +msgstr "" + +#: ../../library/tarfile.rst:221 +msgid "Raised to refuse extracting a member with an absolute path." +msgstr "" + +#: ../../library/tarfile.rst:225 +msgid "Raised to refuse extracting a member outside the destination directory." +msgstr "" + +#: ../../library/tarfile.rst:229 +msgid "Raised to refuse extracting a special file (e.g. a device or pipe)." +msgstr "" + +#: ../../library/tarfile.rst:233 +msgid "Raised to refuse extracting a symbolic link with an absolute path." +msgstr "" + +#: ../../library/tarfile.rst:237 +msgid "" +"Raised to refuse extracting a symbolic link pointing outside the destination " +"directory." +msgstr "" + +#: ../../library/tarfile.rst:241 msgid "The following constants are available at the module level:" msgstr "" -#: ../../library/tarfile.rst:213 +#: ../../library/tarfile.rst:245 msgid "" "The default character encoding: ``'utf-8'`` on Windows, the value returned " "by :func:`sys.getfilesystemencoding` otherwise." msgstr "" -#: ../../library/tarfile.rst:217 +#: ../../library/tarfile.rst:249 msgid "" "Each of the following constants defines a tar archive format that the :mod:" "`tarfile` module is able to create. See section :ref:`tar-formats` for " "details." msgstr "" -#: ../../library/tarfile.rst:224 +#: ../../library/tarfile.rst:256 msgid "POSIX.1-1988 (ustar) format." msgstr "" -#: ../../library/tarfile.rst:229 +#: ../../library/tarfile.rst:261 msgid "GNU tar format." msgstr "" -#: ../../library/tarfile.rst:234 +#: ../../library/tarfile.rst:266 msgid "POSIX.1-2001 (pax) format." msgstr "" -#: ../../library/tarfile.rst:239 +#: ../../library/tarfile.rst:271 msgid "" "The default format for creating archives. This is currently :const:" "`PAX_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:241 +#: ../../library/tarfile.rst:273 msgid "" "The default format for new archives was changed to :const:`PAX_FORMAT` from :" "const:`GNU_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:249 +#: ../../library/tarfile.rst:281 msgid "Module :mod:`zipfile`" msgstr ":mod:`zipfile` 模組" -#: ../../library/tarfile.rst:249 +#: ../../library/tarfile.rst:281 msgid "Documentation of the :mod:`zipfile` standard module." msgstr "" -#: ../../library/tarfile.rst:253 +#: ../../library/tarfile.rst:285 msgid ":ref:`archiving-operations`" msgstr ":ref:`archiving-operations`" -#: ../../library/tarfile.rst:252 +#: ../../library/tarfile.rst:284 msgid "" "Documentation of the higher-level archiving facilities provided by the " "standard :mod:`shutil` module." msgstr "" -#: ../../library/tarfile.rst:255 +#: ../../library/tarfile.rst:287 msgid "" "`GNU tar manual, Basic Tar Format `_" msgstr "" -#: ../../library/tarfile.rst:256 +#: ../../library/tarfile.rst:288 msgid "Documentation for tar archive files, including GNU tar extensions." msgstr "" -#: ../../library/tarfile.rst:262 +#: ../../library/tarfile.rst:294 msgid "TarFile Objects" msgstr "TarFile 物件" -#: ../../library/tarfile.rst:264 +#: ../../library/tarfile.rst:296 msgid "" "The :class:`TarFile` object provides an interface to a tar archive. A tar " "archive is a sequence of blocks. An archive member (a stored file) is made " @@ -478,7 +511,7 @@ msgid "" "class:`TarInfo` object, see :ref:`tarinfo-objects` for details." msgstr "" -#: ../../library/tarfile.rst:270 +#: ../../library/tarfile.rst:302 msgid "" "A :class:`TarFile` object can be used as a context manager in a :keyword:" "`with` statement. It will automatically be closed when the block is " @@ -487,24 +520,24 @@ msgid "" "be closed. See the :ref:`tar-examples` section for a use case." msgstr "" -#: ../../library/tarfile.rst:276 +#: ../../library/tarfile.rst:308 msgid "Added support for the context management protocol." msgstr "" -#: ../../library/tarfile.rst:281 +#: ../../library/tarfile.rst:313 msgid "" "All following arguments are optional and can be accessed as instance " "attributes as well." msgstr "" -#: ../../library/tarfile.rst:284 +#: ../../library/tarfile.rst:316 msgid "" "*name* is the pathname of the archive. *name* may be a :term:`path-like " "object`. It can be omitted if *fileobj* is given. In this case, the file " "object's :attr:`name` attribute is used if it exists." msgstr "" -#: ../../library/tarfile.rst:288 +#: ../../library/tarfile.rst:320 msgid "" "*mode* is either ``'r'`` to read from an existing archive, ``'a'`` to append " "data to an existing file, ``'w'`` to create a new file overwriting an " @@ -512,18 +545,18 @@ msgid "" "exist." msgstr "" -#: ../../library/tarfile.rst:292 +#: ../../library/tarfile.rst:324 msgid "" "If *fileobj* is given, it is used for reading or writing data. If it can be " "determined, *mode* is overridden by *fileobj*'s mode. *fileobj* will be used " "from position 0." msgstr "" -#: ../../library/tarfile.rst:298 +#: ../../library/tarfile.rst:330 msgid "*fileobj* is not closed, when :class:`TarFile` is closed." msgstr "" -#: ../../library/tarfile.rst:300 +#: ../../library/tarfile.rst:332 msgid "" "*format* controls the archive format for writing. It must be one of the " "constants :const:`USTAR_FORMAT`, :const:`GNU_FORMAT` or :const:`PAX_FORMAT` " @@ -531,20 +564,20 @@ msgid "" "detected, even if different formats are present in a single archive." msgstr "" -#: ../../library/tarfile.rst:305 +#: ../../library/tarfile.rst:337 msgid "" "The *tarinfo* argument can be used to replace the default :class:`TarInfo` " "class with a different one." msgstr "" -#: ../../library/tarfile.rst:308 +#: ../../library/tarfile.rst:340 msgid "" "If *dereference* is :const:`False`, add symbolic and hard links to the " "archive. If it is :const:`True`, add the content of the target files to the " "archive. This has no effect on systems that do not support symbolic links." msgstr "" -#: ../../library/tarfile.rst:312 +#: ../../library/tarfile.rst:344 msgid "" "If *ignore_zeros* is :const:`False`, treat an empty block as the end of the " "archive. If it is :const:`True`, skip empty (and invalid) blocks and try to " @@ -552,22 +585,19 @@ msgid "" "concatenated or damaged archives." msgstr "" -#: ../../library/tarfile.rst:316 +#: ../../library/tarfile.rst:348 msgid "" "*debug* can be set from ``0`` (no debug messages) up to ``3`` (all debug " "messages). The messages are written to ``sys.stderr``." msgstr "" -#: ../../library/tarfile.rst:319 +#: ../../library/tarfile.rst:351 msgid "" -"If *errorlevel* is ``0``, all errors are ignored when using :meth:`TarFile." -"extract`. Nevertheless, they appear as error messages in the debug output, " -"when debugging is enabled. If ``1``, all *fatal* errors are raised as :exc:" -"`OSError` exceptions. If ``2``, all *non-fatal* errors are raised as :exc:" -"`TarError` exceptions as well." +"*errorlevel* controls how extraction errors are handled, see :attr:`the " +"corresponding attribute <~TarFile.errorlevel>`." msgstr "" -#: ../../library/tarfile.rst:325 +#: ../../library/tarfile.rst:354 msgid "" "The *encoding* and *errors* arguments define the character encoding to be " "used for reading or writing the archive and how conversion errors are going " @@ -575,47 +605,47 @@ msgid "" "ref:`tar-unicode` for in-depth information." msgstr "" -#: ../../library/tarfile.rst:330 +#: ../../library/tarfile.rst:359 msgid "" "The *pax_headers* argument is an optional dictionary of strings which will " "be added as a pax global header if *format* is :const:`PAX_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:333 ../../library/tarfile.rst:561 +#: ../../library/tarfile.rst:362 ../../library/tarfile.rst:678 msgid "Use ``'surrogateescape'`` as the default for the *errors* argument." msgstr "" -#: ../../library/tarfile.rst:345 +#: ../../library/tarfile.rst:374 msgid "" "Alternative constructor. The :func:`tarfile.open` function is actually a " "shortcut to this classmethod." msgstr "" -#: ../../library/tarfile.rst:351 +#: ../../library/tarfile.rst:380 msgid "" "Return a :class:`TarInfo` object for member *name*. If *name* can not be " "found in the archive, :exc:`KeyError` is raised." msgstr "" -#: ../../library/tarfile.rst:356 +#: ../../library/tarfile.rst:385 msgid "" "If a member occurs more than once in the archive, its last occurrence is " "assumed to be the most up-to-date version." msgstr "" -#: ../../library/tarfile.rst:362 +#: ../../library/tarfile.rst:391 msgid "" "Return the members of the archive as a list of :class:`TarInfo` objects. The " "list has the same order as the members in the archive." msgstr "" -#: ../../library/tarfile.rst:368 +#: ../../library/tarfile.rst:397 msgid "" "Return the members as a list of their names. It has the same order as the " "list returned by :meth:`getmembers`." msgstr "" -#: ../../library/tarfile.rst:374 +#: ../../library/tarfile.rst:403 msgid "" "Print a table of contents to ``sys.stdout``. If *verbose* is :const:`False`, " "only the names of the members are printed. If it is :const:`True`, output " @@ -623,18 +653,18 @@ msgid "" "given, it must be a subset of the list returned by :meth:`getmembers`." msgstr "" -#: ../../library/tarfile.rst:379 +#: ../../library/tarfile.rst:408 msgid "Added the *members* parameter." msgstr "新增 *members* 參數。" -#: ../../library/tarfile.rst:385 +#: ../../library/tarfile.rst:414 msgid "" "Return the next member of the archive as a :class:`TarInfo` object, when :" "class:`TarFile` is opened for reading. Return :const:`None` if there is no " "more available." msgstr "" -#: ../../library/tarfile.rst:392 +#: ../../library/tarfile.rst:421 msgid "" "Extract all members from the archive to the current working directory or " "directory *path*. If optional *members* is given, it must be a subset of the " @@ -646,14 +676,22 @@ msgid "" "fail." msgstr "" -#: ../../library/tarfile.rst:400 ../../library/tarfile.rst:426 +#: ../../library/tarfile.rst:429 msgid "" "If *numeric_owner* is :const:`True`, the uid and gid numbers from the " "tarfile are used to set the owner/group for the extracted files. Otherwise, " "the named values from the tarfile are used." msgstr "" -#: ../../library/tarfile.rst:406 +#: ../../library/tarfile.rst:433 +msgid "" +"The *filter* argument, which was added in Python 3.11.4, specifies how " +"``members`` are modified or rejected before extraction. See :ref:`tarfile-" +"extraction-filter` for details. It is recommended to set this explicitly " +"depending on which *tar* features you need to support." +msgstr "" + +#: ../../library/tarfile.rst:441 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of *path*, e.g. members that have " @@ -661,15 +699,26 @@ msgid "" "\"``." msgstr "" -#: ../../library/tarfile.rst:411 ../../library/tarfile.rst:442 +#: ../../library/tarfile.rst:446 ../../library/tarfile.rst:479 +msgid "" +"Set ``filter='data'`` to prevent the most dangerous security issues, and " +"read the :ref:`tarfile-extraction-filter` section for details." +msgstr "" + +#: ../../library/tarfile.rst:449 ../../library/tarfile.rst:485 msgid "Added the *numeric_owner* parameter." msgstr "新增 *numeric_owner* 參數。" -#: ../../library/tarfile.rst:414 ../../library/tarfile.rst:445 +#: ../../library/tarfile.rst:452 ../../library/tarfile.rst:488 msgid "The *path* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/tarfile.rst:420 +#: ../../library/tarfile.rst:455 ../../library/tarfile.rst:491 +#: ../../library/tarfile.rst:571 +msgid "Added the *filter* parameter." +msgstr "新增 *filter* 參數。" + +#: ../../library/tarfile.rst:461 msgid "" "Extract a member from the archive to the current working directory, using " "its full name. Its file information is extracted as accurately as possible. " @@ -678,21 +727,27 @@ msgid "" "File attributes (owner, mtime, mode) are set unless *set_attrs* is false." msgstr "" -#: ../../library/tarfile.rst:432 +#: ../../library/tarfile.rst:467 +msgid "" +"The *numeric_owner* and *filter* arguments are the same as for :meth:" +"`extractall`." +msgstr "" + +#: ../../library/tarfile.rst:472 msgid "" "The :meth:`extract` method does not take care of several extraction issues. " "In most cases you should consider using the :meth:`extractall` method." msgstr "" -#: ../../library/tarfile.rst:437 +#: ../../library/tarfile.rst:477 msgid "See the warning for :meth:`extractall`." msgstr "參閱 :meth:`extractall` 的警告。" -#: ../../library/tarfile.rst:439 +#: ../../library/tarfile.rst:482 msgid "Added the *set_attrs* parameter." msgstr "增加 *set_attrs* 參數。" -#: ../../library/tarfile.rst:451 +#: ../../library/tarfile.rst:497 msgid "" "Extract a member from the archive as a file object. *member* may be a " "filename or a :class:`TarInfo` object. If *member* is a regular file or a " @@ -701,11 +756,84 @@ msgid "" "the archive, :exc:`KeyError` is raised." msgstr "" -#: ../../library/tarfile.rst:457 +#: ../../library/tarfile.rst:503 msgid "Return an :class:`io.BufferedReader` object." msgstr "" -#: ../../library/tarfile.rst:463 +#: ../../library/tarfile.rst:509 +msgid "" +"If *errorlevel* is ``0``, errors are ignored when using :meth:`TarFile." +"extract` and :meth:`TarFile.extractall`. Nevertheless, they appear as error " +"messages in the debug output when *debug* is greater than 0. If ``1`` (the " +"default), all *fatal* errors are raised as :exc:`OSError` or :exc:" +"`FilterError` exceptions. If ``2``, all *non-fatal* errors are raised as :" +"exc:`TarError` exceptions as well." +msgstr "" + +#: ../../library/tarfile.rst:517 +msgid "" +"Some exceptions, e.g. ones caused by wrong argument types or data " +"corruption, are always raised." +msgstr "" + +#: ../../library/tarfile.rst:520 +msgid "" +"Custom :ref:`extraction filters ` should raise :" +"exc:`FilterError` for *fatal* errors and :exc:`ExtractError` for *non-fatal* " +"ones." +msgstr "" + +#: ../../library/tarfile.rst:524 +msgid "" +"Note that when an exception is raised, the archive may be partially " +"extracted. It is the user’s responsibility to clean up." +msgstr "" + +#: ../../library/tarfile.rst:531 +msgid "" +"The :ref:`extraction filter ` used as a default " +"for the *filter* argument of :meth:`~TarFile.extract` and :meth:`~TarFile." +"extractall`." +msgstr "" + +#: ../../library/tarfile.rst:535 +msgid "" +"The attribute may be ``None`` or a callable. String names are not allowed " +"for this attribute, unlike the *filter* argument to :meth:`~TarFile.extract`." +msgstr "" + +#: ../../library/tarfile.rst:539 +msgid "" +"If ``extraction_filter`` is ``None`` (the default), calling an extraction " +"method without a *filter* argument will use the :func:`fully_trusted " +"` filter for compatibility with previous Python " +"versions." +msgstr "" + +#: ../../library/tarfile.rst:544 +msgid "" +"In Python 3.12+, leaving ``extraction_filter=None`` will emit a " +"``DeprecationWarning``." +msgstr "" + +#: ../../library/tarfile.rst:547 +msgid "" +"In Python 3.14+, leaving ``extraction_filter=None`` will cause extraction " +"methods to use the :func:`data ` filter by default." +msgstr "" + +#: ../../library/tarfile.rst:550 +msgid "" +"The attribute may be set on instances or overridden in subclasses. It also " +"is possible to set it on the ``TarFile`` class itself to set a global " +"default, although, since it affects all uses of *tarfile*, it is best " +"practice to only do so in top-level applications or :mod:`site configuration " +"`. To set a global default this way, a filter function needs to be " +"wrapped in :func:`staticmethod()` to prevent injection of a ``self`` " +"argument." +msgstr "" + +#: ../../library/tarfile.rst:560 msgid "" "Add the file *name* to the archive. *name* may be any type of file " "(directory, fifo, symbolic link, etc.). If given, *arcname* specifies an " @@ -718,15 +846,11 @@ msgid "" "ref:`tar-examples` for an example." msgstr "" -#: ../../library/tarfile.rst:474 -msgid "Added the *filter* parameter." -msgstr "新增 *filter* 參數。" - -#: ../../library/tarfile.rst:477 +#: ../../library/tarfile.rst:574 msgid "Recursion adds entries in sorted order." msgstr "" -#: ../../library/tarfile.rst:483 +#: ../../library/tarfile.rst:580 msgid "" "Add the :class:`TarInfo` object *tarinfo* to the archive. If *fileobj* is " "given, it should be a :term:`binary file`, and ``tarinfo.size`` bytes are " @@ -734,7 +858,7 @@ msgid "" "objects directly, or by using :meth:`gettarinfo`." msgstr "" -#: ../../library/tarfile.rst:491 +#: ../../library/tarfile.rst:588 msgid "" "Create a :class:`TarInfo` object from the result of :func:`os.stat` or " "equivalent on an existing file. The file is either named by *name*, or " @@ -745,7 +869,7 @@ msgid "" "The name should be a text string." msgstr "" -#: ../../library/tarfile.rst:500 +#: ../../library/tarfile.rst:597 msgid "" "You can modify some of the :class:`TarInfo`’s attributes before you add it " "using :meth:`addfile`. If the file object is not an ordinary file object " @@ -755,21 +879,21 @@ msgid "" "case *arcname* could be a dummy string." msgstr "" -#: ../../library/tarfile.rst:514 +#: ../../library/tarfile.rst:611 msgid "" "Close the :class:`TarFile`. In write mode, two finishing zero blocks are " "appended to the archive." msgstr "" -#: ../../library/tarfile.rst:520 +#: ../../library/tarfile.rst:617 msgid "A dictionary containing key-value pairs of pax global headers." msgstr "" -#: ../../library/tarfile.rst:527 +#: ../../library/tarfile.rst:624 msgid "TarInfo Objects" msgstr "TarInfo 物件" -#: ../../library/tarfile.rst:529 +#: ../../library/tarfile.rst:626 msgid "" "A :class:`TarInfo` object represents one member in a :class:`TarFile`. Aside " "from storing all required attributes of a file (like file type, size, time, " @@ -777,57 +901,102 @@ msgid "" "type. It does *not* contain the file's data itself." msgstr "" -#: ../../library/tarfile.rst:534 +#: ../../library/tarfile.rst:631 msgid "" ":class:`TarInfo` objects are returned by :class:`TarFile`'s methods :meth:" -"`getmember`, :meth:`getmembers` and :meth:`gettarinfo`." +"`~TarFile.getmember`, :meth:`~TarFile.getmembers` and :meth:`~TarFile." +"gettarinfo`." msgstr "" -#: ../../library/tarfile.rst:540 +#: ../../library/tarfile.rst:635 +msgid "" +"Modifying the objects returned by :meth:`~!TarFile.getmember` or :meth:`~!" +"TarFile.getmembers` will affect all subsequent operations on the archive. " +"For cases where this is unwanted, you can use :mod:`copy.copy() ` or " +"call the :meth:`~TarInfo.replace` method to create a modified copy in one " +"step." +msgstr "" + +#: ../../library/tarfile.rst:641 +msgid "" +"Several attributes can be set to ``None`` to indicate that a piece of " +"metadata is unused or unknown. Different :class:`TarInfo` methods handle " +"``None`` differently:" +msgstr "" + +#: ../../library/tarfile.rst:645 +msgid "" +"The :meth:`~TarFile.extract` or :meth:`~TarFile.extractall` methods will " +"ignore the corresponding metadata, leaving it set to a default." +msgstr "" + +#: ../../library/tarfile.rst:647 +msgid ":meth:`~TarFile.addfile` will fail." +msgstr "" + +#: ../../library/tarfile.rst:648 +msgid ":meth:`~TarFile.list` will print a placeholder string." +msgstr "" + +#: ../../library/tarfile.rst:651 +msgid "Added :meth:`~TarInfo.replace` and handling of ``None``." +msgstr "" + +#: ../../library/tarfile.rst:657 msgid "Create a :class:`TarInfo` object." msgstr "" -#: ../../library/tarfile.rst:545 +#: ../../library/tarfile.rst:662 msgid "Create and return a :class:`TarInfo` object from string buffer *buf*." msgstr "" -#: ../../library/tarfile.rst:547 +#: ../../library/tarfile.rst:664 msgid "Raises :exc:`HeaderError` if the buffer is invalid." msgstr "" -#: ../../library/tarfile.rst:552 +#: ../../library/tarfile.rst:669 msgid "" "Read the next member from the :class:`TarFile` object *tarfile* and return " "it as a :class:`TarInfo` object." msgstr "" -#: ../../library/tarfile.rst:558 +#: ../../library/tarfile.rst:675 msgid "" "Create a string buffer from a :class:`TarInfo` object. For information on " "the arguments see the constructor of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:565 +#: ../../library/tarfile.rst:682 msgid "A ``TarInfo`` object has the following public data attributes:" msgstr "" -#: ../../library/tarfile.rst:570 +#: ../../library/tarfile.rst:688 msgid "Name of the archive member." msgstr "" -#: ../../library/tarfile.rst:575 +#: ../../library/tarfile.rst:694 msgid "Size in bytes." msgstr "" -#: ../../library/tarfile.rst:580 -msgid "Time of last modification." +#: ../../library/tarfile.rst:700 +msgid "" +"Time of last modification in seconds since the :ref:`epoch `, as in :" +"attr:`os.stat_result.st_mtime`." msgstr "" -#: ../../library/tarfile.rst:585 -msgid "Permission bits." +#: ../../library/tarfile.rst:705 ../../library/tarfile.rst:716 +#: ../../library/tarfile.rst:743 ../../library/tarfile.rst:754 +#: ../../library/tarfile.rst:765 ../../library/tarfile.rst:776 +msgid "" +"Can be set to ``None`` for :meth:`~TarFile.extract` and :meth:`~TarFile." +"extractall`, causing extraction to skip applying this attribute." msgstr "" -#: ../../library/tarfile.rst:590 +#: ../../library/tarfile.rst:712 +msgid "Permission bits, as for :func:`os.chmod`." +msgstr "" + +#: ../../library/tarfile.rst:722 msgid "" "File type. *type* is usually one of these constants: :const:`REGTYPE`, :" "const:`AREGTYPE`, :const:`LNKTYPE`, :const:`SYMTYPE`, :const:`DIRTYPE`, :" @@ -836,180 +1005,555 @@ msgid "" "more conveniently, use the ``is*()`` methods below." msgstr "" -#: ../../library/tarfile.rst:599 +#: ../../library/tarfile.rst:732 msgid "" "Name of the target file name, which is only present in :class:`TarInfo` " "objects of type :const:`LNKTYPE` and :const:`SYMTYPE`." msgstr "" -#: ../../library/tarfile.rst:605 +#: ../../library/tarfile.rst:739 msgid "User ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:610 +#: ../../library/tarfile.rst:750 msgid "Group ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:615 +#: ../../library/tarfile.rst:761 msgid "User name." msgstr "" -#: ../../library/tarfile.rst:620 +#: ../../library/tarfile.rst:772 msgid "Group name." msgstr "" -#: ../../library/tarfile.rst:625 +#: ../../library/tarfile.rst:783 msgid "" "A dictionary containing key-value pairs of an associated pax extended header." msgstr "" -#: ../../library/tarfile.rst:628 +#: ../../library/tarfile.rst:791 +msgid "" +"Return a *new* copy of the :class:`!TarInfo` object with the given " +"attributes changed. For example, to return a ``TarInfo`` with the group name " +"set to ``'staff'``, use::" +msgstr "" + +#: ../../library/tarfile.rst:797 +msgid "" +"By default, a deep copy is made. If *deep* is false, the copy is shallow, i." +"e. ``pax_headers`` and any custom attributes are shared with the original " +"``TarInfo`` object." +msgstr "" + +#: ../../library/tarfile.rst:801 msgid "A :class:`TarInfo` object also provides some convenient query methods:" msgstr "" -#: ../../library/tarfile.rst:633 +#: ../../library/tarfile.rst:806 msgid "Return :const:`True` if the :class:`Tarinfo` object is a regular file." msgstr "" -#: ../../library/tarfile.rst:638 +#: ../../library/tarfile.rst:811 msgid "Same as :meth:`isfile`." msgstr "" -#: ../../library/tarfile.rst:643 +#: ../../library/tarfile.rst:816 msgid "Return :const:`True` if it is a directory." msgstr "" -#: ../../library/tarfile.rst:648 +#: ../../library/tarfile.rst:821 msgid "Return :const:`True` if it is a symbolic link." msgstr "" -#: ../../library/tarfile.rst:653 +#: ../../library/tarfile.rst:826 msgid "Return :const:`True` if it is a hard link." msgstr "" -#: ../../library/tarfile.rst:658 +#: ../../library/tarfile.rst:831 msgid "Return :const:`True` if it is a character device." msgstr "" -#: ../../library/tarfile.rst:663 +#: ../../library/tarfile.rst:836 msgid "Return :const:`True` if it is a block device." msgstr "" -#: ../../library/tarfile.rst:668 +#: ../../library/tarfile.rst:841 msgid "Return :const:`True` if it is a FIFO." msgstr "" -#: ../../library/tarfile.rst:673 +#: ../../library/tarfile.rst:846 msgid "" "Return :const:`True` if it is one of character device, block device or FIFO." msgstr "" -#: ../../library/tarfile.rst:680 +#: ../../library/tarfile.rst:852 +msgid "Extraction filters" +msgstr "" + +#: ../../library/tarfile.rst:856 +msgid "" +"The *tar* format is designed to capture all details of a UNIX-like " +"filesystem, which makes it very powerful. Unfortunately, the features make " +"it easy to create tar files that have unintended -- and possibly malicious " +"-- effects when extracted. For example, extracting a tar file can overwrite " +"arbitrary files in various ways (e.g. by using absolute paths, ``..`` path " +"components, or symlinks that affect later members)." +msgstr "" + +#: ../../library/tarfile.rst:864 +msgid "" +"In most cases, the full functionality is not needed. Therefore, *tarfile* " +"supports extraction filters: a mechanism to limit functionality, and thus " +"mitigate some of the security issues." +msgstr "" + +#: ../../library/tarfile.rst:870 +msgid ":pep:`706`" +msgstr "" + +#: ../../library/tarfile.rst:871 +msgid "Contains further motivation and rationale behind the design." +msgstr "" + +#: ../../library/tarfile.rst:873 +msgid "" +"The *filter* argument to :meth:`TarFile.extract` or :meth:`~TarFile." +"extractall` can be:" +msgstr "" + +#: ../../library/tarfile.rst:876 +msgid "" +"the string ``'fully_trusted'``: Honor all metadata as specified in the " +"archive. Should be used if the user trusts the archive completely, or " +"implements their own complex verification." +msgstr "" + +#: ../../library/tarfile.rst:881 +msgid "" +"the string ``'tar'``: Honor most *tar*-specific features (i.e. features of " +"UNIX-like filesystems), but block features that are very likely to be " +"surprising or malicious. See :func:`tar_filter` for details." +msgstr "" + +#: ../../library/tarfile.rst:885 +msgid "" +"the string ``'data'``: Ignore or block most features specific to UNIX-like " +"filesystems. Intended for extracting cross-platform data archives. See :func:" +"`data_filter` for details." +msgstr "" + +#: ../../library/tarfile.rst:889 +msgid "``None`` (default): Use :attr:`TarFile.extraction_filter`." +msgstr "" + +#: ../../library/tarfile.rst:891 +msgid "" +"If that is also ``None`` (the default), the ``'fully_trusted'`` filter will " +"be used (for compatibility with earlier versions of Python)." +msgstr "" + +#: ../../library/tarfile.rst:894 +msgid "In Python 3.12, the default will emit a ``DeprecationWarning``." +msgstr "" + +#: ../../library/tarfile.rst:896 +msgid "" +"In Python 3.14, the ``'data'`` filter will become the default instead. It's " +"possible to switch earlier; see :attr:`TarFile.extraction_filter`." +msgstr "" + +#: ../../library/tarfile.rst:899 +msgid "" +"A callable which will be called for each extracted member with a :ref:" +"`TarInfo ` describing the member and the destination path " +"to where the archive is extracted (i.e. the same path is used for all " +"members)::" +msgstr "" + +#: ../../library/tarfile.rst:906 +msgid "" +"The callable is called just before each member is extracted, so it can take " +"the current state of the disk into account. It can:" +msgstr "" + +#: ../../library/tarfile.rst:910 +msgid "" +"return a :class:`TarInfo` object which will be used instead of the metadata " +"in the archive, or" +msgstr "" + +#: ../../library/tarfile.rst:912 +msgid "return ``None``, in which case the member will be skipped, or" +msgstr "" + +#: ../../library/tarfile.rst:913 +msgid "" +"raise an exception to abort the operation or skip the member, depending on :" +"attr:`~TarFile.errorlevel`. Note that when extraction is aborted, :meth:" +"`~TarFile.extractall` may leave the archive partially extracted. It does not " +"attempt to clean up." +msgstr "" + +#: ../../library/tarfile.rst:919 +msgid "Default named filters" +msgstr "" + +#: ../../library/tarfile.rst:921 +msgid "" +"The pre-defined, named filters are available as functions, so they can be " +"reused in custom filters:" +msgstr "" + +#: ../../library/tarfile.rst:926 +msgid "Return *member* unchanged." +msgstr "" + +#: ../../library/tarfile.rst:928 +msgid "This implements the ``'fully_trusted'`` filter." +msgstr "" + +#: ../../library/tarfile.rst:932 +msgid "Implements the ``'tar'`` filter." +msgstr "" + +#: ../../library/tarfile.rst:934 +msgid "Strip leading slashes (``/`` and :attr:`os.sep`) from filenames." +msgstr "" + +#: ../../library/tarfile.rst:935 +msgid "" +":ref:`Refuse ` to extract files with absolute " +"paths (in case the name is absolute even after stripping slashes, e.g. ``C:/" +"foo`` on Windows). This raises :class:`~tarfile.AbsolutePathError`." +msgstr "" + +#: ../../library/tarfile.rst:939 +msgid "" +":ref:`Refuse ` to extract files whose absolute " +"path (after following symlinks) would end up outside the destination. This " +"raises :class:`~tarfile.OutsideDestinationError`." +msgstr "" + +#: ../../library/tarfile.rst:942 +msgid "" +"Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:" +"attr:`~stat.S_IWGRP`|:attr:`~stat.S_IWOTH`)." +msgstr "" + +#: ../../library/tarfile.rst:945 ../../library/tarfile.rst:978 +msgid "Return the modified ``TarInfo`` member." +msgstr "" + +#: ../../library/tarfile.rst:949 +msgid "" +"Implements the ``'data'`` filter. In addition to what ``tar_filter`` does:" +msgstr "" + +#: ../../library/tarfile.rst:952 +msgid "" +":ref:`Refuse ` to extract links (hard or soft) " +"that link to absolute paths, or ones that link outside the destination." +msgstr "" + +#: ../../library/tarfile.rst:955 +msgid "" +"This raises :class:`~tarfile.AbsoluteLinkError` or :class:`~tarfile." +"LinkOutsideDestinationError`." +msgstr "" + +#: ../../library/tarfile.rst:958 +msgid "" +"Note that such files are refused even on platforms that do not support " +"symbolic links." +msgstr "" + +#: ../../library/tarfile.rst:961 +msgid "" +":ref:`Refuse ` to extract device files (including " +"pipes). This raises :class:`~tarfile.SpecialFileError`." +msgstr "" + +#: ../../library/tarfile.rst:965 +msgid "For regular files, including hard links:" +msgstr "" + +#: ../../library/tarfile.rst:967 +msgid "" +"Set the owner read and write permissions (:attr:`~stat.S_IRUSR`|:attr:`~stat." +"S_IWUSR`)." +msgstr "" + +#: ../../library/tarfile.rst:969 +msgid "" +"Remove the group & other executable permission (:attr:`~stat.S_IXGRP`|:attr:" +"`~stat.S_IXOTH`) if the owner doesn’t have it (:attr:`~stat.S_IXUSR`)." +msgstr "" + +#: ../../library/tarfile.rst:973 +msgid "" +"For other files (directories), set ``mode`` to ``None``, so that extraction " +"methods skip applying permission bits." +msgstr "" + +#: ../../library/tarfile.rst:975 +msgid "" +"Set user and group info (``uid``, ``gid``, ``uname``, ``gname``) to " +"``None``, so that extraction methods skip setting it." +msgstr "" + +#: ../../library/tarfile.rst:984 +msgid "Filter errors" +msgstr "" + +#: ../../library/tarfile.rst:986 +msgid "" +"When a filter refuses to extract a file, it will raise an appropriate " +"exception, a subclass of :class:`~tarfile.FilterError`. This will abort the " +"extraction if :attr:`TarFile.errorlevel` is 1 or more. With ``errorlevel=0`` " +"the error will be logged and the member will be skipped, but extraction will " +"continue." +msgstr "" + +#: ../../library/tarfile.rst:994 +msgid "Hints for further verification" +msgstr "" + +#: ../../library/tarfile.rst:996 +msgid "" +"Even with ``filter='data'``, *tarfile* is not suited for extracting " +"untrusted files without prior inspection. Among other issues, the pre-" +"defined filters do not prevent denial-of-service attacks. Users should do " +"additional checks." +msgstr "" + +#: ../../library/tarfile.rst:1001 +msgid "Here is an incomplete list of things to consider:" +msgstr "" + +#: ../../library/tarfile.rst:1003 +msgid "" +"Extract to a :func:`new temporary directory ` to prevent e." +"g. exploiting pre-existing links, and to make it easier to clean up after a " +"failed extraction." +msgstr "" + +#: ../../library/tarfile.rst:1006 +msgid "" +"When working with untrusted data, use external (e.g. OS-level) limits on " +"disk, memory and CPU usage." +msgstr "" + +#: ../../library/tarfile.rst:1008 +msgid "" +"Check filenames against an allow-list of characters (to filter out control " +"characters, confusables, foreign path separators, etc.)." +msgstr "" + +#: ../../library/tarfile.rst:1011 +msgid "" +"Check that filenames have expected extensions (discouraging files that " +"execute when you “click on them”, or extension-less files like Windows " +"special device names)." +msgstr "" + +#: ../../library/tarfile.rst:1013 +msgid "" +"Limit the number of extracted files, total size of extracted data, filename " +"length (including symlink length), and size of individual files." +msgstr "" + +#: ../../library/tarfile.rst:1015 +msgid "Check for files that would be shadowed on case-insensitive filesystems." +msgstr "" + +#: ../../library/tarfile.rst:1017 +msgid "Also note that:" +msgstr "" + +#: ../../library/tarfile.rst:1019 +msgid "" +"Tar files may contain multiple versions of the same file. Later ones are " +"expected to overwrite any earlier ones. This feature is crucial to allow " +"updating tape archives, but can be abused maliciously." +msgstr "" + +#: ../../library/tarfile.rst:1023 +msgid "" +"*tarfile* does not protect against issues with “live” data, e.g. an attacker " +"tinkering with the destination (or source) directory while extraction (or " +"archiving) is in progress." +msgstr "" + +#: ../../library/tarfile.rst:1029 +msgid "Supporting older Python versions" +msgstr "" + +#: ../../library/tarfile.rst:1031 +msgid "" +"Extraction filters were added to Python 3.12, and are backported to older " +"versions as security updates. To check whether the feature is available, use " +"e.g. ``hasattr(tarfile, 'data_filter')`` rather than checking the Python " +"version." +msgstr "" + +#: ../../library/tarfile.rst:1036 +msgid "" +"The following examples show how to support Python versions with and without " +"the feature. Note that setting ``extraction_filter`` will affect any " +"subsequent operations." +msgstr "" + +#: ../../library/tarfile.rst:1040 +msgid "Fully trusted archive::" +msgstr "" + +#: ../../library/tarfile.rst:1045 +msgid "" +"Use the ``'data'`` filter if available, but revert to Python 3.11 behavior " +"(``'fully_trusted'``) if this feature is not available::" +msgstr "" + +#: ../../library/tarfile.rst:1052 +msgid "Use the ``'data'`` filter; *fail* if it is not available::" +msgstr "" + +#: ../../library/tarfile.rst:1056 +msgid "or::" +msgstr "" + +#: ../../library/tarfile.rst:1061 +msgid "Use the ``'data'`` filter; *warn* if it is not available::" +msgstr "" + +#: ../../library/tarfile.rst:1072 +msgid "Stateful extraction filter example" +msgstr "" + +#: ../../library/tarfile.rst:1074 +msgid "" +"While *tarfile*'s extraction methods take a simple *filter* callable, custom " +"filters may be more complex objects with an internal state. It may be useful " +"to write these as context managers, to be used like this::" +msgstr "" + +#: ../../library/tarfile.rst:1081 +msgid "Such a filter can be written as, for example::" +msgstr "" + +#: ../../library/tarfile.rst:1103 msgid "Command-Line Interface" msgstr "" -#: ../../library/tarfile.rst:684 +#: ../../library/tarfile.rst:1107 msgid "" "The :mod:`tarfile` module provides a simple command-line interface to " "interact with tar archives." msgstr "" -#: ../../library/tarfile.rst:687 +#: ../../library/tarfile.rst:1110 msgid "" "If you want to create a new tar archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/tarfile.rst:694 +#: ../../library/tarfile.rst:1117 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/tarfile.rst:700 +#: ../../library/tarfile.rst:1123 msgid "" "If you want to extract a tar archive into the current directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/tarfile.rst:707 +#: ../../library/tarfile.rst:1130 msgid "" "You can also extract a tar archive into a different directory by passing the " "directory's name:" msgstr "" -#: ../../library/tarfile.rst:714 +#: ../../library/tarfile.rst:1137 msgid "For a list of the files in a tar archive, use the :option:`-l` option:" msgstr "" -#: ../../library/tarfile.rst:722 +#: ../../library/tarfile.rst:1145 msgid "Command-line options" msgstr "" -#: ../../library/tarfile.rst:727 +#: ../../library/tarfile.rst:1150 msgid "List files in a tarfile." msgstr "" -#: ../../library/tarfile.rst:732 +#: ../../library/tarfile.rst:1155 msgid "Create tarfile from source files." msgstr "" -#: ../../library/tarfile.rst:737 +#: ../../library/tarfile.rst:1160 msgid "" "Extract tarfile into the current directory if *output_dir* is not specified." msgstr "" -#: ../../library/tarfile.rst:742 +#: ../../library/tarfile.rst:1165 msgid "Test whether the tarfile is valid or not." msgstr "" -#: ../../library/tarfile.rst:746 +#: ../../library/tarfile.rst:1169 msgid "Verbose output." msgstr "" -#: ../../library/tarfile.rst:751 +#: ../../library/tarfile.rst:1173 +msgid "" +"Specifies the *filter* for ``--extract``. See :ref:`tarfile-extraction-" +"filter` for details. Only string names are accepted (that is, " +"``fully_trusted``, ``tar``, and ``data``)." +msgstr "" + +#: ../../library/tarfile.rst:1183 msgid "Examples" msgstr "範例" -#: ../../library/tarfile.rst:753 +#: ../../library/tarfile.rst:1185 msgid "How to extract an entire tar archive to the current working directory::" msgstr "" -#: ../../library/tarfile.rst:760 +#: ../../library/tarfile.rst:1192 msgid "" "How to extract a subset of a tar archive with :meth:`TarFile.extractall` " "using a generator function instead of a list::" msgstr "" -#: ../../library/tarfile.rst:775 +#: ../../library/tarfile.rst:1207 msgid "How to create an uncompressed tar archive from a list of filenames::" msgstr "" -#: ../../library/tarfile.rst:783 +#: ../../library/tarfile.rst:1215 msgid "The same example using the :keyword:`with` statement::" msgstr "" -#: ../../library/tarfile.rst:790 +#: ../../library/tarfile.rst:1222 msgid "" "How to read a gzip compressed tar archive and display some member " "information::" msgstr "" -#: ../../library/tarfile.rst:804 +#: ../../library/tarfile.rst:1236 msgid "" "How to create an archive and reset the user information using the *filter* " "parameter in :meth:`TarFile.add`::" msgstr "" -#: ../../library/tarfile.rst:820 +#: ../../library/tarfile.rst:1252 msgid "Supported tar formats" msgstr "" -#: ../../library/tarfile.rst:822 +#: ../../library/tarfile.rst:1254 msgid "" "There are three tar formats that can be created with the :mod:`tarfile` " "module:" msgstr "" -#: ../../library/tarfile.rst:824 +#: ../../library/tarfile.rst:1256 msgid "" "The POSIX.1-1988 ustar format (:const:`USTAR_FORMAT`). It supports filenames " "up to a length of at best 256 characters and linknames up to 100 characters. " @@ -1017,7 +1561,7 @@ msgid "" "supported format." msgstr "" -#: ../../library/tarfile.rst:829 +#: ../../library/tarfile.rst:1261 msgid "" "The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and " "linknames, files bigger than 8 GiB and sparse files. It is the de facto " @@ -1025,7 +1569,7 @@ msgid "" "extensions for long names, sparse file support is read-only." msgstr "" -#: ../../library/tarfile.rst:834 +#: ../../library/tarfile.rst:1266 msgid "" "The POSIX.1-2001 pax format (:const:`PAX_FORMAT`). It is the most flexible " "format with virtually no limits. It supports long filenames and linknames, " @@ -1036,7 +1580,7 @@ msgid "" "*ustar* format. It is the current default format for new archives." msgstr "" -#: ../../library/tarfile.rst:842 +#: ../../library/tarfile.rst:1274 msgid "" "It extends the existing *ustar* format with extra headers for information " "that cannot be stored otherwise. There are two flavours of pax headers: " @@ -1045,13 +1589,13 @@ msgid "" "in a pax header is encoded in *UTF-8* for portability reasons." msgstr "" -#: ../../library/tarfile.rst:848 +#: ../../library/tarfile.rst:1280 msgid "" "There are some more variants of the tar format which can be read, but not " "created:" msgstr "" -#: ../../library/tarfile.rst:851 +#: ../../library/tarfile.rst:1283 msgid "" "The ancient V7 format. This is the first tar format from Unix Seventh " "Edition, storing only regular files and directories. Names must not be " @@ -1060,17 +1604,17 @@ msgid "" "ASCII characters." msgstr "" -#: ../../library/tarfile.rst:856 +#: ../../library/tarfile.rst:1288 msgid "" "The SunOS tar extended format. This format is a variant of the POSIX.1-2001 " "pax format, but is not compatible." msgstr "" -#: ../../library/tarfile.rst:862 +#: ../../library/tarfile.rst:1294 msgid "Unicode issues" msgstr "" -#: ../../library/tarfile.rst:864 +#: ../../library/tarfile.rst:1296 msgid "" "The tar format was originally conceived to make backups on tape drives with " "the main focus on preserving file system information. Nowadays tar archives " @@ -1085,13 +1629,13 @@ msgid "" "It stores non-ASCII metadata using the universal character encoding *UTF-8*." msgstr "" -#: ../../library/tarfile.rst:876 +#: ../../library/tarfile.rst:1308 msgid "" "The details of character conversion in :mod:`tarfile` are controlled by the " "*encoding* and *errors* keyword arguments of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:879 +#: ../../library/tarfile.rst:1311 msgid "" "*encoding* defines the character encoding to use for the metadata in the " "archive. The default value is :func:`sys.getfilesystemencoding` or " @@ -1100,7 +1644,7 @@ msgid "" "not set appropriately, this conversion may fail." msgstr "" -#: ../../library/tarfile.rst:885 +#: ../../library/tarfile.rst:1317 msgid "" "The *errors* argument defines how characters are treated that cannot be " "converted. Possible values are listed in section :ref:`error-handlers`. The " @@ -1108,7 +1652,7 @@ msgid "" "system calls, see :ref:`os-filenames`." msgstr "" -#: ../../library/tarfile.rst:890 +#: ../../library/tarfile.rst:1322 msgid "" "For :const:`PAX_FORMAT` archives (the default), *encoding* is generally not " "needed because all the metadata is stored using *UTF-8*. *encoding* is only " diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index a2f1d7180e..dfb53a9ca0 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-23 00:31+0000\n" +"POT-Creation-Date: 2023-04-29 00:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -4196,6 +4196,25 @@ msgid "" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" msgstr "" +#: ../../whatsnew/3.11.rst:2706 +msgid "Notable Changes in 3.11.4" +msgstr "" + +#: ../../whatsnew/3.11.rst:2709 +msgid "tarfile" +msgstr "" + +#: ../../whatsnew/3.11.rst:2711 +msgid "" +"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " +"have a new a *filter* argument that allows limiting tar features than may be " +"surprising or dangerous, such as creating files outside the destination " +"directory. See :ref:`tarfile-extraction-filter` for details. In Python 3.12, " +"use without the *filter* argument will show a :exc:`DeprecationWarning`. In " +"Python 3.14, the default will switch to ``'data'``. (Contributed by Petr " +"Viktorin in :pep:`706`.)" +msgstr "" + #~ msgid "``x+x; x*x; x-x;``" #~ msgstr "``x+x; x*x; x-x;``" From 077b84e04b61a4c632dbf85a787cd3a1a7dc3556 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 30 Apr 2023 00:34:44 +0000 Subject: [PATCH 077/130] sync with cpython 86ef1ce1 --- library/datetime.po | 61 +++++++++++++++++++++------------------------ library/dis.po | 6 ++--- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/library/datetime.po b/library/datetime.po index 7945d19c7f..dc8cef1777 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 00:32+0000\n" +"POT-Creation-Date: 2023-04-30 00:32+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1582,7 +1582,7 @@ msgstr "" #: ../../library/datetime.rst:1294 ../../library/datetime.rst:1887 #: ../../library/datetime.rst:1993 ../../library/datetime.rst:2238 -#: ../../library/datetime.rst:2250 ../../library/datetime.rst:2555 +#: ../../library/datetime.rst:2250 ../../library/datetime.rst:2552 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" @@ -2744,7 +2744,7 @@ msgstr "000000, 000001, ..., 999999" msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2553 +#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2550 msgid "``%z``" msgstr "``%z``" @@ -2762,7 +2762,7 @@ msgstr "" msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2394 ../../library/datetime.rst:2577 +#: ../../library/datetime.rst:2394 ../../library/datetime.rst:2574 msgid "``%Z``" msgstr "``%Z``" @@ -3011,43 +3011,40 @@ msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " "example, \"month/day/year\" versus \"day/month/year\"), and the output may " -"contain Unicode characters encoded using the locale's default encoding (for " -"example, if the current locale is ``ja_JP``, the default encoding could be " -"any one of ``eucJP``, ``SJIS``, or ``utf-8``; use :meth:`locale.getlocale` " -"to determine the current locale's encoding)." +"contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2511 +#: ../../library/datetime.rst:2508 msgid "" "The :meth:`strptime` method can parse years in the full [1, 9999] range, but " "years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2514 +#: ../../library/datetime.rst:2511 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2518 +#: ../../library/datetime.rst:2515 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2523 +#: ../../library/datetime.rst:2520 msgid "" "When used with the :meth:`strptime` method, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/datetime.rst:2527 +#: ../../library/datetime.rst:2524 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2531 +#: ../../library/datetime.rst:2528 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3055,17 +3052,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2538 +#: ../../library/datetime.rst:2535 msgid "" "For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty " "strings." msgstr "" -#: ../../library/datetime.rst:2541 +#: ../../library/datetime.rst:2538 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2544 +#: ../../library/datetime.rst:2541 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3079,7 +3076,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2558 +#: ../../library/datetime.rst:2555 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3087,47 +3084,47 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2566 +#: ../../library/datetime.rst:2563 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2570 +#: ../../library/datetime.rst:2567 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2572 +#: ../../library/datetime.rst:2569 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2573 +#: ../../library/datetime.rst:2570 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2575 +#: ../../library/datetime.rst:2572 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2579 +#: ../../library/datetime.rst:2576 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, an " "aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " "result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2585 +#: ../../library/datetime.rst:2582 msgid "" "When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " "in calculations when the day of the week and the calendar year (``%Y``) are " "specified." msgstr "" -#: ../../library/datetime.rst:2590 +#: ../../library/datetime.rst:2587 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:" @@ -3135,22 +3132,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2596 +#: ../../library/datetime.rst:2593 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2601 +#: ../../library/datetime.rst:2598 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2602 +#: ../../library/datetime.rst:2599 msgid "If, that is, we ignore the effects of Relativity" msgstr "" -#: ../../library/datetime.rst:2604 +#: ../../library/datetime.rst:2601 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3159,14 +3156,14 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2610 +#: ../../library/datetime.rst:2607 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2614 +#: ../../library/datetime.rst:2611 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." diff --git a/library/dis.po b/library/dis.po index f7174b1207..9e95cfebeb 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-02 00:33+0000\n" +"POT-Creation-Date: 2023-04-30 00:32+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1057,8 +1057,8 @@ msgstr "" #: ../../library/dis.rst:1091 msgid "" -"Creates a new cell in slot ``i``. If that slot is empty then that value is " -"stored into the new cell." +"Creates a new cell in slot ``i``. If that slot is nonempty then that value " +"is stored into the new cell." msgstr "" #: ../../library/dis.rst:1099 From a43353ca06277c1e54ba8e81b74272b17728314e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 2 May 2023 00:31:57 +0000 Subject: [PATCH 078/130] sync with cpython 10db28bf --- library/venv.po | 4 +- whatsnew/3.11.po | 1242 +++++++++++++++++++++++----------------------- 2 files changed, 618 insertions(+), 628 deletions(-) diff --git a/library/venv.po b/library/venv.po index 8d4886e141..07f51d10be 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-16 00:34+0000\n" +"POT-Creation-Date: 2023-05-02 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -188,7 +188,7 @@ msgid "" "prefix` and :data:`sys.exec_prefix` point to the directories of the virtual " "environment, whereas :data:`sys.base_prefix` and :data:`sys." "base_exec_prefix` point to those of the base Python used to create the " -"environment. It is sufficient to check ``sys.prefix == sys.base_prefix`` to " +"environment. It is sufficient to check ``sys.prefix != sys.base_prefix`` to " "determine if the current interpreter is running from a virtual environment." msgstr "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index dfb53a9ca0..3ac82b59ac 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-29 00:29+0000\n" +"POT-Creation-Date: 2023-05-02 00:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -152,7 +152,7 @@ msgid "" "pep670>`" msgstr "" -#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2199 +#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2191 msgid "New Features" msgstr "" @@ -774,51 +774,41 @@ msgstr "" #: ../../whatsnew/3.11.rst:671 msgid "" -"Changed :class:`~enum.IntEnum`, :class:`~enum.IntFlag` and :class:`~enum." -"StrEnum` to now inherit from :class:`~enum.ReprEnum`, so their :func:`str` " -"output now matches :func:`format` (both ``str(AnIntEnum.ONE)`` and " -"``format(AnIntEnum.ONE)`` return ``'1'``, whereas before ``str(AnIntEnum." -"ONE)`` returned ``'AnIntEnum.ONE'``." -msgstr "" - -#: ../../whatsnew/3.11.rst:677 -msgid "" "Changed :meth:`Enum.__format__() ` (the default for :" -"func:`format`, :meth:`str.format` and :term:`f-string`\\s) of enums with " -"mixed-in types (e.g. :class:`int`, :class:`str`) to also include the class " -"name in the output, not just the member's key. This matches the existing " -"behavior of :meth:`enum.Enum.__str__`, returning e.g. ``'AnEnum.MEMBER'`` " -"for an enum ``AnEnum(str, Enum)`` instead of just ``'MEMBER'``." +"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 "" -#: ../../whatsnew/3.11.rst:685 +#: ../../whatsnew/3.11.rst:677 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." msgstr "" -#: ../../whatsnew/3.11.rst:689 +#: ../../whatsnew/3.11.rst:681 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." msgstr "" -#: ../../whatsnew/3.11.rst:693 +#: ../../whatsnew/3.11.rst:685 msgid "" "Added the :func:`~enum.member` and :func:`~enum.nonmember` decorators, to " "ensure the decorated object is/is not converted to an enum member." msgstr "" -#: ../../whatsnew/3.11.rst:696 +#: ../../whatsnew/3.11.rst:688 msgid "" "Added the :func:`~enum.property` decorator, which works like :func:" "`property` except for enums. Use this instead of :func:`types." "DynamicClassAttribute`." msgstr "" -#: ../../whatsnew/3.11.rst:700 +#: ../../whatsnew/3.11.rst:692 msgid "" "Added the :func:`~enum.global_enum` enum decorator, which adjusts :meth:" "`~object.__repr__` and :meth:`~object.__str__` to show values as members of " @@ -827,80 +817,80 @@ msgid "" "``'RegexFlag.ASCII'``." msgstr "" -#: ../../whatsnew/3.11.rst:706 +#: ../../whatsnew/3.11.rst:698 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)``" msgstr "" -#: ../../whatsnew/3.11.rst:711 +#: ../../whatsnew/3.11.rst:703 msgid "" "Changed :class:`~enum.Enum` and :class:`~enum.Flag` so that members are now " "defined before :meth:`~object.__init_subclass__` is called; :func:`dir` now " "includes methods, etc., from mixed-in data types." msgstr "" -#: ../../whatsnew/3.11.rst:716 +#: ../../whatsnew/3.11.rst:708 msgid "" "Changed :class:`~enum.Flag` to only consider primary values (power of two) " "canonical while composite values (``3``, ``6``, ``10``, etc.) are considered " "aliases; inverted flags are coerced to their positive equivalent." msgstr "" -#: ../../whatsnew/3.11.rst:725 +#: ../../whatsnew/3.11.rst:717 msgid "fcntl" msgstr "fcntl" -#: ../../whatsnew/3.11.rst:727 +#: ../../whatsnew/3.11.rst:719 msgid "" "On FreeBSD, the :data:`!F_DUP2FD` and :data:`!F_DUP2FD_CLOEXEC` flags " "respectively are supported, the former equals to ``dup2`` usage while the " "latter set the ``FD_CLOEXEC`` flag in addition." msgstr "" -#: ../../whatsnew/3.11.rst:735 +#: ../../whatsnew/3.11.rst:727 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.11.rst:737 +#: ../../whatsnew/3.11.rst:729 msgid "" "Support :PEP:`515`-style initialization of :class:`~fractions.Fraction` from " "string. (Contributed by Sergey B Kirpichev in :issue:`44258`.)" msgstr "" -#: ../../whatsnew/3.11.rst:740 +#: ../../whatsnew/3.11.rst:732 msgid "" ":class:`~fractions.Fraction` now implements an ``__int__`` method, so that " "an ``isinstance(some_fraction, typing.SupportsInt)`` check passes. " "(Contributed by Mark Dickinson in :issue:`44547`.)" msgstr "" -#: ../../whatsnew/3.11.rst:748 +#: ../../whatsnew/3.11.rst:740 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.11.rst:750 +#: ../../whatsnew/3.11.rst:742 msgid "" ":func:`functools.singledispatch` now supports :data:`types.UnionType` and :" "data:`typing.Union` as annotations to the dispatch argument.::" msgstr "" -#: ../../whatsnew/3.11.rst:775 +#: ../../whatsnew/3.11.rst:767 msgid "(Contributed by Yurii Karabas in :issue:`46014`.)" msgstr "" -#: ../../whatsnew/3.11.rst:781 +#: ../../whatsnew/3.11.rst:773 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.11.rst:783 +#: ../../whatsnew/3.11.rst:775 msgid "" ":func:`hashlib.blake2b` and :func:`hashlib.blake2s` now prefer `libb2`_ over " "Python's vendored copy. (Contributed by Christian Heimes in :issue:`47095`.)" msgstr "" -#: ../../whatsnew/3.11.rst:787 +#: ../../whatsnew/3.11.rst:779 msgid "" "The internal ``_sha3`` module with SHA3 and SHAKE algorithms now uses " "*tiny_sha3* instead of the *Keccak Code Package* to reduce code and binary " @@ -909,47 +899,47 @@ msgid "" "OpenSSL support. (Contributed by Christian Heimes in :issue:`47098`.)" msgstr "" -#: ../../whatsnew/3.11.rst:794 +#: ../../whatsnew/3.11.rst:786 msgid "" "Add :func:`hashlib.file_digest`, a helper function for efficient hashing of " "files or file-like objects. (Contributed by Christian Heimes in :gh:`89313`.)" msgstr "" -#: ../../whatsnew/3.11.rst:802 +#: ../../whatsnew/3.11.rst:794 msgid "IDLE and idlelib" msgstr "" -#: ../../whatsnew/3.11.rst:804 +#: ../../whatsnew/3.11.rst:796 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" msgstr "" -#: ../../whatsnew/3.11.rst:807 +#: ../../whatsnew/3.11.rst:799 msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" msgstr "" -#: ../../whatsnew/3.11.rst:814 +#: ../../whatsnew/3.11.rst:806 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.11.rst:816 +#: ../../whatsnew/3.11.rst:808 msgid "" "Add :func:`~inspect.getmembers_static` to return all members without " "triggering dynamic lookup via the descriptor protocol. (Contributed by " "Weipeng Hong in :issue:`30533`.)" msgstr "" -#: ../../whatsnew/3.11.rst:820 +#: ../../whatsnew/3.11.rst:812 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:824 +#: ../../whatsnew/3.11.rst:816 msgid "" "Change the frame-related functions in the :mod:`inspect` module to return " "new :class:`~inspect.FrameInfo` and :class:`~inspect.Traceback` class " @@ -958,46 +948,46 @@ msgid "" "line number, column and end column). The affected functions are:" msgstr "" -#: ../../whatsnew/3.11.rst:830 +#: ../../whatsnew/3.11.rst:822 msgid ":func:`inspect.getframeinfo`" msgstr "" -#: ../../whatsnew/3.11.rst:831 +#: ../../whatsnew/3.11.rst:823 msgid ":func:`inspect.getouterframes`" msgstr "" -#: ../../whatsnew/3.11.rst:832 +#: ../../whatsnew/3.11.rst:824 msgid ":func:`inspect.getinnerframes`," msgstr "" -#: ../../whatsnew/3.11.rst:833 +#: ../../whatsnew/3.11.rst:825 msgid ":func:`inspect.stack`" msgstr "" -#: ../../whatsnew/3.11.rst:834 +#: ../../whatsnew/3.11.rst:826 msgid ":func:`inspect.trace`" msgstr "" -#: ../../whatsnew/3.11.rst:836 +#: ../../whatsnew/3.11.rst:828 msgid "(Contributed by Pablo Galindo in :gh:`88116`.)" msgstr "" -#: ../../whatsnew/3.11.rst:842 +#: ../../whatsnew/3.11.rst:834 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.11.rst:844 +#: ../../whatsnew/3.11.rst:836 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 `." msgstr "" -#: ../../whatsnew/3.11.rst:852 +#: ../../whatsnew/3.11.rst:844 msgid "logging" msgstr "" -#: ../../whatsnew/3.11.rst:854 +#: ../../whatsnew/3.11.rst:846 msgid "" "Added :func:`~logging.getLevelNamesMapping` to return a mapping from logging " "level names (e.g. ``'CRITICAL'``) to the values of their corresponding :ref:" @@ -1005,7 +995,7 @@ msgid "" "`88024`.)" msgstr "" -#: ../../whatsnew/3.11.rst:859 +#: ../../whatsnew/3.11.rst:851 msgid "" "Added a :meth:`~logging.handlers.SysLogHandler.createSocket` method to :" "class:`~logging.handlers.SysLogHandler`, to match :meth:`SocketHandler." @@ -1014,23 +1004,23 @@ msgid "" "there is no active socket. (Contributed by Kirill Pinchuk in :gh:`88457`.)" msgstr "" -#: ../../whatsnew/3.11.rst:871 +#: ../../whatsnew/3.11.rst:863 msgid "math" msgstr "math" -#: ../../whatsnew/3.11.rst:873 +#: ../../whatsnew/3.11.rst:865 msgid "" "Add :func:`math.exp2`: return 2 raised to the power of x. (Contributed by " "Gideon Mitchell in :issue:`45917`.)" msgstr "" -#: ../../whatsnew/3.11.rst:876 +#: ../../whatsnew/3.11.rst:868 msgid "" "Add :func:`math.cbrt`: return the cube root of x. (Contributed by Ajith " "Ramachandran in :issue:`44357`.)" msgstr "" -#: ../../whatsnew/3.11.rst:879 +#: ../../whatsnew/3.11.rst:871 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, -" @@ -1039,39 +1029,39 @@ msgid "" "`44339`.)" msgstr "" -#: ../../whatsnew/3.11.rst:885 +#: ../../whatsnew/3.11.rst:877 msgid "" "The :data:`math.nan` value is now always available. (Contributed by Victor " "Stinner in :issue:`46917`.)" msgstr "" -#: ../../whatsnew/3.11.rst:892 +#: ../../whatsnew/3.11.rst:884 msgid "operator" msgstr "operator" -#: ../../whatsnew/3.11.rst:894 +#: ../../whatsnew/3.11.rst:886 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:902 +#: ../../whatsnew/3.11.rst:894 msgid "os" msgstr "os" -#: ../../whatsnew/3.11.rst:904 +#: ../../whatsnew/3.11.rst:896 msgid "" "On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``, instead of " "``CryptGenRandom()`` which is deprecated. (Contributed by Dong-hee Na in :" "issue:`44611`.)" msgstr "" -#: ../../whatsnew/3.11.rst:912 +#: ../../whatsnew/3.11.rst:904 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.11.rst:914 +#: ../../whatsnew/3.11.rst:906 msgid "" ":meth:`~pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` return only " "directories if *pattern* ends with a pathname components separator: :data:" @@ -1079,56 +1069,56 @@ msgid "" "`22276` and :issue:`33392`.)" msgstr "" -#: ../../whatsnew/3.11.rst:923 +#: ../../whatsnew/3.11.rst:915 msgid "re" msgstr "re" -#: ../../whatsnew/3.11.rst:925 +#: ../../whatsnew/3.11.rst:917 msgid "" "Atomic grouping (``(?>...)``) and possessive quantifiers (``*+``, ``++``, ``?" "+``, ``{m,n}+``) are now supported in regular expressions. (Contributed by " "Jeffrey C. Jacobs and Serhiy Storchaka in :issue:`433030`.)" msgstr "" -#: ../../whatsnew/3.11.rst:933 +#: ../../whatsnew/3.11.rst:925 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.11.rst:935 +#: ../../whatsnew/3.11.rst:927 msgid "" "Add optional parameter *dir_fd* in :func:`shutil.rmtree`. (Contributed by " "Serhiy Storchaka in :issue:`46245`.)" msgstr "" -#: ../../whatsnew/3.11.rst:942 +#: ../../whatsnew/3.11.rst:934 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.11.rst:944 +#: ../../whatsnew/3.11.rst:936 msgid "" "Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner in :issue:" "`30512`.)" msgstr "" -#: ../../whatsnew/3.11.rst:947 +#: ../../whatsnew/3.11.rst:939 msgid "" ":meth:`~socket.create_connection` has an option to raise, in case of failure " "to connect, an :exc:`ExceptionGroup` containing all errors instead of only " "raising the last error. (Contributed by Irit Katriel in :issue:`29980`.)" msgstr "" -#: ../../whatsnew/3.11.rst:956 +#: ../../whatsnew/3.11.rst:948 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.11.rst:958 +#: ../../whatsnew/3.11.rst:950 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:962 +#: ../../whatsnew/3.11.rst:954 msgid "" "Collation name :meth:`~sqlite3.Connection.create_collation` can now contain " "any Unicode character. Collation names with invalid characters now raise :" @@ -1136,7 +1126,7 @@ msgid "" "(Contributed by Erlend E. Aasland in :issue:`44688`.)" msgstr "" -#: ../../whatsnew/3.11.rst:967 +#: ../../whatsnew/3.11.rst:959 msgid "" ":mod:`sqlite3` exceptions now include the SQLite extended error code as :" "attr:`~sqlite3.Error.sqlite_errorcode` and the SQLite error name as :attr:" @@ -1144,7 +1134,7 @@ msgid "" "Shahaf, and Erlend E. Aasland in :issue:`16379` and :issue:`24139`.)" msgstr "" -#: ../../whatsnew/3.11.rst:973 +#: ../../whatsnew/3.11.rst:965 msgid "" "Add :meth:`~sqlite3.Connection.setlimit` and :meth:`~sqlite3.Connection." "getlimit` to :class:`sqlite3.Connection` for setting and getting SQLite " @@ -1152,14 +1142,14 @@ msgid "" "`45243`.)" msgstr "" -#: ../../whatsnew/3.11.rst:978 +#: ../../whatsnew/3.11.rst:970 msgid "" ":mod:`sqlite3` now sets :attr:`sqlite3.threadsafety` based on the default " "threading mode the underlying SQLite library has been compiled with. " "(Contributed by Erlend E. Aasland in :issue:`45613`.)" msgstr "" -#: ../../whatsnew/3.11.rst:982 +#: ../../whatsnew/3.11.rst:974 msgid "" ":mod:`sqlite3` C callbacks now use unraisable exceptions if callback " "tracebacks are enabled. Users can now register an :func:`unraisable hook " @@ -1167,14 +1157,14 @@ msgid "" "(Contributed by Erlend E. Aasland in :issue:`45828`.)" msgstr "" -#: ../../whatsnew/3.11.rst:988 +#: ../../whatsnew/3.11.rst:980 msgid "" "Fetch across rollback no longer raises :exc:`~sqlite3.InterfaceError`. " "Instead we leave it to the SQLite library to handle these cases. " "(Contributed by Erlend E. Aasland in :issue:`44092`.)" msgstr "" -#: ../../whatsnew/3.11.rst:992 +#: ../../whatsnew/3.11.rst:984 msgid "" "Add :meth:`~sqlite3.Connection.serialize` and :meth:`~sqlite3.Connection." "deserialize` to :class:`sqlite3.Connection` for serializing and " @@ -1182,25 +1172,25 @@ msgid "" "`41930`.)" msgstr "" -#: ../../whatsnew/3.11.rst:997 +#: ../../whatsnew/3.11.rst:989 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1001 +#: ../../whatsnew/3.11.rst:993 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1009 +#: ../../whatsnew/3.11.rst:1001 msgid "string" msgstr "" -#: ../../whatsnew/3.11.rst:1011 +#: ../../whatsnew/3.11.rst:1003 msgid "" "Add :meth:`~string.Template.get_identifiers` and :meth:`~string.Template." "is_valid` to :class:`string.Template`, which respectively return all valid " @@ -1208,11 +1198,11 @@ msgid "" "by Ben Kehoe in :gh:`90465`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1021 +#: ../../whatsnew/3.11.rst:1013 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.11.rst:1023 +#: ../../whatsnew/3.11.rst:1015 msgid "" ":func:`sys.exc_info` now derives the ``type`` and ``traceback`` fields from " "the ``value`` (the exception instance), so when an exception is modified " @@ -1221,24 +1211,24 @@ msgid "" "issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1029 +#: ../../whatsnew/3.11.rst:1021 msgid "" "Add :func:`sys.exception` which returns the active exception instance " "(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel in :" "issue:`46328`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1033 +#: ../../whatsnew/3.11.rst:1025 msgid "" "Add the :data:`sys.flags.safe_path ` flag. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1040 +#: ../../whatsnew/3.11.rst:1032 msgid "sysconfig" msgstr "sysconfig" -#: ../../whatsnew/3.11.rst:1042 +#: ../../whatsnew/3.11.rst:1034 msgid "" "Three new :ref:`installation schemes ` (*posix_venv*, " "*nt_venv* and *venv*) were added and are used when Python creates new " @@ -1252,11 +1242,11 @@ msgid "" "(Contributed by Miro Hrončok in :issue:`45413`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1059 +#: ../../whatsnew/3.11.rst:1051 msgid "tempfile" msgstr "" -#: ../../whatsnew/3.11.rst:1061 +#: ../../whatsnew/3.11.rst:1053 msgid "" ":class:`~tempfile.SpooledTemporaryFile` objects now fully implement the " "methods of :class:`io.BufferedIOBase` or :class:`io.TextIOBase` (depending " @@ -1265,11 +1255,11 @@ msgid "" "`70363`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1072 +#: ../../whatsnew/3.11.rst:1064 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.11.rst:1074 +#: ../../whatsnew/3.11.rst:1066 msgid "" "On Unix, if the ``sem_clockwait()`` function is available in the C library " "(glibc 2.30 and newer), the :meth:`threading.Lock.acquire` method now uses " @@ -1279,11 +1269,11 @@ msgid "" "`41710`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1085 +#: ../../whatsnew/3.11.rst:1077 msgid "time" msgstr "time" -#: ../../whatsnew/3.11.rst:1087 +#: ../../whatsnew/3.11.rst:1079 msgid "" "On Unix, :func:`time.sleep` now uses the ``clock_nanosleep()`` or " "``nanosleep()`` function, if available, which has a resolution of 1 " @@ -1292,7 +1282,7 @@ msgid "" "Benjamin Szőke and Victor Stinner in :issue:`21302`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1093 +#: ../../whatsnew/3.11.rst:1085 msgid "" "On Windows 8.1 and newer, :func:`time.sleep` now uses a waitable timer based " "on `high-resolution timers `. " "(Contributed by Niklas Rosenstein in :gh:`85542`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1184 +#: ../../whatsnew/3.11.rst:1176 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1188 +#: ../../whatsnew/3.11.rst:1180 msgid "" ":func:`typing.get_type_hints` now supports evaluating bare stringified :data:" "`~typing.ClassVar` annotations. (Contributed by Gregory Beauregard in :gh:" "`90711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1192 +#: ../../whatsnew/3.11.rst:1184 msgid "" ":func:`typing.no_type_check` no longer modifies external classes and " "functions. It also now correctly marks classmethods as not to be type " "checked. (Contributed by Nikita Sobolev in :gh:`90729`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1200 +#: ../../whatsnew/3.11.rst:1192 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.11.rst:1202 +#: ../../whatsnew/3.11.rst:1194 msgid "" "The Unicode database has been updated to version 14.0.0. (Contributed by " "Benjamin Peterson in :issue:`45190`)." msgstr "" -#: ../../whatsnew/3.11.rst:1209 +#: ../../whatsnew/3.11.rst:1201 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.11.rst:1211 +#: ../../whatsnew/3.11.rst:1203 msgid "" "Added methods :meth:`~unittest.TestCase.enterContext` and :meth:`~unittest." "TestCase.enterClassContext` of class :class:`~unittest.TestCase`, method :" @@ -1466,11 +1456,11 @@ msgid "" "enterModuleContext`. (Contributed by Serhiy Storchaka in :issue:`45046`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1223 +#: ../../whatsnew/3.11.rst:1215 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.11.rst:1225 +#: ../../whatsnew/3.11.rst:1217 msgid "" "When new Python virtual environments are created, the *venv* :ref:`sysconfig " "installation scheme ` is used to determine the paths " @@ -1482,11 +1472,11 @@ msgid "" "`45413`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1239 +#: ../../whatsnew/3.11.rst:1231 msgid "warnings" msgstr "warnings" -#: ../../whatsnew/3.11.rst:1241 +#: ../../whatsnew/3.11.rst:1233 msgid "" ":func:`warnings.catch_warnings` now accepts arguments for :func:`warnings." "simplefilter`, providing a more concise way to locally ignore warnings or " @@ -1494,41 +1484,41 @@ msgid "" "`47074`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1249 +#: ../../whatsnew/3.11.rst:1241 msgid "zipfile" msgstr "zipfile" -#: ../../whatsnew/3.11.rst:1251 +#: ../../whatsnew/3.11.rst:1243 msgid "" "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 "" -#: ../../whatsnew/3.11.rst:1255 +#: ../../whatsnew/3.11.rst:1247 msgid "" "Added :meth:`ZipFile.mkdir() ` for creating new " "directories inside ZIP archives. (Contributed by Sam Ezeh in :gh:`49083`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1259 +#: ../../whatsnew/3.11.rst:1251 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1267 +#: ../../whatsnew/3.11.rst:1259 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.11.rst:1269 +#: ../../whatsnew/3.11.rst:1261 msgid "" "This section covers specific optimizations independent of the :ref:" "`whatsnew311-faster-cpython` project, which is covered in its own section." msgstr "" -#: ../../whatsnew/3.11.rst:1272 +#: ../../whatsnew/3.11.rst:1264 msgid "" "The compiler now optimizes simple :ref:`printf-style % formatting ` on string literals containing only the format codes " @@ -1536,7 +1526,7 @@ msgid "" "string` expression. (Contributed by Serhiy Storchaka in :issue:`28307`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1278 +#: ../../whatsnew/3.11.rst:1270 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 " @@ -1544,20 +1534,20 @@ msgid "" "gh:`90564`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1283 +#: ../../whatsnew/3.11.rst:1275 msgid "" ":func:`sum` is now nearly 30% faster for integers smaller than ``2**30``. " "(Contributed by Stefan Behnel in :gh:`68264`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1286 +#: ../../whatsnew/3.11.rst:1278 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1291 +#: ../../whatsnew/3.11.rst:1283 msgid "" "Dictionaries don't store hash values when all keys are Unicode objects, " "decreasing :class:`dict` size. For example, ``sys.getsizeof(dict." @@ -1565,21 +1555,21 @@ msgid "" "smaller) on 64-bit platforms. (Contributed by Inada Naoki in :issue:`46845`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1297 +#: ../../whatsnew/3.11.rst:1289 msgid "" "Using :class:`asyncio.DatagramProtocol` is now orders of magnitude faster " "when transferring large files over UDP, with speeds over 100 times higher " "for a ≈60 MiB file. (Contributed by msoxzw in :gh:`91487`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1302 +#: ../../whatsnew/3.11.rst:1294 msgid "" ":mod:`math` functions :func:`~math.comb` and :func:`~math.perm` are now ≈10 " "times faster for large arguments (with a larger speedup for larger *k*). " "(Contributed by Serhiy Storchaka in :issue:`37295`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1306 +#: ../../whatsnew/3.11.rst:1298 msgid "" "The :mod:`statistics` functions :func:`~statistics.mean`, :func:`~statistics." "variance` and :func:`~statistics.stdev` now consume iterators in one pass " @@ -1588,17 +1578,17 @@ msgid "" "`90415`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1312 +#: ../../whatsnew/3.11.rst:1304 msgid "" ":func:`unicodedata.normalize` now normalizes pure-ASCII strings in constant " "time. (Contributed by Dong-hee Na in :issue:`44987`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1320 +#: ../../whatsnew/3.11.rst:1312 msgid "Faster CPython" msgstr "" -#: ../../whatsnew/3.11.rst:1322 +#: ../../whatsnew/3.11.rst:1314 msgid "" "CPython 3.11 is an average of `25% faster `_ than CPython 3.10 as measured with the " @@ -1607,32 +1597,32 @@ msgid "" "overall speedup could be 10-60%." msgstr "" -#: ../../whatsnew/3.11.rst:1329 +#: ../../whatsnew/3.11.rst:1321 msgid "" "This project focuses on two major areas in Python: :ref:`whatsnew311-faster-" "startup` and :ref:`whatsnew311-faster-runtime`. Optimizations not covered by " "this project are listed separately under :ref:`whatsnew311-optimizations`." msgstr "" -#: ../../whatsnew/3.11.rst:1338 +#: ../../whatsnew/3.11.rst:1330 msgid "Faster Startup" msgstr "" -#: ../../whatsnew/3.11.rst:1343 +#: ../../whatsnew/3.11.rst:1335 msgid "Frozen imports / Static code objects" msgstr "" -#: ../../whatsnew/3.11.rst:1345 +#: ../../whatsnew/3.11.rst:1337 msgid "" "Python caches :term:`bytecode` in the :ref:`__pycache__ ` " "directory to speed up module loading." msgstr "" -#: ../../whatsnew/3.11.rst:1348 +#: ../../whatsnew/3.11.rst:1340 msgid "Previously in 3.10, Python module execution looked like this:" msgstr "" -#: ../../whatsnew/3.11.rst:1354 +#: ../../whatsnew/3.11.rst:1346 msgid "" "In Python 3.11, the core modules essential for Python startup are " "\"frozen\". This means that their :ref:`codeobjects` (and bytecode) are " @@ -1640,47 +1630,47 @@ msgid "" "execution process to:" msgstr "" -#: ../../whatsnew/3.11.rst:1363 +#: ../../whatsnew/3.11.rst:1355 msgid "" "Interpreter startup is now 10-15% faster in Python 3.11. This has a big " "impact for short-running programs using Python." msgstr "" -#: ../../whatsnew/3.11.rst:1366 +#: ../../whatsnew/3.11.rst:1358 msgid "" "(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in many issues.)" msgstr "" -#: ../../whatsnew/3.11.rst:1372 +#: ../../whatsnew/3.11.rst:1364 msgid "Faster Runtime" msgstr "" -#: ../../whatsnew/3.11.rst:1377 +#: ../../whatsnew/3.11.rst:1369 msgid "Cheaper, lazy Python frames" msgstr "" -#: ../../whatsnew/3.11.rst:1379 +#: ../../whatsnew/3.11.rst:1371 msgid "" "Python frames, holding execution information, are created whenever Python " "calls a Python function. The following are new frame optimizations:" msgstr "" -#: ../../whatsnew/3.11.rst:1383 +#: ../../whatsnew/3.11.rst:1375 msgid "Streamlined the frame creation process." msgstr "" -#: ../../whatsnew/3.11.rst:1384 +#: ../../whatsnew/3.11.rst:1376 msgid "" "Avoided memory allocation by generously re-using frame space on the C stack." msgstr "" -#: ../../whatsnew/3.11.rst:1385 +#: ../../whatsnew/3.11.rst:1377 msgid "" "Streamlined the internal frame struct to contain only essential information. " "Frames previously held extra debugging and memory management information." msgstr "" -#: ../../whatsnew/3.11.rst:1388 +#: ../../whatsnew/3.11.rst:1380 msgid "" "Old-style :ref:`frame objects ` are now created only when " "requested by debuggers or by Python introspection functions such as :func:" @@ -1690,29 +1680,29 @@ msgid "" "pyperformance." msgstr "" -#: ../../whatsnew/3.11.rst:1395 +#: ../../whatsnew/3.11.rst:1387 msgid "(Contributed by Mark Shannon in :issue:`44590`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1402 +#: ../../whatsnew/3.11.rst:1394 msgid "Inlined Python function calls" msgstr "" -#: ../../whatsnew/3.11.rst:1404 +#: ../../whatsnew/3.11.rst:1396 msgid "" "During a Python function call, Python will call an evaluating C function to " "interpret that function's code. This effectively limits pure Python " "recursion to what's safe for the C stack." msgstr "" -#: ../../whatsnew/3.11.rst:1408 +#: ../../whatsnew/3.11.rst:1400 msgid "" "In 3.11, when CPython detects Python code calling another Python function, " "it sets up a new frame, and \"jumps\" to the new code inside the new frame. " "This avoids calling the C interpreting function altogether." msgstr "" -#: ../../whatsnew/3.11.rst:1412 +#: ../../whatsnew/3.11.rst:1404 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 " @@ -1721,15 +1711,15 @@ msgid "" "setrecursionlimit`). We measured a 1-3% improvement in pyperformance." msgstr "" -#: ../../whatsnew/3.11.rst:1419 +#: ../../whatsnew/3.11.rst:1411 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1425 +#: ../../whatsnew/3.11.rst:1417 msgid "PEP 659: Specializing Adaptive Interpreter" msgstr "" -#: ../../whatsnew/3.11.rst:1427 +#: ../../whatsnew/3.11.rst:1419 msgid "" ":pep:`659` is one of the key parts of the Faster CPython project. The " "general idea is that while Python is a dynamic language, most code has " @@ -1737,7 +1727,7 @@ msgid "" "*type stability*." msgstr "" -#: ../../whatsnew/3.11.rst:1431 +#: ../../whatsnew/3.11.rst:1423 msgid "" "At runtime, Python will try to look for common patterns and type stability " "in the executing code. Python will then replace the current operation with a " @@ -1748,13 +1738,13 @@ msgid "" "term:`bytecode`." msgstr "" -#: ../../whatsnew/3.11.rst:1439 +#: ../../whatsnew/3.11.rst:1431 msgid "" "The specializer will also combine certain common instruction pairs into one " "superinstruction, reducing the overhead during execution." msgstr "" -#: ../../whatsnew/3.11.rst:1442 +#: ../../whatsnew/3.11.rst:1434 msgid "" "Python will only specialize when it sees code that is \"hot\" (executed " "multiple times). This prevents Python from wasting time on run-once code. " @@ -1764,280 +1754,280 @@ msgid "" "circumstances." msgstr "" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1441 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.)" msgstr "" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1449 msgid "Operation" msgstr "" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1449 msgid "Form" msgstr "" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1449 msgid "Specialization" msgstr "" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1449 msgid "Operation speedup (up to)" msgstr "" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1449 msgid "Contributor(s)" msgstr "" -#: ../../whatsnew/3.11.rst:1460 +#: ../../whatsnew/3.11.rst:1452 msgid "Binary operations" msgstr "" -#: ../../whatsnew/3.11.rst:1460 +#: ../../whatsnew/3.11.rst:1452 msgid "``x + x``" msgstr "" -#: ../../whatsnew/3.11.rst:1462 +#: ../../whatsnew/3.11.rst:1454 msgid "``x - x``" msgstr "" -#: ../../whatsnew/3.11.rst:1464 +#: ../../whatsnew/3.11.rst:1456 msgid "``x * x``" msgstr "" -#: ../../whatsnew/3.11.rst:1460 +#: ../../whatsnew/3.11.rst:1452 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." msgstr "" -#: ../../whatsnew/3.11.rst:1460 +#: ../../whatsnew/3.11.rst:1452 msgid "10%" msgstr "10%" -#: ../../whatsnew/3.11.rst:1460 +#: ../../whatsnew/3.11.rst:1452 msgid "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" msgstr "" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1458 msgid "Subscript" msgstr "" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1458 msgid "``a[i]``" msgstr "``a[i]``" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1458 msgid "" "Subscripting container types such as :class:`list`, :class:`tuple` and :" "class:`dict` directly index the underlying data structures." msgstr "" -#: ../../whatsnew/3.11.rst:1470 +#: ../../whatsnew/3.11.rst:1462 msgid "" "Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" "ref:`inline-calls`." msgstr "" -#: ../../whatsnew/3.11.rst:1466 ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1458 ../../whatsnew/3.11.rst:1465 msgid "10-25%" msgstr "10-25%" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1458 msgid "Irit Katriel, Mark Shannon" msgstr "Irit Katriel, Mark Shannon" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1465 msgid "Store subscript" msgstr "" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1465 msgid "``a[i] = z``" msgstr "``a[i] = z``" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1465 msgid "Similar to subscripting specialization above." msgstr "" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1465 msgid "Dennis Sweeney" msgstr "Dennis Sweeney" -#: ../../whatsnew/3.11.rst:1476 +#: ../../whatsnew/3.11.rst:1468 msgid "Calls" msgstr "" -#: ../../whatsnew/3.11.rst:1476 +#: ../../whatsnew/3.11.rst:1468 msgid "``f(arg)``" msgstr "" -#: ../../whatsnew/3.11.rst:1478 +#: ../../whatsnew/3.11.rst:1470 msgid "``C(arg)``" msgstr "" -#: ../../whatsnew/3.11.rst:1476 +#: ../../whatsnew/3.11.rst:1468 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 " "through the internal calling convention." msgstr "" -#: ../../whatsnew/3.11.rst:1476 +#: ../../whatsnew/3.11.rst:1468 msgid "20%" msgstr "20%" -#: ../../whatsnew/3.11.rst:1476 +#: ../../whatsnew/3.11.rst:1468 msgid "Mark Shannon, Ken Jin" msgstr "Mark Shannon, Ken Jin" -#: ../../whatsnew/3.11.rst:1481 +#: ../../whatsnew/3.11.rst:1473 msgid "Load global variable" msgstr "" -#: ../../whatsnew/3.11.rst:1481 +#: ../../whatsnew/3.11.rst:1473 msgid "``print``" msgstr "" -#: ../../whatsnew/3.11.rst:1483 +#: ../../whatsnew/3.11.rst:1475 msgid "``len``" msgstr "" -#: ../../whatsnew/3.11.rst:1481 +#: ../../whatsnew/3.11.rst:1473 msgid "" "The object's index in the globals/builtins namespace is cached. Loading " "globals and builtins require zero namespace lookups." msgstr "" -#: ../../whatsnew/3.11.rst:1481 +#: ../../whatsnew/3.11.rst:1473 msgid "[#load-global]_" msgstr "" -#: ../../whatsnew/3.11.rst:1481 ../../whatsnew/3.11.rst:1485 -#: ../../whatsnew/3.11.rst:1494 +#: ../../whatsnew/3.11.rst:1473 ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1486 msgid "Mark Shannon" msgstr "Mark Shannon" -#: ../../whatsnew/3.11.rst:1485 +#: ../../whatsnew/3.11.rst:1477 msgid "Load attribute" msgstr "" -#: ../../whatsnew/3.11.rst:1485 +#: ../../whatsnew/3.11.rst:1477 msgid "``o.attr``" msgstr "``o.attr``" -#: ../../whatsnew/3.11.rst:1485 +#: ../../whatsnew/3.11.rst:1477 msgid "" "Similar to loading global variables. The attribute's index inside the class/" "object's namespace is cached. In most cases, attribute loading will require " "zero namespace lookups." msgstr "" -#: ../../whatsnew/3.11.rst:1485 +#: ../../whatsnew/3.11.rst:1477 msgid "[#load-attr]_" msgstr "" -#: ../../whatsnew/3.11.rst:1490 +#: ../../whatsnew/3.11.rst:1482 msgid "Load methods for call" msgstr "" -#: ../../whatsnew/3.11.rst:1490 +#: ../../whatsnew/3.11.rst:1482 msgid "``o.meth()``" msgstr "``o.meth()``" -#: ../../whatsnew/3.11.rst:1490 +#: ../../whatsnew/3.11.rst:1482 msgid "" "The actual address of the method is cached. Method loading now has no " "namespace lookups -- even for classes with long inheritance chains." msgstr "" -#: ../../whatsnew/3.11.rst:1490 +#: ../../whatsnew/3.11.rst:1482 msgid "10-20%" msgstr "10-20%" -#: ../../whatsnew/3.11.rst:1490 +#: ../../whatsnew/3.11.rst:1482 msgid "Ken Jin, Mark Shannon" msgstr "Ken Jin, Mark Shannon" -#: ../../whatsnew/3.11.rst:1494 +#: ../../whatsnew/3.11.rst:1486 msgid "Store attribute" msgstr "" -#: ../../whatsnew/3.11.rst:1494 +#: ../../whatsnew/3.11.rst:1486 msgid "``o.attr = z``" msgstr "``o.attr = z``" -#: ../../whatsnew/3.11.rst:1494 +#: ../../whatsnew/3.11.rst:1486 msgid "Similar to load attribute optimization." msgstr "" -#: ../../whatsnew/3.11.rst:1494 +#: ../../whatsnew/3.11.rst:1486 msgid "2% in pyperformance" msgstr "" -#: ../../whatsnew/3.11.rst:1497 +#: ../../whatsnew/3.11.rst:1489 msgid "Unpack Sequence" msgstr "" -#: ../../whatsnew/3.11.rst:1497 +#: ../../whatsnew/3.11.rst:1489 msgid "``*seq``" msgstr "``*seq``" -#: ../../whatsnew/3.11.rst:1497 +#: ../../whatsnew/3.11.rst:1489 msgid "" "Specialized for common containers such as :class:`list` and :class:`tuple`. " "Avoids internal calling convention." msgstr "" -#: ../../whatsnew/3.11.rst:1497 +#: ../../whatsnew/3.11.rst:1489 msgid "8%" msgstr "8%" -#: ../../whatsnew/3.11.rst:1497 +#: ../../whatsnew/3.11.rst:1489 msgid "Brandt Bucher" msgstr "" -#: ../../whatsnew/3.11.rst:1502 +#: ../../whatsnew/3.11.rst:1494 msgid "" "A similar optimization already existed since Python 3.8. 3.11 specializes " "for more forms and reduces some overhead." msgstr "" -#: ../../whatsnew/3.11.rst:1505 +#: ../../whatsnew/3.11.rst:1497 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`." msgstr "" -#: ../../whatsnew/3.11.rst:1513 +#: ../../whatsnew/3.11.rst:1505 msgid "Misc" msgstr "" -#: ../../whatsnew/3.11.rst:1515 +#: ../../whatsnew/3.11.rst:1507 msgid "" "Objects now require less memory due to lazily created object namespaces. " "Their namespace dictionaries now also share keys more freely. (Contributed " "Mark Shannon in :issue:`45340` and :issue:`40116`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1519 +#: ../../whatsnew/3.11.rst:1511 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1523 +#: ../../whatsnew/3.11.rst:1515 msgid "" "A more concise representation of exceptions in the interpreter reduced the " "time required for catching an exception by about 10%. (Contributed by Irit " "Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1527 +#: ../../whatsnew/3.11.rst:1519 msgid "" ":mod:`re`'s regular expression matching engine has been partially " "refactored, and now uses computed gotos (or \"threaded code\") on supported " @@ -2047,37 +2037,37 @@ msgid "" "Bucher in :gh:`91404`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1538 +#: ../../whatsnew/3.11.rst:1530 msgid "FAQ" msgstr "" -#: ../../whatsnew/3.11.rst:1543 +#: ../../whatsnew/3.11.rst:1535 msgid "How should I write my code to utilize these speedups?" msgstr "" -#: ../../whatsnew/3.11.rst:1545 +#: ../../whatsnew/3.11.rst:1537 msgid "" "Write Pythonic code that follows common best practices; you don't have to " "change your code. The Faster CPython project optimizes for common code " "patterns we observe." msgstr "" -#: ../../whatsnew/3.11.rst:1553 +#: ../../whatsnew/3.11.rst:1545 msgid "Will CPython 3.11 use more memory?" msgstr "" -#: ../../whatsnew/3.11.rst:1555 +#: ../../whatsnew/3.11.rst:1547 msgid "" "Maybe not; we don't expect memory use to exceed 20% higher than 3.10. This " "is offset by memory optimizations for frame objects and object dictionaries " "as mentioned above." msgstr "" -#: ../../whatsnew/3.11.rst:1563 +#: ../../whatsnew/3.11.rst:1555 msgid "I don't see any speedups in my workload. Why?" msgstr "" -#: ../../whatsnew/3.11.rst:1565 +#: ../../whatsnew/3.11.rst:1557 msgid "" "Certain code won't have noticeable benefits. If your code spends most of its " "time on I/O operations, or already does most of its computation in a C " @@ -2085,26 +2075,26 @@ msgid "" "project currently benefits pure-Python workloads the most." msgstr "" -#: ../../whatsnew/3.11.rst:1570 +#: ../../whatsnew/3.11.rst:1562 msgid "" "Furthermore, the pyperformance figures are a geometric mean. Even within the " "pyperformance benchmarks, certain benchmarks have slowed down slightly, " "while others have sped up by nearly 2x!" msgstr "" -#: ../../whatsnew/3.11.rst:1578 +#: ../../whatsnew/3.11.rst:1570 msgid "Is there a JIT compiler?" msgstr "" -#: ../../whatsnew/3.11.rst:1580 +#: ../../whatsnew/3.11.rst:1572 msgid "No. We're still exploring other optimizations." msgstr "" -#: ../../whatsnew/3.11.rst:1586 +#: ../../whatsnew/3.11.rst:1578 msgid "About" msgstr "" -#: ../../whatsnew/3.11.rst:1588 +#: ../../whatsnew/3.11.rst:1580 msgid "" "Faster CPython explores optimizations for :term:`CPython`. The main team is " "funded by Microsoft to work on this full-time. Pablo Galindo Salgado is also " @@ -2112,11 +2102,11 @@ msgid "" "contributors are volunteers from the community." msgstr "" -#: ../../whatsnew/3.11.rst:1597 +#: ../../whatsnew/3.11.rst:1589 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.11.rst:1599 +#: ../../whatsnew/3.11.rst:1591 msgid "" "The bytecode now contains inline cache entries, which take the form of the " "newly-added :opcode:`CACHE` instructions. Many opcodes expect to be followed " @@ -2126,62 +2116,62 @@ msgid "" "containing quickened data." msgstr "" -#: ../../whatsnew/3.11.rst:1611 +#: ../../whatsnew/3.11.rst:1603 msgid "New opcodes" msgstr "" -#: ../../whatsnew/3.11.rst:1613 +#: ../../whatsnew/3.11.rst:1605 msgid "" ":opcode:`ASYNC_GEN_WRAP`, :opcode:`RETURN_GENERATOR` and :opcode:`SEND`, " "used in generators and co-routines." msgstr "" -#: ../../whatsnew/3.11.rst:1616 +#: ../../whatsnew/3.11.rst:1608 msgid "" ":opcode:`COPY_FREE_VARS`, which avoids needing special caller-side code for " "closures." msgstr "" -#: ../../whatsnew/3.11.rst:1619 +#: ../../whatsnew/3.11.rst:1611 msgid "" ":opcode:`JUMP_BACKWARD_NO_INTERRUPT`, for use in certain loops where " "handling interrupts is undesirable." msgstr "" -#: ../../whatsnew/3.11.rst:1622 +#: ../../whatsnew/3.11.rst:1614 msgid ":opcode:`MAKE_CELL`, to create :ref:`cell-objects`." msgstr "" -#: ../../whatsnew/3.11.rst:1624 +#: ../../whatsnew/3.11.rst:1616 msgid "" ":opcode:`CHECK_EG_MATCH` and :opcode:`PREP_RERAISE_STAR`, to handle the :" "ref:`new exception groups and except* ` added in :pep:" "`654`." msgstr "" -#: ../../whatsnew/3.11.rst:1628 +#: ../../whatsnew/3.11.rst:1620 msgid ":opcode:`PUSH_EXC_INFO`, for use in exception handlers." msgstr "" -#: ../../whatsnew/3.11.rst:1630 +#: ../../whatsnew/3.11.rst:1622 msgid "" ":opcode:`RESUME`, a no-op, for internal tracing, debugging and optimization " "checks." msgstr "" -#: ../../whatsnew/3.11.rst:1637 +#: ../../whatsnew/3.11.rst:1629 msgid "Replaced opcodes" msgstr "" -#: ../../whatsnew/3.11.rst:1640 +#: ../../whatsnew/3.11.rst:1632 msgid "Replaced Opcode(s)" msgstr "" -#: ../../whatsnew/3.11.rst:1640 +#: ../../whatsnew/3.11.rst:1632 msgid "New Opcode(s)" msgstr "" -#: ../../whatsnew/3.11.rst:1640 +#: ../../whatsnew/3.11.rst:1632 msgid "Notes" msgstr "" @@ -2193,11 +2183,11 @@ msgstr "" msgid ":opcode:`!INPLACE_*`" msgstr "" -#: ../../whatsnew/3.11.rst:1642 +#: ../../whatsnew/3.11.rst:1634 msgid ":opcode:`BINARY_OP`" msgstr "" -#: ../../whatsnew/3.11.rst:1642 +#: ../../whatsnew/3.11.rst:1634 msgid "Replaced all numeric binary/in-place opcodes with a single opcode" msgstr "" @@ -2229,7 +2219,7 @@ msgstr "" msgid ":opcode:`PUSH_NULL`" msgstr "" -#: ../../whatsnew/3.11.rst:1645 +#: ../../whatsnew/3.11.rst:1637 msgid "" "Decouples argument shifting for methods from handling of keyword arguments; " "allows better specialization of calls" @@ -2267,7 +2257,7 @@ msgstr "" msgid ":opcode:`SWAP`" msgstr "" -#: ../../whatsnew/3.11.rst:1650 +#: ../../whatsnew/3.11.rst:1642 msgid "Stack manipulation instructions" msgstr "" @@ -2279,7 +2269,7 @@ msgstr "" msgid ":opcode:`CHECK_EXC_MATCH`" msgstr "" -#: ../../whatsnew/3.11.rst:1657 +#: ../../whatsnew/3.11.rst:1649 msgid "Now performs check but doesn't jump" msgstr "" @@ -2307,7 +2297,7 @@ msgstr "" msgid ":opcode:`POP_JUMP_FORWARD_IF_* `" msgstr "" -#: ../../whatsnew/3.11.rst:1659 +#: ../../whatsnew/3.11.rst:1651 msgid "" "See [#bytecode-jump]_; ``TRUE``, ``FALSE``, ``NONE`` and ``NOT_NONE`` " "variants for each direction" @@ -2321,64 +2311,64 @@ msgstr "" msgid ":opcode:`!SETUP_ASYNC_WITH`" msgstr "" -#: ../../whatsnew/3.11.rst:1665 +#: ../../whatsnew/3.11.rst:1657 msgid ":opcode:`BEFORE_WITH`" msgstr "" -#: ../../whatsnew/3.11.rst:1665 +#: ../../whatsnew/3.11.rst:1657 msgid ":keyword:`with` block setup" msgstr "" -#: ../../whatsnew/3.11.rst:1669 +#: ../../whatsnew/3.11.rst:1661 msgid "" "All jump opcodes are now relative, including the existing :opcode:" "`JUMP_IF_TRUE_OR_POP` and :opcode:`JUMP_IF_FALSE_OR_POP`. The argument is " "now an offset from the current instruction rather than an absolute location." msgstr "" -#: ../../whatsnew/3.11.rst:1680 +#: ../../whatsnew/3.11.rst:1672 msgid "Changed/removed opcodes" msgstr "" -#: ../../whatsnew/3.11.rst:1682 +#: ../../whatsnew/3.11.rst:1674 msgid "" "Changed :opcode:`MATCH_CLASS` and :opcode:`MATCH_KEYS` to no longer push an " "additional boolean value to indicate success/failure. Instead, ``None`` is " "pushed on failure in place of the tuple of extracted values." msgstr "" -#: ../../whatsnew/3.11.rst:1687 +#: ../../whatsnew/3.11.rst:1679 msgid "" "Changed opcodes that work with exceptions to reflect them now being " "represented as one item on the stack instead of three (see :gh:`89874`)." msgstr "" -#: ../../whatsnew/3.11.rst:1691 +#: ../../whatsnew/3.11.rst:1683 msgid "" "Removed :opcode:`!COPY_DICT_WITHOUT_KEYS`, :opcode:`!GEN_START`, :opcode:`!" "POP_BLOCK`, :opcode:`!SETUP_FINALLY` and :opcode:`!YIELD_FROM`." msgstr "" -#: ../../whatsnew/3.11.rst:1699 ../../whatsnew/3.11.rst:2567 +#: ../../whatsnew/3.11.rst:1691 ../../whatsnew/3.11.rst:2559 msgid "Deprecated" msgstr "" -#: ../../whatsnew/3.11.rst:1701 +#: ../../whatsnew/3.11.rst:1693 msgid "" "This section lists Python APIs that have been deprecated in Python 3.11." msgstr "" -#: ../../whatsnew/3.11.rst:1703 +#: ../../whatsnew/3.11.rst:1695 msgid "" "Deprecated C APIs are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:1710 +#: ../../whatsnew/3.11.rst:1702 msgid "Language/Builtins" msgstr "" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1704 msgid "" "Chaining :class:`classmethod` descriptors (introduced in :issue:`19072`) is " "now deprecated. It can no longer be used to wrap other descriptors such as :" @@ -2388,7 +2378,7 @@ msgid "" "3.10. (Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1720 +#: ../../whatsnew/3.11.rst:1712 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 " @@ -2396,7 +2386,7 @@ msgid "" "`SyntaxError`. (Contributed by Serhiy Storchaka in :gh:`81548`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1726 +#: ../../whatsnew/3.11.rst:1718 msgid "" "The delegation of :func:`int` to :meth:`~object.__trunc__` is now " "deprecated. Calling ``int(a)`` when ``type(a)`` implements :meth:`!" @@ -2405,99 +2395,99 @@ msgid "" "`44977`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1728 msgid "Modules" msgstr "" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1732 msgid "" ":pep:`594` led to the deprecations of the following modules slated for " "removal in Python 3.13:" msgstr "" -#: ../../whatsnew/3.11.rst:1744 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.11.rst:1744 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.11.rst:1744 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.11.rst:1744 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.11.rst:1744 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.11.rst:1746 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.11.rst:1746 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.11.rst:1746 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.11.rst:1746 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.11.rst:1746 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.11.rst:1748 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.11.rst:1748 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.11.rst:1748 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.11.rst:1748 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.11.rst:1748 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.11.rst:1750 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.11.rst:1750 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.11.rst:1750 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.11.rst:1750 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.11.rst:1753 +#: ../../whatsnew/3.11.rst:1745 msgid "" "(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:" "`68966`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1756 +#: ../../whatsnew/3.11.rst:1748 msgid "" "The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been " "deprecated since at least Python 3.6. Their documentation and deprecation " @@ -2505,7 +2495,7 @@ msgid "" "(Contributed by Hugo van Kemenade in :issue:`47022`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1761 +#: ../../whatsnew/3.11.rst:1753 msgid "" "The :mod:`lib2to3` package and :ref:`2to3 <2to3-reference>` tool are now " "deprecated and may not be able to parse Python 3.10 or newer. See :pep:" @@ -2513,41 +2503,41 @@ msgid "" "Stinner in :issue:`40360`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1766 +#: ../../whatsnew/3.11.rst:1758 msgid "" "Undocumented modules :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!" "sre_parse` are now deprecated. (Contributed by Serhiy Storchaka in :issue:" "`47152`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1774 +#: ../../whatsnew/3.11.rst:1766 msgid "Standard Library" msgstr "" -#: ../../whatsnew/3.11.rst:1776 +#: ../../whatsnew/3.11.rst:1768 msgid "" "The following have been deprecated in :mod:`configparser` since Python 3.2. " "Their deprecation warnings have now been updated to note they will be " "removed in Python 3.12:" msgstr "" -#: ../../whatsnew/3.11.rst:1780 +#: ../../whatsnew/3.11.rst:1772 msgid "the :class:`!configparser.SafeConfigParser` class" msgstr "" -#: ../../whatsnew/3.11.rst:1781 +#: ../../whatsnew/3.11.rst:1773 msgid "the :attr:`!configparser.ParsingError.filename` property" msgstr "" -#: ../../whatsnew/3.11.rst:1782 +#: ../../whatsnew/3.11.rst:1774 msgid "the :meth:`configparser.RawConfigParser.readfp` method" msgstr ":meth:`configparser.RawConfigParser.readfp` 方法" -#: ../../whatsnew/3.11.rst:1784 +#: ../../whatsnew/3.11.rst:1776 msgid "(Contributed by Hugo van Kemenade in :issue:`45173`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1786 +#: ../../whatsnew/3.11.rst:1778 msgid "" ":class:`!configparser.LegacyInterpolation` has been deprecated in the " "docstring since Python 3.2, and is not listed in the :mod:`configparser` " @@ -2557,7 +2547,7 @@ msgid "" "Kemenade in :issue:`46607`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1793 +#: ../../whatsnew/3.11.rst:1785 msgid "" "The older set of :mod:`importlib.resources` functions were deprecated in " "favor of the replacements added in Python 3.9 and will be removed in a " @@ -2565,35 +2555,35 @@ msgid "" "package subdirectories:" msgstr "" -#: ../../whatsnew/3.11.rst:1798 +#: ../../whatsnew/3.11.rst:1790 msgid ":func:`importlib.resources.contents`" msgstr "" -#: ../../whatsnew/3.11.rst:1799 +#: ../../whatsnew/3.11.rst:1791 msgid ":func:`importlib.resources.is_resource`" msgstr "" -#: ../../whatsnew/3.11.rst:1800 +#: ../../whatsnew/3.11.rst:1792 msgid ":func:`importlib.resources.open_binary`" msgstr "" -#: ../../whatsnew/3.11.rst:1801 +#: ../../whatsnew/3.11.rst:1793 msgid ":func:`importlib.resources.open_text`" msgstr "" -#: ../../whatsnew/3.11.rst:1802 +#: ../../whatsnew/3.11.rst:1794 msgid ":func:`importlib.resources.read_binary`" msgstr "" -#: ../../whatsnew/3.11.rst:1803 +#: ../../whatsnew/3.11.rst:1795 msgid ":func:`importlib.resources.read_text`" msgstr "" -#: ../../whatsnew/3.11.rst:1804 +#: ../../whatsnew/3.11.rst:1796 msgid ":func:`importlib.resources.path`" msgstr "" -#: ../../whatsnew/3.11.rst:1806 +#: ../../whatsnew/3.11.rst:1798 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " "removed in Python 3.13. Use :func:`locale.setlocale`, :func:`locale." @@ -2601,14 +2591,14 @@ msgid "" "getlocale` functions instead. (Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1812 +#: ../../whatsnew/3.11.rst:1804 msgid "" "The :func:`locale.resetlocale` function is deprecated and will be removed in " "Python 3.13. Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. " "(Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1816 +#: ../../whatsnew/3.11.rst:1808 msgid "" "Stricter rules will now be applied for numerical group references and group " "names in :ref:`regular expressions `. Only sequences of ASCII " @@ -2619,7 +2609,7 @@ msgid "" "`91760`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1824 +#: ../../whatsnew/3.11.rst:1816 msgid "" "In the :mod:`re` module, the :func:`!re.template` function and the " "corresponding :data:`!re.TEMPLATE` and :data:`!re.T` flags are deprecated, " @@ -2628,7 +2618,7 @@ msgid "" "in :gh:`92728`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1830 +#: ../../whatsnew/3.11.rst:1822 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:" @@ -2637,7 +2627,7 @@ msgid "" "issue:`45837`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1836 +#: ../../whatsnew/3.11.rst:1828 msgid "" ":class:`typing.Text`, which exists solely to provide compatibility support " "between Python 2 and Python 3 code, is now deprecated. Its removal is " @@ -2645,345 +2635,345 @@ msgid "" "wherever possible. (Contributed by Alex Waygood in :gh:`92332`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1842 +#: ../../whatsnew/3.11.rst:1834 msgid "" "The keyword argument syntax for constructing :data:`typing.TypedDict` types " "is now deprecated. Support will be removed in Python 3.13. (Contributed by " "Jingchen Ye in :gh:`90224`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1846 +#: ../../whatsnew/3.11.rst:1838 msgid "" ":class:`!webbrowser.MacOSX` is deprecated and will be removed in Python " "3.13. It is untested, undocumented, and not used by :mod:`webbrowser` " "itself. (Contributed by Dong-hee Na in :issue:`42255`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1850 +#: ../../whatsnew/3.11.rst:1842 msgid "" "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 "" -#: ../../whatsnew/3.11.rst:1854 +#: ../../whatsnew/3.11.rst:1846 msgid "" "Deprecated the following not-formally-documented :mod:`unittest` functions, " "scheduled for removal in Python 3.13:" msgstr "" -#: ../../whatsnew/3.11.rst:1857 +#: ../../whatsnew/3.11.rst:1849 msgid ":func:`!unittest.findTestCases`" msgstr "" -#: ../../whatsnew/3.11.rst:1858 +#: ../../whatsnew/3.11.rst:1850 msgid ":func:`!unittest.makeSuite`" msgstr "" -#: ../../whatsnew/3.11.rst:1859 +#: ../../whatsnew/3.11.rst:1851 msgid ":func:`!unittest.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.11.rst:1861 +#: ../../whatsnew/3.11.rst:1853 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.11.rst:1863 +#: ../../whatsnew/3.11.rst:1855 msgid ":meth:`unittest.TestLoader.loadTestsFromModule`" msgstr ":meth:`unittest.TestLoader.loadTestsFromModule`" -#: ../../whatsnew/3.11.rst:1864 +#: ../../whatsnew/3.11.rst:1856 msgid ":meth:`unittest.TestLoader.loadTestsFromTestCase`" msgstr ":meth:`unittest.TestLoader.loadTestsFromTestCase`" -#: ../../whatsnew/3.11.rst:1865 +#: ../../whatsnew/3.11.rst:1857 msgid ":meth:`unittest.TestLoader.getTestCaseNames`" msgstr ":meth:`unittest.TestLoader.getTestCaseNames`" -#: ../../whatsnew/3.11.rst:1867 +#: ../../whatsnew/3.11.rst:1859 msgid "(Contributed by Erlend E. Aasland in :issue:`5846`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1874 ../../whatsnew/3.11.rst:2595 +#: ../../whatsnew/3.11.rst:1866 ../../whatsnew/3.11.rst:2587 msgid "Pending Removal in Python 3.12" msgstr "" -#: ../../whatsnew/3.11.rst:1876 +#: ../../whatsnew/3.11.rst:1868 msgid "" "The following Python APIs have been deprecated in earlier Python releases, " "and will be removed in Python 3.12." msgstr "" -#: ../../whatsnew/3.11.rst:1879 +#: ../../whatsnew/3.11.rst:1871 msgid "" "C APIs pending removal are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1874 msgid "The :mod:`asynchat` module" msgstr "" -#: ../../whatsnew/3.11.rst:1883 +#: ../../whatsnew/3.11.rst:1875 msgid "The :mod:`asyncore` module" msgstr "" -#: ../../whatsnew/3.11.rst:1884 +#: ../../whatsnew/3.11.rst:1876 msgid "The :ref:`entire distutils package `" msgstr "" -#: ../../whatsnew/3.11.rst:1885 +#: ../../whatsnew/3.11.rst:1877 msgid "The :mod:`imp` module" msgstr "" -#: ../../whatsnew/3.11.rst:1886 +#: ../../whatsnew/3.11.rst:1878 msgid "The :class:`typing.io ` namespace" msgstr "" -#: ../../whatsnew/3.11.rst:1887 +#: ../../whatsnew/3.11.rst:1879 msgid "The :class:`typing.re ` namespace" msgstr "" -#: ../../whatsnew/3.11.rst:1888 +#: ../../whatsnew/3.11.rst:1880 msgid ":func:`!cgi.log`" msgstr "" -#: ../../whatsnew/3.11.rst:1889 +#: ../../whatsnew/3.11.rst:1881 msgid ":func:`importlib.find_loader`" msgstr ":func:`importlib.find_loader`" -#: ../../whatsnew/3.11.rst:1890 +#: ../../whatsnew/3.11.rst:1882 msgid ":meth:`importlib.abc.Loader.module_repr`" msgstr ":meth:`importlib.abc.Loader.module_repr`" -#: ../../whatsnew/3.11.rst:1891 +#: ../../whatsnew/3.11.rst:1883 msgid ":meth:`importlib.abc.MetaPathFinder.find_module`" msgstr ":meth:`importlib.abc.MetaPathFinder.find_module`" -#: ../../whatsnew/3.11.rst:1892 +#: ../../whatsnew/3.11.rst:1884 msgid ":meth:`importlib.abc.PathEntryFinder.find_loader`" msgstr ":meth:`importlib.abc.PathEntryFinder.find_loader`" -#: ../../whatsnew/3.11.rst:1893 +#: ../../whatsnew/3.11.rst:1885 msgid ":meth:`importlib.abc.PathEntryFinder.find_module`" msgstr ":meth:`importlib.abc.PathEntryFinder.find_module`" -#: ../../whatsnew/3.11.rst:1894 +#: ../../whatsnew/3.11.rst:1886 msgid ":meth:`!importlib.machinery.BuiltinImporter.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1895 +#: ../../whatsnew/3.11.rst:1887 msgid ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" msgstr "" -#: ../../whatsnew/3.11.rst:1896 +#: ../../whatsnew/3.11.rst:1888 msgid ":meth:`!importlib.machinery.FileFinder.find_loader`" msgstr "" -#: ../../whatsnew/3.11.rst:1897 +#: ../../whatsnew/3.11.rst:1889 msgid ":meth:`!importlib.machinery.FileFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1898 +#: ../../whatsnew/3.11.rst:1890 msgid ":meth:`!importlib.machinery.FrozenImporter.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1899 +#: ../../whatsnew/3.11.rst:1891 msgid ":meth:`!importlib.machinery.FrozenLoader.module_repr`" msgstr "" -#: ../../whatsnew/3.11.rst:1900 +#: ../../whatsnew/3.11.rst:1892 msgid ":meth:`importlib.machinery.PathFinder.find_module`" msgstr ":meth:`importlib.machinery.PathFinder.find_module`" -#: ../../whatsnew/3.11.rst:1901 +#: ../../whatsnew/3.11.rst:1893 msgid ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1902 +#: ../../whatsnew/3.11.rst:1894 msgid ":func:`importlib.util.module_for_loader`" msgstr ":func:`importlib.util.module_for_loader`" -#: ../../whatsnew/3.11.rst:1903 +#: ../../whatsnew/3.11.rst:1895 msgid ":func:`!importlib.util.set_loader_wrapper`" msgstr "" -#: ../../whatsnew/3.11.rst:1904 +#: ../../whatsnew/3.11.rst:1896 msgid ":func:`!importlib.util.set_package_wrapper`" msgstr "" -#: ../../whatsnew/3.11.rst:1905 +#: ../../whatsnew/3.11.rst:1897 msgid ":class:`pkgutil.ImpImporter`" msgstr ":class:`pkgutil.ImpImporter`" -#: ../../whatsnew/3.11.rst:1906 +#: ../../whatsnew/3.11.rst:1898 msgid ":class:`pkgutil.ImpLoader`" msgstr ":class:`pkgutil.ImpLoader`" -#: ../../whatsnew/3.11.rst:1907 +#: ../../whatsnew/3.11.rst:1899 msgid ":meth:`pathlib.Path.link_to`" msgstr ":meth:`pathlib.Path.link_to`" -#: ../../whatsnew/3.11.rst:1908 +#: ../../whatsnew/3.11.rst:1900 msgid ":func:`!sqlite3.enable_shared_cache`" msgstr "" -#: ../../whatsnew/3.11.rst:1909 +#: ../../whatsnew/3.11.rst:1901 msgid ":func:`!sqlite3.OptimizedUnicode`" msgstr "" -#: ../../whatsnew/3.11.rst:1910 +#: ../../whatsnew/3.11.rst:1902 msgid ":envvar:`PYTHONTHREADDEBUG` environment variable" msgstr "" -#: ../../whatsnew/3.11.rst:1911 +#: ../../whatsnew/3.11.rst:1903 msgid "The following deprecated aliases in :mod:`unittest`:" msgstr "" -#: ../../whatsnew/3.11.rst:1914 +#: ../../whatsnew/3.11.rst:1906 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.11.rst:1914 +#: ../../whatsnew/3.11.rst:1906 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.11.rst:1914 +#: ../../whatsnew/3.11.rst:1906 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1908 msgid "``failUnless``" msgstr "" -#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1908 ../../whatsnew/3.11.rst:1915 msgid ":meth:`.assertTrue`" msgstr "" -#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1917 -#: ../../whatsnew/3.11.rst:1918 ../../whatsnew/3.11.rst:1919 -#: ../../whatsnew/3.11.rst:1920 ../../whatsnew/3.11.rst:1921 -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1908 ../../whatsnew/3.11.rst:1909 +#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1911 +#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1913 +#: ../../whatsnew/3.11.rst:1914 msgid "3.1" msgstr "" -#: ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1909 msgid "``failIf``" msgstr "" -#: ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1909 msgid ":meth:`.assertFalse`" msgstr "" -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1910 msgid "``failUnlessEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1918 ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1916 msgid ":meth:`.assertEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1911 msgid "``failIfEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1919 ../../whatsnew/3.11.rst:1925 +#: ../../whatsnew/3.11.rst:1911 ../../whatsnew/3.11.rst:1917 msgid ":meth:`.assertNotEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1912 msgid "``failUnlessAlmostEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1920 ../../whatsnew/3.11.rst:1926 +#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1918 msgid ":meth:`.assertAlmostEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1913 msgid "``failIfAlmostEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1921 ../../whatsnew/3.11.rst:1927 +#: ../../whatsnew/3.11.rst:1913 ../../whatsnew/3.11.rst:1919 msgid ":meth:`.assertNotAlmostEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1914 msgid "``failUnlessRaises``" msgstr "" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1914 msgid ":meth:`.assertRaises`" msgstr "" -#: ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1915 msgid "``assert_``" msgstr "" -#: ../../whatsnew/3.11.rst:1923 ../../whatsnew/3.11.rst:1924 -#: ../../whatsnew/3.11.rst:1925 ../../whatsnew/3.11.rst:1926 -#: ../../whatsnew/3.11.rst:1927 ../../whatsnew/3.11.rst:1928 -#: ../../whatsnew/3.11.rst:1929 +#: ../../whatsnew/3.11.rst:1915 ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1917 ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1919 ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1921 msgid "3.2" msgstr "" -#: ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1916 msgid "``assertEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1925 +#: ../../whatsnew/3.11.rst:1917 msgid "``assertNotEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1926 +#: ../../whatsnew/3.11.rst:1918 msgid "``assertAlmostEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1927 +#: ../../whatsnew/3.11.rst:1919 msgid "``assertNotAlmostEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1928 +#: ../../whatsnew/3.11.rst:1920 msgid "``assertRegexpMatches``" msgstr "" -#: ../../whatsnew/3.11.rst:1928 +#: ../../whatsnew/3.11.rst:1920 msgid ":meth:`.assertRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1929 +#: ../../whatsnew/3.11.rst:1921 msgid "``assertRaisesRegexp``" msgstr "" -#: ../../whatsnew/3.11.rst:1929 +#: ../../whatsnew/3.11.rst:1921 msgid ":meth:`.assertRaisesRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1930 +#: ../../whatsnew/3.11.rst:1922 msgid "``assertNotRegexpMatches``" msgstr "" -#: ../../whatsnew/3.11.rst:1930 +#: ../../whatsnew/3.11.rst:1922 msgid ":meth:`.assertNotRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1930 +#: ../../whatsnew/3.11.rst:1922 msgid "3.5" msgstr "" -#: ../../whatsnew/3.11.rst:1937 ../../whatsnew/3.11.rst:2621 +#: ../../whatsnew/3.11.rst:1929 ../../whatsnew/3.11.rst:2613 msgid "Removed" msgstr "" -#: ../../whatsnew/3.11.rst:1939 +#: ../../whatsnew/3.11.rst:1931 msgid "This section lists Python APIs that have been removed in Python 3.11." msgstr "" -#: ../../whatsnew/3.11.rst:1941 +#: ../../whatsnew/3.11.rst:1933 msgid "" "Removed C APIs are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:1943 +#: ../../whatsnew/3.11.rst:1935 msgid "" "Removed the :func:`!@asyncio.coroutine` :term:`decorator` enabling legacy " "generator-based coroutines to be compatible with :keyword:`async` / :keyword:" @@ -2992,14 +2982,14 @@ msgid "" "instead. (Contributed by Illia Volochii in :issue:`43216`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1950 +#: ../../whatsnew/3.11.rst:1942 msgid "" "Removed :class:`!asyncio.coroutines.CoroWrapper` used for wrapping legacy " "generator-based coroutine objects in the debug mode. (Contributed by Illia " "Volochii in :issue:`43216`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1954 +#: ../../whatsnew/3.11.rst:1946 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is now " @@ -3008,44 +2998,44 @@ msgid "" "`45129`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1960 +#: ../../whatsnew/3.11.rst:1952 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" msgstr "" -#: ../../whatsnew/3.11.rst:1963 +#: ../../whatsnew/3.11.rst:1955 msgid ":func:`!binascii.a2b_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1964 +#: ../../whatsnew/3.11.rst:1956 msgid ":func:`!binascii.b2a_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1965 +#: ../../whatsnew/3.11.rst:1957 msgid ":func:`!binascii.rlecode_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1966 +#: ../../whatsnew/3.11.rst:1958 msgid ":func:`!binascii.rldecode_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1968 +#: ../../whatsnew/3.11.rst:1960 msgid "The :func:`binascii.crc_hqx` function remains available." msgstr "" -#: ../../whatsnew/3.11.rst:1970 +#: ../../whatsnew/3.11.rst:1962 msgid "(Contributed by Victor Stinner in :issue:`45085`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1972 +#: ../../whatsnew/3.11.rst:1964 msgid "" "Removed the :mod:`distutils` ``bdist_msi`` command deprecated in Python 3.9. " "Use ``bdist_wheel`` (wheel packages) instead. (Contributed by Hugo van " "Kemenade in :issue:`45124`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1976 +#: ../../whatsnew/3.11.rst:1968 msgid "" "Removed the :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." "DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." @@ -3053,7 +3043,7 @@ msgid "" "in :issue:`45132`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1981 +#: ../../whatsnew/3.11.rst:1973 msgid "" "Removed the deprecated :mod:`gettext` functions :func:`!lgettext`, :func:`!" "ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed the :" @@ -3064,62 +3054,62 @@ msgid "" "by Dong-hee Na and Serhiy Storchaka in :issue:`44235`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1991 +#: ../../whatsnew/3.11.rst:1983 msgid "Removed from the :mod:`inspect` module:" msgstr "" -#: ../../whatsnew/3.11.rst:1993 +#: ../../whatsnew/3.11.rst:1985 msgid "" "The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" "`inspect.signature` or :func:`inspect.getfullargspec` instead." msgstr "" -#: ../../whatsnew/3.11.rst:1996 +#: ../../whatsnew/3.11.rst:1988 msgid "" "The :func:`!formatargspec` function, deprecated since Python 3.5; use the :" "func:`inspect.signature` function or the :class:`inspect.Signature` object " "directly." msgstr "" -#: ../../whatsnew/3.11.rst:2000 +#: ../../whatsnew/3.11.rst:1992 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." msgstr "" -#: ../../whatsnew/3.11.rst:2005 +#: ../../whatsnew/3.11.rst:1997 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2007 +#: ../../whatsnew/3.11.rst:1999 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2012 +#: ../../whatsnew/3.11.rst:2004 msgid "" "Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " "Dong-hee Na in :issue:`35800`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2016 +#: ../../whatsnew/3.11.rst:2008 msgid "" "Removed the deprecated :meth:`!split` method of :class:`!_tkinter." "TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2019 +#: ../../whatsnew/3.11.rst:2011 msgid "" "Removed namespace package support from :mod:`unittest` discovery. It was " "introduced in Python 3.4 but has been broken since Python 3.7. (Contributed " "by Inada Naoki in :issue:`23882`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2023 +#: ../../whatsnew/3.11.rst:2015 msgid "" "Removed the undocumented private :meth:`!float.__set_format__()` method, " "previously known as :meth:`!float.__setformat__()` in Python 3.7. Its " @@ -3128,14 +3118,14 @@ msgid "" "in :issue:`46852`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2029 +#: ../../whatsnew/3.11.rst:2021 msgid "" "The :option:`!--experimental-isolated-subinterpreters` configure flag (and " "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " "been removed." msgstr "" -#: ../../whatsnew/3.11.rst:2033 +#: ../../whatsnew/3.11.rst:2025 msgid "" "`Pynche `_ --- The Pythonically Natural " "Color and Hue Editor --- has been moved out of ``Tools/scripts`` and is " @@ -3143,23 +3133,23 @@ msgid "" "main>`_ from the Python source tree." msgstr "" -#: ../../whatsnew/3.11.rst:2043 ../../whatsnew/3.11.rst:2265 +#: ../../whatsnew/3.11.rst:2035 ../../whatsnew/3.11.rst:2257 msgid "Porting to Python 3.11" msgstr "" -#: ../../whatsnew/3.11.rst:2045 +#: ../../whatsnew/3.11.rst:2037 msgid "" "This section lists previously described changes and other bugfixes in the " "Python API that may require changes to your Python code." msgstr "" -#: ../../whatsnew/3.11.rst:2048 +#: ../../whatsnew/3.11.rst:2040 msgid "" "Porting notes for the C API are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:2051 +#: ../../whatsnew/3.11.rst:2043 msgid "" ":func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput." "FileInput` no longer accept ``'U'`` (\"universal newline\") in the file " @@ -3170,7 +3160,7 @@ msgid "" "Stinner in :issue:`37330`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2060 +#: ../../whatsnew/3.11.rst:2052 msgid "" ":class:`ast.AST` node positions are now validated when provided to :func:" "`compile` and other related functions. If invalid positions are detected, a :" @@ -3178,14 +3168,14 @@ msgid "" "`93351`)" msgstr "" -#: ../../whatsnew/3.11.rst:2064 +#: ../../whatsnew/3.11.rst:2056 msgid "" "Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor` " "executors to :meth:`asyncio.loop.set_default_executor` following a " "deprecation in Python 3.8. (Contributed by Illia Volochii in :issue:`43234`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2069 +#: ../../whatsnew/3.11.rst:2061 msgid "" ":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:" "`calendar.LocaleHTMLCalendar` classes now use :func:`locale.getlocale`, " @@ -3193,14 +3183,14 @@ msgid "" "(Contributed by Victor Stinner in :issue:`46659`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2075 +#: ../../whatsnew/3.11.rst:2067 msgid "" "The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with " "the ``'UTF-8'`` encoding. (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ " "రెడ్డి తాటిపర్తి) in :issue:`41137`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2079 +#: ../../whatsnew/3.11.rst:2071 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 " @@ -3209,14 +3199,14 @@ msgid "" "`40465`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2085 +#: ../../whatsnew/3.11.rst:2077 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." msgstr "" -#: ../../whatsnew/3.11.rst:2089 +#: ../../whatsnew/3.11.rst:2081 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 " @@ -3224,7 +3214,7 @@ msgid "" "`47066`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2094 +#: ../../whatsnew/3.11.rst:2086 msgid "" "In the :mod:`re` module, several long-standing bugs where fixed that, in " "rare cases, could cause capture groups to get the wrong result. Therefore, " @@ -3232,11 +3222,11 @@ msgid "" "in :issue:`35859`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2103 +#: ../../whatsnew/3.11.rst:2095 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.11.rst:2105 +#: ../../whatsnew/3.11.rst:2097 msgid "" "CPython now has :pep:`11` :pep:`Tier 3 support <11#tier-3>` for cross " "compiling to the `WebAssembly `_ platforms " @@ -3251,11 +3241,11 @@ msgid "" "gh:`90473`; platforms promoted in :gh:`95085`)" msgstr "" -#: ../../whatsnew/3.11.rst:2119 +#: ../../whatsnew/3.11.rst:2111 msgid "Building CPython now requires:" msgstr "" -#: ../../whatsnew/3.11.rst:2121 +#: ../../whatsnew/3.11.rst:2113 msgid "" "A `C11 `_ compiler and standard library. " "`Optional C11 features `_ floating " "point numbers. (Contributed by Victor Stinner in :issue:`46917`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2132 +#: ../../whatsnew/3.11.rst:2124 msgid "" "The :c:macro:`!Py_NO_NAN` macro has been removed. Since CPython now requires " "IEEE 754 floats, NaN values are always available. (Contributed by Victor " "Stinner in :issue:`46656`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2136 +#: ../../whatsnew/3.11.rst:2128 msgid "" "The :mod:`tkinter` package now requires `Tcl/Tk `_ " "version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2140 +#: ../../whatsnew/3.11.rst:2132 msgid "" "Build dependencies, compiler flags, and linker flags for most stdlib " "extension modules are now detected by :program:`configure`. libffi, libnsl, " @@ -3295,13 +3285,13 @@ msgid "" "`45847`, :issue:`45747`, and :issue:`45763`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2150 +#: ../../whatsnew/3.11.rst:2142 msgid "" "libpython is no longer linked against libcrypt. (Contributed by Mike Gilbert " "in :issue:`45433`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2153 +#: ../../whatsnew/3.11.rst:2145 msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " @@ -3309,7 +3299,7 @@ msgid "" "`44340`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2158 +#: ../../whatsnew/3.11.rst:2150 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " "option :option:`!--without-freelists` can be used to disable all freelists " @@ -3317,7 +3307,7 @@ msgid "" "`45522`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2163 +#: ../../whatsnew/3.11.rst:2155 msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " @@ -3326,7 +3316,7 @@ msgid "" "`45570`, :issue:`45571`, and :issue:`43974`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2170 +#: ../../whatsnew/3.11.rst:2162 msgid "" "Use the environment variables :envvar:`!TCLTK_CFLAGS` and :envvar:`!" "TCLTK_LIBS` to manually specify the location of Tcl/Tk headers and " @@ -3334,7 +3324,7 @@ msgid "" "and :option:`!--with-tcltk-libs` have been removed." msgstr "" -#: ../../whatsnew/3.11.rst:2176 +#: ../../whatsnew/3.11.rst:2168 msgid "" "On RHEL 7 and CentOS 7 the development packages do not provide ``tcl.pc`` " "and ``tk.pc``; use ``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``. The " @@ -3342,7 +3332,7 @@ msgid "" "build Python with RHEL 7's and CentOS 7's Tcl/Tk and OpenSSL." msgstr "" -#: ../../whatsnew/3.11.rst:2181 +#: ../../whatsnew/3.11.rst:2173 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 " @@ -3354,23 +3344,23 @@ msgid "" "in :issue:`45569`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2194 +#: ../../whatsnew/3.11.rst:2186 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.11.rst:2201 +#: ../../whatsnew/3.11.rst:2193 msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2204 +#: ../../whatsnew/3.11.rst:2196 msgid "" "Add a new :c:func:`PyType_GetQualName` function to get type's qualified " "name. (Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2207 +#: ../../whatsnew/3.11.rst:2199 msgid "" "Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " @@ -3378,78 +3368,78 @@ msgid "" "`43760`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2212 +#: ../../whatsnew/3.11.rst:2204 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2216 +#: ../../whatsnew/3.11.rst:2208 msgid "" ":c:type:`Py_buffer` and APIs are now part of the limited API and the stable " "ABI:" msgstr "" -#: ../../whatsnew/3.11.rst:2219 +#: ../../whatsnew/3.11.rst:2211 msgid ":c:func:`PyObject_CheckBuffer`" msgstr ":c:func:`PyObject_CheckBuffer`" -#: ../../whatsnew/3.11.rst:2220 +#: ../../whatsnew/3.11.rst:2212 msgid ":c:func:`PyObject_GetBuffer`" msgstr ":c:func:`PyObject_GetBuffer`" -#: ../../whatsnew/3.11.rst:2221 +#: ../../whatsnew/3.11.rst:2213 msgid ":c:func:`PyBuffer_GetPointer`" msgstr ":c:func:`PyBuffer_GetPointer`" -#: ../../whatsnew/3.11.rst:2222 +#: ../../whatsnew/3.11.rst:2214 msgid ":c:func:`PyBuffer_SizeFromFormat`" msgstr ":c:func:`PyBuffer_SizeFromFormat`" -#: ../../whatsnew/3.11.rst:2223 +#: ../../whatsnew/3.11.rst:2215 msgid ":c:func:`PyBuffer_ToContiguous`" msgstr ":c:func:`PyBuffer_ToContiguous`" -#: ../../whatsnew/3.11.rst:2224 +#: ../../whatsnew/3.11.rst:2216 msgid ":c:func:`PyBuffer_FromContiguous`" msgstr ":c:func:`PyBuffer_FromContiguous`" -#: ../../whatsnew/3.11.rst:2225 +#: ../../whatsnew/3.11.rst:2217 msgid ":c:func:`PyBuffer_CopyData`" msgstr ":c:func:`PyBuffer_CopyData`" -#: ../../whatsnew/3.11.rst:2226 +#: ../../whatsnew/3.11.rst:2218 msgid ":c:func:`PyBuffer_IsContiguous`" msgstr ":c:func:`PyBuffer_IsContiguous`" -#: ../../whatsnew/3.11.rst:2227 +#: ../../whatsnew/3.11.rst:2219 msgid ":c:func:`PyBuffer_FillContiguousStrides`" msgstr ":c:func:`PyBuffer_FillContiguousStrides`" -#: ../../whatsnew/3.11.rst:2228 +#: ../../whatsnew/3.11.rst:2220 msgid ":c:func:`PyBuffer_FillInfo`" msgstr ":c:func:`PyBuffer_FillInfo`" -#: ../../whatsnew/3.11.rst:2229 +#: ../../whatsnew/3.11.rst:2221 msgid ":c:func:`PyBuffer_Release`" msgstr ":c:func:`PyBuffer_Release`" -#: ../../whatsnew/3.11.rst:2230 +#: ../../whatsnew/3.11.rst:2222 msgid ":c:func:`PyMemoryView_FromBuffer`" msgstr ":c:func:`PyMemoryView_FromBuffer`" -#: ../../whatsnew/3.11.rst:2231 +#: ../../whatsnew/3.11.rst:2223 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` type slots" msgstr "" -#: ../../whatsnew/3.11.rst:2234 +#: ../../whatsnew/3.11.rst:2226 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2236 +#: ../../whatsnew/3.11.rst:2228 msgid "" "Added the :c:data:`PyType_GetModuleByDef` function, used to get the module " "in which a method was defined, in cases where this information is not " @@ -3457,7 +3447,7 @@ msgid "" "in :issue:`46613`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2241 +#: ../../whatsnew/3.11.rst:2233 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:" @@ -3465,14 +3455,14 @@ msgid "" "`PyFloat_Unpack8`. (Contributed by Victor Stinner in :issue:`46906`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2247 +#: ../../whatsnew/3.11.rst:2239 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`." msgstr "" -#: ../../whatsnew/3.11.rst:2251 +#: ../../whatsnew/3.11.rst:2243 msgid "" "Added two new functions to get and set the active exception instance: :c:" "func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " @@ -3481,13 +3471,13 @@ msgid "" "exceptions. (Contributed by Irit Katriel in :issue:`46343`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2258 +#: ../../whatsnew/3.11.rst:2250 msgid "" "Added the :c:member:`PyConfig.safe_path` member. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2269 +#: ../../whatsnew/3.11.rst:2261 msgid "" "Some macros have been converted to static inline functions to avoid `macro " "pitfalls `_. The " @@ -3499,7 +3489,7 @@ msgid "" "Stinner and Erlend E. Aasland in :gh:`89653`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2280 +#: ../../whatsnew/3.11.rst:2272 msgid "" ":c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback`` " "arguments, the interpreter now derives those values from the exception " @@ -3507,14 +3497,14 @@ msgid "" "all three arguments. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2286 +#: ../../whatsnew/3.11.rst:2278 msgid "" ":c:func:`PyErr_GetExcInfo()` now derives the ``type`` and ``traceback`` " "fields of the result from the exception instance (the ``value`` field). " "(Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2290 +#: ../../whatsnew/3.11.rst:2282 msgid "" ":c:struct:`_frozen` has a new ``is_package`` field to indicate whether or " "not the frozen module is a package. Previously, a negative value in the " @@ -3522,14 +3512,14 @@ msgid "" "``size``. (Contributed by Kumar Aditya in :issue:`46608`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2296 +#: ../../whatsnew/3.11.rst:2288 msgid "" ":c:func:`_PyFrameEvalFunction` now takes ``_PyInterpreterFrame*`` as its " "second parameter, instead of ``PyFrameObject*``. See :pep:`523` for more " "details of how to use this function pointer type." msgstr "" -#: ../../whatsnew/3.11.rst:2300 +#: ../../whatsnew/3.11.rst:2292 msgid "" ":c:func:`PyCode_New` and :c:func:`PyCode_NewWithPosOnlyArgs` now take an " "additional ``exception_table`` argument. Using these functions should be " @@ -3538,7 +3528,7 @@ msgid "" "method." msgstr "" -#: ../../whatsnew/3.11.rst:2306 +#: ../../whatsnew/3.11.rst:2298 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " "``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" @@ -3548,35 +3538,35 @@ msgid "" "and :gh:`94936`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2314 +#: ../../whatsnew/3.11.rst:2306 msgid "" "The old trashcan macros (``Py_TRASHCAN_SAFE_BEGIN``/" "``Py_TRASHCAN_SAFE_END``) are now deprecated. They should be replaced by the " "new macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.11.rst:2318 +#: ../../whatsnew/3.11.rst:2310 msgid "A tp_dealloc function that has the old macros, such as::" msgstr "" -#: ../../whatsnew/3.11.rst:2329 +#: ../../whatsnew/3.11.rst:2321 msgid "should migrate to the new macros as follows::" msgstr "" -#: ../../whatsnew/3.11.rst:2340 +#: ../../whatsnew/3.11.rst:2332 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in." msgstr "" -#: ../../whatsnew/3.11.rst:2343 +#: ../../whatsnew/3.11.rst:2335 msgid "" "To support older Python versions in the same codebase, you can define the " "following macros and use them throughout the code (credit: these were copied " "from the ``mypy`` codebase)::" msgstr "" -#: ../../whatsnew/3.11.rst:2355 +#: ../../whatsnew/3.11.rst:2347 msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " "with the :const:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function (:" @@ -3584,7 +3574,7 @@ msgid "" "issue:`44263`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2360 +#: ../../whatsnew/3.11.rst:2352 msgid "" "Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " "the :pep:`590` vectorcall protocol. Previously, this was only possible for :" @@ -3592,7 +3582,7 @@ msgid "" "issue:`43908`)" msgstr "" -#: ../../whatsnew/3.11.rst:2365 +#: ../../whatsnew/3.11.rst:2357 msgid "" "Since :c:func:`Py_TYPE()` is changed to a inline static function, " "``Py_TYPE(obj) = new_type`` must be replaced with ``Py_SET_TYPE(obj, " @@ -3600,11 +3590,11 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.11.rst:2377 ../../whatsnew/3.11.rst:2391 +#: ../../whatsnew/3.11.rst:2369 ../../whatsnew/3.11.rst:2383 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2379 +#: ../../whatsnew/3.11.rst:2371 msgid "" "Since :c:func:`Py_SIZE()` is changed to a inline static function, " "``Py_SIZE(obj) = new_size`` must be replaced with ``Py_SET_SIZE(obj, " @@ -3612,7 +3602,7 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.11.rst:2393 +#: ../../whatsnew/3.11.rst:2385 msgid "" "```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " @@ -3621,7 +3611,7 @@ msgid "" "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2399 +#: ../../whatsnew/3.11.rst:2391 msgid "" "The non-limited API files ``cellobject.h``, ``classobject.h``, ``code.h``, " "``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have " @@ -3632,7 +3622,7 @@ msgid "" "instead. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2407 +#: ../../whatsnew/3.11.rst:2399 msgid "" "The :c:func:`PyUnicode_CHECK_INTERNED` macro has been excluded from the " "limited C API. It was never usable there, because it used internal " @@ -3640,149 +3630,149 @@ msgid "" "Victor Stinner in :issue:`46007`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2412 +#: ../../whatsnew/3.11.rst:2404 msgid "" "The following frame functions and type are now directly available with " "``#include ``, it's no longer needed to add ``#include " "``:" msgstr "" -#: ../../whatsnew/3.11.rst:2416 +#: ../../whatsnew/3.11.rst:2408 msgid ":c:func:`PyFrame_Check`" msgstr ":c:func:`PyFrame_Check`" -#: ../../whatsnew/3.11.rst:2417 +#: ../../whatsnew/3.11.rst:2409 msgid ":c:func:`PyFrame_GetBack`" msgstr ":c:func:`PyFrame_GetBack`" -#: ../../whatsnew/3.11.rst:2418 +#: ../../whatsnew/3.11.rst:2410 msgid ":c:func:`PyFrame_GetBuiltins`" msgstr ":c:func:`PyFrame_GetBuiltins`" -#: ../../whatsnew/3.11.rst:2419 +#: ../../whatsnew/3.11.rst:2411 msgid ":c:func:`PyFrame_GetGenerator`" msgstr ":c:func:`PyFrame_GetGenerator`" -#: ../../whatsnew/3.11.rst:2420 +#: ../../whatsnew/3.11.rst:2412 msgid ":c:func:`PyFrame_GetGlobals`" msgstr ":c:func:`PyFrame_GetGlobals`" -#: ../../whatsnew/3.11.rst:2421 +#: ../../whatsnew/3.11.rst:2413 msgid ":c:func:`PyFrame_GetLasti`" msgstr ":c:func:`PyFrame_GetLasti`" -#: ../../whatsnew/3.11.rst:2422 +#: ../../whatsnew/3.11.rst:2414 msgid ":c:func:`PyFrame_GetLocals`" msgstr ":c:func:`PyFrame_GetLocals`" -#: ../../whatsnew/3.11.rst:2423 +#: ../../whatsnew/3.11.rst:2415 msgid ":c:type:`PyFrame_Type`" msgstr ":c:type:`PyFrame_Type`" -#: ../../whatsnew/3.11.rst:2425 +#: ../../whatsnew/3.11.rst:2417 msgid "(Contributed by Victor Stinner in :gh:`93937`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2429 +#: ../../whatsnew/3.11.rst:2421 msgid "" "The :c:type:`PyFrameObject` structure members have been removed from the " "public C API." msgstr "" -#: ../../whatsnew/3.11.rst:2432 +#: ../../whatsnew/3.11.rst:2424 msgid "" "While the documentation notes that the :c:type:`PyFrameObject` fields are " "subject to change at any time, they have been stable for a long time and " "were used in several popular extensions." msgstr "" -#: ../../whatsnew/3.11.rst:2436 +#: ../../whatsnew/3.11.rst:2428 msgid "" "In Python 3.11, the frame struct was reorganized to allow performance " "optimizations. Some fields were removed entirely, as they were details of " "the old implementation." msgstr "" -#: ../../whatsnew/3.11.rst:2440 +#: ../../whatsnew/3.11.rst:2432 msgid ":c:type:`PyFrameObject` fields:" msgstr "" -#: ../../whatsnew/3.11.rst:2442 +#: ../../whatsnew/3.11.rst:2434 msgid "``f_back``: use :c:func:`PyFrame_GetBack`." msgstr "" -#: ../../whatsnew/3.11.rst:2443 +#: ../../whatsnew/3.11.rst:2435 msgid "``f_blockstack``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2444 +#: ../../whatsnew/3.11.rst:2436 msgid "``f_builtins``: use :c:func:`PyFrame_GetBuiltins`." msgstr "" -#: ../../whatsnew/3.11.rst:2445 +#: ../../whatsnew/3.11.rst:2437 msgid "``f_code``: use :c:func:`PyFrame_GetCode`." msgstr "" -#: ../../whatsnew/3.11.rst:2446 +#: ../../whatsnew/3.11.rst:2438 msgid "``f_gen``: use :c:func:`PyFrame_GetGenerator`." msgstr "" -#: ../../whatsnew/3.11.rst:2447 +#: ../../whatsnew/3.11.rst:2439 msgid "``f_globals``: use :c:func:`PyFrame_GetGlobals`." msgstr "" -#: ../../whatsnew/3.11.rst:2448 +#: ../../whatsnew/3.11.rst:2440 msgid "``f_iblock``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2449 +#: ../../whatsnew/3.11.rst:2441 msgid "" "``f_lasti``: use :c:func:`PyFrame_GetLasti`. Code using ``f_lasti`` with " "``PyCode_Addr2Line()`` should use :c:func:`PyFrame_GetLineNumber` instead; " "it may be faster." msgstr "" -#: ../../whatsnew/3.11.rst:2452 +#: ../../whatsnew/3.11.rst:2444 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" msgstr "" -#: ../../whatsnew/3.11.rst:2453 +#: ../../whatsnew/3.11.rst:2445 msgid "``f_locals``: use :c:func:`PyFrame_GetLocals`." msgstr "" -#: ../../whatsnew/3.11.rst:2454 +#: ../../whatsnew/3.11.rst:2446 msgid "``f_stackdepth``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2455 +#: ../../whatsnew/3.11.rst:2447 msgid "``f_state``: no public API (renamed to ``f_frame.f_state``)." msgstr "" -#: ../../whatsnew/3.11.rst:2456 +#: ../../whatsnew/3.11.rst:2448 msgid "``f_trace``: no public API." msgstr "" -#: ../../whatsnew/3.11.rst:2457 +#: ../../whatsnew/3.11.rst:2449 msgid "" "``f_trace_lines``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_lines\")``." msgstr "" -#: ../../whatsnew/3.11.rst:2458 +#: ../../whatsnew/3.11.rst:2450 msgid "" "``f_trace_opcodes``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_opcodes\")``." msgstr "" -#: ../../whatsnew/3.11.rst:2459 +#: ../../whatsnew/3.11.rst:2451 msgid "``f_localsplus``: no public API (renamed to ``f_frame.localsplus``)." msgstr "" -#: ../../whatsnew/3.11.rst:2460 +#: ../../whatsnew/3.11.rst:2452 msgid "``f_valuestack``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2462 +#: ../../whatsnew/3.11.rst:2454 msgid "" "The Python frame object is now created lazily. A side effect is that the " "``f_back`` member must not be accessed directly, since its value is now also " @@ -3790,7 +3780,7 @@ msgid "" "instead." msgstr "" -#: ../../whatsnew/3.11.rst:2467 +#: ../../whatsnew/3.11.rst:2459 msgid "" "Debuggers that accessed the ``f_locals`` directly *must* call :c:func:" "`PyFrame_GetLocals` instead. They no longer need to call :c:func:" @@ -3799,71 +3789,71 @@ msgid "" "now managed by the virtual machine." msgstr "" -#: ../../whatsnew/3.11.rst:2473 +#: ../../whatsnew/3.11.rst:2465 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2483 +#: ../../whatsnew/3.11.rst:2475 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2493 +#: ../../whatsnew/3.11.rst:2485 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." msgstr "" -#: ../../whatsnew/3.11.rst:2497 +#: ../../whatsnew/3.11.rst:2489 msgid "Changes of the :c:type:`PyThreadState` structure members:" msgstr "" -#: ../../whatsnew/3.11.rst:2499 +#: ../../whatsnew/3.11.rst:2491 msgid "" "``frame``: removed, use :c:func:`PyThreadState_GetFrame` (function added to " "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " "reference`, need to call :c:func:`Py_XDECREF`." msgstr "" -#: ../../whatsnew/3.11.rst:2503 +#: ../../whatsnew/3.11.rst:2495 msgid "" "``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" "`43760`)." msgstr "" -#: ../../whatsnew/3.11.rst:2506 +#: ../../whatsnew/3.11.rst:2498 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." msgstr "" -#: ../../whatsnew/3.11.rst:2508 +#: ../../whatsnew/3.11.rst:2500 msgid "``stackcheck_counter``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2510 +#: ../../whatsnew/3.11.rst:2502 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2520 +#: ../../whatsnew/3.11.rst:2512 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2546 +#: ../../whatsnew/3.11.rst:2538 msgid "" "Or use `the pythoncapi_compat project `__ to get these functions on old Python functions." msgstr "" -#: ../../whatsnew/3.11.rst:2550 +#: ../../whatsnew/3.11.rst:2542 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." msgstr "" -#: ../../whatsnew/3.11.rst:2553 +#: ../../whatsnew/3.11.rst:2545 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to 1 " "for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -3871,7 +3861,7 @@ msgid "" "path and replace any values added to ``module_search_paths``." msgstr "" -#: ../../whatsnew/3.11.rst:2558 +#: ../../whatsnew/3.11.rst:2550 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 " @@ -3880,177 +3870,177 @@ msgid "" "object and modify it directly." msgstr "" -#: ../../whatsnew/3.11.rst:2569 +#: ../../whatsnew/3.11.rst:2561 msgid "" "Deprecate the following functions to configure the Python initialization:" msgstr "" -#: ../../whatsnew/3.11.rst:2571 +#: ../../whatsnew/3.11.rst:2563 msgid ":c:func:`PySys_AddWarnOptionUnicode`" msgstr ":c:func:`PySys_AddWarnOptionUnicode`" -#: ../../whatsnew/3.11.rst:2572 +#: ../../whatsnew/3.11.rst:2564 msgid ":c:func:`PySys_AddWarnOption`" msgstr ":c:func:`PySys_AddWarnOption`" -#: ../../whatsnew/3.11.rst:2573 +#: ../../whatsnew/3.11.rst:2565 msgid ":c:func:`PySys_AddXOption`" msgstr ":c:func:`PySys_AddXOption`" -#: ../../whatsnew/3.11.rst:2574 +#: ../../whatsnew/3.11.rst:2566 msgid ":c:func:`PySys_HasWarnOptions`" msgstr ":c:func:`PySys_HasWarnOptions`" -#: ../../whatsnew/3.11.rst:2575 +#: ../../whatsnew/3.11.rst:2567 msgid ":c:func:`PySys_SetArgvEx`" msgstr ":c:func:`PySys_SetArgvEx`" -#: ../../whatsnew/3.11.rst:2576 +#: ../../whatsnew/3.11.rst:2568 msgid ":c:func:`PySys_SetArgv`" msgstr ":c:func:`PySys_SetArgv`" -#: ../../whatsnew/3.11.rst:2577 +#: ../../whatsnew/3.11.rst:2569 msgid ":c:func:`PySys_SetPath`" msgstr ":c:func:`PySys_SetPath`" -#: ../../whatsnew/3.11.rst:2578 +#: ../../whatsnew/3.11.rst:2570 msgid ":c:func:`Py_SetPath`" msgstr ":c:func:`Py_SetPath`" -#: ../../whatsnew/3.11.rst:2579 +#: ../../whatsnew/3.11.rst:2571 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../whatsnew/3.11.rst:2580 +#: ../../whatsnew/3.11.rst:2572 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../whatsnew/3.11.rst:2581 +#: ../../whatsnew/3.11.rst:2573 msgid ":c:func:`Py_SetStandardStreamEncoding`" msgstr ":c:func:`Py_SetStandardStreamEncoding`" -#: ../../whatsnew/3.11.rst:2582 +#: ../../whatsnew/3.11.rst:2574 msgid ":c:func:`_Py_SetProgramFullPath`" msgstr ":c:func:`_Py_SetProgramFullPath`" -#: ../../whatsnew/3.11.rst:2584 +#: ../../whatsnew/3.11.rst:2576 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`). (Contributed by Victor " "Stinner in :gh:`88279`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2588 +#: ../../whatsnew/3.11.rst:2580 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2597 +#: ../../whatsnew/3.11.rst:2589 msgid "" "The following C APIs have been deprecated in earlier Python releases, and " "will be removed in Python 3.12." msgstr "" -#: ../../whatsnew/3.11.rst:2600 +#: ../../whatsnew/3.11.rst:2592 msgid ":c:func:`PyUnicode_AS_DATA`" msgstr ":c:func:`PyUnicode_AS_DATA`" -#: ../../whatsnew/3.11.rst:2601 +#: ../../whatsnew/3.11.rst:2593 msgid ":c:func:`PyUnicode_AS_UNICODE`" msgstr ":c:func:`PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.11.rst:2602 +#: ../../whatsnew/3.11.rst:2594 msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.11.rst:2603 +#: ../../whatsnew/3.11.rst:2595 msgid ":c:func:`PyUnicode_AsUnicode`" msgstr ":c:func:`PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2604 +#: ../../whatsnew/3.11.rst:2596 msgid ":c:func:`PyUnicode_FromUnicode`" msgstr ":c:func:`PyUnicode_FromUnicode`" -#: ../../whatsnew/3.11.rst:2605 +#: ../../whatsnew/3.11.rst:2597 msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.11.rst:2606 +#: ../../whatsnew/3.11.rst:2598 msgid ":c:func:`PyUnicode_GET_SIZE`" msgstr ":c:func:`PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.11.rst:2607 +#: ../../whatsnew/3.11.rst:2599 msgid ":c:func:`PyUnicode_GetSize`" msgstr ":c:func:`PyUnicode_GetSize`" -#: ../../whatsnew/3.11.rst:2608 +#: ../../whatsnew/3.11.rst:2600 msgid ":c:func:`PyUnicode_IS_COMPACT`" msgstr ":c:func:`PyUnicode_IS_COMPACT`" -#: ../../whatsnew/3.11.rst:2609 +#: ../../whatsnew/3.11.rst:2601 msgid ":c:func:`PyUnicode_IS_READY`" msgstr ":c:func:`PyUnicode_IS_READY`" -#: ../../whatsnew/3.11.rst:2610 +#: ../../whatsnew/3.11.rst:2602 msgid ":c:func:`PyUnicode_READY`" msgstr ":c:func:`PyUnicode_READY`" -#: ../../whatsnew/3.11.rst:2611 +#: ../../whatsnew/3.11.rst:2603 msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" -#: ../../whatsnew/3.11.rst:2612 +#: ../../whatsnew/3.11.rst:2604 msgid ":c:func:`_PyUnicode_AsUnicode`" msgstr ":c:func:`_PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2613 +#: ../../whatsnew/3.11.rst:2605 msgid ":c:macro:`PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.11.rst:2614 +#: ../../whatsnew/3.11.rst:2606 msgid ":c:type:`PyUnicodeObject`" msgstr ":c:type:`PyUnicodeObject`" -#: ../../whatsnew/3.11.rst:2615 +#: ../../whatsnew/3.11.rst:2607 msgid ":c:func:`PyUnicode_InternImmortal()`" msgstr ":c:func:`PyUnicode_InternImmortal()`" -#: ../../whatsnew/3.11.rst:2623 +#: ../../whatsnew/3.11.rst:2615 msgid "" ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2627 +#: ../../whatsnew/3.11.rst:2619 msgid "Remove the following math macros using the ``errno`` variable:" msgstr "" -#: ../../whatsnew/3.11.rst:2629 +#: ../../whatsnew/3.11.rst:2621 msgid "``Py_ADJUST_ERANGE1()``" msgstr "``Py_ADJUST_ERANGE1()``" -#: ../../whatsnew/3.11.rst:2630 +#: ../../whatsnew/3.11.rst:2622 msgid "``Py_ADJUST_ERANGE2()``" msgstr "``Py_ADJUST_ERANGE2()``" -#: ../../whatsnew/3.11.rst:2631 +#: ../../whatsnew/3.11.rst:2623 msgid "``Py_OVERFLOWED()``" msgstr "``Py_OVERFLOWED()``" -#: ../../whatsnew/3.11.rst:2632 +#: ../../whatsnew/3.11.rst:2624 msgid "``Py_SET_ERANGE_IF_OVERFLOW()``" msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" -#: ../../whatsnew/3.11.rst:2633 +#: ../../whatsnew/3.11.rst:2625 msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2635 +#: ../../whatsnew/3.11.rst:2627 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2637 +#: ../../whatsnew/3.11.rst:2629 msgid "" "Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated " "since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()`` " @@ -4058,62 +4048,62 @@ msgid "" "(Contributed by Victor Stinner in :issue:`41123`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2642 +#: ../../whatsnew/3.11.rst:2634 msgid "" "Remove the ``pystrhex.h`` header file. It only contains private functions. C " "extensions should only include the main ```` header file. " "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2646 +#: ../../whatsnew/3.11.rst:2638 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" "`45440`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2650 +#: ../../whatsnew/3.11.rst:2642 msgid "" "The following items are no longer available when :c:macro:`Py_LIMITED_API` " "is defined:" msgstr "" -#: ../../whatsnew/3.11.rst:2653 +#: ../../whatsnew/3.11.rst:2645 msgid ":c:func:`PyMarshal_WriteLongToFile`" msgstr ":c:func:`PyMarshal_WriteLongToFile`" -#: ../../whatsnew/3.11.rst:2654 +#: ../../whatsnew/3.11.rst:2646 msgid ":c:func:`PyMarshal_WriteObjectToFile`" msgstr ":c:func:`PyMarshal_WriteObjectToFile`" -#: ../../whatsnew/3.11.rst:2655 +#: ../../whatsnew/3.11.rst:2647 msgid ":c:func:`PyMarshal_ReadObjectFromString`" msgstr ":c:func:`PyMarshal_ReadObjectFromString`" -#: ../../whatsnew/3.11.rst:2656 +#: ../../whatsnew/3.11.rst:2648 msgid ":c:func:`PyMarshal_WriteObjectToString`" msgstr ":c:func:`PyMarshal_WriteObjectToString`" -#: ../../whatsnew/3.11.rst:2657 +#: ../../whatsnew/3.11.rst:2649 msgid "the ``Py_MARSHAL_VERSION`` macro" msgstr "``Py_MARSHAL_VERSION`` 巨集" -#: ../../whatsnew/3.11.rst:2659 +#: ../../whatsnew/3.11.rst:2651 msgid "These are not part of the :ref:`limited API `." msgstr "" -#: ../../whatsnew/3.11.rst:2661 +#: ../../whatsnew/3.11.rst:2653 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2663 +#: ../../whatsnew/3.11.rst:2655 msgid "" "Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API. It never " "worked since the :c:type:`PyWeakReference` structure is opaque in the " "limited C API. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2668 +#: ../../whatsnew/3.11.rst:2660 msgid "" "Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed in the public " "C API by mistake, it must only be used by Python internally. Use the " @@ -4121,90 +4111,90 @@ msgid "" "in :issue:`40170`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2673 +#: ../../whatsnew/3.11.rst:2665 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2679 +#: ../../whatsnew/3.11.rst:2671 msgid "" "Remove the :c:type:`Py_UNICODE` encoder APIs, as they have been deprecated " "since Python 3.3, are little used and are inefficient relative to the " "recommended alternatives." msgstr "" -#: ../../whatsnew/3.11.rst:2684 +#: ../../whatsnew/3.11.rst:2676 msgid "The removed functions are:" msgstr "" -#: ../../whatsnew/3.11.rst:2686 +#: ../../whatsnew/3.11.rst:2678 msgid ":func:`!PyUnicode_Encode`" msgstr ":func:`!PyUnicode_Encode`" -#: ../../whatsnew/3.11.rst:2687 +#: ../../whatsnew/3.11.rst:2679 msgid ":func:`!PyUnicode_EncodeASCII`" msgstr ":func:`!PyUnicode_EncodeASCII`" -#: ../../whatsnew/3.11.rst:2688 +#: ../../whatsnew/3.11.rst:2680 msgid ":func:`!PyUnicode_EncodeLatin1`" msgstr ":func:`!PyUnicode_EncodeLatin1`" -#: ../../whatsnew/3.11.rst:2689 +#: ../../whatsnew/3.11.rst:2681 msgid ":func:`!PyUnicode_EncodeUTF7`" msgstr ":func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.11.rst:2690 +#: ../../whatsnew/3.11.rst:2682 msgid ":func:`!PyUnicode_EncodeUTF8`" msgstr ":func:`!PyUnicode_EncodeUTF8`" -#: ../../whatsnew/3.11.rst:2691 +#: ../../whatsnew/3.11.rst:2683 msgid ":func:`!PyUnicode_EncodeUTF16`" msgstr ":func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.11.rst:2692 +#: ../../whatsnew/3.11.rst:2684 msgid ":func:`!PyUnicode_EncodeUTF32`" msgstr ":func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.11.rst:2693 +#: ../../whatsnew/3.11.rst:2685 msgid ":func:`!PyUnicode_EncodeUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2694 +#: ../../whatsnew/3.11.rst:2686 msgid ":func:`!PyUnicode_EncodeRawUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeRawUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2695 +#: ../../whatsnew/3.11.rst:2687 msgid ":func:`!PyUnicode_EncodeCharmap`" msgstr ":func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.11.rst:2696 +#: ../../whatsnew/3.11.rst:2688 msgid ":func:`!PyUnicode_TranslateCharmap`" msgstr ":func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.11.rst:2697 +#: ../../whatsnew/3.11.rst:2689 msgid ":func:`!PyUnicode_EncodeDecimal`" msgstr ":func:`!PyUnicode_EncodeDecimal`" -#: ../../whatsnew/3.11.rst:2698 +#: ../../whatsnew/3.11.rst:2690 msgid ":func:`!PyUnicode_TransformDecimalToASCII`" msgstr ":func:`!PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.11.rst:2700 +#: ../../whatsnew/3.11.rst:2692 msgid "" "See :pep:`624` for details and :pep:`migration guidance <624#alternative-" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2706 +#: ../../whatsnew/3.11.rst:2698 msgid "Notable Changes in 3.11.4" msgstr "" -#: ../../whatsnew/3.11.rst:2709 +#: ../../whatsnew/3.11.rst:2701 msgid "tarfile" msgstr "" -#: ../../whatsnew/3.11.rst:2711 +#: ../../whatsnew/3.11.rst:2703 msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " From efe356741709df81d9dec8689563fc204e4e5d54 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 3 May 2023 00:31:31 +0000 Subject: [PATCH 079/130] sync with cpython 5386730c --- distutils/apiref.po | 8 +- distutils/setupscript.po | 6 +- faq/extending.po | 12 +- faq/general.po | 13 +- faq/programming.po | 8 +- library/asyncio-eventloop.po | 5 +- library/copyreg.po | 6 +- library/hashlib.po | 20 +- library/os.po | 4 +- library/plistlib.po | 4 +- library/resource.po | 4 +- library/select.po | 5 +- library/ssl.po | 4 +- library/statistics.po | 10 +- library/sys.po | 8 +- library/typing.po | 179 +++++----- library/unittest.mock-examples.po | 15 +- library/unittest.po | 4 +- library/xmlrpc.client.po | 4 +- library/zipfile.po | 5 +- reference/compound_stmts.po | 559 +++++++++++++++--------------- reference/datamodel.po | 4 +- reference/introduction.po | 6 +- sphinx.po | 14 +- using/cmdline.po | 4 +- using/mac.po | 16 +- using/windows.po | 5 +- whatsnew/2.0.po | 17 +- whatsnew/2.1.po | 14 +- whatsnew/2.2.po | 24 +- whatsnew/2.3.po | 34 +- whatsnew/2.4.po | 10 +- whatsnew/2.6.po | 11 +- whatsnew/3.11.po | 12 +- whatsnew/3.2.po | 19 +- whatsnew/3.3.po | 15 +- whatsnew/3.5.po | 41 +-- whatsnew/3.6.po | 8 +- whatsnew/3.8.po | 34 +- whatsnew/3.9.po | 4 +- 40 files changed, 605 insertions(+), 570 deletions(-) diff --git a/distutils/apiref.po b/distutils/apiref.po index 5ae418e732..937340893a 100644 --- a/distutils/apiref.po +++ b/distutils/apiref.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1055,8 +1055,8 @@ msgid "" "component). These are on top of the system default and those supplied to :" "meth:`add_library_dir` and/or :meth:`set_library_dirs`. " "*runtime_library_dirs* is a list of directories that will be embedded into " -"the shared library and used to search for other shared libraries that \\*it" -"\\* depends on at run-time. (This may only be relevant on Unix.)" +"the shared library and used to search for other shared libraries that " +"\\*it\\* depends on at run-time. (This may only be relevant on Unix.)" msgstr "" #: ../../distutils/apiref.rst:675 @@ -1431,7 +1431,7 @@ msgstr "" #: ../../distutils/apiref.rst:1022 msgid "" "Files in *src* that begin with :file:`.nfs` are skipped (more information on " -"these files is available in answer D2 of the `NFS FAQ page `_)." msgstr "" diff --git a/distutils/setupscript.po b/distutils/setupscript.po index f3484fbfad..d0674cf72c 100644 --- a/distutils/setupscript.po +++ b/distutils/setupscript.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 14:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -960,8 +960,8 @@ msgstr "" #: ../../distutils/setupscript.rst:644 msgid "" -"Multiple lines of plain text in reStructuredText format (see http://docutils." -"sourceforge.net/)." +"Multiple lines of plain text in reStructuredText format (see https://" +"docutils.sourceforge.io/)." msgstr "" #: ../../distutils/setupscript.rst:648 diff --git a/faq/extending.po b/faq/extending.po index dc99558285..baf9b27960 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -47,10 +47,10 @@ msgstr "" #: ../../faq/extending.rst:28 msgid "" -"Yes, using the C compatibility features found in C++. Place ``extern \"C" -"\" { ... }`` around the Python include files and put ``extern \"C\"`` before " -"each function that is going to be called by the Python interpreter. Global " -"or static C++ objects with constructors are probably not a good idea." +"Yes, using the C compatibility features found in C++. Place ``extern " +"\"C\" { ... }`` around the Python include files and put ``extern \"C\"`` " +"before each function that is going to be called by the Python interpreter. " +"Global or static C++ objects with constructors are probably not a good idea." msgstr "" #: ../../faq/extending.rst:37 @@ -65,7 +65,7 @@ msgstr "" #: ../../faq/extending.rst:44 msgid "" -"`Cython `_ and its relative `Pyrex `_ and its relative `Pyrex `_ are compilers that accept a " "slightly modified form of Python and generate the corresponding C code. " "Cython and Pyrex make it possible to write an extension without having to " diff --git a/faq/general.po b/faq/general.po index 27c8d7a7b7..68705b58fb 100644 --- a/faq/general.po +++ b/faq/general.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-01 00:37+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2022-10-16 06:51+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -116,9 +116,10 @@ msgstr "" "形式銷售內含 Python 的產品。當然,我們仍然會想要知道所有的 Python 商業用途。" #: ../../faq/general.rst:57 +#, fuzzy msgid "" -"See `the PSF license page `_ to find " -"further explanations and a link to the full text of the license." +"See `the license page `_ to find " +"further explanations and the full text of the PSF License." msgstr "" "請參閱 `PSF 授權頁面 `_,查詢更深入的說" "明和授權全文的連結。" @@ -435,11 +436,12 @@ msgstr "" "章,而 Usenet 的讀者通常較能夠處理這樣的文章數量。" #: ../../faq/general.rst:215 +#, fuzzy msgid "" "Announcements of new software releases and events can be found in comp.lang." "python.announce, a low-traffic moderated list that receives about five " "postings per day. It's available as `the python-announce mailing list " -"`_." +"`_." msgstr "" "新的軟體發布版本及事件的通知,可以在 comp.lang.python.announce 中找到,這是一" "個低流量的精選討論群,每天收到大約五篇文章。它也能從 `python-announce 郵件討" @@ -700,9 +702,10 @@ msgstr "" "程表)」的 PEP,其中 X.Y 是一個尚未公開發布的版本。" #: ../../faq/general.rst:354 +#, fuzzy msgid "" "New development is discussed on `the python-dev mailing list `_." +"python.org/mailman3/lists/python-dev.python.org/>`_." msgstr "" "新的開發會在 `python-dev 郵件討論群 `_\\ 中討論。" diff --git a/faq/programming.po b/faq/programming.po index 462aae78c9..37bfdc12b5 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:32+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -124,9 +124,9 @@ msgstr "" #: ../../faq/programming.rst:64 msgid "" -"Static type checkers such as `Mypy `_, `Pyre `_, and `Pytype `_ can " -"check type hints in Python source code." +"Static type checkers such as `Mypy `_, `Pyre " +"`_, and `Pytype `_ can check type hints in Python source code." msgstr "" #: ../../faq/programming.rst:73 diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 80fa7c820e..aeb0867e59 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 00:32+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -702,7 +702,8 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:518 -msgid "For more information: https://tools.ietf.org/html/rfc6555" +#, fuzzy +msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" msgstr "更多資訊請見:\\ https://tools.ietf.org/html/rfc6555" #: ../../library/asyncio-eventloop.rst:522 diff --git a/library/copyreg.po b/library/copyreg.po index 1104d349b6..2617ec82ae 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-11 00:23+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,8 +44,8 @@ msgstr "" #: ../../library/copyreg.rst:30 msgid "" "Declares that *function* should be used as a \"reduction\" function for " -"objects of type *type*. *function* should return either a string or a tuple " -"containing two or three elements. See the :attr:`~pickle.Pickler." +"objects of type *type*. *function* must return either a string or a tuple " +"containing between two and six elements. See the :attr:`~pickle.Pickler." "dispatch_table` for more details on the interface of *function*." msgstr "" diff --git a/library/hashlib.po b/library/hashlib.po index 92c10c588b..cadc52c2c5 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,8 +44,8 @@ msgstr "" #: ../../library/hashlib.rst:37 msgid "" -"Some algorithms have known hash collision weaknesses, refer to the \"See also" -"\" section at the end." +"Some algorithms have known hash collision weaknesses, refer to the \"See " +"also\" section at the end." msgstr "" #: ../../library/hashlib.rst:44 @@ -288,8 +288,8 @@ msgid "" "Key derivation and key stretching algorithms are designed for secure " "password hashing. Naive algorithms such as ``sha1(password)`` are not " "resistant against brute-force attacks. A good password hashing function must " -"be tunable, slow, and include a `salt `_." +"be tunable, slow, and include a `salt `_." msgstr "" #: ../../library/hashlib.rst:283 @@ -544,7 +544,7 @@ msgstr "" #: ../../library/hashlib.rst:440 msgid "" -"See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." msgstr "" @@ -681,7 +681,7 @@ msgstr "" #: ../../library/hashlib.rst:626 msgid "" "(`NIST SP-800-106 \"Randomized Hashing for Digital Signatures\" `_)" +"csrc.nist.gov/publications/detail/sp/800-106/archive/2009-02-25>`_)" msgstr "" #: ../../library/hashlib.rst:629 @@ -694,7 +694,8 @@ msgstr "" msgid "" "*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose " "cryptographic hash function, such as SHA-256, is not suitable for hashing " -"passwords. See `BLAKE2 FAQ `_ for more information." +"passwords. See `BLAKE2 FAQ `_ for more " +"information." msgstr "" #: ../../library/hashlib.rst:657 @@ -825,7 +826,8 @@ msgid "Another way to encode binary hashes for non-binary environments." msgstr "" #: ../../library/hashlib.rst:791 -msgid "https://blake2.net" +#, fuzzy +msgid "https://www.blake2.net" msgstr "https://blake2.net" #: ../../library/hashlib.rst:791 diff --git a/library/os.po b/library/os.po index fc14a2233c..9359a5c375 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4750,7 +4750,7 @@ msgstr "" #: ../../library/os.rst:4366 msgid "" -"See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " "GetProcessTimes MSDN `_ on Windows. On " diff --git a/library/plistlib.po b/library/plistlib.po index 60b9dc638c..824c46c83e 100644 --- a/library/plistlib.po +++ b/library/plistlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-18 00:33+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2016-01-31 07:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -75,7 +75,7 @@ msgstr "" #: ../../library/plistlib.rst:49 msgid "" -"`PList manual page `_" msgstr "" diff --git a/library/resource.po b/library/resource.po index abb349de08..488c24b06b 100644 --- a/library/resource.po +++ b/library/resource.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -286,7 +286,7 @@ msgstr ":ref:`適用 `:FreeBSD。" msgid "" "The maximum size (in bytes) of the swap space that may be reserved or used " "by all of this user id's processes. This limit is enforced only if bit 1 of " -"the vm.overcommit sysctl is set. Please see `tuning(7) `__ for a complete description of " "this sysctl." msgstr "" diff --git a/library/select.po b/library/select.po index c502cc8e09..0248edacbe 100644 --- a/library/select.po +++ b/library/select.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -663,7 +663,8 @@ msgid "Kevent Objects" msgstr "" #: ../../library/select.rst:508 -msgid "https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2" +#, fuzzy +msgid "https://man.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2" msgstr "https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2" #: ../../library/select.rst:512 diff --git a/library/ssl.po b/library/ssl.po index 6573813814..b024ff7578 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-25 00:29+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+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-" @@ -2038,7 +2038,7 @@ msgstr "" #: ../../library/ssl.rst:1817 msgid "" -"`SSL/TLS & Perfect Forward Secrecy `_" msgstr "" diff --git a/library/statistics.po b/library/statistics.po index 4a665c6d29..64b070c00f 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-07-27 16:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,7 +37,7 @@ msgstr "這個模組提供計算數值 (:class:`Real`-valued) 資料的數學統 #: ../../library/statistics.rst:24 msgid "" "The module is not intended to be a competitor to third-party libraries such " -"as `NumPy `_, `SciPy `_, or " +"as `NumPy `_, `SciPy `_, or " "proprietary full-featured statistics packages aimed at professional " "statisticians such as Minitab, SAS and Matlab. It is aimed at the level of " "graphing and scientific calculators." @@ -925,9 +925,9 @@ msgstr "" #: ../../library/statistics.rst:813 msgid "" "The relative likelihood is computed as the probability of a sample occurring " -"in a narrow range divided by the width of the range (hence the word \"density" -"\"). Since the likelihood is relative to other points, its value can be " -"greater than ``1.0``." +"in a narrow range divided by the width of the range (hence the word " +"\"density\"). Since the likelihood is relative to other points, its value " +"can be greater than ``1.0``." msgstr "" #: ../../library/statistics.rst:820 diff --git a/library/sys.po b/library/sys.po index 1797877370..1072248740 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1173,9 +1173,9 @@ msgstr "" #: ../../library/sys.rst:784 msgid "" -"See `recursive sizeof recipe `_ " -"for an example of using :func:`getsizeof` recursively to find the size of " -"containers and all their contents." +"See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size " +"of containers and all their contents." msgstr "" #: ../../library/sys.rst:790 diff --git a/library/typing.po b/library/typing.po index e6680541a8..06b5f74d79 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-31 00:31+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -351,7 +351,7 @@ msgid "" msgstr "" #: ../../library/typing.rst:229 ../../library/typing.rst:1171 -#: ../../library/typing.rst:2824 +#: ../../library/typing.rst:2825 msgid "For example::" msgstr "" "舉例來說:\n" @@ -671,7 +671,7 @@ msgid "" "``LiteralString``-typed objects is also acceptable as a ``LiteralString``." msgstr "" -#: ../../library/typing.rst:622 ../../library/typing.rst:2466 +#: ../../library/typing.rst:622 ../../library/typing.rst:2467 msgid "Example::" msgstr "" "舉例來說:\n" @@ -1038,7 +1038,7 @@ msgid "" "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1038 ../../library/typing.rst:2707 +#: ../../library/typing.rst:1038 ../../library/typing.rst:2708 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -2339,27 +2339,28 @@ msgstr "" #: ../../library/typing.rst:2441 msgid "" -"When the type checker encounters a call to ``assert_type()``, it emits an " -"error if the value is not of the specified type::" +"At runtime this does nothing: it returns the first argument unchanged with " +"no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2448 +#: ../../library/typing.rst:2444 msgid "" -"At runtime this returns the first argument unchanged with no side effects." +"When a static type checker encounters a call to ``assert_type()``, it emits " +"an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2450 +#: ../../library/typing.rst:2451 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2464 +#: ../../library/typing.rst:2465 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2478 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " @@ -2372,53 +2373,53 @@ msgid "" "bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2489 +#: ../../library/typing.rst:2490 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2492 +#: ../../library/typing.rst:2493 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2500 +#: ../../library/typing.rst:2501 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2502 +#: ../../library/typing.rst:2503 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2508 +#: ../../library/typing.rst:2509 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2511 +#: ../../library/typing.rst:2512 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2516 +#: ../../library/typing.rst:2517 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2521 +#: ../../library/typing.rst:2522 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2531 +#: ../../library/typing.rst:2532 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -2427,19 +2428,19 @@ msgid "" "`dataclasses.dataclass`-like behaviors." msgstr "" -#: ../../library/typing.rst:2537 +#: ../../library/typing.rst:2538 msgid "Example usage with a decorator function::" msgstr "" -#: ../../library/typing.rst:2551 +#: ../../library/typing.rst:2552 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2560 +#: ../../library/typing.rst:2561 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2571 +#: ../../library/typing.rst:2572 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*. *func* is the function object for the implementation of the " @@ -2585,25 +2586,25 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2673 +#: ../../library/typing.rst:2674 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2681 +#: ../../library/typing.rst:2682 msgid "" "Clear all registered overloads in the internal registry. This can be used to " "reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2689 +#: ../../library/typing.rst:2690 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2712 +#: ../../library/typing.rst:2713 msgid "" "The decorator will now set the ``__final__`` attribute to ``True`` on the " "decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2613,59 +2614,59 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2723 +#: ../../library/typing.rst:2724 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2725 +#: ../../library/typing.rst:2726 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods and classes defined in that class (but not to " "methods defined in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2729 +#: ../../library/typing.rst:2730 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2733 +#: ../../library/typing.rst:2734 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2735 +#: ../../library/typing.rst:2736 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2740 +#: ../../library/typing.rst:2741 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2742 +#: ../../library/typing.rst:2743 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2753 +#: ../../library/typing.rst:2754 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2757 +#: ../../library/typing.rst:2758 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2761 +#: ../../library/typing.rst:2762 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2764 +#: ../../library/typing.rst:2765 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2674,36 +2675,36 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2770 +#: ../../library/typing.rst:2771 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2785 +#: ../../library/typing.rst:2786 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2790 +#: ../../library/typing.rst:2791 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2793 +#: ../../library/typing.rst:2794 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2801 +#: ../../library/typing.rst:2802 msgid "Provide basic introspection for generic types and special typing forms." msgstr "" -#: ../../library/typing.rst:2803 +#: ../../library/typing.rst:2804 msgid "" "For a typing object of the form ``X[Y, Z, ...]`` these functions return " "``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" @@ -2714,11 +2715,11 @@ msgid "" "and ``()`` correspondingly. Examples::" msgstr "" -#: ../../library/typing.rst:2822 +#: ../../library/typing.rst:2823 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2837 +#: ../../library/typing.rst:2838 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2726,24 +2727,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2843 +#: ../../library/typing.rst:2844 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2850 +#: ../../library/typing.rst:2851 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2854 +#: ../../library/typing.rst:2855 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2864 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2751,7 +2752,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2870 +#: ../../library/typing.rst:2871 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2759,11 +2760,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2879 +#: ../../library/typing.rst:2880 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:2881 +#: ../../library/typing.rst:2882 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2771,62 +2772,62 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:2886 +#: ../../library/typing.rst:2887 msgid "Feature" msgstr "" -#: ../../library/typing.rst:2886 +#: ../../library/typing.rst:2887 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:2886 +#: ../../library/typing.rst:2887 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:2886 +#: ../../library/typing.rst:2887 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:2888 +#: ../../library/typing.rst:2889 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:2888 +#: ../../library/typing.rst:2889 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:2888 +#: ../../library/typing.rst:2889 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:2888 +#: ../../library/typing.rst:2889 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:2891 +#: ../../library/typing.rst:2892 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:2891 +#: ../../library/typing.rst:2892 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:2891 ../../library/typing.rst:2894 +#: ../../library/typing.rst:2892 ../../library/typing.rst:2895 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:2891 +#: ../../library/typing.rst:2892 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2895 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2895 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2895 msgid ":gh:`92332`" msgstr ":gh:`92332`" diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index cd4698242d..61ca72b3a1 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2016-11-19 00:35+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -854,9 +854,8 @@ msgstr "" msgid "" "Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted " -"adaptor `_. Having this applied to attributes too actually causes " -"errors." +"adaptor `_. Having this applied to attributes too actually causes errors." msgstr "" #: ../../library/unittest.mock-examples.rst:1080 @@ -890,10 +889,10 @@ msgstr "" msgid "" "Generally local imports are to be avoided. They are sometimes done to " "prevent circular dependencies, for which there is *usually* a much better " -"way to solve the problem (refactor the code) or to prevent \"up front costs" -"\" by delaying the import. This can also be solved in better ways than an " -"unconditional local import (store the module as a class or module attribute " -"and only do the import on first use)." +"way to solve the problem (refactor the code) or to prevent \"up front " +"costs\" by delaying the import. This can also be solved in better ways than " +"an unconditional local import (store the module as a class or module " +"attribute and only do the import on first use)." msgstr "" #: ../../library/unittest.mock-examples.rst:1116 diff --git a/library/unittest.po b/library/unittest.po index ff5478b761..7348e67514 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-09 00:17+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -182,7 +182,7 @@ msgid "" "intended largely for ease of use for those new to unit testing. For " "production environments it is recommended that tests be driven by a " "continuous integration system such as `Buildbot `_, " -"`Jenkins `_, `GitHub Actions `_, `GitHub Actions `_, or `AppVeyor `_." msgstr "" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index 19622f37b8..9ac90536ed 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -271,7 +271,7 @@ msgid "" msgstr "" #: ../../library/xmlrpc.client.rst:166 -msgid "`XML-RPC HOWTO `_" +msgid "`XML-RPC HOWTO `_" msgstr "" #: ../../library/xmlrpc.client.rst:165 diff --git a/library/zipfile.po b/library/zipfile.po index 8cb1c81a74..b8fd9689ce 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-09 00:34+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -144,7 +144,8 @@ msgid "" msgstr "" #: ../../library/zipfile.rst:132 -msgid "`Info-ZIP Home Page `_" +#, fuzzy +msgid "`Info-ZIP Home Page `_" msgstr "`Info-ZIP 首頁 `_" #: ../../library/zipfile.rst:132 diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index cef2f2177c..16cfca57dc 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-14 00:30+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -296,12 +296,19 @@ msgstr "" #: ../../reference/compound_stmts.rst:368 msgid "" +"From version 3.11.4, when the entire :exc:`ExceptionGroup` is handled and " +"only one exception is raised from an :keyword:`!except*` clause, this " +"exception is no longer wrapped to form a new :exc:`ExceptionGroup`." +msgstr "" + +#: ../../reference/compound_stmts.rst:372 +msgid "" "If the raised exception is not an exception group and its type matches one " "of the :keyword:`!except*` clauses, it is caught and wrapped by an exception " "group with an empty message string. ::" msgstr "" -#: ../../reference/compound_stmts.rst:379 +#: ../../reference/compound_stmts.rst:383 msgid "" "An :keyword:`!except*` clause must have a matching type, and this type " "cannot be a subclass of :exc:`BaseExceptionGroup`. It is not possible to " @@ -310,11 +317,11 @@ msgid "" "an :keyword:`!except*` clause." msgstr "" -#: ../../reference/compound_stmts.rst:396 +#: ../../reference/compound_stmts.rst:400 msgid ":keyword:`!else` clause" msgstr "" -#: ../../reference/compound_stmts.rst:398 +#: ../../reference/compound_stmts.rst:402 msgid "" "The optional :keyword:`!else` clause is executed if the control flow leaves " "the :keyword:`try` suite, no exception was raised, and no :keyword:" @@ -323,11 +330,11 @@ msgid "" "keyword:`except` clauses." msgstr "" -#: ../../reference/compound_stmts.rst:410 +#: ../../reference/compound_stmts.rst:414 msgid ":keyword:`!finally` clause" msgstr "" -#: ../../reference/compound_stmts.rst:412 +#: ../../reference/compound_stmts.rst:416 msgid "" "If :keyword:`!finally` is present, it specifies a 'cleanup' handler. The :" "keyword:`try` clause is executed, including any :keyword:`except` and :" @@ -341,13 +348,13 @@ msgid "" "exception is discarded::" msgstr "" -#: ../../reference/compound_stmts.rst:431 +#: ../../reference/compound_stmts.rst:435 msgid "" "The exception information is not available to the program during execution " "of the :keyword:`!finally` clause." msgstr "" -#: ../../reference/compound_stmts.rst:439 +#: ../../reference/compound_stmts.rst:443 msgid "" "When a :keyword:`return`, :keyword:`break` or :keyword:`continue` statement " "is executed in the :keyword:`try` suite of a :keyword:`!try`...\\ :keyword:`!" @@ -355,7 +362,7 @@ msgid "" "way out.'" msgstr "" -#: ../../reference/compound_stmts.rst:443 +#: ../../reference/compound_stmts.rst:447 msgid "" "The return value of a function is determined by the last :keyword:`return` " "statement executed. Since the :keyword:`!finally` clause always executes, " @@ -363,17 +370,17 @@ msgid "" "will always be the last one executed::" msgstr "" -#: ../../reference/compound_stmts.rst:457 +#: ../../reference/compound_stmts.rst:461 msgid "" "Prior to Python 3.8, a :keyword:`continue` statement was illegal in the :" "keyword:`!finally` clause due to a problem with the implementation." msgstr "" -#: ../../reference/compound_stmts.rst:466 +#: ../../reference/compound_stmts.rst:470 msgid "The :keyword:`!with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:475 +#: ../../reference/compound_stmts.rst:479 msgid "" "The :keyword:`with` statement is used to wrap the execution of a block with " "methods defined by a context manager (see section :ref:`context-managers`). " @@ -381,37 +388,37 @@ msgid "" "`finally` usage patterns to be encapsulated for convenient reuse." msgstr "" -#: ../../reference/compound_stmts.rst:485 +#: ../../reference/compound_stmts.rst:489 msgid "" "The execution of the :keyword:`with` statement with one \"item\" proceeds as " "follows:" msgstr "" -#: ../../reference/compound_stmts.rst:487 +#: ../../reference/compound_stmts.rst:491 msgid "" "The context expression (the expression given in the :token:`~python-grammar:" "with_item`) is evaluated to obtain a context manager." msgstr "" -#: ../../reference/compound_stmts.rst:490 +#: ../../reference/compound_stmts.rst:494 msgid "The context manager's :meth:`__enter__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:492 +#: ../../reference/compound_stmts.rst:496 msgid "The context manager's :meth:`__exit__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:494 +#: ../../reference/compound_stmts.rst:498 msgid "The context manager's :meth:`__enter__` method is invoked." msgstr "" -#: ../../reference/compound_stmts.rst:496 +#: ../../reference/compound_stmts.rst:500 msgid "" "If a target was included in the :keyword:`with` statement, the return value " "from :meth:`__enter__` is assigned to it." msgstr "" -#: ../../reference/compound_stmts.rst:501 +#: ../../reference/compound_stmts.rst:505 msgid "" "The :keyword:`with` statement guarantees that if the :meth:`__enter__` " "method returns without an error, then :meth:`__exit__` will always be " @@ -420,11 +427,11 @@ msgid "" "See step 7 below." msgstr "" -#: ../../reference/compound_stmts.rst:507 +#: ../../reference/compound_stmts.rst:511 msgid "The suite is executed." msgstr "" -#: ../../reference/compound_stmts.rst:509 +#: ../../reference/compound_stmts.rst:513 msgid "" "The context manager's :meth:`__exit__` method is invoked. If an exception " "caused the suite to be exited, its type, value, and traceback are passed as " @@ -432,7 +439,7 @@ msgid "" "supplied." msgstr "" -#: ../../reference/compound_stmts.rst:514 +#: ../../reference/compound_stmts.rst:518 msgid "" "If the suite was exited due to an exception, and the return value from the :" "meth:`__exit__` method was false, the exception is reraised. If the return " @@ -440,119 +447,119 @@ msgid "" "the statement following the :keyword:`with` statement." msgstr "" -#: ../../reference/compound_stmts.rst:519 +#: ../../reference/compound_stmts.rst:523 msgid "" "If the suite was exited for any reason other than an exception, the return " "value from :meth:`__exit__` is ignored, and execution proceeds at the normal " "location for the kind of exit that was taken." msgstr "" -#: ../../reference/compound_stmts.rst:523 -#: ../../reference/compound_stmts.rst:1514 -#: ../../reference/compound_stmts.rst:1555 +#: ../../reference/compound_stmts.rst:527 +#: ../../reference/compound_stmts.rst:1518 +#: ../../reference/compound_stmts.rst:1559 msgid "The following code::" msgstr "" -#: ../../reference/compound_stmts.rst:528 -#: ../../reference/compound_stmts.rst:553 -#: ../../reference/compound_stmts.rst:1560 +#: ../../reference/compound_stmts.rst:532 +#: ../../reference/compound_stmts.rst:557 +#: ../../reference/compound_stmts.rst:1564 msgid "is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:547 +#: ../../reference/compound_stmts.rst:551 msgid "" "With more than one item, the context managers are processed as if multiple :" "keyword:`with` statements were nested::" msgstr "" -#: ../../reference/compound_stmts.rst:559 +#: ../../reference/compound_stmts.rst:563 msgid "" "You can also write multi-item context managers in multiple lines if the " "items are surrounded by parentheses. For example::" msgstr "" -#: ../../reference/compound_stmts.rst:568 +#: ../../reference/compound_stmts.rst:572 msgid "Support for multiple context expressions." msgstr "" -#: ../../reference/compound_stmts.rst:571 +#: ../../reference/compound_stmts.rst:575 msgid "" "Support for using grouping parentheses to break the statement in multiple " "lines." msgstr "" -#: ../../reference/compound_stmts.rst:577 +#: ../../reference/compound_stmts.rst:581 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/compound_stmts.rst:577 +#: ../../reference/compound_stmts.rst:581 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/compound_stmts.rst:583 +#: ../../reference/compound_stmts.rst:587 msgid "The :keyword:`!match` statement" msgstr "" -#: ../../reference/compound_stmts.rst:597 +#: ../../reference/compound_stmts.rst:601 msgid "The match statement is used for pattern matching. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:606 +#: ../../reference/compound_stmts.rst:610 msgid "" "This section uses single quotes to denote :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:609 +#: ../../reference/compound_stmts.rst:613 msgid "" "Pattern matching takes a pattern as input (following ``case``) and a subject " "value (following ``match``). The pattern (which may contain subpatterns) is " "matched against the subject value. The outcomes are:" msgstr "" -#: ../../reference/compound_stmts.rst:613 +#: ../../reference/compound_stmts.rst:617 msgid "A match success or failure (also termed a pattern success or failure)." msgstr "" -#: ../../reference/compound_stmts.rst:615 +#: ../../reference/compound_stmts.rst:619 msgid "" "Possible binding of matched values to a name. The prerequisites for this " "are further discussed below." msgstr "" -#: ../../reference/compound_stmts.rst:618 +#: ../../reference/compound_stmts.rst:622 msgid "" "The ``match`` and ``case`` keywords are :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:622 -#: ../../reference/compound_stmts.rst:1177 +#: ../../reference/compound_stmts.rst:626 +#: ../../reference/compound_stmts.rst:1181 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../reference/compound_stmts.rst:623 -#: ../../reference/compound_stmts.rst:1178 +#: ../../reference/compound_stmts.rst:627 +#: ../../reference/compound_stmts.rst:1182 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" msgstr "" -#: ../../reference/compound_stmts.rst:627 +#: ../../reference/compound_stmts.rst:631 msgid "Overview" msgstr "" -#: ../../reference/compound_stmts.rst:629 +#: ../../reference/compound_stmts.rst:633 msgid "Here's an overview of the logical flow of a match statement:" msgstr "" -#: ../../reference/compound_stmts.rst:632 +#: ../../reference/compound_stmts.rst:636 msgid "" "The subject expression ``subject_expr`` is evaluated and a resulting subject " "value obtained. If the subject expression contains a comma, a tuple is " "constructed using :ref:`the standard rules `." msgstr "" -#: ../../reference/compound_stmts.rst:636 +#: ../../reference/compound_stmts.rst:640 msgid "" "Each pattern in a ``case_block`` is attempted to match with the subject " "value. The specific rules for success or failure are described below. The " @@ -562,7 +569,7 @@ msgid "" "outlive the executed block and can be used after the match statement**." msgstr "" -#: ../../reference/compound_stmts.rst:645 +#: ../../reference/compound_stmts.rst:649 msgid "" "During failed pattern matches, some subpatterns may succeed. Do not rely on " "bindings being made for a failed match. Conversely, do not rely on " @@ -571,87 +578,87 @@ msgid "" "made to allow different implementations to add optimizations." msgstr "" -#: ../../reference/compound_stmts.rst:652 +#: ../../reference/compound_stmts.rst:656 msgid "" "If the pattern succeeds, the corresponding guard (if present) is evaluated. " "In this case all name bindings are guaranteed to have happened." msgstr "" -#: ../../reference/compound_stmts.rst:655 +#: ../../reference/compound_stmts.rst:659 msgid "" "If the guard evaluates as true or is missing, the ``block`` inside " "``case_block`` is executed." msgstr "" -#: ../../reference/compound_stmts.rst:658 +#: ../../reference/compound_stmts.rst:662 msgid "Otherwise, the next ``case_block`` is attempted as described above." msgstr "" -#: ../../reference/compound_stmts.rst:660 +#: ../../reference/compound_stmts.rst:664 msgid "If there are no further case blocks, the match statement is completed." msgstr "" -#: ../../reference/compound_stmts.rst:664 +#: ../../reference/compound_stmts.rst:668 msgid "" "Users should generally never rely on a pattern being evaluated. Depending " "on implementation, the interpreter may cache values or use other " "optimizations which skip repeated evaluations." msgstr "" -#: ../../reference/compound_stmts.rst:668 +#: ../../reference/compound_stmts.rst:672 msgid "A sample match statement::" msgstr "" -#: ../../reference/compound_stmts.rst:684 +#: ../../reference/compound_stmts.rst:688 msgid "" "In this case, ``if flag`` is a guard. Read more about that in the next " "section." msgstr "" -#: ../../reference/compound_stmts.rst:687 +#: ../../reference/compound_stmts.rst:691 msgid "Guards" msgstr "" -#: ../../reference/compound_stmts.rst:694 +#: ../../reference/compound_stmts.rst:698 msgid "" "A ``guard`` (which is part of the ``case``) must succeed for code inside the " "``case`` block to execute. It takes the form: :keyword:`if` followed by an " "expression." msgstr "" -#: ../../reference/compound_stmts.rst:699 +#: ../../reference/compound_stmts.rst:703 msgid "The logical flow of a ``case`` block with a ``guard`` follows:" msgstr "" -#: ../../reference/compound_stmts.rst:701 +#: ../../reference/compound_stmts.rst:705 msgid "" "Check that the pattern in the ``case`` block succeeded. If the pattern " "failed, the ``guard`` is not evaluated and the next ``case`` block is " "checked." msgstr "" -#: ../../reference/compound_stmts.rst:705 +#: ../../reference/compound_stmts.rst:709 msgid "If the pattern succeeded, evaluate the ``guard``." msgstr "" -#: ../../reference/compound_stmts.rst:707 +#: ../../reference/compound_stmts.rst:711 msgid "" "If the ``guard`` condition evaluates as true, the case block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:710 +#: ../../reference/compound_stmts.rst:714 msgid "" "If the ``guard`` condition evaluates as false, the case block is not " "selected." msgstr "" -#: ../../reference/compound_stmts.rst:713 +#: ../../reference/compound_stmts.rst:717 msgid "" "If the ``guard`` raises an exception during evaluation, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:716 +#: ../../reference/compound_stmts.rst:720 msgid "" "Guards are allowed to have side effects as they are expressions. Guard " "evaluation must proceed from the first to the last case block, one at a " @@ -660,17 +667,17 @@ msgid "" "block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:726 +#: ../../reference/compound_stmts.rst:730 msgid "Irrefutable Case Blocks" msgstr "" -#: ../../reference/compound_stmts.rst:730 +#: ../../reference/compound_stmts.rst:734 msgid "" "An irrefutable case block is a match-all case block. A match statement may " "have at most one irrefutable case block, and it must be last." msgstr "" -#: ../../reference/compound_stmts.rst:733 +#: ../../reference/compound_stmts.rst:737 msgid "" "A case block is considered irrefutable if it has no guard and its pattern is " "irrefutable. A pattern is considered irrefutable if we can prove from its " @@ -678,47 +685,47 @@ msgid "" "irrefutable:" msgstr "" -#: ../../reference/compound_stmts.rst:738 +#: ../../reference/compound_stmts.rst:742 msgid ":ref:`as-patterns` whose left-hand side is irrefutable" msgstr "" -#: ../../reference/compound_stmts.rst:740 +#: ../../reference/compound_stmts.rst:744 msgid ":ref:`or-patterns` containing at least one irrefutable pattern" msgstr "" -#: ../../reference/compound_stmts.rst:742 +#: ../../reference/compound_stmts.rst:746 msgid ":ref:`capture-patterns`" msgstr ":ref:`capture-patterns`" -#: ../../reference/compound_stmts.rst:744 +#: ../../reference/compound_stmts.rst:748 msgid ":ref:`wildcard-patterns`" msgstr ":ref:`wildcard-patterns`" -#: ../../reference/compound_stmts.rst:746 +#: ../../reference/compound_stmts.rst:750 msgid "parenthesized irrefutable patterns" msgstr "" -#: ../../reference/compound_stmts.rst:750 +#: ../../reference/compound_stmts.rst:754 msgid "Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:757 +#: ../../reference/compound_stmts.rst:761 msgid "This section uses grammar notations beyond standard EBNF:" msgstr "" -#: ../../reference/compound_stmts.rst:759 +#: ../../reference/compound_stmts.rst:763 msgid "the notation ``SEP.RULE+`` is shorthand for ``RULE (SEP RULE)*``" msgstr "" -#: ../../reference/compound_stmts.rst:761 +#: ../../reference/compound_stmts.rst:765 msgid "the notation ``!RULE`` is shorthand for a negative lookahead assertion" msgstr "" -#: ../../reference/compound_stmts.rst:764 +#: ../../reference/compound_stmts.rst:768 msgid "The top-level syntax for ``patterns`` is:" msgstr "" -#: ../../reference/compound_stmts.rst:778 +#: ../../reference/compound_stmts.rst:782 msgid "" "The descriptions below will include a description \"in simple terms\" of " "what a pattern does for illustration purposes (credits to Raymond Hettinger " @@ -728,70 +735,70 @@ msgid "" "forms." msgstr "" -#: ../../reference/compound_stmts.rst:788 +#: ../../reference/compound_stmts.rst:792 msgid "OR Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:790 +#: ../../reference/compound_stmts.rst:794 msgid "" "An OR pattern is two or more patterns separated by vertical bars ``|``. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:796 +#: ../../reference/compound_stmts.rst:800 msgid "" "Only the final subpattern may be :ref:`irrefutable `, and " "each subpattern must bind the same set of names to avoid ambiguity." msgstr "" -#: ../../reference/compound_stmts.rst:799 +#: ../../reference/compound_stmts.rst:803 msgid "" "An OR pattern matches each of its subpatterns in turn to the subject value, " "until one succeeds. The OR pattern is then considered successful. " "Otherwise, if none of the subpatterns succeed, the OR pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:803 +#: ../../reference/compound_stmts.rst:807 msgid "" "In simple terms, ``P1 | P2 | ...`` will try to match ``P1``, if it fails it " "will try to match ``P2``, succeeding immediately if any succeeds, failing " "otherwise." msgstr "" -#: ../../reference/compound_stmts.rst:809 +#: ../../reference/compound_stmts.rst:813 msgid "AS Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:811 +#: ../../reference/compound_stmts.rst:815 msgid "" "An AS pattern matches an OR pattern on the left of the :keyword:`as` keyword " "against a subject. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:817 +#: ../../reference/compound_stmts.rst:821 msgid "" "If the OR pattern fails, the AS pattern fails. Otherwise, the AS pattern " "binds the subject to the name on the right of the as keyword and succeeds. " "``capture_pattern`` cannot be a ``_``." msgstr "" -#: ../../reference/compound_stmts.rst:821 +#: ../../reference/compound_stmts.rst:825 msgid "" "In simple terms ``P as NAME`` will match with ``P``, and on success it will " "set ``NAME = ``." msgstr "" -#: ../../reference/compound_stmts.rst:828 +#: ../../reference/compound_stmts.rst:832 msgid "Literal Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:830 +#: ../../reference/compound_stmts.rst:834 msgid "" "A literal pattern corresponds to most :ref:`literals ` in Python. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:843 +#: ../../reference/compound_stmts.rst:847 msgid "" "The rule ``strings`` and the token ``NUMBER`` are defined in the :doc:" "`standard Python grammar <./grammar>`. Triple-quoted strings are " @@ -799,42 +806,42 @@ msgid "" "are not supported." msgstr "" -#: ../../reference/compound_stmts.rst:848 +#: ../../reference/compound_stmts.rst:852 msgid "" "The forms ``signed_number '+' NUMBER`` and ``signed_number '-' NUMBER`` are " "for expressing :ref:`complex numbers `; they require a real " "number on the left and an imaginary number on the right. E.g. ``3 + 4j``." msgstr "" -#: ../../reference/compound_stmts.rst:852 +#: ../../reference/compound_stmts.rst:856 msgid "" "In simple terms, ``LITERAL`` will succeed only if `` == LITERAL``. " "For the singletons ``None``, ``True`` and ``False``, the :keyword:`is` " "operator is used." msgstr "" -#: ../../reference/compound_stmts.rst:858 +#: ../../reference/compound_stmts.rst:862 msgid "Capture Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:860 +#: ../../reference/compound_stmts.rst:864 msgid "A capture pattern binds the subject value to a name. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:866 +#: ../../reference/compound_stmts.rst:870 msgid "" "A single underscore ``_`` is not a capture pattern (this is what ``!'_'`` " "expresses). It is instead treated as a :token:`~python-grammar:" "wildcard_pattern`." msgstr "" -#: ../../reference/compound_stmts.rst:870 +#: ../../reference/compound_stmts.rst:874 msgid "" "In a given pattern, a given name can only be bound once. E.g. ``case x, " "x: ...`` is invalid while ``case [x] | x: ...`` is allowed." msgstr "" -#: ../../reference/compound_stmts.rst:873 +#: ../../reference/compound_stmts.rst:877 msgid "" "Capture patterns always succeed. The binding follows scoping rules " "established by the assignment expression operator in :pep:`572`; the name " @@ -842,55 +849,55 @@ msgid "" "there's an applicable :keyword:`global` or :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/compound_stmts.rst:878 +#: ../../reference/compound_stmts.rst:882 msgid "" "In simple terms ``NAME`` will always succeed and it will set ``NAME = " "``." msgstr "" -#: ../../reference/compound_stmts.rst:883 +#: ../../reference/compound_stmts.rst:887 msgid "Wildcard Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:885 +#: ../../reference/compound_stmts.rst:889 msgid "" "A wildcard pattern always succeeds (matches anything) and binds no name. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:891 +#: ../../reference/compound_stmts.rst:895 msgid "" "``_`` is a :ref:`soft keyword ` within any pattern, but only " "within patterns. It is an identifier, as usual, even within ``match`` " "subject expressions, ``guard``\\ s, and ``case`` blocks." msgstr "" -#: ../../reference/compound_stmts.rst:895 +#: ../../reference/compound_stmts.rst:899 msgid "In simple terms, ``_`` will always succeed." msgstr "" -#: ../../reference/compound_stmts.rst:900 +#: ../../reference/compound_stmts.rst:904 msgid "Value Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:902 +#: ../../reference/compound_stmts.rst:906 msgid "A value pattern represents a named value in Python. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:910 +#: ../../reference/compound_stmts.rst:914 msgid "" "The dotted name in the pattern is looked up using standard Python :ref:`name " "resolution rules `. The pattern succeeds if the value found " "compares equal to the subject value (using the ``==`` equality operator)." msgstr "" -#: ../../reference/compound_stmts.rst:915 +#: ../../reference/compound_stmts.rst:919 msgid "" "In simple terms ``NAME1.NAME2`` will succeed only if `` == NAME1." "NAME2``" msgstr "" -#: ../../reference/compound_stmts.rst:919 +#: ../../reference/compound_stmts.rst:923 msgid "" "If the same value occurs multiple times in the same match statement, the " "interpreter may cache the first value found and reuse it rather than repeat " @@ -898,44 +905,44 @@ msgid "" "given match statement." msgstr "" -#: ../../reference/compound_stmts.rst:927 +#: ../../reference/compound_stmts.rst:931 msgid "Group Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:929 +#: ../../reference/compound_stmts.rst:933 msgid "" "A group pattern allows users to add parentheses around patterns to emphasize " "the intended grouping. Otherwise, it has no additional syntax. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:936 +#: ../../reference/compound_stmts.rst:940 msgid "In simple terms ``(P)`` has the same effect as ``P``." msgstr "" -#: ../../reference/compound_stmts.rst:941 +#: ../../reference/compound_stmts.rst:945 msgid "Sequence Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:943 +#: ../../reference/compound_stmts.rst:947 msgid "" "A sequence pattern contains several subpatterns to be matched against " "sequence elements. The syntax is similar to the unpacking of a list or tuple." msgstr "" -#: ../../reference/compound_stmts.rst:954 +#: ../../reference/compound_stmts.rst:958 msgid "" "There is no difference if parentheses or square brackets are used for " "sequence patterns (i.e. ``(...)`` vs ``[...]`` )." msgstr "" -#: ../../reference/compound_stmts.rst:958 +#: ../../reference/compound_stmts.rst:962 msgid "" "A single pattern enclosed in parentheses without a trailing comma (e.g. ``(3 " "| 4)``) is a :ref:`group pattern `. While a single pattern " "enclosed in square brackets (e.g. ``[3 | 4]``) is still a sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:963 +#: ../../reference/compound_stmts.rst:967 msgid "" "At most one star subpattern may be in a sequence pattern. The star " "subpattern may occur in any position. If no star subpattern is present, the " @@ -943,40 +950,40 @@ msgid "" "variable-length sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:968 +#: ../../reference/compound_stmts.rst:972 msgid "" "The following is the logical flow for matching a sequence pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:971 +#: ../../reference/compound_stmts.rst:975 msgid "" "If the subject value is not a sequence [#]_, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:974 +#: ../../reference/compound_stmts.rst:978 msgid "" "If the subject value is an instance of ``str``, ``bytes`` or ``bytearray`` " "the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:977 +#: ../../reference/compound_stmts.rst:981 msgid "" "The subsequent steps depend on whether the sequence pattern is fixed or " "variable-length." msgstr "" -#: ../../reference/compound_stmts.rst:980 +#: ../../reference/compound_stmts.rst:984 msgid "If the sequence pattern is fixed-length:" msgstr "" -#: ../../reference/compound_stmts.rst:982 +#: ../../reference/compound_stmts.rst:986 msgid "" "If the length of the subject sequence is not equal to the number of " "subpatterns, the sequence pattern fails" msgstr "" -#: ../../reference/compound_stmts.rst:985 +#: ../../reference/compound_stmts.rst:989 msgid "" "Subpatterns in the sequence pattern are matched to their corresponding items " "in the subject sequence from left to right. Matching stops as soon as a " @@ -984,118 +991,118 @@ msgid "" "corresponding item, the sequence pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:990 +#: ../../reference/compound_stmts.rst:994 msgid "Otherwise, if the sequence pattern is variable-length:" msgstr "" -#: ../../reference/compound_stmts.rst:992 +#: ../../reference/compound_stmts.rst:996 msgid "" "If the length of the subject sequence is less than the number of non-star " "subpatterns, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:995 +#: ../../reference/compound_stmts.rst:999 msgid "" "The leading non-star subpatterns are matched to their corresponding items as " "for fixed-length sequences." msgstr "" -#: ../../reference/compound_stmts.rst:998 +#: ../../reference/compound_stmts.rst:1002 msgid "" "If the previous step succeeds, the star subpattern matches a list formed of " "the remaining subject items, excluding the remaining items corresponding to " "non-star subpatterns following the star subpattern." msgstr "" -#: ../../reference/compound_stmts.rst:1002 +#: ../../reference/compound_stmts.rst:1006 msgid "" "Remaining non-star subpatterns are matched to their corresponding subject " "items, as for a fixed-length sequence." msgstr "" -#: ../../reference/compound_stmts.rst:1005 +#: ../../reference/compound_stmts.rst:1009 msgid "" "The length of the subject sequence is obtained via :func:`len` (i.e. via " "the :meth:`__len__` protocol). This length may be cached by the interpreter " "in a similar manner as :ref:`value patterns `." msgstr "" -#: ../../reference/compound_stmts.rst:1011 +#: ../../reference/compound_stmts.rst:1015 msgid "" "In simple terms ``[P1, P2, P3,`` ... ``, P]`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1014 +#: ../../reference/compound_stmts.rst:1018 msgid "check ```` is a sequence" msgstr "" -#: ../../reference/compound_stmts.rst:1015 +#: ../../reference/compound_stmts.rst:1019 msgid "``len(subject) == ``" msgstr "``len(subject) == ``" -#: ../../reference/compound_stmts.rst:1016 +#: ../../reference/compound_stmts.rst:1020 msgid "" "``P1`` matches ``[0]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1017 +#: ../../reference/compound_stmts.rst:1021 msgid "" "``P2`` matches ``[1]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1018 +#: ../../reference/compound_stmts.rst:1022 msgid "... and so on for the corresponding pattern/element." msgstr "" -#: ../../reference/compound_stmts.rst:1023 +#: ../../reference/compound_stmts.rst:1027 msgid "Mapping Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1025 +#: ../../reference/compound_stmts.rst:1029 msgid "" "A mapping pattern contains one or more key-value patterns. The syntax is " "similar to the construction of a dictionary. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1036 +#: ../../reference/compound_stmts.rst:1040 msgid "" "At most one double star pattern may be in a mapping pattern. The double " "star pattern must be the last subpattern in the mapping pattern." msgstr "" -#: ../../reference/compound_stmts.rst:1039 +#: ../../reference/compound_stmts.rst:1043 msgid "" "Duplicate keys in mapping patterns are disallowed. Duplicate literal keys " "will raise a :exc:`SyntaxError`. Two keys that otherwise have the same value " "will raise a :exc:`ValueError` at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1043 +#: ../../reference/compound_stmts.rst:1047 msgid "" "The following is the logical flow for matching a mapping pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1046 +#: ../../reference/compound_stmts.rst:1050 msgid "If the subject value is not a mapping [#]_,the mapping pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1048 +#: ../../reference/compound_stmts.rst:1052 msgid "" "If every key given in the mapping pattern is present in the subject mapping, " "and the pattern for each key matches the corresponding item of the subject " "mapping, the mapping pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1052 +#: ../../reference/compound_stmts.rst:1056 msgid "" "If duplicate keys are detected in the mapping pattern, the pattern is " "considered invalid. A :exc:`SyntaxError` is raised for duplicate literal " "values; or a :exc:`ValueError` for named keys of the same value." msgstr "" -#: ../../reference/compound_stmts.rst:1056 +#: ../../reference/compound_stmts.rst:1060 msgid "" "Key-value pairs are matched using the two-argument form of the mapping " "subject's ``get()`` method. Matched key-value pairs must already be present " @@ -1103,256 +1110,256 @@ msgid "" "`__getitem__`." msgstr "" -#: ../../reference/compound_stmts.rst:1061 +#: ../../reference/compound_stmts.rst:1065 msgid "" "In simple terms ``{KEY1: P1, KEY2: P2, ... }`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1064 +#: ../../reference/compound_stmts.rst:1068 msgid "check ```` is a mapping" msgstr "" -#: ../../reference/compound_stmts.rst:1065 +#: ../../reference/compound_stmts.rst:1069 msgid "``KEY1 in ``" msgstr "``KEY1 in ``" -#: ../../reference/compound_stmts.rst:1066 +#: ../../reference/compound_stmts.rst:1070 msgid "``P1`` matches ``[KEY1]``" msgstr "" -#: ../../reference/compound_stmts.rst:1067 +#: ../../reference/compound_stmts.rst:1071 msgid "... and so on for the corresponding KEY/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1073 +#: ../../reference/compound_stmts.rst:1077 msgid "Class Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1075 +#: ../../reference/compound_stmts.rst:1079 msgid "" "A class pattern represents a class and its positional and keyword arguments " "(if any). Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1086 +#: ../../reference/compound_stmts.rst:1090 msgid "The same keyword should not be repeated in class patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1088 +#: ../../reference/compound_stmts.rst:1092 msgid "" "The following is the logical flow for matching a class pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1091 +#: ../../reference/compound_stmts.rst:1095 msgid "" "If ``name_or_attr`` is not an instance of the builtin :class:`type` , raise :" "exc:`TypeError`." msgstr "" -#: ../../reference/compound_stmts.rst:1094 +#: ../../reference/compound_stmts.rst:1098 msgid "" "If the subject value is not an instance of ``name_or_attr`` (tested via :" "func:`isinstance`), the class pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1097 +#: ../../reference/compound_stmts.rst:1101 msgid "" "If no pattern arguments are present, the pattern succeeds. Otherwise, the " "subsequent steps depend on whether keyword or positional argument patterns " "are present." msgstr "" -#: ../../reference/compound_stmts.rst:1101 +#: ../../reference/compound_stmts.rst:1105 msgid "" "For a number of built-in types (specified below), a single positional " "subpattern is accepted which will match the entire subject; for these types " "keyword patterns also work as for other types." msgstr "" -#: ../../reference/compound_stmts.rst:1105 +#: ../../reference/compound_stmts.rst:1109 msgid "" "If only keyword patterns are present, they are processed as follows, one by " "one:" msgstr "" -#: ../../reference/compound_stmts.rst:1108 +#: ../../reference/compound_stmts.rst:1112 msgid "I. The keyword is looked up as an attribute on the subject." msgstr "" -#: ../../reference/compound_stmts.rst:1110 +#: ../../reference/compound_stmts.rst:1114 msgid "" "If this raises an exception other than :exc:`AttributeError`, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1113 +#: ../../reference/compound_stmts.rst:1117 msgid "If this raises :exc:`AttributeError`, the class pattern has failed." msgstr "" -#: ../../reference/compound_stmts.rst:1115 +#: ../../reference/compound_stmts.rst:1119 msgid "" "Else, the subpattern associated with the keyword pattern is matched against " "the subject's attribute value. If this fails, the class pattern fails; if " "this succeeds, the match proceeds to the next keyword." msgstr "" -#: ../../reference/compound_stmts.rst:1120 +#: ../../reference/compound_stmts.rst:1124 msgid "II. If all keyword patterns succeed, the class pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1122 +#: ../../reference/compound_stmts.rst:1126 msgid "" "If any positional patterns are present, they are converted to keyword " "patterns using the :data:`~object.__match_args__` attribute on the class " "``name_or_attr`` before matching:" msgstr "" -#: ../../reference/compound_stmts.rst:1126 +#: ../../reference/compound_stmts.rst:1130 msgid "" "I. The equivalent of ``getattr(cls, \"__match_args__\", ())`` is called." msgstr "" -#: ../../reference/compound_stmts.rst:1128 +#: ../../reference/compound_stmts.rst:1132 msgid "If this raises an exception, the exception bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1130 +#: ../../reference/compound_stmts.rst:1134 msgid "" "If the returned value is not a tuple, the conversion fails and :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1133 +#: ../../reference/compound_stmts.rst:1137 msgid "" "If there are more positional patterns than ``len(cls.__match_args__)``, :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1136 +#: ../../reference/compound_stmts.rst:1140 msgid "" "Otherwise, positional pattern ``i`` is converted to a keyword pattern using " "``__match_args__[i]`` as the keyword. ``__match_args__[i]`` must be a " "string; if not :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1140 +#: ../../reference/compound_stmts.rst:1144 msgid "If there are duplicate keywords, :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1142 +#: ../../reference/compound_stmts.rst:1146 msgid ":ref:`class-pattern-matching`" msgstr ":ref:`class-pattern-matching`" -#: ../../reference/compound_stmts.rst:1145 +#: ../../reference/compound_stmts.rst:1149 msgid "" "II. Once all positional patterns have been converted to keyword patterns," msgstr "" -#: ../../reference/compound_stmts.rst:1145 +#: ../../reference/compound_stmts.rst:1149 msgid "the match proceeds as if there were only keyword patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1147 +#: ../../reference/compound_stmts.rst:1151 msgid "" "For the following built-in types the handling of positional subpatterns is " "different:" msgstr "" -#: ../../reference/compound_stmts.rst:1150 +#: ../../reference/compound_stmts.rst:1154 msgid ":class:`bool`" msgstr ":class:`bool`" -#: ../../reference/compound_stmts.rst:1151 +#: ../../reference/compound_stmts.rst:1155 msgid ":class:`bytearray`" msgstr ":class:`bytearray`" -#: ../../reference/compound_stmts.rst:1152 +#: ../../reference/compound_stmts.rst:1156 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../reference/compound_stmts.rst:1153 +#: ../../reference/compound_stmts.rst:1157 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../reference/compound_stmts.rst:1154 +#: ../../reference/compound_stmts.rst:1158 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../reference/compound_stmts.rst:1155 +#: ../../reference/compound_stmts.rst:1159 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../reference/compound_stmts.rst:1156 +#: ../../reference/compound_stmts.rst:1160 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../reference/compound_stmts.rst:1157 -#: ../../reference/compound_stmts.rst:1608 +#: ../../reference/compound_stmts.rst:1161 +#: ../../reference/compound_stmts.rst:1612 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../reference/compound_stmts.rst:1158 +#: ../../reference/compound_stmts.rst:1162 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../reference/compound_stmts.rst:1159 +#: ../../reference/compound_stmts.rst:1163 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../reference/compound_stmts.rst:1160 -#: ../../reference/compound_stmts.rst:1611 +#: ../../reference/compound_stmts.rst:1164 +#: ../../reference/compound_stmts.rst:1615 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../reference/compound_stmts.rst:1162 +#: ../../reference/compound_stmts.rst:1166 msgid "" "These classes accept a single positional argument, and the pattern there is " "matched against the whole object rather than an attribute. For example " "``int(0|1)`` matches the value ``0``, but not the value ``0.0``." msgstr "" -#: ../../reference/compound_stmts.rst:1166 +#: ../../reference/compound_stmts.rst:1170 msgid "" "In simple terms ``CLS(P1, attr=P2)`` matches only if the following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1168 +#: ../../reference/compound_stmts.rst:1172 msgid "``isinstance(, CLS)``" msgstr "``isinstance(, CLS)``" -#: ../../reference/compound_stmts.rst:1169 +#: ../../reference/compound_stmts.rst:1173 msgid "convert ``P1`` to a keyword pattern using ``CLS.__match_args__``" msgstr "" -#: ../../reference/compound_stmts.rst:1171 +#: ../../reference/compound_stmts.rst:1175 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1171 +#: ../../reference/compound_stmts.rst:1175 msgid "``hasattr(, \"attr\")``" msgstr "``hasattr(, \"attr\")``" -#: ../../reference/compound_stmts.rst:1172 +#: ../../reference/compound_stmts.rst:1176 msgid "``P2`` matches ``.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1173 +#: ../../reference/compound_stmts.rst:1177 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1188 +#: ../../reference/compound_stmts.rst:1192 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1203 +#: ../../reference/compound_stmts.rst:1207 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1222 +#: ../../reference/compound_stmts.rst:1226 msgid "" "A function definition is an executable statement. Its execution binds the " "function name in the current local namespace to a function object (a wrapper " @@ -1361,13 +1368,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1228 +#: ../../reference/compound_stmts.rst:1232 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1234 +#: ../../reference/compound_stmts.rst:1238 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1378,28 +1385,28 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1245 -#: ../../reference/compound_stmts.rst:1422 +#: ../../reference/compound_stmts.rst:1249 +#: ../../reference/compound_stmts.rst:1426 msgid "is roughly equivalent to ::" msgstr "" "大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1250 +#: ../../reference/compound_stmts.rst:1254 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1252 +#: ../../reference/compound_stmts.rst:1256 msgid "" "Functions may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1262 +#: ../../reference/compound_stmts.rst:1266 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1410,7 +1417,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1274 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1423,7 +1430,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1291 +#: ../../reference/compound_stmts.rst:1295 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1439,13 +1446,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1303 +#: ../../reference/compound_stmts.rst:1307 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1312 +#: ../../reference/compound_stmts.rst:1316 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1462,7 +1469,7 @@ msgid "" "different order than they appear in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1327 +#: ../../reference/compound_stmts.rst:1331 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1474,7 +1481,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1335 +#: ../../reference/compound_stmts.rst:1339 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1483,51 +1490,51 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1344 +#: ../../reference/compound_stmts.rst:1348 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1344 +#: ../../reference/compound_stmts.rst:1348 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1347 +#: ../../reference/compound_stmts.rst:1351 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1347 +#: ../../reference/compound_stmts.rst:1351 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1351 +#: ../../reference/compound_stmts.rst:1355 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1350 +#: ../../reference/compound_stmts.rst:1354 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables" msgstr "" -#: ../../reference/compound_stmts.rst:1354 +#: ../../reference/compound_stmts.rst:1358 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1354 +#: ../../reference/compound_stmts.rst:1358 msgid "" "Support for forward references within annotations by preserving annotations " "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:1361 +#: ../../reference/compound_stmts.rst:1365 msgid "Class definitions" msgstr "" -#: ../../reference/compound_stmts.rst:1376 +#: ../../reference/compound_stmts.rst:1380 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1383 +#: ../../reference/compound_stmts.rst:1387 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1536,11 +1543,11 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1396 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1397 +#: ../../reference/compound_stmts.rst:1401 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -1552,7 +1559,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1406 +#: ../../reference/compound_stmts.rst:1410 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's ``__dict__``. Note that this is reliable only right after " @@ -1560,30 +1567,30 @@ msgid "" "definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1411 +#: ../../reference/compound_stmts.rst:1415 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1416 +#: ../../reference/compound_stmts.rst:1420 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1427 +#: ../../reference/compound_stmts.rst:1431 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:1430 +#: ../../reference/compound_stmts.rst:1434 msgid "" "Classes may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1435 +#: ../../reference/compound_stmts.rst:1439 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1596,35 +1603,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1450 +#: ../../reference/compound_stmts.rst:1454 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1448 +#: ../../reference/compound_stmts.rst:1452 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:1453 +#: ../../reference/compound_stmts.rst:1457 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../reference/compound_stmts.rst:1453 +#: ../../reference/compound_stmts.rst:1457 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1460 +#: ../../reference/compound_stmts.rst:1464 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1468 +#: ../../reference/compound_stmts.rst:1472 msgid "Coroutine function definition" msgstr "" -#: ../../reference/compound_stmts.rst:1478 +#: ../../reference/compound_stmts.rst:1482 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1632,189 +1639,189 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1482 +#: ../../reference/compound_stmts.rst:1486 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:1485 +#: ../../reference/compound_stmts.rst:1489 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1488 +#: ../../reference/compound_stmts.rst:1492 msgid "An example of a coroutine function::" msgstr "" "一個協程韓式函式範例:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1498 msgid "" "``await`` and ``async`` are now keywords; previously they were only treated " "as such inside the body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1502 +#: ../../reference/compound_stmts.rst:1506 msgid "The :keyword:`!async for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1511 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:1511 +#: ../../reference/compound_stmts.rst:1515 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1521 +#: ../../reference/compound_stmts.rst:1525 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1537 +#: ../../reference/compound_stmts.rst:1541 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "" "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`\\ 。" -#: ../../reference/compound_stmts.rst:1539 +#: ../../reference/compound_stmts.rst:1543 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1547 +#: ../../reference/compound_stmts.rst:1551 msgid "The :keyword:`!async with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1552 +#: ../../reference/compound_stmts.rst:1556 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:1579 +#: ../../reference/compound_stmts.rst:1583 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "" "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`\\ 。" -#: ../../reference/compound_stmts.rst:1581 +#: ../../reference/compound_stmts.rst:1585 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1587 +#: ../../reference/compound_stmts.rst:1591 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1587 +#: ../../reference/compound_stmts.rst:1591 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1592 +#: ../../reference/compound_stmts.rst:1596 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1593 +#: ../../reference/compound_stmts.rst:1597 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:1597 +#: ../../reference/compound_stmts.rst:1601 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1599 +#: ../../reference/compound_stmts.rst:1603 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1600 +#: ../../reference/compound_stmts.rst:1604 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1601 +#: ../../reference/compound_stmts.rst:1605 msgid "" "a builtin class that has its (CPython) :data:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1602 -#: ../../reference/compound_stmts.rst:1621 +#: ../../reference/compound_stmts.rst:1606 +#: ../../reference/compound_stmts.rst:1625 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1604 +#: ../../reference/compound_stmts.rst:1608 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1606 +#: ../../reference/compound_stmts.rst:1610 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1607 +#: ../../reference/compound_stmts.rst:1611 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1609 +#: ../../reference/compound_stmts.rst:1613 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1610 +#: ../../reference/compound_stmts.rst:1614 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1613 +#: ../../reference/compound_stmts.rst:1617 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1616 +#: ../../reference/compound_stmts.rst:1620 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1618 +#: ../../reference/compound_stmts.rst:1622 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1619 +#: ../../reference/compound_stmts.rst:1623 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1620 +#: ../../reference/compound_stmts.rst:1624 msgid "" "a builtin class that has its (CPython) :data:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1623 +#: ../../reference/compound_stmts.rst:1627 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1626 +#: ../../reference/compound_stmts.rst:1630 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's ``__doc__`` attribute and therefore the " "function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1630 +#: ../../reference/compound_stmts.rst:1634 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's ``__doc__`` item and therefore the class's :" diff --git a/reference/datamodel.po b/reference/datamodel.po index 03bdb2c864..37514e7cd0 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1863,7 +1863,7 @@ msgstr "" msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " -"insertion, O(n\\ :sup:`2`) complexity. See http://www.ocert.org/advisories/" +"insertion, O(n\\ :sup:`2`) complexity. See http://ocert.org/advisories/" "ocert-2011-003.html for details." msgstr "" diff --git a/reference/introduction.po b/reference/introduction.po index 63c6530e67..70f85cc759 100644 --- a/reference/introduction.po +++ b/reference/introduction.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -137,8 +137,8 @@ msgid "" "support and a Just in Time compiler. One of the goals of the project is to " "encourage experimentation with the language itself by making it easier to " "modify the interpreter (since it is written in Python). Additional " -"information is available on `the PyPy project's home page `_." +"information is available on `the PyPy project's home page `_." msgstr "" #: ../../reference/introduction.rst:79 diff --git a/sphinx.po b/sphinx.po index c4aa043ae5..2546ddc36b 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-07 00:36+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2022-06-27 11:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -301,3 +301,15 @@ msgstr "這份說明文件是寫給一個不再被支援的舊版 Python。你 #: ../../tools/templates/layout.html:8 msgid " Python documentation for the current stable release" msgstr " 當前穩定發行的 Python 版本說明文件" + +#: ../../tools/templates/layout.html:14 +msgid "" +"This is a deploy preview created from a pull request.\n" +" For authoritative documentation, see the " +msgstr "" + +#: ../../tools/templates/layout.html:16 +#, fuzzy +msgid " the current stable release" +msgstr " 當前穩定發行的 Python 版本說明文件" diff --git a/using/cmdline.po b/using/cmdline.po index 1f371926a8..3979741aa3 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -476,7 +476,7 @@ msgid "" "Hash randomization is intended to provide protection against a denial-of-" "service caused by carefully chosen inputs that exploit the worst case " "performance of a dict construction, O(n\\ :sup:`2`) complexity. See http://" -"www.ocert.org/advisories/ocert-2011-003.html for details." +"ocert.org/advisories/ocert-2011-003.html for details." msgstr "" #: ../../using/cmdline.rst:372 diff --git a/using/mac.po b/using/mac.po index 56c7c819cc..86c390affe 100644 --- a/using/mac.po +++ b/using/mac.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-07 00:19+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2022-08-31 22:26+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -136,6 +136,7 @@ msgstr "" "`ide` 部分,並在 IDE 執行時使用幫助選單。" #: ../../using/mac.rst:62 +#, fuzzy msgid "" "If you want to run Python scripts from the Terminal window command line or " "from the Finder you first need an editor to create your script. macOS comes " @@ -144,8 +145,8 @@ msgid "" "`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see http://www." "barebones.com/products/bbedit/index.html) are good choices, as is :program:" "`TextMate` (see https://macromates.com/). Other editors include :program:" -"`Gvim` (https://macvim-dev.github.io/macvim/) and :program:`Aquamacs` " -"(http://aquamacs.org/)." +"`Gvim` (https://macvim.org/macvim/) and :program:`Aquamacs` (http://aquamacs." +"org/)." msgstr "" "如果要從終端機視窗命令列或 Finder 執行 Python 腳本,首先需要一個編輯器來建立" "腳本。macOS 附帶了許多標準的 Unix 命令列編輯器,如 :program:`vim` 和 :" @@ -218,10 +219,11 @@ msgid "" "or :file:`.cshrc` at startup. You need to create a file :file:`~/.MacOSX/" "environment.plist`. See Apple's Technical Document QA1067 for details." msgstr "" -"macOS 上的 Python 遵循所有標準的 Unix 環境變數,例如 :envvar:`PYTHONPATH`" -"\\ ,但是為 Finder 啟動的程式設定這些變數並非是標準做法,因為 Finder 在啟動時" -"不會讀取你的 :file:`.profile` 或 :file:`.cshrc`\\ 。你需要建立一個檔案 :file:" -"`~/.MacOSX/environment.plist`\\ 。相關資訊請參閱 Apple 的技術文件 QA1067。" +"macOS 上的 Python 遵循所有標準的 Unix 環境變數,例如 :envvar:" +"`PYTHONPATH`\\ ,但是為 Finder 啟動的程式設定這些變數並非是標準做法,因為 " +"Finder 在啟動時不會讀取你的 :file:`.profile` 或 :file:`.cshrc`\\ 。你需要建立" +"一個檔案 :file:`~/.MacOSX/environment.plist`\\ 。相關資訊請參閱 Apple 的技術" +"文件 QA1067。" #: ../../using/mac.rst:109 msgid "" diff --git a/using/windows.po b/using/windows.po index 1c3a4135e6..985d2bb44d 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-25 00:30+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -925,7 +925,8 @@ msgid "" msgstr "" #: ../../using/windows.rst:532 -msgid "`ActivePython `_" +#, fuzzy +msgid "`ActivePython `_" msgstr "`ActivePython `_" #: ../../using/windows.rst:532 diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 842bd199a6..42cb45e38b 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -212,10 +212,11 @@ msgstr "" #: ../../whatsnew/2.0.rst:155 msgid "" "In Python source code, Unicode strings are written as ``u\"string\"``. " -"Arbitrary Unicode characters can be written using a new escape sequence, ``" -"\\uHHHH``, where *HHHH* is a 4-digit hexadecimal number from 0000 to FFFF. " -"The existing ``\\xHHHH`` escape sequence can also be used, and octal escapes " -"can be used for characters up to U+01FF, which is represented by ``\\777``." +"Arbitrary Unicode characters can be written using a new escape sequence, " +"``\\uHHHH``, where *HHHH* is a 4-digit hexadecimal number from 0000 to " +"FFFF. The existing ``\\xHHHH`` escape sequence can also be used, and octal " +"escapes can be used for characters up to U+01FF, which is represented by " +"``\\777``." msgstr "" #: ../../whatsnew/2.0.rst:161 @@ -846,8 +847,8 @@ msgstr "" msgid "" "The ``\\x`` escape in string literals now takes exactly 2 hex digits. " "Previously it would consume all the hex digits following the 'x' and take " -"the lowest 8 bits of the result, so ``\\x123456`` was equivalent to ``" -"\\x56``." +"the lowest 8 bits of the result, so ``\\x123456`` was equivalent to " +"``\\x56``." msgstr "" #: ../../whatsnew/2.0.rst:688 @@ -1131,7 +1132,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:935 msgid "" "For more information, consult the Python documentation, or the XML HOWTO at " -"http://pyxml.sourceforge.net/topics/howto/xml-howto.html." +"https://pyxml.sourceforge.net/topics/howto/xml-howto.html." msgstr "" #: ../../whatsnew/2.0.rst:940 diff --git a/whatsnew/2.1.po b/whatsnew/2.1.po index fce5510943..72fff69652 100644 --- a/whatsnew/2.1.po +++ b/whatsnew/2.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-22 00:18+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -314,11 +314,11 @@ msgstr "" msgid "" "The built-in ``cmp(A,B)`` function can use the rich comparison machinery, " "and now accepts an optional argument specifying which comparison operation " -"to use; this is given as one of the strings ``\"<\"``, ``\"<=\"``, ``\">" -"\"``, ``\">=\"``, ``\"==\"``, or ``\"!=\"``. If called without the optional " -"third argument, :func:`cmp` will only return -1, 0, or +1 as in previous " -"versions of Python; otherwise it will call the appropriate method and can " -"return any Python object." +"to use; this is given as one of the strings ``\"<\"``, ``\"<=\"``, " +"``\">\"``, ``\">=\"``, ``\"==\"``, or ``\"!=\"``. If called without the " +"optional third argument, :func:`cmp` will only return -1, 0, or +1 as in " +"previous versions of Python; otherwise it will call the appropriate method " +"and can return any Python object." msgstr "" #: ../../whatsnew/2.1.rst:214 @@ -760,7 +760,7 @@ msgid "" "framework based on running embedded examples in docstrings and comparing the " "results against the expected output. PyUnit, contributed by Steve Purcell, " "is a unit testing framework inspired by JUnit, which was in turn an " -"adaptation of Kent Beck's Smalltalk testing framework. See http://pyunit." +"adaptation of Kent Beck's Smalltalk testing framework. See https://pyunit." "sourceforge.net/ for more information about PyUnit." msgstr "" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index c4bf8916fd..833f7f5d56 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -704,11 +704,11 @@ msgstr "" #: ../../whatsnew/2.2.rst:634 msgid "" "The idea of generators comes from other programming languages, especially " -"Icon (https://www.cs.arizona.edu/icon/), where the idea of generators is " +"Icon (https://www2.cs.arizona.edu/icon/), where the idea of generators is " "central. In Icon, every expression and function call behaves like a " -"generator. One example from \"An Overview of the Icon Programming Language" -"\" at https://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what " -"this looks like::" +"generator. One example from \"An Overview of the Icon Programming " +"Language\" at https://www2.cs.arizona.edu/icon/docs/ipd266.htm gives an idea " +"of what this looks like::" msgstr "" #: ../../whatsnew/2.2.rst:644 @@ -1150,8 +1150,8 @@ msgstr "" #: ../../whatsnew/2.2.rst:1006 msgid "" -"The :mod:`smtplib` module now supports :rfc:`2487`, \"Secure SMTP over TLS" -"\", so it's now possible to encrypt the SMTP traffic between a Python " +"The :mod:`smtplib` module now supports :rfc:`2487`, \"Secure SMTP over " +"TLS\", so it's now possible to encrypt the SMTP traffic between a Python " "program and the mail transport agent being handed a message. :mod:`smtplib` " "also supports SMTP authentication. (Contributed by Gerhard Häring.)" msgstr "" @@ -1370,11 +1370,11 @@ msgid "" "The most significant change is the ability to build Python as a framework, " "enabled by supplying the :option:`!--enable-framework` option to the " "configure script when compiling Python. According to Jack Jansen, \"This " -"installs a self-contained Python installation plus the OS X framework \"glue" -"\" into :file:`/Library/Frameworks/Python.framework` (or another location of " -"choice). For now there is little immediate added benefit to this (actually, " -"there is the disadvantage that you have to change your PATH to be able to " -"find Python), but it is the basis for creating a full-blown Python " +"installs a self-contained Python installation plus the OS X framework " +"\"glue\" into :file:`/Library/Frameworks/Python.framework` (or another " +"location of choice). For now there is little immediate added benefit to this " +"(actually, there is the disadvantage that you have to change your PATH to be " +"able to find Python), but it is the basis for creating a full-blown Python " "application, porting the MacPython IDE, possibly using Python as a standard " "OSA scripting language and much more.\"" msgstr "" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 9d578a9e26..f821ec1caa 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -225,11 +225,11 @@ msgstr "" #: ../../whatsnew/2.3.rst:220 msgid "" "The idea of generators comes from other programming languages, especially " -"Icon (https://www.cs.arizona.edu/icon/), where the idea of generators is " +"Icon (https://www2.cs.arizona.edu/icon/), where the idea of generators is " "central. In Icon, every expression and function call behaves like a " -"generator. One example from \"An Overview of the Icon Programming Language" -"\" at https://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what " -"this looks like::" +"generator. One example from \"An Overview of the Icon Programming " +"Language\" at https://www2.cs.arizona.edu/icon/docs/ipd266.htm gives an idea " +"of what this looks like::" msgstr "" #: ../../whatsnew/2.3.rst:230 @@ -650,9 +650,9 @@ msgstr "" msgid "" "When encoding a Unicode string into a byte string, unencodable characters " "may be encountered. So far, Python has allowed specifying the error " -"processing as either \"strict\" (raising :exc:`UnicodeError`), \"ignore" -"\" (skipping the character), or \"replace\" (using a question mark in the " -"output string), with \"strict\" being the default behavior. It may be " +"processing as either \"strict\" (raising :exc:`UnicodeError`), " +"\"ignore\" (skipping the character), or \"replace\" (using a question mark " +"in the output string), with \"strict\" being the default behavior. It may be " "desirable to specify alternative processing of such errors, such as " "inserting an XML character reference or HTML entity reference into the " "converted string." @@ -1421,11 +1421,11 @@ msgstr "" msgid "" "The new :mod:`heapq` module contains an implementation of a heap queue " "algorithm. A heap is an array-like data structure that keeps items in a " -"partially sorted order such that, for every index *k*, ``heap[k] <= heap[2*k" -"+1]`` and ``heap[k] <= heap[2*k+2]``. This makes it quick to remove the " -"smallest item, and inserting a new item while maintaining the heap property " -"is O(lg n). (See https://xlinux.nist.gov/dads//HTML/priorityque.html for " -"more information about the priority queue data structure.)" +"partially sorted order such that, for every index *k*, ``heap[k] <= " +"heap[2*k+1]`` and ``heap[k] <= heap[2*k+2]``. This makes it quick to remove " +"the smallest item, and inserting a new item while maintaining the heap " +"property is O(lg n). (See https://xlinux.nist.gov/dads//HTML/priorityque." +"html for more information about the priority queue data structure.)" msgstr "" #: ../../whatsnew/2.3.rst:1314 @@ -1443,7 +1443,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1334 msgid "" "The IDLE integrated development environment has been updated using the code " -"from the IDLEfork project (http://idlefork.sourceforge.net). The most " +"from the IDLEfork project (https://idlefork.sourceforge.net). The most " "notable feature is that the code being developed is now executed in a " "subprocess, meaning that there's no longer any need for manual ``reload()`` " "operations. IDLE's core code has been incorporated into the standard library " @@ -1993,9 +1993,9 @@ msgstr "" #: ../../whatsnew/2.3.rst:1842 msgid "" -"To allocate and free an undistinguished chunk of memory use the \"raw memory" -"\" family: :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc`, and :c:func:" -"`PyMem_Free`." +"To allocate and free an undistinguished chunk of memory use the \"raw " +"memory\" family: :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc`, and :c:" +"func:`PyMem_Free`." msgstr "" #: ../../whatsnew/2.3.rst:1845 diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index e12a0301c8..cf2aecba40 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -842,8 +842,8 @@ msgstr "" #: ../../whatsnew/2.4.rst:758 msgid "" -"The code for these functions came from the GLib library (https://developer." -"gnome.org/glib/stable/), whose developers kindly relicensed the relevant " +"The code for these functions came from the GLib library (https://developer-" +"old.gnome.org/glib/2.26/), whose developers kindly relicensed the relevant " "functions and donated them to the Python Software Foundation. The :mod:" "`locale` module can now change the numeric locale, letting extensions such " "as GTK+ produce the correct results." @@ -1697,8 +1697,8 @@ msgid "" "with-tsc` switch enables profiling using the Pentium's Time-Stamp-Counter " "register. Note that the :option:`!--with-tsc` switch is slightly misnamed, " "because the profiling feature also works on the PowerPC platform, though " -"that processor architecture doesn't call that register \"the TSC register" -"\". (Contributed by Jeremy Hylton.)" +"that processor architecture doesn't call that register \"the TSC " +"register\". (Contributed by Jeremy Hylton.)" msgstr "" #: ../../whatsnew/2.4.rst:1494 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 32e9d9f8b1..0a77dbcc82 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1566,8 +1566,9 @@ msgstr "" #: ../../whatsnew/2.6.rst:1436 msgid "" -"`Scheme's number datatypes `__ from the R5RS Scheme specification." +"`Scheme's number datatypes `__ from the R5RS " +"Scheme specification." msgstr "" #: ../../whatsnew/2.6.rst:1440 @@ -2648,8 +2649,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:2366 msgid "" -"The :mod:`socket` module now supports TIPC (http://tipc.sourceforge.net/), a " -"high-performance non-IP-based protocol designed for use in clustered " +"The :mod:`socket` module now supports TIPC (https://tipc.sourceforge.net/), " +"a high-performance non-IP-based protocol designed for use in clustered " "environments. TIPC addresses are 4- or 5-tuples. (Contributed by Alberto " "Bertogli; :issue:`1646`.)" msgstr "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 3ac82b59ac..e4bb2883da 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-02 00:29+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -266,7 +266,7 @@ msgid "" "significantly updated. It now supports company/tag syntax as defined in :pep:" "`514` using the ``-V:/`` argument instead of the limited ``-" ".``. This allows launching distributions other than " -"``PythonCore``, the one hosted on `python.org `_." +"``PythonCore``, the one hosted on `python.org `_." msgstr "" #: ../../whatsnew/3.11.rst:227 @@ -3799,8 +3799,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:2485 msgid "" -"Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." +"Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." msgstr "" #: ../../whatsnew/3.11.rst:2489 @@ -3843,8 +3843,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:2538 msgid "" -"Or use `the pythoncapi_compat project `__ to get these functions on old Python functions." +"Or use `the pythoncapi-compat project `__ to get these functions on old Python functions." msgstr "" #: ../../whatsnew/3.11.rst:2542 diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index f4bc1a9565..4da847bdcc 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -274,10 +274,10 @@ msgid "" "To solve this problem, Python's import machinery has been extended to use " "distinct filenames for each interpreter. Instead of Python 3.2 and Python " "3.3 and Unladen Swallow each competing for a file called \"mymodule.pyc\", " -"they will now look for \"mymodule.cpython-32.pyc\", \"mymodule.cpython-33.pyc" -"\", and \"mymodule.unladen10.pyc\". And to prevent all of these new files " -"from cluttering source directories, the *pyc* files are now collected in a " -"\"__pycache__\" directory stored under the package directory." +"they will now look for \"mymodule.cpython-32.pyc\", \"mymodule.cpython-33." +"pyc\", and \"mymodule.unladen10.pyc\". And to prevent all of these new " +"files from cluttering source directories, the *pyc* files are now collected " +"in a \"__pycache__\" directory stored under the package directory." msgstr "" #: ../../whatsnew/3.2.rst:312 @@ -867,8 +867,8 @@ msgstr "" msgid "" "(Contributed by Raymond Hettinger and incorporating design ideas from Jim " "Baker, Miki Tebeka, and Nick Coghlan; see `recipe 498245 `_\\, `recipe 577479 `_\\, :issue:`10586`, and :issue:`10593`.)" +"activestate.com/recipes/498245/>`_\\, `recipe 577479 `_\\, :issue:`10586`, and :issue:`10593`.)" msgstr "" #: ../../whatsnew/3.2.rst:790 @@ -3013,8 +3013,9 @@ msgid "" "BuildScript/README.txt>`_ for details. For users running a 32/64-bit build, " "there is a known problem with the default Tcl/Tk on Mac OS X 10.6. " "Accordingly, we recommend installing an updated alternative such as " -"`ActiveState Tcl/Tk 8.5.9 `_" -"\\. See https://www.python.org/download/mac/tcltk/ for additional details." +"`ActiveState Tcl/Tk 8.5.9 `_\\. See https://www.python." +"org/download/mac/tcltk/ for additional details." msgstr "" #: ../../whatsnew/3.2.rst:2608 diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index e3234c5200..856aac9cbc 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -353,8 +353,8 @@ msgstr "" #: ../../whatsnew/3.3.rst:242 msgid "" -"surrogate pairs are not recombined in string literals, so ``'\\uDBFF" -"\\uDFFF' != '\\U0010FFFF'``;" +"surrogate pairs are not recombined in string literals, so " +"``'\\uDBFF\\uDFFF' != '\\U0010FFFF'``;" msgstr "" #: ../../whatsnew/3.3.rst:245 @@ -1775,8 +1775,8 @@ msgid "" "A new policy instance, with new settings, is created using the :meth:`~email." "policy.Policy.clone` method of policy objects. ``clone`` takes any of the " "above controls as keyword arguments. Any control not specified in the call " -"retains its default value. Thus you can create a policy that uses ``\\r" -"\\n`` linesep characters like this::" +"retains its default value. Thus you can create a policy that uses " +"``\\r\\n`` linesep characters like this::" msgstr "" #: ../../whatsnew/3.3.rst:1240 @@ -2756,8 +2756,9 @@ msgstr "" #: ../../whatsnew/3.3.rst:1893 msgid "" "The :class:`~socket.socket` class now supports the PF_RDS protocol family " -"(https://en.wikipedia.org/wiki/Reliable_Datagram_Sockets and https://oss." -"oracle.com/projects/rds/)." +"(https://en.wikipedia.org/wiki/Reliable_Datagram_Sockets and `https://oss." +"oracle.com/projects/rds `__)." msgstr "" #: ../../whatsnew/3.3.rst:1897 diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 48e92b7d51..9b1d89f28e 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -452,7 +452,7 @@ msgid "" "While these annotations are available at runtime through the usual :attr:" "`__annotations__` attribute, *no automatic type checking happens at " "runtime*. Instead, it is assumed that a separate off-line type checker (e." -"g. `mypy `_) will be used for on-demand source code " +"g. `mypy `_) will be used for on-demand source code " "analysis." msgstr "" @@ -1286,8 +1286,8 @@ msgstr "difflib" msgid "" "The charset of HTML documents generated by :meth:`HtmlDiff.make_file() " "` can now be customized by using a new *charset* " -"keyword-only argument. The default charset of HTML document changed from ``" -"\"ISO-8859-1\"`` to ``\"utf-8\"``. (Contributed by Berker Peksag in :issue:" +"keyword-only argument. The default charset of HTML document changed from " +"``\"ISO-8859-1\"`` to ``\"utf-8\"``. (Contributed by Berker Peksag in :issue:" "`2052`.)" msgstr "" @@ -1419,9 +1419,9 @@ msgstr "gzip" #: ../../whatsnew/3.5.rst:1168 msgid "" -"The *mode* argument of the :class:`~gzip.GzipFile` constructor now accepts ``" -"\"x\"`` to request exclusive creation. (Contributed by Tim Heaney in :issue:" -"`19222`.)" +"The *mode* argument of the :class:`~gzip.GzipFile` constructor now accepts " +"``\"x\"`` to request exclusive creation. (Contributed by Tim Heaney in :" +"issue:`19222`.)" msgstr "" #: ../../whatsnew/3.5.rst:1174 @@ -2322,9 +2322,9 @@ msgstr "tarfile" #: ../../whatsnew/3.5.rst:1890 msgid "" -"The *mode* argument of the :func:`~tarfile.open` function now accepts ``\"x" -"\"`` to request exclusive creation. (Contributed by Berker Peksag in :issue:" -"`21717`.)" +"The *mode* argument of the :func:`~tarfile.open` function now accepts " +"``\"x\"`` to request exclusive creation. (Contributed by Berker Peksag in :" +"issue:`21717`.)" msgstr "" #: ../../whatsnew/3.5.rst:1893 @@ -2490,8 +2490,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:2007 msgid "" "The class constructor has a new *unsafe* parameter, which causes mock " -"objects to raise :exc:`AttributeError` on attribute names starting with ``" -"\"assert\"``. (Contributed by Kushal Das in :issue:`21238`.)" +"objects to raise :exc:`AttributeError` on attribute names starting with " +"``\"assert\"``. (Contributed by Kushal Das in :issue:`21238`.)" msgstr "" #: ../../whatsnew/3.5.rst:2012 @@ -2825,7 +2825,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:2214 msgid "" "Windows builds now require Microsoft Visual C++ 14.0, which is available as " -"part of `Visual Studio 2015 `_." +"part of `Visual Studio 2015 `_." msgstr "" #: ../../whatsnew/3.5.rst:2217 @@ -3185,13 +3186,13 @@ msgstr "" #: ../../whatsnew/3.5.rst:2450 msgid "" -"The :func:`re.split` function always ignored empty pattern matches, so the ``" -"\"x*\"`` pattern worked the same as ``\"x+\"``, and the ``\"\\b\"`` pattern " -"never worked. Now :func:`re.split` raises a warning if the pattern could " -"match an empty string. For compatibility, use patterns that never match an " -"empty string (e.g. ``\"x+\"`` instead of ``\"x*\"``). Patterns that could " -"only match an empty string (such as ``\"\\b\"``) now raise an error. " -"(Contributed by Serhiy Storchaka in :issue:`22818`.)" +"The :func:`re.split` function always ignored empty pattern matches, so the " +"``\"x*\"`` pattern worked the same as ``\"x+\"``, and the ``\"\\b\"`` " +"pattern never worked. Now :func:`re.split` raises a warning if the pattern " +"could match an empty string. For compatibility, use patterns that never " +"match an empty string (e.g. ``\"x+\"`` instead of ``\"x*\"``). Patterns " +"that could only match an empty string (such as ``\"\\b\"``) now raise an " +"error. (Contributed by Serhiy Storchaka in :issue:`22818`.)" msgstr "" #: ../../whatsnew/3.5.rst:2458 diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index d67eb574cf..4dfba6697f 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+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" @@ -306,7 +306,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:240 msgid "" -"Tools that use or will use the new syntax: `mypy `_, `pytype `_, PyCharm, etc." msgstr "" @@ -862,8 +862,8 @@ msgstr "" #: ../../whatsnew/3.6.rst:752 msgid "" -"Long sequences of repeated traceback lines are now abbreviated as ``" -"\"[Previous line repeated {count} more times]\"`` (see :ref:`whatsnew36-" +"Long sequences of repeated traceback lines are now abbreviated as " +"``\"[Previous line repeated {count} more times]\"`` (see :ref:`whatsnew36-" "traceback` for an example). (Contributed by Emanuel Barry in :issue:`26823`.)" msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index fe32a89acc..939ba69ba3 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+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-" @@ -1803,17 +1803,17 @@ msgstr "" #: ../../whatsnew/3.8.rst:1468 msgid "" ":func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, :func:" -"`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-copy" -"\" syscalls on Linux and macOS in order to copy the file more efficiently. " -"\"fast-copy\" means that the copying operation occurs within the kernel, " -"avoiding the use of userspace buffers in Python as in \"``outfd.write(infd." -"read())``\". On Windows :func:`shutil.copyfile` uses a bigger default buffer " -"size (1 MiB instead of 16 KiB) and a :func:`memoryview`-based variant of :" -"func:`shutil.copyfileobj` is used. The speedup for copying a 512 MiB file " -"within the same partition is about +26% on Linux, +50% on macOS and +40% on " -"Windows. Also, much less CPU cycles are consumed. See :ref:`shutil-platform-" -"dependent-efficient-copy-operations` section. (Contributed by Giampaolo " -"Rodolà in :issue:`33671`.)" +"`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-" +"copy\" syscalls on Linux and macOS in order to copy the file more " +"efficiently. \"fast-copy\" means that the copying operation occurs within " +"the kernel, avoiding the use of userspace buffers in Python as in \"``outfd." +"write(infd.read())``\". On Windows :func:`shutil.copyfile` uses a bigger " +"default buffer size (1 MiB instead of 16 KiB) and a :func:`memoryview`-based " +"variant of :func:`shutil.copyfileobj` is used. The speedup for copying a 512 " +"MiB file within the same partition is about +26% on Linux, +50% on macOS and " +"+40% on Windows. Also, much less CPU cycles are consumed. See :ref:`shutil-" +"platform-dependent-efficient-copy-operations` section. (Contributed by " +"Giampaolo Rodolà in :issue:`33671`.)" msgstr "" #: ../../whatsnew/3.8.rst:1484 @@ -2502,9 +2502,9 @@ msgstr "" #: ../../whatsnew/3.8.rst:1919 msgid "" ":func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, :func:" -"`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-copy" -"\" syscalls (see :ref:`shutil-platform-dependent-efficient-copy-operations` " -"section)." +"`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-" +"copy\" syscalls (see :ref:`shutil-platform-dependent-efficient-copy-" +"operations` section)." msgstr "" #: ../../whatsnew/3.8.rst:1924 @@ -2825,8 +2825,8 @@ msgid "" "The benchmarks were measured on an `Intel® Core™ i7-4960HQ processor " "`_ running the macOS 64-bit " -"builds found at `python.org `_. " -"The benchmark script displays timings in nanoseconds." +"builds found at `python.org `_. The " +"benchmark script displays timings in nanoseconds." msgstr "" #: ../../whatsnew/3.8.rst:2234 diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 5d76e62444..cfe262469f 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-04 00:15+0000\n" +"POT-Creation-Date: 2023-05-03 00:29+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-" @@ -1208,7 +1208,7 @@ msgid "" "i7-4960HQ processor `_ running the macOS 64-bit builds found at `python.org `_." +"python.org/downloads/macos/>`_." msgstr "" #: ../../whatsnew/3.9.rst:856 From 4ebf4318f8c22e029347f130b4de8c03e7a3c6e4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 4 May 2023 00:32:44 +0000 Subject: [PATCH 080/130] sync with cpython 365e0772 --- howto/curses.po | 259 +++--- library/curses.ascii.po | 254 +++--- library/curses.po | 1739 ++++++++++++++++++--------------------- 3 files changed, 1051 insertions(+), 1201 deletions(-) diff --git a/howto/curses.po b/howto/curses.po index 186af6bdda..1e17bd442c 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-04 00:30+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-" @@ -26,7 +26,7 @@ msgstr "" msgid "Author" msgstr "作者" -#: ../../howto/curses.rst:7 +#: ../../howto/curses.rst:9 msgid "A.M. Kuchling, Eric S. Raymond" msgstr "A.M. Kuchling, Eric S. Raymond" @@ -34,7 +34,7 @@ msgstr "A.M. Kuchling, Eric S. Raymond" msgid "Release" msgstr "發佈版本" -#: ../../howto/curses.rst:8 +#: ../../howto/curses.rst:10 msgid "2.04" msgstr "2.04" @@ -42,17 +42,17 @@ msgstr "2.04" msgid "Abstract" msgstr "摘要" -#: ../../howto/curses.rst:13 +#: ../../howto/curses.rst:15 msgid "" "This document describes how to use the :mod:`curses` extension module to " "control text-mode displays." msgstr "" -#: ../../howto/curses.rst:18 +#: ../../howto/curses.rst:20 msgid "What is curses?" msgstr "" -#: ../../howto/curses.rst:20 +#: ../../howto/curses.rst:22 msgid "" "The curses library supplies a terminal-independent screen-painting and " "keyboard-handling facility for text-based terminals; such terminals include " @@ -63,7 +63,7 @@ msgid "" "own minor quirks." msgstr "" -#: ../../howto/curses.rst:28 +#: ../../howto/curses.rst:30 msgid "" "In a world of graphical displays, one might ask \"why bother\"? It's true " "that character-cell display terminals are an obsolete technology, but there " @@ -73,7 +73,7 @@ msgid "" "configurators that may have to run before any graphical support is available." msgstr "" -#: ../../howto/curses.rst:36 +#: ../../howto/curses.rst:38 msgid "" "The curses library provides fairly basic functionality, providing the " "programmer with an abstraction of a display containing multiple non-" @@ -86,7 +86,7 @@ msgid "" "project/urwid/>`_." msgstr "" -#: ../../howto/curses.rst:46 +#: ../../howto/curses.rst:48 msgid "" "The curses library was originally written for BSD Unix; the later System V " "versions of Unix from AT&T added many enhancements and new functions. BSD " @@ -99,29 +99,29 @@ msgid "" "everything, though." msgstr "" -#: ../../howto/curses.rst:56 +#: ../../howto/curses.rst:58 msgid "" "The Windows version of Python doesn't include the :mod:`curses` module. A " "ported version called `UniCurses `_ is " "available." msgstr "" -#: ../../howto/curses.rst:62 +#: ../../howto/curses.rst:64 msgid "The Python curses module" msgstr "" -#: ../../howto/curses.rst:64 +#: ../../howto/curses.rst:66 msgid "" "The Python module is a fairly simple wrapper over the C functions provided " "by curses; if you're already familiar with curses programming in C, it's " "really easy to transfer that knowledge to Python. The biggest difference is " "that the Python interface makes things simpler by merging different C " -"functions such as :c:func:`addstr`, :c:func:`mvaddstr`, and :c:func:" -"`mvwaddstr` into a single :meth:`~curses.window.addstr` method. You'll see " +"functions such as :c:func:`!addstr`, :c:func:`!mvaddstr`, and :c:func:`!" +"mvwaddstr` into a single :meth:`~curses.window.addstr` method. You'll see " "this covered in more detail later." msgstr "" -#: ../../howto/curses.rst:72 +#: ../../howto/curses.rst:74 msgid "" "This HOWTO is an introduction to writing text-mode programs with curses and " "Python. It doesn't attempt to be a complete guide to the curses API; for " @@ -129,35 +129,35 @@ msgid "" "pages for ncurses. It will, however, give you the basic ideas." msgstr "" -#: ../../howto/curses.rst:79 +#: ../../howto/curses.rst:81 msgid "Starting and ending a curses application" msgstr "" -#: ../../howto/curses.rst:81 +#: ../../howto/curses.rst:83 msgid "" "Before doing anything, curses must be initialized. This is done by calling " "the :func:`~curses.initscr` function, which will determine the terminal " "type, send any required setup codes to the terminal, and create various " -"internal data structures. If successful, :func:`initscr` returns a window " +"internal data structures. If successful, :func:`!initscr` returns a window " "object representing the entire screen; this is usually called ``stdscr`` " "after the name of the corresponding C variable. ::" msgstr "" -#: ../../howto/curses.rst:92 +#: ../../howto/curses.rst:94 msgid "" "Usually curses applications turn off automatic echoing of keys to the " "screen, in order to be able to read keys and only display them under certain " "circumstances. This requires calling the :func:`~curses.noecho` function. ::" msgstr "" -#: ../../howto/curses.rst:99 +#: ../../howto/curses.rst:101 msgid "" "Applications will also commonly need to react to keys instantly, without " "requiring the Enter key to be pressed; this is called cbreak mode, as " "opposed to the usual buffered input mode. ::" msgstr "" -#: ../../howto/curses.rst:105 +#: ../../howto/curses.rst:107 msgid "" "Terminals usually return special keys, such as the cursor keys or navigation " "keys such as Page Up and Home, as a multibyte escape sequence. While you " @@ -167,20 +167,20 @@ msgid "" "keypad mode. ::" msgstr "" -#: ../../howto/curses.rst:114 +#: ../../howto/curses.rst:116 msgid "" "Terminating a curses application is much easier than starting one. You'll " "need to call::" msgstr "" -#: ../../howto/curses.rst:121 +#: ../../howto/curses.rst:123 msgid "" "to reverse the curses-friendly terminal settings. Then call the :func:" "`~curses.endwin` function to restore the terminal to its original operating " "mode. ::" msgstr "" -#: ../../howto/curses.rst:127 +#: ../../howto/curses.rst:129 msgid "" "A common problem when debugging a curses application is to get your terminal " "messed up when the application dies without restoring the terminal to its " @@ -189,18 +189,18 @@ msgid "" "you type them, for example, which makes using the shell difficult." msgstr "" -#: ../../howto/curses.rst:133 +#: ../../howto/curses.rst:135 msgid "" "In Python you can avoid these complications and make debugging much easier " "by importing the :func:`curses.wrapper` function and using it like this::" msgstr "" -#: ../../howto/curses.rst:152 +#: ../../howto/curses.rst:154 msgid "" "The :func:`~curses.wrapper` function takes a callable object and does the " "initializations described above, also initializing colors if color support " -"is present. :func:`wrapper` then runs your provided callable. Once the " -"callable returns, :func:`wrapper` will restore the original state of the " +"is present. :func:`!wrapper` then runs your provided callable. Once the " +"callable returns, :func:`!wrapper` will restore the original state of the " "terminal. The callable is called inside a :keyword:`try`...\\ :keyword:" "`except` that catches exceptions, restores the state of the terminal, and " "then re-raises the exception. Therefore your terminal won't be left in a " @@ -208,18 +208,18 @@ msgid "" "and traceback." msgstr "" -#: ../../howto/curses.rst:164 +#: ../../howto/curses.rst:166 msgid "Windows and Pads" msgstr "" -#: ../../howto/curses.rst:166 +#: ../../howto/curses.rst:168 msgid "" "Windows are the basic abstraction in curses. A window object represents a " "rectangular area of the screen, and supports methods to display text, erase " "it, allow the user to input strings, and so forth." msgstr "" -#: ../../howto/curses.rst:170 +#: ../../howto/curses.rst:172 msgid "" "The ``stdscr`` object returned by the :func:`~curses.initscr` function is a " "window object that covers the entire screen. Many programs may need only " @@ -229,7 +229,7 @@ msgid "" "window object. ::" msgstr "" -#: ../../howto/curses.rst:181 +#: ../../howto/curses.rst:183 msgid "" "Note that the coordinate system used in curses is unusual. Coordinates are " "always passed in the order *y,x*, and the top-left corner of a window is " @@ -239,7 +239,7 @@ msgid "" "curses since it was first written, and it's too late to change things now." msgstr "" -#: ../../howto/curses.rst:189 +#: ../../howto/curses.rst:191 msgid "" "Your application can determine the size of the screen by using the :data:" "`curses.LINES` and :data:`curses.COLS` variables to obtain the *y* and *x* " @@ -247,35 +247,35 @@ msgid "" "- 1, curses.COLS - 1)``." msgstr "" -#: ../../howto/curses.rst:194 +#: ../../howto/curses.rst:196 msgid "" "When you call a method to display or erase text, the effect doesn't " "immediately show up on the display. Instead you must call the :meth:" "`~curses.window.refresh` method of window objects to update the screen." msgstr "" -#: ../../howto/curses.rst:199 +#: ../../howto/curses.rst:201 msgid "" "This is because curses was originally written with slow 300-baud terminal " "connections in mind; with these terminals, minimizing the time required to " "redraw the screen was very important. Instead curses accumulates changes to " "the screen and displays them in the most efficient manner when you call :" -"meth:`refresh`. For example, if your program displays some text in a window " -"and then clears the window, there's no need to send the original text " +"meth:`!refresh`. For example, if your program displays some text in a " +"window and then clears the window, there's no need to send the original text " "because they're never visible." msgstr "" -#: ../../howto/curses.rst:208 +#: ../../howto/curses.rst:210 msgid "" "In practice, explicitly telling curses to redraw a window doesn't really " "complicate programming with curses much. Most programs go into a flurry of " "activity, and then pause waiting for a keypress or some other action on the " "part of the user. All you have to do is to be sure that the screen has been " -"redrawn before pausing to wait for user input, by first calling ``stdscr." -"refresh()`` or the :meth:`refresh` method of some other relevant window." +"redrawn before pausing to wait for user input, by first calling :meth:`!" +"stdscr.refresh` or the :meth:`!refresh` method of some other relevant window." msgstr "" -#: ../../howto/curses.rst:216 +#: ../../howto/curses.rst:218 msgid "" "A pad is a special case of a window; it can be larger than the actual " "display screen, and only a portion of the pad displayed at a time. Creating " @@ -284,56 +284,57 @@ msgid "" "will be displayed. ::" msgstr "" -#: ../../howto/curses.rst:237 +#: ../../howto/curses.rst:239 msgid "" -"The :meth:`refresh` call displays a section of the pad in the rectangle " +"The :meth:`!refresh` call displays a section of the pad in the rectangle " "extending from coordinate (5,5) to coordinate (20,75) on the screen; the " "upper left corner of the displayed section is coordinate (0,0) on the pad. " "Beyond that difference, pads are exactly like ordinary windows and support " "the same methods." msgstr "" -#: ../../howto/curses.rst:243 +#: ../../howto/curses.rst:245 msgid "" "If you have multiple windows and pads on screen there is a more efficient " "way to update the screen and prevent annoying screen flicker as each part of " -"the screen gets updated. :meth:`refresh` actually does two things:" +"the screen gets updated. :meth:`!refresh` actually does two things:" msgstr "" -#: ../../howto/curses.rst:248 +#: ../../howto/curses.rst:250 msgid "" "Calls the :meth:`~curses.window.noutrefresh` method of each window to update " "an underlying data structure representing the desired state of the screen." msgstr "" -#: ../../howto/curses.rst:251 +#: ../../howto/curses.rst:253 msgid "" "Calls the function :func:`~curses.doupdate` function to change the physical " "screen to match the desired state recorded in the data structure." msgstr "" -#: ../../howto/curses.rst:254 +#: ../../howto/curses.rst:256 msgid "" -"Instead you can call :meth:`noutrefresh` on a number of windows to update " -"the data structure, and then call :func:`doupdate` to update the screen." +"Instead you can call :meth:`!noutrefresh` on a number of windows to update " +"the data structure, and then call :func:`!doupdate` to update the screen." msgstr "" -#: ../../howto/curses.rst:260 +#: ../../howto/curses.rst:262 msgid "Displaying Text" msgstr "" -#: ../../howto/curses.rst:262 +#: ../../howto/curses.rst:264 msgid "" "From a C programmer's point of view, curses may sometimes look like a twisty " -"maze of functions, all subtly different. For example, :c:func:`addstr` " +"maze of functions, all subtly different. For example, :c:func:`!addstr` " "displays a string at the current cursor location in the ``stdscr`` window, " -"while :c:func:`mvaddstr` moves to a given y,x coordinate first before " -"displaying the string. :c:func:`waddstr` is just like :c:func:`addstr`, but " -"allows specifying a window to use instead of using ``stdscr`` by default. :c:" -"func:`mvwaddstr` allows specifying both a window and a coordinate." +"while :c:func:`!mvaddstr` moves to a given y,x coordinate first before " +"displaying the string. :c:func:`!waddstr` is just like :c:func:`!addstr`, " +"but allows specifying a window to use instead of using ``stdscr`` by " +"default. :c:func:`!mvwaddstr` allows specifying both a window and a " +"coordinate." msgstr "" -#: ../../howto/curses.rst:271 +#: ../../howto/curses.rst:273 msgid "" "Fortunately the Python interface hides all these details. ``stdscr`` is a " "window object like any other, and methods such as :meth:`~curses.window." @@ -341,73 +342,73 @@ msgid "" "forms." msgstr "" -#: ../../howto/curses.rst:277 +#: ../../howto/curses.rst:279 msgid "Form" msgstr "" -#: ../../howto/curses.rst:277 ../../howto/curses.rst:345 +#: ../../howto/curses.rst:279 ../../howto/curses.rst:347 msgid "Description" msgstr "描述" -#: ../../howto/curses.rst:279 +#: ../../howto/curses.rst:281 msgid "*str* or *ch*" msgstr "" -#: ../../howto/curses.rst:279 +#: ../../howto/curses.rst:281 msgid "Display the string *str* or character *ch* at the current position" msgstr "" -#: ../../howto/curses.rst:282 +#: ../../howto/curses.rst:284 msgid "*str* or *ch*, *attr*" msgstr "" -#: ../../howto/curses.rst:282 +#: ../../howto/curses.rst:284 msgid "" "Display the string *str* or character *ch*, using attribute *attr* at the " "current position" msgstr "" -#: ../../howto/curses.rst:286 +#: ../../howto/curses.rst:288 msgid "*y*, *x*, *str* or *ch*" msgstr "*y*\\ 、\\ *x*\\ 、\\ *str* 或 *ch*" -#: ../../howto/curses.rst:286 +#: ../../howto/curses.rst:288 msgid "Move to position *y,x* within the window, and display *str* or *ch*" msgstr "" -#: ../../howto/curses.rst:289 +#: ../../howto/curses.rst:291 msgid "*y*, *x*, *str* or *ch*, *attr*" msgstr "*y*\\ 、\\ *x*\\ 、\\ *str* 或 *ch*\\ 、\\ *attr*" -#: ../../howto/curses.rst:289 +#: ../../howto/curses.rst:291 msgid "" "Move to position *y,x* within the window, and display *str* or *ch*, using " "attribute *attr*" msgstr "" -#: ../../howto/curses.rst:293 +#: ../../howto/curses.rst:295 msgid "" "Attributes allow displaying text in highlighted forms such as boldface, " "underline, reverse code, or in color. They'll be explained in more detail " "in the next subsection." msgstr "" -#: ../../howto/curses.rst:298 +#: ../../howto/curses.rst:300 msgid "" "The :meth:`~curses.window.addstr` method takes a Python string or bytestring " "as the value to be displayed. The contents of bytestrings are sent to the " "terminal as-is. Strings are encoded to bytes using the value of the " -"window's :attr:`encoding` attribute; this defaults to the default system " -"encoding as returned by :func:`locale.getencoding`." +"window's :attr:`~window.encoding` attribute; this defaults to the default " +"system encoding as returned by :func:`locale.getencoding`." msgstr "" -#: ../../howto/curses.rst:304 +#: ../../howto/curses.rst:306 msgid "" "The :meth:`~curses.window.addch` methods take a character, which can be " "either a string of length 1, a bytestring of length 1, or an integer." msgstr "" -#: ../../howto/curses.rst:307 +#: ../../howto/curses.rst:309 msgid "" "Constants are provided for extension characters; these constants are " "integers greater than 255. For example, :const:`ACS_PLMINUS` is a +/- " @@ -415,7 +416,7 @@ msgid "" "for drawing borders). You can also use the appropriate Unicode character." msgstr "" -#: ../../howto/curses.rst:313 +#: ../../howto/curses.rst:315 msgid "" "Windows remember where the cursor was left after the last operation, so if " "you leave out the *y,x* coordinates, the string or character will be " @@ -426,7 +427,7 @@ msgid "" "cursor blinking at some apparently random location." msgstr "" -#: ../../howto/curses.rst:321 +#: ../../howto/curses.rst:323 msgid "" "If your application doesn't need a blinking cursor at all, you can call " "``curs_set(False)`` to make it invisible. For compatibility with older " @@ -436,11 +437,11 @@ msgid "" "leaving it in odd locations." msgstr "" -#: ../../howto/curses.rst:330 +#: ../../howto/curses.rst:332 msgid "Attributes and Color" msgstr "" -#: ../../howto/curses.rst:332 +#: ../../howto/curses.rst:334 msgid "" "Characters can be displayed in different ways. Status lines in a text-based " "application are commonly shown in reverse video, or a text viewer may need " @@ -448,7 +449,7 @@ msgid "" "an attribute for each cell on the screen." msgstr "" -#: ../../howto/curses.rst:337 +#: ../../howto/curses.rst:339 msgid "" "An attribute is an integer, each bit representing a different attribute. " "You can try to display text with multiple attribute bits set, but curses " @@ -458,72 +459,72 @@ msgid "" "attributes, listed here." msgstr "" -#: ../../howto/curses.rst:345 +#: ../../howto/curses.rst:347 msgid "Attribute" msgstr "屬性" -#: ../../howto/curses.rst:347 +#: ../../howto/curses.rst:349 msgid ":const:`A_BLINK`" msgstr ":const:`A_BLINK`" -#: ../../howto/curses.rst:347 +#: ../../howto/curses.rst:349 msgid "Blinking text" msgstr "" -#: ../../howto/curses.rst:349 +#: ../../howto/curses.rst:351 msgid ":const:`A_BOLD`" msgstr ":const:`A_BOLD`" -#: ../../howto/curses.rst:349 +#: ../../howto/curses.rst:351 msgid "Extra bright or bold text" msgstr "" -#: ../../howto/curses.rst:351 +#: ../../howto/curses.rst:353 msgid ":const:`A_DIM`" msgstr ":const:`A_DIM`" -#: ../../howto/curses.rst:351 +#: ../../howto/curses.rst:353 msgid "Half bright text" msgstr "" -#: ../../howto/curses.rst:353 +#: ../../howto/curses.rst:355 msgid ":const:`A_REVERSE`" msgstr ":const:`A_REVERSE`" -#: ../../howto/curses.rst:353 +#: ../../howto/curses.rst:355 msgid "Reverse-video text" msgstr "" -#: ../../howto/curses.rst:355 +#: ../../howto/curses.rst:357 msgid ":const:`A_STANDOUT`" msgstr ":const:`A_STANDOUT`" -#: ../../howto/curses.rst:355 +#: ../../howto/curses.rst:357 msgid "The best highlighting mode available" msgstr "" -#: ../../howto/curses.rst:357 +#: ../../howto/curses.rst:359 msgid ":const:`A_UNDERLINE`" msgstr ":const:`A_UNDERLINE`" -#: ../../howto/curses.rst:357 +#: ../../howto/curses.rst:359 msgid "Underlined text" msgstr "" -#: ../../howto/curses.rst:360 +#: ../../howto/curses.rst:362 msgid "" "So, to display a reverse-video status line on the top line of the screen, " "you could code::" msgstr "" -#: ../../howto/curses.rst:367 +#: ../../howto/curses.rst:369 msgid "" "The curses library also supports color on those terminals that provide it. " "The most common such terminal is probably the Linux console, followed by " "color xterms." msgstr "" -#: ../../howto/curses.rst:371 +#: ../../howto/curses.rst:373 msgid "" "To use color, you must call the :func:`~curses.start_color` function soon " "after calling :func:`~curses.initscr`, to initialize the default color set " @@ -535,7 +536,7 @@ msgid "" "for the sake of these functions.)" msgstr "" -#: ../../howto/curses.rst:381 +#: ../../howto/curses.rst:383 msgid "" "The curses library maintains a finite number of color pairs, containing a " "foreground (or text) color and a background color. You can get the " @@ -545,11 +546,11 @@ msgid "" "work on all terminals." msgstr "" -#: ../../howto/curses.rst:388 +#: ../../howto/curses.rst:390 msgid "An example, which displays a line of text using color pair 1::" msgstr "" -#: ../../howto/curses.rst:393 +#: ../../howto/curses.rst:395 msgid "" "As I said before, a color pair consists of a foreground and background " "color. The ``init_pair(n, f, b)`` function changes the definition of color " @@ -557,7 +558,7 @@ msgid "" "hard-wired to white on black, and cannot be changed." msgstr "" -#: ../../howto/curses.rst:398 +#: ../../howto/curses.rst:400 msgid "" "Colors are numbered, and :func:`start_color` initializes 8 basic colors when " "it activates color mode. They are: 0:black, 1:red, 2:green, 3:yellow, 4:" @@ -566,20 +567,20 @@ msgid "" "const:`curses.COLOR_RED`, and so forth." msgstr "" -#: ../../howto/curses.rst:404 +#: ../../howto/curses.rst:406 msgid "" "Let's put all this together. To change color 1 to red text on a white " "background, you would call::" msgstr "" -#: ../../howto/curses.rst:409 +#: ../../howto/curses.rst:411 msgid "" "When you change a color pair, any text already displayed using that color " "pair will change to the new colors. You can also display new text in this " "color with::" msgstr "" -#: ../../howto/curses.rst:415 +#: ../../howto/curses.rst:417 msgid "" "Very fancy terminals can change the definitions of the actual colors to a " "given RGB value. This lets you change color 1, which is usually red, to " @@ -591,11 +592,11 @@ msgid "" "your system's man pages for more information." msgstr "" -#: ../../howto/curses.rst:426 +#: ../../howto/curses.rst:428 msgid "User Input" msgstr "" -#: ../../howto/curses.rst:428 +#: ../../howto/curses.rst:430 msgid "" "The C curses library offers only very simple input mechanisms. Python's :mod:" "`curses` module adds a basic text-input widget. (Other libraries such as " @@ -603,11 +604,11 @@ msgid "" "of widgets.)" msgstr "" -#: ../../howto/curses.rst:433 +#: ../../howto/curses.rst:435 msgid "There are two methods for getting input from a window:" msgstr "" -#: ../../howto/curses.rst:435 +#: ../../howto/curses.rst:437 msgid "" ":meth:`~curses.window.getch` refreshes the screen and then waits for the " "user to hit a key, displaying the key if :func:`~curses.echo` has been " @@ -615,7 +616,7 @@ msgid "" "should be moved before pausing." msgstr "" -#: ../../howto/curses.rst:440 +#: ../../howto/curses.rst:442 msgid "" ":meth:`~curses.window.getkey` does the same thing but converts the integer " "to a string. Individual characters are returned as 1-character strings, and " @@ -623,21 +624,21 @@ msgid "" "name such as ``KEY_UP`` or ``^G``." msgstr "" -#: ../../howto/curses.rst:445 +#: ../../howto/curses.rst:447 msgid "" "It's possible to not wait for the user using the :meth:`~curses.window." -"nodelay` window method. After ``nodelay(True)``, :meth:`getch` and :meth:" -"`getkey` for the window become non-blocking. To signal that no input is " -"ready, :meth:`getch` returns ``curses.ERR`` (a value of -1) and :meth:" -"`getkey` raises an exception. There's also a :func:`~curses.halfdelay` " -"function, which can be used to (in effect) set a timer on each :meth:" -"`getch`; if no input becomes available within a specified delay (measured in " +"nodelay` window method. After ``nodelay(True)``, :meth:`!getch` and :meth:`!" +"getkey` for the window become non-blocking. To signal that no input is " +"ready, :meth:`!getch` returns ``curses.ERR`` (a value of -1) and :meth:`!" +"getkey` raises an exception. There's also a :func:`~curses.halfdelay` " +"function, which can be used to (in effect) set a timer on each :meth:`!" +"getch`; if no input becomes available within a specified delay (measured in " "tenths of a second), curses raises an exception." msgstr "" -#: ../../howto/curses.rst:455 +#: ../../howto/curses.rst:457 msgid "" -"The :meth:`getch` method returns an integer; if it's between 0 and 255, it " +"The :meth:`!getch` method returns an integer; if it's between 0 and 255, it " "represents the ASCII code of the key pressed. Values greater than 255 are " "special keys such as Page Up, Home, or the cursor keys. You can compare the " "value returned to constants such as :const:`curses.KEY_PPAGE`, :const:" @@ -645,7 +646,7 @@ msgid "" "program may look something like this::" msgstr "" -#: ../../howto/curses.rst:471 +#: ../../howto/curses.rst:473 msgid "" "The :mod:`curses.ascii` module supplies ASCII class membership functions " "that take either integer or 1-character string arguments; these may be " @@ -655,7 +656,7 @@ msgid "" "returns the control character corresponding to its argument." msgstr "" -#: ../../howto/curses.rst:478 +#: ../../howto/curses.rst:480 msgid "" "There's also a method to retrieve an entire string, :meth:`~curses.window." "getstr`. It isn't used very often, because its functionality is quite " @@ -664,7 +665,7 @@ msgid "" "number of characters. ::" msgstr "" -#: ../../howto/curses.rst:489 +#: ../../howto/curses.rst:491 msgid "" "The :mod:`curses.textpad` module supplies a text box that supports an Emacs-" "like set of keybindings. Various methods of the :class:`~curses.textpad." @@ -672,16 +673,16 @@ msgid "" "results either with or without trailing spaces. Here's an example::" msgstr "" -#: ../../howto/curses.rst:513 +#: ../../howto/curses.rst:515 msgid "" "See the library documentation on :mod:`curses.textpad` for more details." msgstr "" -#: ../../howto/curses.rst:517 +#: ../../howto/curses.rst:519 msgid "For More Information" msgstr "" -#: ../../howto/curses.rst:519 +#: ../../howto/curses.rst:521 msgid "" "This HOWTO doesn't cover some advanced topics, such as reading the contents " "of the screen or capturing mouse events from an xterm instance, but the " @@ -689,7 +690,7 @@ msgid "" "complete. You should browse it next." msgstr "" -#: ../../howto/curses.rst:524 +#: ../../howto/curses.rst:526 msgid "" "If you're in doubt about the detailed behavior of the curses functions, " "consult the manual pages for your curses implementation, whether it's " @@ -698,7 +699,7 @@ msgid "" "const:`ACS_\\*` characters available to you." msgstr "" -#: ../../howto/curses.rst:531 +#: ../../howto/curses.rst:533 msgid "" "Because the curses API is so large, some functions aren't supported in the " "Python interface. Often this isn't because they're difficult to implement, " @@ -708,30 +709,30 @@ msgid "" "org/>`_ to learn more about submitting patches to Python." msgstr "" -#: ../../howto/curses.rst:539 +#: ../../howto/curses.rst:541 msgid "" "`Writing Programs with NCURSES `_: a lengthy tutorial for C programmers." msgstr "" -#: ../../howto/curses.rst:541 +#: ../../howto/curses.rst:543 msgid "`The ncurses man page `_" msgstr "`ncurses 使用者手冊 `_" -#: ../../howto/curses.rst:542 +#: ../../howto/curses.rst:544 msgid "" "`The ncurses FAQ `_" msgstr "" "`ncurses 問答集 `_" -#: ../../howto/curses.rst:543 +#: ../../howto/curses.rst:545 msgid "" "`\"Use curses... don't swear\" `_: video of a PyCon 2013 talk on controlling terminals using " "curses or Urwid." msgstr "" -#: ../../howto/curses.rst:545 +#: ../../howto/curses.rst:547 msgid "" "`\"Console Applications with Urwid\" `_: video of a PyCon CA 2012 talk demonstrating some " diff --git a/library/curses.ascii.po b/library/curses.ascii.po index c647491464..5308f46610 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-26 00:17+0000\n" +"POT-Creation-Date: 2023-05-04 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,286 +41,142 @@ msgstr "" msgid "Meaning" msgstr "" -#: ../../library/curses.ascii.rst:21 -msgid ":const:`NUL`" -msgstr ":const:`NUL`" - -#: ../../library/curses.ascii.rst:23 -msgid ":const:`SOH`" -msgstr ":const:`SOH`" - #: ../../library/curses.ascii.rst:23 msgid "Start of heading, console interrupt" msgstr "" -#: ../../library/curses.ascii.rst:25 -msgid ":const:`STX`" -msgstr ":const:`STX`" - #: ../../library/curses.ascii.rst:25 msgid "Start of text" msgstr "" -#: ../../library/curses.ascii.rst:27 -msgid ":const:`ETX`" -msgstr ":const:`ETX`" - #: ../../library/curses.ascii.rst:27 msgid "End of text" msgstr "" -#: ../../library/curses.ascii.rst:29 -msgid ":const:`EOT`" -msgstr ":const:`EOT`" - #: ../../library/curses.ascii.rst:29 msgid "End of transmission" msgstr "" -#: ../../library/curses.ascii.rst:31 -msgid ":const:`ENQ`" -msgstr ":const:`ENQ`" - #: ../../library/curses.ascii.rst:31 msgid "Enquiry, goes with :const:`ACK` flow control" msgstr "" -#: ../../library/curses.ascii.rst:33 -msgid ":const:`ACK`" -msgstr ":const:`ACK`" - #: ../../library/curses.ascii.rst:33 msgid "Acknowledgement" msgstr "" -#: ../../library/curses.ascii.rst:35 -msgid ":const:`BEL`" -msgstr ":const:`BEL`" - #: ../../library/curses.ascii.rst:35 msgid "Bell" msgstr "" -#: ../../library/curses.ascii.rst:37 -msgid ":const:`BS`" -msgstr ":const:`BS`" - #: ../../library/curses.ascii.rst:37 msgid "Backspace" msgstr "" -#: ../../library/curses.ascii.rst:39 -msgid ":const:`TAB`" -msgstr ":const:`TAB`" - #: ../../library/curses.ascii.rst:39 msgid "Tab" msgstr "" -#: ../../library/curses.ascii.rst:41 -msgid ":const:`HT`" -msgstr ":const:`HT`" - #: ../../library/curses.ascii.rst:41 msgid "Alias for :const:`TAB`: \"Horizontal tab\"" msgstr "" -#: ../../library/curses.ascii.rst:43 -msgid ":const:`LF`" -msgstr ":const:`LF`" - #: ../../library/curses.ascii.rst:43 msgid "Line feed" msgstr "" -#: ../../library/curses.ascii.rst:45 -msgid ":const:`NL`" -msgstr ":const:`NL`" - #: ../../library/curses.ascii.rst:45 msgid "Alias for :const:`LF`: \"New line\"" msgstr "" -#: ../../library/curses.ascii.rst:47 -msgid ":const:`VT`" -msgstr ":const:`VT`" - #: ../../library/curses.ascii.rst:47 msgid "Vertical tab" msgstr "" -#: ../../library/curses.ascii.rst:49 -msgid ":const:`FF`" -msgstr ":const:`FF`" - #: ../../library/curses.ascii.rst:49 msgid "Form feed" msgstr "" -#: ../../library/curses.ascii.rst:51 -msgid ":const:`CR`" -msgstr ":const:`CR`" - #: ../../library/curses.ascii.rst:51 msgid "Carriage return" msgstr "" -#: ../../library/curses.ascii.rst:53 -msgid ":const:`SO`" -msgstr ":const:`SO`" - #: ../../library/curses.ascii.rst:53 msgid "Shift-out, begin alternate character set" msgstr "" -#: ../../library/curses.ascii.rst:55 -msgid ":const:`SI`" -msgstr ":const:`SI`" - #: ../../library/curses.ascii.rst:55 msgid "Shift-in, resume default character set" msgstr "" -#: ../../library/curses.ascii.rst:57 -msgid ":const:`DLE`" -msgstr ":const:`DLE`" - #: ../../library/curses.ascii.rst:57 msgid "Data-link escape" msgstr "" -#: ../../library/curses.ascii.rst:59 -msgid ":const:`DC1`" -msgstr ":const:`DC1`" - #: ../../library/curses.ascii.rst:59 msgid "XON, for flow control" msgstr "" -#: ../../library/curses.ascii.rst:61 -msgid ":const:`DC2`" -msgstr ":const:`DC2`" - #: ../../library/curses.ascii.rst:61 msgid "Device control 2, block-mode flow control" msgstr "" -#: ../../library/curses.ascii.rst:63 -msgid ":const:`DC3`" -msgstr ":const:`DC3`" - #: ../../library/curses.ascii.rst:63 msgid "XOFF, for flow control" msgstr "" -#: ../../library/curses.ascii.rst:65 -msgid ":const:`DC4`" -msgstr ":const:`DC4`" - #: ../../library/curses.ascii.rst:65 msgid "Device control 4" msgstr "" -#: ../../library/curses.ascii.rst:67 -msgid ":const:`NAK`" -msgstr ":const:`NAK`" - #: ../../library/curses.ascii.rst:67 msgid "Negative acknowledgement" msgstr "" -#: ../../library/curses.ascii.rst:69 -msgid ":const:`SYN`" -msgstr ":const:`SYN`" - #: ../../library/curses.ascii.rst:69 msgid "Synchronous idle" msgstr "" -#: ../../library/curses.ascii.rst:71 -msgid ":const:`ETB`" -msgstr ":const:`ETB`" - #: ../../library/curses.ascii.rst:71 msgid "End transmission block" msgstr "" -#: ../../library/curses.ascii.rst:73 -msgid ":const:`CAN`" -msgstr ":const:`CAN`" - #: ../../library/curses.ascii.rst:73 msgid "Cancel" msgstr "" -#: ../../library/curses.ascii.rst:75 -msgid ":const:`EM`" -msgstr ":const:`EM`" - #: ../../library/curses.ascii.rst:75 msgid "End of medium" msgstr "" -#: ../../library/curses.ascii.rst:77 -msgid ":const:`SUB`" -msgstr ":const:`SUB`" - #: ../../library/curses.ascii.rst:77 msgid "Substitute" msgstr "" -#: ../../library/curses.ascii.rst:79 -msgid ":const:`ESC`" -msgstr ":const:`ESC`" - #: ../../library/curses.ascii.rst:79 msgid "Escape" msgstr "" -#: ../../library/curses.ascii.rst:81 -msgid ":const:`FS`" -msgstr ":const:`FS`" - #: ../../library/curses.ascii.rst:81 msgid "File separator" msgstr "" -#: ../../library/curses.ascii.rst:83 -msgid ":const:`GS`" -msgstr ":const:`GS`" - #: ../../library/curses.ascii.rst:83 msgid "Group separator" msgstr "" -#: ../../library/curses.ascii.rst:85 -msgid ":const:`RS`" -msgstr ":const:`RS`" - #: ../../library/curses.ascii.rst:85 msgid "Record separator, block-mode terminator" msgstr "" -#: ../../library/curses.ascii.rst:87 -msgid ":const:`US`" -msgstr ":const:`US`" - #: ../../library/curses.ascii.rst:87 msgid "Unit separator" msgstr "" -#: ../../library/curses.ascii.rst:89 -msgid ":const:`SP`" -msgstr ":const:`SP`" - #: ../../library/curses.ascii.rst:89 msgid "Space" msgstr "" -#: ../../library/curses.ascii.rst:91 -msgid ":const:`DEL`" -msgstr ":const:`DEL`" - #: ../../library/curses.ascii.rst:91 msgid "Delete" msgstr "" @@ -470,3 +326,111 @@ msgid "" "two ASCII control characters from 0 (NUL) to 0x1f (US), in order, plus the " "mnemonic ``SP`` for the space character." msgstr "" + +#~ msgid ":const:`NUL`" +#~ msgstr ":const:`NUL`" + +#~ msgid ":const:`SOH`" +#~ msgstr ":const:`SOH`" + +#~ msgid ":const:`STX`" +#~ msgstr ":const:`STX`" + +#~ msgid ":const:`ETX`" +#~ msgstr ":const:`ETX`" + +#~ msgid ":const:`EOT`" +#~ msgstr ":const:`EOT`" + +#~ msgid ":const:`ENQ`" +#~ msgstr ":const:`ENQ`" + +#~ msgid ":const:`ACK`" +#~ msgstr ":const:`ACK`" + +#~ msgid ":const:`BEL`" +#~ msgstr ":const:`BEL`" + +#~ msgid ":const:`BS`" +#~ msgstr ":const:`BS`" + +#~ msgid ":const:`TAB`" +#~ msgstr ":const:`TAB`" + +#~ msgid ":const:`HT`" +#~ msgstr ":const:`HT`" + +#~ msgid ":const:`LF`" +#~ msgstr ":const:`LF`" + +#~ msgid ":const:`NL`" +#~ msgstr ":const:`NL`" + +#~ msgid ":const:`VT`" +#~ msgstr ":const:`VT`" + +#~ msgid ":const:`FF`" +#~ msgstr ":const:`FF`" + +#~ msgid ":const:`CR`" +#~ msgstr ":const:`CR`" + +#~ msgid ":const:`SO`" +#~ msgstr ":const:`SO`" + +#~ msgid ":const:`SI`" +#~ msgstr ":const:`SI`" + +#~ msgid ":const:`DLE`" +#~ msgstr ":const:`DLE`" + +#~ msgid ":const:`DC1`" +#~ msgstr ":const:`DC1`" + +#~ msgid ":const:`DC2`" +#~ msgstr ":const:`DC2`" + +#~ msgid ":const:`DC3`" +#~ msgstr ":const:`DC3`" + +#~ msgid ":const:`DC4`" +#~ msgstr ":const:`DC4`" + +#~ msgid ":const:`NAK`" +#~ msgstr ":const:`NAK`" + +#~ msgid ":const:`SYN`" +#~ msgstr ":const:`SYN`" + +#~ msgid ":const:`ETB`" +#~ msgstr ":const:`ETB`" + +#~ msgid ":const:`CAN`" +#~ msgstr ":const:`CAN`" + +#~ msgid ":const:`EM`" +#~ msgstr ":const:`EM`" + +#~ msgid ":const:`SUB`" +#~ msgstr ":const:`SUB`" + +#~ msgid ":const:`ESC`" +#~ msgstr ":const:`ESC`" + +#~ msgid ":const:`FS`" +#~ msgstr ":const:`FS`" + +#~ msgid ":const:`GS`" +#~ msgstr ":const:`GS`" + +#~ msgid ":const:`RS`" +#~ msgstr ":const:`RS`" + +#~ msgid ":const:`US`" +#~ msgstr ":const:`US`" + +#~ msgid ":const:`SP`" +#~ msgstr ":const:`SP`" + +#~ msgid ":const:`DEL`" +#~ msgstr ":const:`DEL`" diff --git a/library/curses.po b/library/curses.po index f479cb8b63..b0af2b3204 100644 --- a/library/curses.po +++ b/library/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-31 00:15+0000\n" +"POT-Creation-Date: 2023-05-04 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -162,7 +162,8 @@ msgid "" "Return the attribute value for displaying text in the specified color pair. " "Only the first 256 color pairs are supported. This attribute value can be " "combined with :const:`A_STANDOUT`, :const:`A_REVERSE`, and the other :const:" -"`A_\\*` attributes. :func:`pair_number` is the counterpart to this function." +"`!A_\\*` attributes. :func:`pair_number` is the counterpart to this " +"function." msgstr "" #: ../../library/curses.rst:119 @@ -269,7 +270,7 @@ msgid "" "const:`BUTTON_ALT`." msgstr "" -#: ../../library/curses.rst:216 +#: ../../library/curses.rst:216 ../../library/curses.rst:1757 msgid "" "The ``BUTTON5_*`` constants are now exposed if they are provided by the " "underlying curses library." @@ -284,9 +285,9 @@ msgstr "" #: ../../library/curses.rst:229 msgid "" -"Read window related data stored in the file by an earlier :func:`putwin` " -"call. The routine then creates and initializes a new window using that data, " -"returning the new window object." +"Read window related data stored in the file by an earlier :func:`window." +"putwin` call. The routine then creates and initializes a new window using " +"that data, returning the new window object." msgstr "" #: ../../library/curses.rst:236 @@ -1476,10 +1477,8 @@ msgid "" "return :const:`OK` upon success." msgstr "" -#: ../../library/curses.rst:1330 -msgid "" -"A bytes object representing the current version of the module. Also " -"available as :const:`__version__`." +#: ../../library/curses.rst:1331 +msgid "A bytes object representing the current version of the module." msgstr "" #: ../../library/curses.rst:1336 @@ -1494,1030 +1493,583 @@ msgstr "" msgid "Availability: if the ncurses library is used." msgstr "" -#: ../../library/curses.rst:1346 +#: ../../library/curses.rst:1347 +msgid "The maximum number of colors the terminal can support." +msgstr "" + +#: ../../library/curses.rst:1351 +msgid "The maximum number of color pairs the terminal can support." +msgstr "" + +#: ../../library/curses.rst:1353 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" -#: ../../library/curses.rst:1350 +#: ../../library/curses.rst:1357 msgid "Attribute" msgstr "" -#: ../../library/curses.rst:1350 ../../library/curses.rst:1398 -#: ../../library/curses.rst:1642 +#: ../../library/curses.rst:1357 ../../library/curses.rst:1402 +#: ../../library/curses.rst:1646 ../../library/curses.rst:1738 msgid "Meaning" msgstr "" -#: ../../library/curses.rst:1352 -msgid "``A_ALTCHARSET``" -msgstr "``A_ALTCHARSET``" - -#: ../../library/curses.rst:1352 +#: ../../library/curses.rst:1359 msgid "Alternate character set mode" msgstr "" -#: ../../library/curses.rst:1354 -msgid "``A_BLINK``" -msgstr "``A_BLINK``" - -#: ../../library/curses.rst:1354 +#: ../../library/curses.rst:1361 msgid "Blink mode" msgstr "" -#: ../../library/curses.rst:1356 -msgid "``A_BOLD``" -msgstr "``A_BOLD``" - -#: ../../library/curses.rst:1356 +#: ../../library/curses.rst:1363 msgid "Bold mode" msgstr "" -#: ../../library/curses.rst:1358 -msgid "``A_DIM``" -msgstr "``A_DIM``" - -#: ../../library/curses.rst:1358 +#: ../../library/curses.rst:1365 msgid "Dim mode" msgstr "" -#: ../../library/curses.rst:1360 -msgid "``A_INVIS``" -msgstr "``A_INVIS``" - -#: ../../library/curses.rst:1360 +#: ../../library/curses.rst:1367 msgid "Invisible or blank mode" msgstr "" -#: ../../library/curses.rst:1362 -msgid "``A_ITALIC``" -msgstr "``A_ITALIC``" - -#: ../../library/curses.rst:1362 +#: ../../library/curses.rst:1369 msgid "Italic mode" msgstr "" -#: ../../library/curses.rst:1364 -msgid "``A_NORMAL``" -msgstr "``A_NORMAL``" - -#: ../../library/curses.rst:1364 +#: ../../library/curses.rst:1371 msgid "Normal attribute" msgstr "" -#: ../../library/curses.rst:1366 -msgid "``A_PROTECT``" -msgstr "``A_PROTECT``" - -#: ../../library/curses.rst:1366 +#: ../../library/curses.rst:1373 msgid "Protected mode" msgstr "" -#: ../../library/curses.rst:1368 -msgid "``A_REVERSE``" -msgstr "``A_REVERSE``" - -#: ../../library/curses.rst:1368 +#: ../../library/curses.rst:1375 msgid "Reverse background and foreground colors" msgstr "" -#: ../../library/curses.rst:1371 -msgid "``A_STANDOUT``" -msgstr "``A_STANDOUT``" - -#: ../../library/curses.rst:1371 +#: ../../library/curses.rst:1378 msgid "Standout mode" msgstr "" -#: ../../library/curses.rst:1373 -msgid "``A_UNDERLINE``" -msgstr "``A_UNDERLINE``" - -#: ../../library/curses.rst:1373 +#: ../../library/curses.rst:1380 msgid "Underline mode" msgstr "" -#: ../../library/curses.rst:1375 -msgid "``A_HORIZONTAL``" -msgstr "``A_HORIZONTAL``" - -#: ../../library/curses.rst:1375 +#: ../../library/curses.rst:1382 msgid "Horizontal highlight" msgstr "" -#: ../../library/curses.rst:1377 -msgid "``A_LEFT``" -msgstr "``A_LEFT``" - -#: ../../library/curses.rst:1377 +#: ../../library/curses.rst:1384 msgid "Left highlight" msgstr "" -#: ../../library/curses.rst:1379 -msgid "``A_LOW``" -msgstr "``A_LOW``" - -#: ../../library/curses.rst:1379 +#: ../../library/curses.rst:1386 msgid "Low highlight" msgstr "" -#: ../../library/curses.rst:1381 -msgid "``A_RIGHT``" -msgstr "``A_RIGHT``" - -#: ../../library/curses.rst:1381 +#: ../../library/curses.rst:1388 msgid "Right highlight" msgstr "" -#: ../../library/curses.rst:1383 -msgid "``A_TOP``" -msgstr "``A_TOP``" - -#: ../../library/curses.rst:1383 +#: ../../library/curses.rst:1390 msgid "Top highlight" msgstr "" -#: ../../library/curses.rst:1385 -msgid "``A_VERTICAL``" -msgstr "``A_VERTICAL``" - -#: ../../library/curses.rst:1385 +#: ../../library/curses.rst:1392 msgid "Vertical highlight" msgstr "" -#: ../../library/curses.rst:1387 ../../library/curses.rst:1403 -msgid "``A_CHARTEXT``" -msgstr "``A_CHARTEXT``" - -#: ../../library/curses.rst:1387 ../../library/curses.rst:1403 -msgid "Bit-mask to extract a character" -msgstr "" - -#: ../../library/curses.rst:1391 +#: ../../library/curses.rst:1395 msgid "``A_ITALIC`` was added." msgstr "" -#: ../../library/curses.rst:1394 +#: ../../library/curses.rst:1398 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" -#: ../../library/curses.rst:1398 +#: ../../library/curses.rst:1402 msgid "Bit-mask" msgstr "" -#: ../../library/curses.rst:1400 -msgid "``A_ATTRIBUTES``" -msgstr "``A_ATTRIBUTES``" - -#: ../../library/curses.rst:1400 +#: ../../library/curses.rst:1404 msgid "Bit-mask to extract attributes" msgstr "" -#: ../../library/curses.rst:1406 -msgid "``A_COLOR``" -msgstr "``A_COLOR``" +#: ../../library/curses.rst:1407 +msgid "Bit-mask to extract a character" +msgstr "" -#: ../../library/curses.rst:1406 +#: ../../library/curses.rst:1410 msgid "Bit-mask to extract color-pair field information" msgstr "" -#: ../../library/curses.rst:1410 +#: ../../library/curses.rst:1414 msgid "" "Keys are referred to by integer constants with names starting with " "``KEY_``. The exact keycaps available are system dependent." msgstr "" -#: ../../library/curses.rst:1416 +#: ../../library/curses.rst:1420 msgid "Key constant" msgstr "" -#: ../../library/curses.rst:1416 +#: ../../library/curses.rst:1420 msgid "Key" msgstr "" -#: ../../library/curses.rst:1418 -msgid "``KEY_MIN``" -msgstr "``KEY_MIN``" - -#: ../../library/curses.rst:1418 +#: ../../library/curses.rst:1422 msgid "Minimum key value" msgstr "" -#: ../../library/curses.rst:1420 -msgid "``KEY_BREAK``" -msgstr "``KEY_BREAK``" - -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1424 msgid "Break key (unreliable)" msgstr "" -#: ../../library/curses.rst:1422 -msgid "``KEY_DOWN``" -msgstr "``KEY_DOWN``" - -#: ../../library/curses.rst:1422 +#: ../../library/curses.rst:1426 msgid "Down-arrow" msgstr "" -#: ../../library/curses.rst:1424 -msgid "``KEY_UP``" -msgstr "``KEY_UP``" - -#: ../../library/curses.rst:1424 +#: ../../library/curses.rst:1428 msgid "Up-arrow" msgstr "" -#: ../../library/curses.rst:1426 -msgid "``KEY_LEFT``" -msgstr "``KEY_LEFT``" - -#: ../../library/curses.rst:1426 +#: ../../library/curses.rst:1430 msgid "Left-arrow" msgstr "" -#: ../../library/curses.rst:1428 -msgid "``KEY_RIGHT``" -msgstr "``KEY_RIGHT``" - -#: ../../library/curses.rst:1428 +#: ../../library/curses.rst:1432 msgid "Right-arrow" msgstr "" -#: ../../library/curses.rst:1430 -msgid "``KEY_HOME``" -msgstr "``KEY_HOME``" - -#: ../../library/curses.rst:1430 +#: ../../library/curses.rst:1434 msgid "Home key (upward+left arrow)" msgstr "" -#: ../../library/curses.rst:1432 -msgid "``KEY_BACKSPACE``" -msgstr "``KEY_BACKSPACE``" - -#: ../../library/curses.rst:1432 +#: ../../library/curses.rst:1436 msgid "Backspace (unreliable)" msgstr "" -#: ../../library/curses.rst:1434 -msgid "``KEY_F0``" -msgstr "``KEY_F0``" - -#: ../../library/curses.rst:1434 +#: ../../library/curses.rst:1438 msgid "Function keys. Up to 64 function keys are supported." msgstr "" -#: ../../library/curses.rst:1437 -msgid "``KEY_Fn``" -msgstr "``KEY_Fn``" - -#: ../../library/curses.rst:1437 +#: ../../library/curses.rst:1441 msgid "Value of function key *n*" msgstr "" -#: ../../library/curses.rst:1439 -msgid "``KEY_DL``" -msgstr "``KEY_DL``" - -#: ../../library/curses.rst:1439 +#: ../../library/curses.rst:1443 msgid "Delete line" msgstr "" -#: ../../library/curses.rst:1441 -msgid "``KEY_IL``" -msgstr "``KEY_IL``" - -#: ../../library/curses.rst:1441 +#: ../../library/curses.rst:1445 msgid "Insert line" msgstr "" -#: ../../library/curses.rst:1443 -msgid "``KEY_DC``" -msgstr "``KEY_DC``" - -#: ../../library/curses.rst:1443 +#: ../../library/curses.rst:1447 msgid "Delete character" msgstr "" -#: ../../library/curses.rst:1445 -msgid "``KEY_IC``" -msgstr "``KEY_IC``" - -#: ../../library/curses.rst:1445 +#: ../../library/curses.rst:1449 msgid "Insert char or enter insert mode" msgstr "" -#: ../../library/curses.rst:1447 -msgid "``KEY_EIC``" -msgstr "``KEY_EIC``" - -#: ../../library/curses.rst:1447 +#: ../../library/curses.rst:1451 msgid "Exit insert char mode" msgstr "" -#: ../../library/curses.rst:1449 -msgid "``KEY_CLEAR``" -msgstr "``KEY_CLEAR``" - -#: ../../library/curses.rst:1449 +#: ../../library/curses.rst:1453 msgid "Clear screen" msgstr "" -#: ../../library/curses.rst:1451 -msgid "``KEY_EOS``" -msgstr "``KEY_EOS``" - -#: ../../library/curses.rst:1451 +#: ../../library/curses.rst:1455 msgid "Clear to end of screen" msgstr "" -#: ../../library/curses.rst:1453 -msgid "``KEY_EOL``" -msgstr "``KEY_EOL``" - -#: ../../library/curses.rst:1453 +#: ../../library/curses.rst:1457 msgid "Clear to end of line" msgstr "" -#: ../../library/curses.rst:1455 -msgid "``KEY_SF``" -msgstr "``KEY_SF``" - -#: ../../library/curses.rst:1455 +#: ../../library/curses.rst:1459 msgid "Scroll 1 line forward" msgstr "" -#: ../../library/curses.rst:1457 -msgid "``KEY_SR``" -msgstr "``KEY_SR``" - -#: ../../library/curses.rst:1457 +#: ../../library/curses.rst:1461 msgid "Scroll 1 line backward (reverse)" msgstr "" -#: ../../library/curses.rst:1459 -msgid "``KEY_NPAGE``" -msgstr "``KEY_NPAGE``" - -#: ../../library/curses.rst:1459 +#: ../../library/curses.rst:1463 msgid "Next page" msgstr "" -#: ../../library/curses.rst:1461 -msgid "``KEY_PPAGE``" -msgstr "``KEY_PPAGE``" - -#: ../../library/curses.rst:1461 +#: ../../library/curses.rst:1465 msgid "Previous page" msgstr "" -#: ../../library/curses.rst:1463 -msgid "``KEY_STAB``" -msgstr "``KEY_STAB``" - -#: ../../library/curses.rst:1463 +#: ../../library/curses.rst:1467 msgid "Set tab" msgstr "" -#: ../../library/curses.rst:1465 -msgid "``KEY_CTAB``" -msgstr "``KEY_CTAB``" - -#: ../../library/curses.rst:1465 +#: ../../library/curses.rst:1469 msgid "Clear tab" msgstr "" -#: ../../library/curses.rst:1467 -msgid "``KEY_CATAB``" -msgstr "``KEY_CATAB``" - -#: ../../library/curses.rst:1467 +#: ../../library/curses.rst:1471 msgid "Clear all tabs" msgstr "" -#: ../../library/curses.rst:1469 -msgid "``KEY_ENTER``" -msgstr "``KEY_ENTER``" - -#: ../../library/curses.rst:1469 +#: ../../library/curses.rst:1473 msgid "Enter or send (unreliable)" msgstr "" -#: ../../library/curses.rst:1471 -msgid "``KEY_SRESET``" -msgstr "``KEY_SRESET``" - -#: ../../library/curses.rst:1471 +#: ../../library/curses.rst:1475 msgid "Soft (partial) reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1473 -msgid "``KEY_RESET``" -msgstr "``KEY_RESET``" - -#: ../../library/curses.rst:1473 +#: ../../library/curses.rst:1477 msgid "Reset or hard reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1475 -msgid "``KEY_PRINT``" -msgstr "``KEY_PRINT``" - -#: ../../library/curses.rst:1475 +#: ../../library/curses.rst:1479 msgid "Print" msgstr "" -#: ../../library/curses.rst:1477 -msgid "``KEY_LL``" -msgstr "``KEY_LL``" - -#: ../../library/curses.rst:1477 +#: ../../library/curses.rst:1481 msgid "Home down or bottom (lower left)" msgstr "" -#: ../../library/curses.rst:1479 -msgid "``KEY_A1``" -msgstr "``KEY_A1``" - -#: ../../library/curses.rst:1479 +#: ../../library/curses.rst:1483 msgid "Upper left of keypad" msgstr "" -#: ../../library/curses.rst:1481 -msgid "``KEY_A3``" -msgstr "``KEY_A3``" - -#: ../../library/curses.rst:1481 +#: ../../library/curses.rst:1485 msgid "Upper right of keypad" msgstr "" -#: ../../library/curses.rst:1483 -msgid "``KEY_B2``" -msgstr "``KEY_B2``" - -#: ../../library/curses.rst:1483 +#: ../../library/curses.rst:1487 msgid "Center of keypad" msgstr "" -#: ../../library/curses.rst:1485 -msgid "``KEY_C1``" -msgstr "``KEY_C1``" - -#: ../../library/curses.rst:1485 +#: ../../library/curses.rst:1489 msgid "Lower left of keypad" msgstr "" -#: ../../library/curses.rst:1487 -msgid "``KEY_C3``" -msgstr "``KEY_C3``" - -#: ../../library/curses.rst:1487 +#: ../../library/curses.rst:1491 msgid "Lower right of keypad" msgstr "" -#: ../../library/curses.rst:1489 -msgid "``KEY_BTAB``" -msgstr "``KEY_BTAB``" - -#: ../../library/curses.rst:1489 +#: ../../library/curses.rst:1493 msgid "Back tab" msgstr "" -#: ../../library/curses.rst:1491 -msgid "``KEY_BEG``" -msgstr "``KEY_BEG``" - -#: ../../library/curses.rst:1491 +#: ../../library/curses.rst:1495 msgid "Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1493 -msgid "``KEY_CANCEL``" -msgstr "``KEY_CANCEL``" - -#: ../../library/curses.rst:1493 +#: ../../library/curses.rst:1497 msgid "Cancel" msgstr "" -#: ../../library/curses.rst:1495 -msgid "``KEY_CLOSE``" -msgstr "``KEY_CLOSE``" - -#: ../../library/curses.rst:1495 +#: ../../library/curses.rst:1499 msgid "Close" msgstr "" -#: ../../library/curses.rst:1497 -msgid "``KEY_COMMAND``" -msgstr "``KEY_COMMAND``" - -#: ../../library/curses.rst:1497 +#: ../../library/curses.rst:1501 msgid "Cmd (command)" msgstr "" -#: ../../library/curses.rst:1499 -msgid "``KEY_COPY``" -msgstr "``KEY_COPY``" - -#: ../../library/curses.rst:1499 +#: ../../library/curses.rst:1503 msgid "Copy" msgstr "" -#: ../../library/curses.rst:1501 -msgid "``KEY_CREATE``" -msgstr "``KEY_CREATE``" - -#: ../../library/curses.rst:1501 +#: ../../library/curses.rst:1505 msgid "Create" msgstr "" -#: ../../library/curses.rst:1503 -msgid "``KEY_END``" -msgstr "``KEY_END``" - -#: ../../library/curses.rst:1503 +#: ../../library/curses.rst:1507 msgid "End" msgstr "" -#: ../../library/curses.rst:1505 -msgid "``KEY_EXIT``" -msgstr "``KEY_EXIT``" - -#: ../../library/curses.rst:1505 +#: ../../library/curses.rst:1509 msgid "Exit" msgstr "" -#: ../../library/curses.rst:1507 -msgid "``KEY_FIND``" -msgstr "``KEY_FIND``" - -#: ../../library/curses.rst:1507 +#: ../../library/curses.rst:1511 msgid "Find" msgstr "" -#: ../../library/curses.rst:1509 -msgid "``KEY_HELP``" -msgstr "``KEY_HELP``" - -#: ../../library/curses.rst:1509 +#: ../../library/curses.rst:1513 msgid "Help" msgstr "" -#: ../../library/curses.rst:1511 -msgid "``KEY_MARK``" -msgstr "``KEY_MARK``" - -#: ../../library/curses.rst:1511 +#: ../../library/curses.rst:1515 msgid "Mark" msgstr "" -#: ../../library/curses.rst:1513 -msgid "``KEY_MESSAGE``" -msgstr "``KEY_MESSAGE``" - -#: ../../library/curses.rst:1513 +#: ../../library/curses.rst:1517 msgid "Message" msgstr "" -#: ../../library/curses.rst:1515 -msgid "``KEY_MOVE``" -msgstr "``KEY_MOVE``" - -#: ../../library/curses.rst:1515 +#: ../../library/curses.rst:1519 msgid "Move" msgstr "" -#: ../../library/curses.rst:1517 -msgid "``KEY_NEXT``" -msgstr "``KEY_NEXT``" - -#: ../../library/curses.rst:1517 +#: ../../library/curses.rst:1521 msgid "Next" msgstr "" -#: ../../library/curses.rst:1519 -msgid "``KEY_OPEN``" -msgstr "``KEY_OPEN``" - -#: ../../library/curses.rst:1519 +#: ../../library/curses.rst:1523 msgid "Open" msgstr "" -#: ../../library/curses.rst:1521 -msgid "``KEY_OPTIONS``" -msgstr "``KEY_OPTIONS``" - -#: ../../library/curses.rst:1521 +#: ../../library/curses.rst:1525 msgid "Options" msgstr "" -#: ../../library/curses.rst:1523 -msgid "``KEY_PREVIOUS``" -msgstr "``KEY_PREVIOUS``" - -#: ../../library/curses.rst:1523 +#: ../../library/curses.rst:1527 msgid "Prev (previous)" msgstr "" -#: ../../library/curses.rst:1525 -msgid "``KEY_REDO``" -msgstr "``KEY_REDO``" - -#: ../../library/curses.rst:1525 +#: ../../library/curses.rst:1529 msgid "Redo" msgstr "" -#: ../../library/curses.rst:1527 -msgid "``KEY_REFERENCE``" -msgstr "``KEY_REFERENCE``" - -#: ../../library/curses.rst:1527 +#: ../../library/curses.rst:1531 msgid "Ref (reference)" msgstr "" -#: ../../library/curses.rst:1529 -msgid "``KEY_REFRESH``" -msgstr "``KEY_REFRESH``" - -#: ../../library/curses.rst:1529 +#: ../../library/curses.rst:1533 msgid "Refresh" msgstr "" -#: ../../library/curses.rst:1531 -msgid "``KEY_REPLACE``" -msgstr "``KEY_REPLACE``" - -#: ../../library/curses.rst:1531 +#: ../../library/curses.rst:1535 msgid "Replace" msgstr "" -#: ../../library/curses.rst:1533 -msgid "``KEY_RESTART``" -msgstr "``KEY_RESTART``" - -#: ../../library/curses.rst:1533 +#: ../../library/curses.rst:1537 msgid "Restart" msgstr "" -#: ../../library/curses.rst:1535 -msgid "``KEY_RESUME``" -msgstr "``KEY_RESUME``" - -#: ../../library/curses.rst:1535 +#: ../../library/curses.rst:1539 msgid "Resume" msgstr "" -#: ../../library/curses.rst:1537 -msgid "``KEY_SAVE``" -msgstr "``KEY_SAVE``" - -#: ../../library/curses.rst:1537 +#: ../../library/curses.rst:1541 msgid "Save" msgstr "" -#: ../../library/curses.rst:1539 -msgid "``KEY_SBEG``" -msgstr "``KEY_SBEG``" - -#: ../../library/curses.rst:1539 +#: ../../library/curses.rst:1543 msgid "Shifted Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1541 -msgid "``KEY_SCANCEL``" -msgstr "``KEY_SCANCEL``" - -#: ../../library/curses.rst:1541 +#: ../../library/curses.rst:1545 msgid "Shifted Cancel" msgstr "" -#: ../../library/curses.rst:1543 -msgid "``KEY_SCOMMAND``" -msgstr "``KEY_SCOMMAND``" - -#: ../../library/curses.rst:1543 +#: ../../library/curses.rst:1547 msgid "Shifted Command" msgstr "" -#: ../../library/curses.rst:1545 -msgid "``KEY_SCOPY``" -msgstr "``KEY_SCOPY``" - -#: ../../library/curses.rst:1545 +#: ../../library/curses.rst:1549 msgid "Shifted Copy" msgstr "" -#: ../../library/curses.rst:1547 -msgid "``KEY_SCREATE``" -msgstr "``KEY_SCREATE``" - -#: ../../library/curses.rst:1547 +#: ../../library/curses.rst:1551 msgid "Shifted Create" msgstr "" -#: ../../library/curses.rst:1549 -msgid "``KEY_SDC``" -msgstr "``KEY_SDC``" - -#: ../../library/curses.rst:1549 +#: ../../library/curses.rst:1553 msgid "Shifted Delete char" msgstr "" -#: ../../library/curses.rst:1551 -msgid "``KEY_SDL``" -msgstr "``KEY_SDL``" - -#: ../../library/curses.rst:1551 +#: ../../library/curses.rst:1555 msgid "Shifted Delete line" msgstr "" -#: ../../library/curses.rst:1553 -msgid "``KEY_SELECT``" -msgstr "``KEY_SELECT``" - -#: ../../library/curses.rst:1553 +#: ../../library/curses.rst:1557 msgid "Select" msgstr "" -#: ../../library/curses.rst:1555 -msgid "``KEY_SEND``" -msgstr "``KEY_SEND``" - -#: ../../library/curses.rst:1555 +#: ../../library/curses.rst:1559 msgid "Shifted End" msgstr "" -#: ../../library/curses.rst:1557 -msgid "``KEY_SEOL``" -msgstr "``KEY_SEOL``" - -#: ../../library/curses.rst:1557 +#: ../../library/curses.rst:1561 msgid "Shifted Clear line" msgstr "" -#: ../../library/curses.rst:1559 -msgid "``KEY_SEXIT``" -msgstr "``KEY_SEXIT``" - -#: ../../library/curses.rst:1559 +#: ../../library/curses.rst:1563 msgid "Shifted Exit" msgstr "" -#: ../../library/curses.rst:1561 -msgid "``KEY_SFIND``" -msgstr "``KEY_SFIND``" - -#: ../../library/curses.rst:1561 +#: ../../library/curses.rst:1565 msgid "Shifted Find" msgstr "" -#: ../../library/curses.rst:1563 -msgid "``KEY_SHELP``" -msgstr "``KEY_SHELP``" - -#: ../../library/curses.rst:1563 +#: ../../library/curses.rst:1567 msgid "Shifted Help" msgstr "" -#: ../../library/curses.rst:1565 -msgid "``KEY_SHOME``" -msgstr "``KEY_SHOME``" - -#: ../../library/curses.rst:1565 +#: ../../library/curses.rst:1569 msgid "Shifted Home" msgstr "" -#: ../../library/curses.rst:1567 -msgid "``KEY_SIC``" -msgstr "``KEY_SIC``" - -#: ../../library/curses.rst:1567 +#: ../../library/curses.rst:1571 msgid "Shifted Input" msgstr "" -#: ../../library/curses.rst:1569 -msgid "``KEY_SLEFT``" -msgstr "``KEY_SLEFT``" - -#: ../../library/curses.rst:1569 +#: ../../library/curses.rst:1573 msgid "Shifted Left arrow" msgstr "" -#: ../../library/curses.rst:1571 -msgid "``KEY_SMESSAGE``" -msgstr "``KEY_SMESSAGE``" - -#: ../../library/curses.rst:1571 +#: ../../library/curses.rst:1575 msgid "Shifted Message" msgstr "" -#: ../../library/curses.rst:1573 -msgid "``KEY_SMOVE``" -msgstr "``KEY_SMOVE``" - -#: ../../library/curses.rst:1573 +#: ../../library/curses.rst:1577 msgid "Shifted Move" msgstr "" -#: ../../library/curses.rst:1575 -msgid "``KEY_SNEXT``" -msgstr "``KEY_SNEXT``" - -#: ../../library/curses.rst:1575 +#: ../../library/curses.rst:1579 msgid "Shifted Next" msgstr "" -#: ../../library/curses.rst:1577 -msgid "``KEY_SOPTIONS``" -msgstr "``KEY_SOPTIONS``" - -#: ../../library/curses.rst:1577 +#: ../../library/curses.rst:1581 msgid "Shifted Options" msgstr "" -#: ../../library/curses.rst:1579 -msgid "``KEY_SPREVIOUS``" -msgstr "``KEY_SPREVIOUS``" - -#: ../../library/curses.rst:1579 +#: ../../library/curses.rst:1583 msgid "Shifted Prev" msgstr "" -#: ../../library/curses.rst:1581 -msgid "``KEY_SPRINT``" -msgstr "``KEY_SPRINT``" - -#: ../../library/curses.rst:1581 +#: ../../library/curses.rst:1585 msgid "Shifted Print" msgstr "" -#: ../../library/curses.rst:1583 -msgid "``KEY_SREDO``" -msgstr "``KEY_SREDO``" - -#: ../../library/curses.rst:1583 +#: ../../library/curses.rst:1587 msgid "Shifted Redo" msgstr "" -#: ../../library/curses.rst:1585 -msgid "``KEY_SREPLACE``" -msgstr "``KEY_SREPLACE``" - -#: ../../library/curses.rst:1585 +#: ../../library/curses.rst:1589 msgid "Shifted Replace" msgstr "" -#: ../../library/curses.rst:1587 -msgid "``KEY_SRIGHT``" -msgstr "``KEY_SRIGHT``" - -#: ../../library/curses.rst:1587 +#: ../../library/curses.rst:1591 msgid "Shifted Right arrow" msgstr "" -#: ../../library/curses.rst:1589 -msgid "``KEY_SRSUME``" -msgstr "``KEY_SRSUME``" - -#: ../../library/curses.rst:1589 +#: ../../library/curses.rst:1593 msgid "Shifted Resume" msgstr "" -#: ../../library/curses.rst:1591 -msgid "``KEY_SSAVE``" -msgstr "``KEY_SSAVE``" - -#: ../../library/curses.rst:1591 +#: ../../library/curses.rst:1595 msgid "Shifted Save" msgstr "" -#: ../../library/curses.rst:1593 -msgid "``KEY_SSUSPEND``" -msgstr "``KEY_SSUSPEND``" - -#: ../../library/curses.rst:1593 +#: ../../library/curses.rst:1597 msgid "Shifted Suspend" msgstr "" -#: ../../library/curses.rst:1595 -msgid "``KEY_SUNDO``" -msgstr "``KEY_SUNDO``" - -#: ../../library/curses.rst:1595 +#: ../../library/curses.rst:1599 msgid "Shifted Undo" msgstr "" -#: ../../library/curses.rst:1597 -msgid "``KEY_SUSPEND``" -msgstr "``KEY_SUSPEND``" - -#: ../../library/curses.rst:1597 +#: ../../library/curses.rst:1601 msgid "Suspend" msgstr "" -#: ../../library/curses.rst:1599 -msgid "``KEY_UNDO``" -msgstr "``KEY_UNDO``" - -#: ../../library/curses.rst:1599 +#: ../../library/curses.rst:1603 msgid "Undo" msgstr "" -#: ../../library/curses.rst:1601 -msgid "``KEY_MOUSE``" -msgstr "``KEY_MOUSE``" - -#: ../../library/curses.rst:1601 +#: ../../library/curses.rst:1605 msgid "Mouse event has occurred" msgstr "" -#: ../../library/curses.rst:1603 -msgid "``KEY_RESIZE``" -msgstr "``KEY_RESIZE``" - -#: ../../library/curses.rst:1603 +#: ../../library/curses.rst:1607 msgid "Terminal resize event" msgstr "" -#: ../../library/curses.rst:1605 -msgid "``KEY_MAX``" -msgstr "``KEY_MAX``" - -#: ../../library/curses.rst:1605 +#: ../../library/curses.rst:1609 msgid "Maximum key value" msgstr "" -#: ../../library/curses.rst:1608 +#: ../../library/curses.rst:1612 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " -"are normally at least four function keys (:const:`KEY_F1`, :const:`KEY_F2`, :" -"const:`KEY_F3`, :const:`KEY_F4`) available, and the arrow keys mapped to :" -"const:`KEY_UP`, :const:`KEY_DOWN`, :const:`KEY_LEFT` and :const:`KEY_RIGHT` " -"in the obvious way. If your machine has a PC keyboard, it is safe to expect " -"arrow keys and twelve function keys (older PC keyboards may have only ten " -"function keys); also, the following keypad mappings are standard:" +"are normally at least four function keys (:const:`KEY_F1 `, :const:" +"`KEY_F2 `, :const:`KEY_F3 `, :const:`KEY_F4 `) " +"available, and the arrow keys mapped to :const:`KEY_UP`, :const:`KEY_DOWN`, :" +"const:`KEY_LEFT` and :const:`KEY_RIGHT` in the obvious way. If your machine " +"has a PC keyboard, it is safe to expect arrow keys and twelve function keys " +"(older PC keyboards may have only ten function keys); also, the following " +"keypad mappings are standard:" msgstr "" -#: ../../library/curses.rst:1617 +#: ../../library/curses.rst:1621 msgid "Keycap" msgstr "" -#: ../../library/curses.rst:1617 ../../library/curses.rst:1734 -#: ../../library/curses.rst:1858 +#: ../../library/curses.rst:1621 ../../library/curses.rst:1764 +#: ../../library/curses.rst:1888 msgid "Constant" msgstr "" -#: ../../library/curses.rst:1619 +#: ../../library/curses.rst:1623 msgid ":kbd:`Insert`" msgstr ":kbd:`Insert`" -#: ../../library/curses.rst:1619 +#: ../../library/curses.rst:1623 msgid "KEY_IC" msgstr "KEY_IC" -#: ../../library/curses.rst:1621 +#: ../../library/curses.rst:1625 msgid ":kbd:`Delete`" msgstr ":kbd:`Delete`" -#: ../../library/curses.rst:1621 +#: ../../library/curses.rst:1625 msgid "KEY_DC" msgstr "KEY_DC" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1627 msgid ":kbd:`Home`" msgstr ":kbd:`Home`" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1627 msgid "KEY_HOME" msgstr "KEY_HOME" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1629 msgid ":kbd:`End`" msgstr ":kbd:`End`" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1629 msgid "KEY_END" msgstr "KEY_END" -#: ../../library/curses.rst:1627 +#: ../../library/curses.rst:1631 msgid ":kbd:`Page Up`" msgstr ":kbd:`Page Up`" -#: ../../library/curses.rst:1627 +#: ../../library/curses.rst:1631 msgid "KEY_PPAGE" msgstr "KEY_PPAGE" -#: ../../library/curses.rst:1629 +#: ../../library/curses.rst:1633 msgid ":kbd:`Page Down`" msgstr ":kbd:`Page Down`" -#: ../../library/curses.rst:1629 +#: ../../library/curses.rst:1633 msgid "KEY_NPAGE" msgstr "KEY_NPAGE" -#: ../../library/curses.rst:1632 +#: ../../library/curses.rst:1636 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2525,435 +2077,268 @@ msgid "" "available, curses falls back on a crude printable ASCII approximation." msgstr "" -#: ../../library/curses.rst:1639 +#: ../../library/curses.rst:1643 msgid "These are available only after :func:`initscr` has been called." msgstr "" -#: ../../library/curses.rst:1642 +#: ../../library/curses.rst:1646 msgid "ACS code" msgstr "" -#: ../../library/curses.rst:1644 -msgid "``ACS_BBSS``" -msgstr "``ACS_BBSS``" - -#: ../../library/curses.rst:1644 +#: ../../library/curses.rst:1648 msgid "alternate name for upper right corner" msgstr "" -#: ../../library/curses.rst:1646 -msgid "``ACS_BLOCK``" -msgstr "``ACS_BLOCK``" - -#: ../../library/curses.rst:1646 +#: ../../library/curses.rst:1650 msgid "solid square block" msgstr "" -#: ../../library/curses.rst:1648 -msgid "``ACS_BOARD``" -msgstr "``ACS_BOARD``" - -#: ../../library/curses.rst:1648 +#: ../../library/curses.rst:1652 msgid "board of squares" msgstr "" -#: ../../library/curses.rst:1650 -msgid "``ACS_BSBS``" -msgstr "``ACS_BSBS``" - -#: ../../library/curses.rst:1650 +#: ../../library/curses.rst:1654 msgid "alternate name for horizontal line" msgstr "" -#: ../../library/curses.rst:1652 -msgid "``ACS_BSSB``" -msgstr "``ACS_BSSB``" - -#: ../../library/curses.rst:1652 +#: ../../library/curses.rst:1656 msgid "alternate name for upper left corner" msgstr "" -#: ../../library/curses.rst:1654 -msgid "``ACS_BSSS``" -msgstr "``ACS_BSSS``" - -#: ../../library/curses.rst:1654 +#: ../../library/curses.rst:1658 msgid "alternate name for top tee" msgstr "" -#: ../../library/curses.rst:1656 -msgid "``ACS_BTEE``" -msgstr "``ACS_BTEE``" - -#: ../../library/curses.rst:1656 +#: ../../library/curses.rst:1660 msgid "bottom tee" msgstr "" -#: ../../library/curses.rst:1658 -msgid "``ACS_BULLET``" -msgstr "``ACS_BULLET``" - -#: ../../library/curses.rst:1658 +#: ../../library/curses.rst:1662 msgid "bullet" msgstr "" -#: ../../library/curses.rst:1660 -msgid "``ACS_CKBOARD``" -msgstr "``ACS_CKBOARD``" - -#: ../../library/curses.rst:1660 +#: ../../library/curses.rst:1664 msgid "checker board (stipple)" msgstr "" -#: ../../library/curses.rst:1662 -msgid "``ACS_DARROW``" -msgstr "``ACS_DARROW``" - -#: ../../library/curses.rst:1662 +#: ../../library/curses.rst:1666 msgid "arrow pointing down" msgstr "" -#: ../../library/curses.rst:1664 -msgid "``ACS_DEGREE``" -msgstr "``ACS_DEGREE``" - -#: ../../library/curses.rst:1664 +#: ../../library/curses.rst:1668 msgid "degree symbol" msgstr "" -#: ../../library/curses.rst:1666 -msgid "``ACS_DIAMOND``" -msgstr "``ACS_DIAMOND``" - -#: ../../library/curses.rst:1666 +#: ../../library/curses.rst:1670 msgid "diamond" msgstr "" -#: ../../library/curses.rst:1668 -msgid "``ACS_GEQUAL``" -msgstr "``ACS_GEQUAL``" - -#: ../../library/curses.rst:1668 +#: ../../library/curses.rst:1672 msgid "greater-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1670 -msgid "``ACS_HLINE``" -msgstr "``ACS_HLINE``" - -#: ../../library/curses.rst:1670 +#: ../../library/curses.rst:1674 msgid "horizontal line" msgstr "" -#: ../../library/curses.rst:1672 -msgid "``ACS_LANTERN``" -msgstr "``ACS_LANTERN``" - -#: ../../library/curses.rst:1672 +#: ../../library/curses.rst:1676 msgid "lantern symbol" msgstr "" -#: ../../library/curses.rst:1674 -msgid "``ACS_LARROW``" -msgstr "``ACS_LARROW``" - -#: ../../library/curses.rst:1674 +#: ../../library/curses.rst:1678 msgid "left arrow" msgstr "" -#: ../../library/curses.rst:1676 -msgid "``ACS_LEQUAL``" -msgstr "``ACS_LEQUAL``" - -#: ../../library/curses.rst:1676 +#: ../../library/curses.rst:1680 msgid "less-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1678 -msgid "``ACS_LLCORNER``" -msgstr "``ACS_LLCORNER``" - -#: ../../library/curses.rst:1678 +#: ../../library/curses.rst:1682 msgid "lower left-hand corner" msgstr "" -#: ../../library/curses.rst:1680 -msgid "``ACS_LRCORNER``" -msgstr "``ACS_LRCORNER``" - -#: ../../library/curses.rst:1680 +#: ../../library/curses.rst:1684 msgid "lower right-hand corner" msgstr "" -#: ../../library/curses.rst:1682 -msgid "``ACS_LTEE``" -msgstr "``ACS_LTEE``" - -#: ../../library/curses.rst:1682 +#: ../../library/curses.rst:1686 msgid "left tee" msgstr "" -#: ../../library/curses.rst:1684 -msgid "``ACS_NEQUAL``" -msgstr "``ACS_NEQUAL``" - -#: ../../library/curses.rst:1684 +#: ../../library/curses.rst:1688 msgid "not-equal sign" msgstr "" -#: ../../library/curses.rst:1686 -msgid "``ACS_PI``" -msgstr "``ACS_PI``" - -#: ../../library/curses.rst:1686 +#: ../../library/curses.rst:1690 msgid "letter pi" msgstr "" -#: ../../library/curses.rst:1688 -msgid "``ACS_PLMINUS``" -msgstr "``ACS_PLMINUS``" - -#: ../../library/curses.rst:1688 +#: ../../library/curses.rst:1692 msgid "plus-or-minus sign" msgstr "" -#: ../../library/curses.rst:1690 -msgid "``ACS_PLUS``" -msgstr "``ACS_PLUS``" - -#: ../../library/curses.rst:1690 +#: ../../library/curses.rst:1694 msgid "big plus sign" msgstr "" -#: ../../library/curses.rst:1692 -msgid "``ACS_RARROW``" -msgstr "``ACS_RARROW``" - -#: ../../library/curses.rst:1692 +#: ../../library/curses.rst:1696 msgid "right arrow" msgstr "" -#: ../../library/curses.rst:1694 -msgid "``ACS_RTEE``" -msgstr "``ACS_RTEE``" - -#: ../../library/curses.rst:1694 +#: ../../library/curses.rst:1698 msgid "right tee" msgstr "" -#: ../../library/curses.rst:1696 -msgid "``ACS_S1``" -msgstr "``ACS_S1``" - -#: ../../library/curses.rst:1696 +#: ../../library/curses.rst:1700 msgid "scan line 1" msgstr "" -#: ../../library/curses.rst:1698 -msgid "``ACS_S3``" -msgstr "``ACS_S3``" - -#: ../../library/curses.rst:1698 +#: ../../library/curses.rst:1702 msgid "scan line 3" msgstr "" -#: ../../library/curses.rst:1700 -msgid "``ACS_S7``" -msgstr "``ACS_S7``" - -#: ../../library/curses.rst:1700 +#: ../../library/curses.rst:1704 msgid "scan line 7" msgstr "" -#: ../../library/curses.rst:1702 -msgid "``ACS_S9``" -msgstr "``ACS_S9``" - -#: ../../library/curses.rst:1702 +#: ../../library/curses.rst:1706 msgid "scan line 9" msgstr "" -#: ../../library/curses.rst:1704 -msgid "``ACS_SBBS``" -msgstr "``ACS_SBBS``" - -#: ../../library/curses.rst:1704 +#: ../../library/curses.rst:1708 msgid "alternate name for lower right corner" msgstr "" -#: ../../library/curses.rst:1706 -msgid "``ACS_SBSB``" -msgstr "``ACS_SBSB``" - -#: ../../library/curses.rst:1706 +#: ../../library/curses.rst:1710 msgid "alternate name for vertical line" msgstr "" -#: ../../library/curses.rst:1708 -msgid "``ACS_SBSS``" -msgstr "``ACS_SBSS``" - -#: ../../library/curses.rst:1708 +#: ../../library/curses.rst:1712 msgid "alternate name for right tee" msgstr "" -#: ../../library/curses.rst:1710 -msgid "``ACS_SSBB``" -msgstr "``ACS_SSBB``" - -#: ../../library/curses.rst:1710 +#: ../../library/curses.rst:1714 msgid "alternate name for lower left corner" msgstr "" -#: ../../library/curses.rst:1712 -msgid "``ACS_SSBS``" -msgstr "``ACS_SSBS``" - -#: ../../library/curses.rst:1712 +#: ../../library/curses.rst:1716 msgid "alternate name for bottom tee" msgstr "" -#: ../../library/curses.rst:1714 -msgid "``ACS_SSSB``" -msgstr "``ACS_SSSB``" - -#: ../../library/curses.rst:1714 +#: ../../library/curses.rst:1718 msgid "alternate name for left tee" msgstr "" -#: ../../library/curses.rst:1716 -msgid "``ACS_SSSS``" -msgstr "``ACS_SSSS``" - -#: ../../library/curses.rst:1716 +#: ../../library/curses.rst:1720 msgid "alternate name for crossover or big plus" msgstr "" -#: ../../library/curses.rst:1718 -msgid "``ACS_STERLING``" -msgstr "``ACS_STERLING``" - -#: ../../library/curses.rst:1718 +#: ../../library/curses.rst:1722 msgid "pound sterling" msgstr "" -#: ../../library/curses.rst:1720 -msgid "``ACS_TTEE``" -msgstr "``ACS_TTEE``" - -#: ../../library/curses.rst:1720 +#: ../../library/curses.rst:1724 msgid "top tee" msgstr "" -#: ../../library/curses.rst:1722 -msgid "``ACS_UARROW``" -msgstr "``ACS_UARROW``" - -#: ../../library/curses.rst:1722 +#: ../../library/curses.rst:1726 msgid "up arrow" msgstr "" -#: ../../library/curses.rst:1724 -msgid "``ACS_ULCORNER``" -msgstr "``ACS_ULCORNER``" - -#: ../../library/curses.rst:1724 +#: ../../library/curses.rst:1728 msgid "upper left corner" msgstr "" -#: ../../library/curses.rst:1726 -msgid "``ACS_URCORNER``" -msgstr "``ACS_URCORNER``" - -#: ../../library/curses.rst:1726 +#: ../../library/curses.rst:1730 msgid "upper right corner" msgstr "" -#: ../../library/curses.rst:1728 -msgid "``ACS_VLINE``" -msgstr "``ACS_VLINE``" - -#: ../../library/curses.rst:1728 +#: ../../library/curses.rst:1732 msgid "vertical line" msgstr "" -#: ../../library/curses.rst:1731 +#: ../../library/curses.rst:1735 +msgid "" +"The following table lists mouse button constants used by :meth:`getmouse`:" +msgstr "" + +#: ../../library/curses.rst:1738 +msgid "Mouse button constant" +msgstr "" + +#: ../../library/curses.rst:1740 +msgid "Mouse button *n* pressed" +msgstr "" + +#: ../../library/curses.rst:1742 +msgid "Mouse button *n* released" +msgstr "" + +#: ../../library/curses.rst:1744 +msgid "Mouse button *n* clicked" +msgstr "" + +#: ../../library/curses.rst:1746 +msgid "Mouse button *n* double clicked" +msgstr "" + +#: ../../library/curses.rst:1748 +msgid "Mouse button *n* triple clicked" +msgstr "" + +#: ../../library/curses.rst:1750 +msgid "Shift was down during button state change" +msgstr "" + +#: ../../library/curses.rst:1752 ../../library/curses.rst:1754 +msgid "Control was down during button state change" +msgstr "" + +#: ../../library/curses.rst:1761 msgid "The following table lists the predefined colors:" msgstr "" -#: ../../library/curses.rst:1734 +#: ../../library/curses.rst:1764 msgid "Color" msgstr "顏色" -#: ../../library/curses.rst:1736 -msgid "``COLOR_BLACK``" -msgstr "``COLOR_BLACK``" - -#: ../../library/curses.rst:1736 +#: ../../library/curses.rst:1766 msgid "Black" msgstr "黑" -#: ../../library/curses.rst:1738 -msgid "``COLOR_BLUE``" -msgstr "``COLOR_BLUE``" - -#: ../../library/curses.rst:1738 +#: ../../library/curses.rst:1768 msgid "Blue" msgstr "藍" -#: ../../library/curses.rst:1740 -msgid "``COLOR_CYAN``" -msgstr "``COLOR_CYAN``" - -#: ../../library/curses.rst:1740 +#: ../../library/curses.rst:1770 msgid "Cyan (light greenish blue)" msgstr "" -#: ../../library/curses.rst:1742 -msgid "``COLOR_GREEN``" -msgstr "``COLOR_GREEN``" - -#: ../../library/curses.rst:1742 +#: ../../library/curses.rst:1772 msgid "Green" msgstr "綠" -#: ../../library/curses.rst:1744 -msgid "``COLOR_MAGENTA``" -msgstr "``COLOR_MAGENTA``" - -#: ../../library/curses.rst:1744 +#: ../../library/curses.rst:1774 msgid "Magenta (purplish red)" msgstr "" -#: ../../library/curses.rst:1746 -msgid "``COLOR_RED``" -msgstr "``COLOR_RED``" - -#: ../../library/curses.rst:1746 +#: ../../library/curses.rst:1776 msgid "Red" msgstr "紅" -#: ../../library/curses.rst:1748 -msgid "``COLOR_WHITE``" -msgstr "``COLOR_WHITE``" - -#: ../../library/curses.rst:1748 +#: ../../library/curses.rst:1778 msgid "White" msgstr "白" -#: ../../library/curses.rst:1750 -msgid "``COLOR_YELLOW``" -msgstr "``COLOR_YELLOW``" - -#: ../../library/curses.rst:1750 +#: ../../library/curses.rst:1780 msgid "Yellow" msgstr "" -#: ../../library/curses.rst:1755 +#: ../../library/curses.rst:1785 msgid ":mod:`curses.textpad` --- Text input widget for curses programs" msgstr "" -#: ../../library/curses.rst:1763 +#: ../../library/curses.rst:1793 msgid "" "The :mod:`curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2963,11 +2348,11 @@ msgid "" "purposes." msgstr "" -#: ../../library/curses.rst:1769 +#: ../../library/curses.rst:1799 msgid "The module :mod:`curses.textpad` defines the following function:" msgstr "" -#: ../../library/curses.rst:1774 +#: ../../library/curses.rst:1804 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2979,15 +2364,15 @@ msgid "" "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" -#: ../../library/curses.rst:1787 +#: ../../library/curses.rst:1817 msgid "Textbox objects" msgstr "" -#: ../../library/curses.rst:1789 +#: ../../library/curses.rst:1819 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" -#: ../../library/curses.rst:1794 +#: ../../library/curses.rst:1824 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2996,11 +2381,11 @@ msgid "" "instance's :attr:`stripspaces` flag is initially on." msgstr "" -#: ../../library/curses.rst:1800 +#: ../../library/curses.rst:1830 msgid ":class:`Textbox` objects have the following methods:" msgstr "" -#: ../../library/curses.rst:1805 +#: ../../library/curses.rst:1835 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -3011,167 +2396,172 @@ msgid "" "`stripspaces` attribute." msgstr "" -#: ../../library/curses.rst:1816 +#: ../../library/curses.rst:1846 msgid "" "Process a single command keystroke. Here are the supported special " "keystrokes:" msgstr "" -#: ../../library/curses.rst:1820 ../../library/curses.rst:1858 +#: ../../library/curses.rst:1850 ../../library/curses.rst:1888 msgid "Keystroke" msgstr "" -#: ../../library/curses.rst:1820 +#: ../../library/curses.rst:1850 msgid "Action" msgstr "" -#: ../../library/curses.rst:1822 +#: ../../library/curses.rst:1852 msgid ":kbd:`Control-A`" msgstr ":kbd:`Control-A`" -#: ../../library/curses.rst:1822 +#: ../../library/curses.rst:1852 msgid "Go to left edge of window." msgstr "" -#: ../../library/curses.rst:1824 ../../library/curses.rst:1860 +#: ../../library/curses.rst:1854 ../../library/curses.rst:1890 msgid ":kbd:`Control-B`" msgstr ":kbd:`Control-B`" -#: ../../library/curses.rst:1824 +#: ../../library/curses.rst:1854 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "" -#: ../../library/curses.rst:1827 +#: ../../library/curses.rst:1857 msgid ":kbd:`Control-D`" msgstr ":kbd:`Control-D`" -#: ../../library/curses.rst:1827 +#: ../../library/curses.rst:1857 msgid "Delete character under cursor." msgstr "" -#: ../../library/curses.rst:1829 +#: ../../library/curses.rst:1859 msgid ":kbd:`Control-E`" msgstr ":kbd:`Control-E`" -#: ../../library/curses.rst:1829 +#: ../../library/curses.rst:1859 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" -#: ../../library/curses.rst:1832 ../../library/curses.rst:1862 +#: ../../library/curses.rst:1862 ../../library/curses.rst:1892 msgid ":kbd:`Control-F`" msgstr ":kbd:`Control-F`" -#: ../../library/curses.rst:1832 +#: ../../library/curses.rst:1862 msgid "Cursor right, wrapping to next line when appropriate." msgstr "" -#: ../../library/curses.rst:1835 +#: ../../library/curses.rst:1865 msgid ":kbd:`Control-G`" msgstr ":kbd:`Control-G`" -#: ../../library/curses.rst:1835 +#: ../../library/curses.rst:1865 msgid "Terminate, returning the window contents." msgstr "" -#: ../../library/curses.rst:1837 +#: ../../library/curses.rst:1867 msgid ":kbd:`Control-H`" msgstr ":kbd:`Control-H`" -#: ../../library/curses.rst:1837 +#: ../../library/curses.rst:1867 msgid "Delete character backward." msgstr "" -#: ../../library/curses.rst:1839 +#: ../../library/curses.rst:1869 msgid ":kbd:`Control-J`" msgstr ":kbd:`Control-J`" -#: ../../library/curses.rst:1839 +#: ../../library/curses.rst:1869 msgid "Terminate if the window is 1 line, otherwise insert newline." msgstr "" -#: ../../library/curses.rst:1842 +#: ../../library/curses.rst:1872 msgid ":kbd:`Control-K`" msgstr ":kbd:`Control-K`" -#: ../../library/curses.rst:1842 +#: ../../library/curses.rst:1872 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" -#: ../../library/curses.rst:1845 +#: ../../library/curses.rst:1875 msgid ":kbd:`Control-L`" msgstr ":kbd:`Control-L`" -#: ../../library/curses.rst:1845 +#: ../../library/curses.rst:1875 msgid "Refresh screen." msgstr "" -#: ../../library/curses.rst:1847 ../../library/curses.rst:1866 +#: ../../library/curses.rst:1877 ../../library/curses.rst:1896 msgid ":kbd:`Control-N`" msgstr ":kbd:`Control-N`" -#: ../../library/curses.rst:1847 +#: ../../library/curses.rst:1877 msgid "Cursor down; move down one line." msgstr "" -#: ../../library/curses.rst:1849 +#: ../../library/curses.rst:1879 msgid ":kbd:`Control-O`" msgstr ":kbd:`Control-O`" -#: ../../library/curses.rst:1849 +#: ../../library/curses.rst:1879 msgid "Insert a blank line at cursor location." msgstr "" -#: ../../library/curses.rst:1851 ../../library/curses.rst:1864 +#: ../../library/curses.rst:1881 ../../library/curses.rst:1894 msgid ":kbd:`Control-P`" msgstr ":kbd:`Control-P`" -#: ../../library/curses.rst:1851 +#: ../../library/curses.rst:1881 msgid "Cursor up; move up one line." msgstr "" -#: ../../library/curses.rst:1854 +#: ../../library/curses.rst:1884 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" msgstr "" -#: ../../library/curses.rst:1860 -msgid ":const:`KEY_LEFT`" +#: ../../library/curses.rst:1890 +#, fuzzy +msgid ":const:`~curses.KEY_LEFT`" msgstr ":const:`KEY_LEFT`" -#: ../../library/curses.rst:1862 -msgid ":const:`KEY_RIGHT`" +#: ../../library/curses.rst:1892 +#, fuzzy +msgid ":const:`~curses.KEY_RIGHT`" msgstr ":const:`KEY_RIGHT`" -#: ../../library/curses.rst:1864 -msgid ":const:`KEY_UP`" +#: ../../library/curses.rst:1894 +#, fuzzy +msgid ":const:`~curses.KEY_UP`" msgstr ":const:`KEY_UP`" -#: ../../library/curses.rst:1866 -msgid ":const:`KEY_DOWN`" +#: ../../library/curses.rst:1896 +#, fuzzy +msgid ":const:`~curses.KEY_DOWN`" msgstr ":const:`KEY_DOWN`" -#: ../../library/curses.rst:1868 -msgid ":const:`KEY_BACKSPACE`" +#: ../../library/curses.rst:1898 +#, fuzzy +msgid ":const:`~curses.KEY_BACKSPACE`" msgstr ":const:`KEY_BACKSPACE`" -#: ../../library/curses.rst:1868 +#: ../../library/curses.rst:1898 msgid ":kbd:`Control-h`" msgstr ":kbd:`Control-h`" -#: ../../library/curses.rst:1871 +#: ../../library/curses.rst:1901 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." msgstr "" -#: ../../library/curses.rst:1877 +#: ../../library/curses.rst:1907 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." msgstr "" -#: ../../library/curses.rst:1883 +#: ../../library/curses.rst:1913 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " @@ -3179,3 +2569,498 @@ msgid "" "that line instead, and trailing blanks are stripped when the window contents " "are gathered." msgstr "" + +#~ msgid "``A_ALTCHARSET``" +#~ msgstr "``A_ALTCHARSET``" + +#~ msgid "``A_BLINK``" +#~ msgstr "``A_BLINK``" + +#~ msgid "``A_BOLD``" +#~ msgstr "``A_BOLD``" + +#~ msgid "``A_DIM``" +#~ msgstr "``A_DIM``" + +#~ msgid "``A_INVIS``" +#~ msgstr "``A_INVIS``" + +#~ msgid "``A_ITALIC``" +#~ msgstr "``A_ITALIC``" + +#~ msgid "``A_NORMAL``" +#~ msgstr "``A_NORMAL``" + +#~ msgid "``A_PROTECT``" +#~ msgstr "``A_PROTECT``" + +#~ msgid "``A_REVERSE``" +#~ msgstr "``A_REVERSE``" + +#~ msgid "``A_STANDOUT``" +#~ msgstr "``A_STANDOUT``" + +#~ msgid "``A_UNDERLINE``" +#~ msgstr "``A_UNDERLINE``" + +#~ msgid "``A_HORIZONTAL``" +#~ msgstr "``A_HORIZONTAL``" + +#~ msgid "``A_LEFT``" +#~ msgstr "``A_LEFT``" + +#~ msgid "``A_LOW``" +#~ msgstr "``A_LOW``" + +#~ msgid "``A_RIGHT``" +#~ msgstr "``A_RIGHT``" + +#~ msgid "``A_TOP``" +#~ msgstr "``A_TOP``" + +#~ msgid "``A_VERTICAL``" +#~ msgstr "``A_VERTICAL``" + +#~ msgid "``A_CHARTEXT``" +#~ msgstr "``A_CHARTEXT``" + +#~ msgid "``A_ATTRIBUTES``" +#~ msgstr "``A_ATTRIBUTES``" + +#~ msgid "``A_COLOR``" +#~ msgstr "``A_COLOR``" + +#~ msgid "``KEY_MIN``" +#~ msgstr "``KEY_MIN``" + +#~ msgid "``KEY_BREAK``" +#~ msgstr "``KEY_BREAK``" + +#~ msgid "``KEY_DOWN``" +#~ msgstr "``KEY_DOWN``" + +#~ msgid "``KEY_UP``" +#~ msgstr "``KEY_UP``" + +#~ msgid "``KEY_LEFT``" +#~ msgstr "``KEY_LEFT``" + +#~ msgid "``KEY_RIGHT``" +#~ msgstr "``KEY_RIGHT``" + +#~ msgid "``KEY_HOME``" +#~ msgstr "``KEY_HOME``" + +#~ msgid "``KEY_BACKSPACE``" +#~ msgstr "``KEY_BACKSPACE``" + +#~ msgid "``KEY_F0``" +#~ msgstr "``KEY_F0``" + +#~ msgid "``KEY_Fn``" +#~ msgstr "``KEY_Fn``" + +#~ msgid "``KEY_DL``" +#~ msgstr "``KEY_DL``" + +#~ msgid "``KEY_IL``" +#~ msgstr "``KEY_IL``" + +#~ msgid "``KEY_DC``" +#~ msgstr "``KEY_DC``" + +#~ msgid "``KEY_IC``" +#~ msgstr "``KEY_IC``" + +#~ msgid "``KEY_EIC``" +#~ msgstr "``KEY_EIC``" + +#~ msgid "``KEY_CLEAR``" +#~ msgstr "``KEY_CLEAR``" + +#~ msgid "``KEY_EOS``" +#~ msgstr "``KEY_EOS``" + +#~ msgid "``KEY_EOL``" +#~ msgstr "``KEY_EOL``" + +#~ msgid "``KEY_SF``" +#~ msgstr "``KEY_SF``" + +#~ msgid "``KEY_SR``" +#~ msgstr "``KEY_SR``" + +#~ msgid "``KEY_NPAGE``" +#~ msgstr "``KEY_NPAGE``" + +#~ msgid "``KEY_PPAGE``" +#~ msgstr "``KEY_PPAGE``" + +#~ msgid "``KEY_STAB``" +#~ msgstr "``KEY_STAB``" + +#~ msgid "``KEY_CTAB``" +#~ msgstr "``KEY_CTAB``" + +#~ msgid "``KEY_CATAB``" +#~ msgstr "``KEY_CATAB``" + +#~ msgid "``KEY_ENTER``" +#~ msgstr "``KEY_ENTER``" + +#~ msgid "``KEY_SRESET``" +#~ msgstr "``KEY_SRESET``" + +#~ msgid "``KEY_RESET``" +#~ msgstr "``KEY_RESET``" + +#~ msgid "``KEY_PRINT``" +#~ msgstr "``KEY_PRINT``" + +#~ msgid "``KEY_LL``" +#~ msgstr "``KEY_LL``" + +#~ msgid "``KEY_A1``" +#~ msgstr "``KEY_A1``" + +#~ msgid "``KEY_A3``" +#~ msgstr "``KEY_A3``" + +#~ msgid "``KEY_B2``" +#~ msgstr "``KEY_B2``" + +#~ msgid "``KEY_C1``" +#~ msgstr "``KEY_C1``" + +#~ msgid "``KEY_C3``" +#~ msgstr "``KEY_C3``" + +#~ msgid "``KEY_BTAB``" +#~ msgstr "``KEY_BTAB``" + +#~ msgid "``KEY_BEG``" +#~ msgstr "``KEY_BEG``" + +#~ msgid "``KEY_CANCEL``" +#~ msgstr "``KEY_CANCEL``" + +#~ msgid "``KEY_CLOSE``" +#~ msgstr "``KEY_CLOSE``" + +#~ msgid "``KEY_COMMAND``" +#~ msgstr "``KEY_COMMAND``" + +#~ msgid "``KEY_COPY``" +#~ msgstr "``KEY_COPY``" + +#~ msgid "``KEY_CREATE``" +#~ msgstr "``KEY_CREATE``" + +#~ msgid "``KEY_END``" +#~ msgstr "``KEY_END``" + +#~ msgid "``KEY_EXIT``" +#~ msgstr "``KEY_EXIT``" + +#~ msgid "``KEY_FIND``" +#~ msgstr "``KEY_FIND``" + +#~ msgid "``KEY_HELP``" +#~ msgstr "``KEY_HELP``" + +#~ msgid "``KEY_MARK``" +#~ msgstr "``KEY_MARK``" + +#~ msgid "``KEY_MESSAGE``" +#~ msgstr "``KEY_MESSAGE``" + +#~ msgid "``KEY_MOVE``" +#~ msgstr "``KEY_MOVE``" + +#~ msgid "``KEY_NEXT``" +#~ msgstr "``KEY_NEXT``" + +#~ msgid "``KEY_OPEN``" +#~ msgstr "``KEY_OPEN``" + +#~ msgid "``KEY_OPTIONS``" +#~ msgstr "``KEY_OPTIONS``" + +#~ msgid "``KEY_PREVIOUS``" +#~ msgstr "``KEY_PREVIOUS``" + +#~ msgid "``KEY_REDO``" +#~ msgstr "``KEY_REDO``" + +#~ msgid "``KEY_REFERENCE``" +#~ msgstr "``KEY_REFERENCE``" + +#~ msgid "``KEY_REFRESH``" +#~ msgstr "``KEY_REFRESH``" + +#~ msgid "``KEY_REPLACE``" +#~ msgstr "``KEY_REPLACE``" + +#~ msgid "``KEY_RESTART``" +#~ msgstr "``KEY_RESTART``" + +#~ msgid "``KEY_RESUME``" +#~ msgstr "``KEY_RESUME``" + +#~ msgid "``KEY_SAVE``" +#~ msgstr "``KEY_SAVE``" + +#~ msgid "``KEY_SBEG``" +#~ msgstr "``KEY_SBEG``" + +#~ msgid "``KEY_SCANCEL``" +#~ msgstr "``KEY_SCANCEL``" + +#~ msgid "``KEY_SCOMMAND``" +#~ msgstr "``KEY_SCOMMAND``" + +#~ msgid "``KEY_SCOPY``" +#~ msgstr "``KEY_SCOPY``" + +#~ msgid "``KEY_SCREATE``" +#~ msgstr "``KEY_SCREATE``" + +#~ msgid "``KEY_SDC``" +#~ msgstr "``KEY_SDC``" + +#~ msgid "``KEY_SDL``" +#~ msgstr "``KEY_SDL``" + +#~ msgid "``KEY_SELECT``" +#~ msgstr "``KEY_SELECT``" + +#~ msgid "``KEY_SEND``" +#~ msgstr "``KEY_SEND``" + +#~ msgid "``KEY_SEOL``" +#~ msgstr "``KEY_SEOL``" + +#~ msgid "``KEY_SEXIT``" +#~ msgstr "``KEY_SEXIT``" + +#~ msgid "``KEY_SFIND``" +#~ msgstr "``KEY_SFIND``" + +#~ msgid "``KEY_SHELP``" +#~ msgstr "``KEY_SHELP``" + +#~ msgid "``KEY_SHOME``" +#~ msgstr "``KEY_SHOME``" + +#~ msgid "``KEY_SIC``" +#~ msgstr "``KEY_SIC``" + +#~ msgid "``KEY_SLEFT``" +#~ msgstr "``KEY_SLEFT``" + +#~ msgid "``KEY_SMESSAGE``" +#~ msgstr "``KEY_SMESSAGE``" + +#~ msgid "``KEY_SMOVE``" +#~ msgstr "``KEY_SMOVE``" + +#~ msgid "``KEY_SNEXT``" +#~ msgstr "``KEY_SNEXT``" + +#~ msgid "``KEY_SOPTIONS``" +#~ msgstr "``KEY_SOPTIONS``" + +#~ msgid "``KEY_SPREVIOUS``" +#~ msgstr "``KEY_SPREVIOUS``" + +#~ msgid "``KEY_SPRINT``" +#~ msgstr "``KEY_SPRINT``" + +#~ msgid "``KEY_SREDO``" +#~ msgstr "``KEY_SREDO``" + +#~ msgid "``KEY_SREPLACE``" +#~ msgstr "``KEY_SREPLACE``" + +#~ msgid "``KEY_SRIGHT``" +#~ msgstr "``KEY_SRIGHT``" + +#~ msgid "``KEY_SRSUME``" +#~ msgstr "``KEY_SRSUME``" + +#~ msgid "``KEY_SSAVE``" +#~ msgstr "``KEY_SSAVE``" + +#~ msgid "``KEY_SSUSPEND``" +#~ msgstr "``KEY_SSUSPEND``" + +#~ msgid "``KEY_SUNDO``" +#~ msgstr "``KEY_SUNDO``" + +#~ msgid "``KEY_SUSPEND``" +#~ msgstr "``KEY_SUSPEND``" + +#~ msgid "``KEY_UNDO``" +#~ msgstr "``KEY_UNDO``" + +#~ msgid "``KEY_MOUSE``" +#~ msgstr "``KEY_MOUSE``" + +#~ msgid "``KEY_RESIZE``" +#~ msgstr "``KEY_RESIZE``" + +#~ msgid "``KEY_MAX``" +#~ msgstr "``KEY_MAX``" + +#~ msgid "``ACS_BBSS``" +#~ msgstr "``ACS_BBSS``" + +#~ msgid "``ACS_BLOCK``" +#~ msgstr "``ACS_BLOCK``" + +#~ msgid "``ACS_BOARD``" +#~ msgstr "``ACS_BOARD``" + +#~ msgid "``ACS_BSBS``" +#~ msgstr "``ACS_BSBS``" + +#~ msgid "``ACS_BSSB``" +#~ msgstr "``ACS_BSSB``" + +#~ msgid "``ACS_BSSS``" +#~ msgstr "``ACS_BSSS``" + +#~ msgid "``ACS_BTEE``" +#~ msgstr "``ACS_BTEE``" + +#~ msgid "``ACS_BULLET``" +#~ msgstr "``ACS_BULLET``" + +#~ msgid "``ACS_CKBOARD``" +#~ msgstr "``ACS_CKBOARD``" + +#~ msgid "``ACS_DARROW``" +#~ msgstr "``ACS_DARROW``" + +#~ msgid "``ACS_DEGREE``" +#~ msgstr "``ACS_DEGREE``" + +#~ msgid "``ACS_DIAMOND``" +#~ msgstr "``ACS_DIAMOND``" + +#~ msgid "``ACS_GEQUAL``" +#~ msgstr "``ACS_GEQUAL``" + +#~ msgid "``ACS_HLINE``" +#~ msgstr "``ACS_HLINE``" + +#~ msgid "``ACS_LANTERN``" +#~ msgstr "``ACS_LANTERN``" + +#~ msgid "``ACS_LARROW``" +#~ msgstr "``ACS_LARROW``" + +#~ msgid "``ACS_LEQUAL``" +#~ msgstr "``ACS_LEQUAL``" + +#~ msgid "``ACS_LLCORNER``" +#~ msgstr "``ACS_LLCORNER``" + +#~ msgid "``ACS_LRCORNER``" +#~ msgstr "``ACS_LRCORNER``" + +#~ msgid "``ACS_LTEE``" +#~ msgstr "``ACS_LTEE``" + +#~ msgid "``ACS_NEQUAL``" +#~ msgstr "``ACS_NEQUAL``" + +#~ msgid "``ACS_PI``" +#~ msgstr "``ACS_PI``" + +#~ msgid "``ACS_PLMINUS``" +#~ msgstr "``ACS_PLMINUS``" + +#~ msgid "``ACS_PLUS``" +#~ msgstr "``ACS_PLUS``" + +#~ msgid "``ACS_RARROW``" +#~ msgstr "``ACS_RARROW``" + +#~ msgid "``ACS_RTEE``" +#~ msgstr "``ACS_RTEE``" + +#~ msgid "``ACS_S1``" +#~ msgstr "``ACS_S1``" + +#~ msgid "``ACS_S3``" +#~ msgstr "``ACS_S3``" + +#~ msgid "``ACS_S7``" +#~ msgstr "``ACS_S7``" + +#~ msgid "``ACS_S9``" +#~ msgstr "``ACS_S9``" + +#~ msgid "``ACS_SBBS``" +#~ msgstr "``ACS_SBBS``" + +#~ msgid "``ACS_SBSB``" +#~ msgstr "``ACS_SBSB``" + +#~ msgid "``ACS_SBSS``" +#~ msgstr "``ACS_SBSS``" + +#~ msgid "``ACS_SSBB``" +#~ msgstr "``ACS_SSBB``" + +#~ msgid "``ACS_SSBS``" +#~ msgstr "``ACS_SSBS``" + +#~ msgid "``ACS_SSSB``" +#~ msgstr "``ACS_SSSB``" + +#~ msgid "``ACS_SSSS``" +#~ msgstr "``ACS_SSSS``" + +#~ msgid "``ACS_STERLING``" +#~ msgstr "``ACS_STERLING``" + +#~ msgid "``ACS_TTEE``" +#~ msgstr "``ACS_TTEE``" + +#~ msgid "``ACS_UARROW``" +#~ msgstr "``ACS_UARROW``" + +#~ msgid "``ACS_ULCORNER``" +#~ msgstr "``ACS_ULCORNER``" + +#~ msgid "``ACS_URCORNER``" +#~ msgstr "``ACS_URCORNER``" + +#~ msgid "``ACS_VLINE``" +#~ msgstr "``ACS_VLINE``" + +#~ msgid "``COLOR_BLACK``" +#~ msgstr "``COLOR_BLACK``" + +#~ msgid "``COLOR_BLUE``" +#~ msgstr "``COLOR_BLUE``" + +#~ msgid "``COLOR_CYAN``" +#~ msgstr "``COLOR_CYAN``" + +#~ msgid "``COLOR_GREEN``" +#~ msgstr "``COLOR_GREEN``" + +#~ msgid "``COLOR_MAGENTA``" +#~ msgstr "``COLOR_MAGENTA``" + +#~ msgid "``COLOR_RED``" +#~ msgstr "``COLOR_RED``" + +#~ msgid "``COLOR_WHITE``" +#~ msgstr "``COLOR_WHITE``" + +#~ msgid "``COLOR_YELLOW``" +#~ msgstr "``COLOR_YELLOW``" From 28f6dff5e13d1e64511183feb8d14aca920b7a3e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 9 May 2023 00:33:03 +0000 Subject: [PATCH 081/130] sync with cpython b7622e7a --- c-api/buffer.po | 37 +- c-api/bytearray.po | 10 +- c-api/bytes.po | 20 +- c-api/capsule.po | 10 +- c-api/code.po | 14 +- c-api/complex.po | 10 +- c-api/concrete.po | 19 +- c-api/dict.po | 23 +- c-api/exceptions.po | 360 ++++++++- c-api/file.po | 18 +- c-api/float.po | 11 +- c-api/function.po | 14 +- c-api/import.po | 34 +- c-api/init.po | 178 ++++- c-api/intro.po | 130 +++- c-api/list.po | 22 +- c-api/long.po | 35 +- c-api/mapping.po | 10 +- c-api/memory.po | 25 +- c-api/memoryview.po | 10 +- c-api/method.po | 24 +- c-api/module.po | 43 +- c-api/none.po | 10 +- c-api/number.po | 28 +- c-api/object.po | 40 +- c-api/sequence.po | 14 +- c-api/set.po | 22 +- c-api/structures.po | 14 +- c-api/sys.po | 19 +- c-api/tuple.po | 10 +- c-api/type.po | 10 +- c-api/typeobj.po | 16 +- c-api/veryhigh.po | 11 +- distributing/index.po | 14 +- extending/extending.po | 22 +- extending/newtypes.po | 68 +- faq/programming.po | 18 +- glossary.po | 99 ++- howto/clinic.po | 401 +++++----- library/_thread.po | 38 +- library/aifc.po | 26 +- library/argparse.po | 19 +- library/array.po | 6 +- library/ast.po | 26 +- library/asyncio-task.po | 109 +-- library/audioop.po | 27 +- library/audit_events.po | 7 +- library/base64.po | 18 +- library/binascii.po | 14 +- library/bisect.po | 112 +-- library/cgi.po | 47 +- library/cgitb.po | 26 +- library/chunk.po | 22 +- library/cmath.po | 10 +- library/cmd.po | 18 +- library/codecs.po | 103 ++- library/configparser.po | 34 +- library/constants.po | 10 +- library/copy.po | 24 +- library/copyreg.po | 14 +- library/crypt.po | 15 +- library/crypto.po | 6 +- library/csv.po | 22 +- library/curses.ascii.po | 14 +- library/datetime.po | 11 +- library/dbm.po | 6 +- library/dis.po | 10 +- library/doctest.po | 46 +- library/exceptions.po | 31 +- library/fcntl.po | 14 +- library/fnmatch.po | 46 +- library/ftplib.po | 14 +- library/functions.po | 118 ++- library/functools.po | 160 ++-- library/gettext.po | 14 +- library/glob.po | 42 +- library/hashlib.po | 22 +- library/html.parser.po | 14 +- library/http.client.po | 22 +- library/http.po | 14 +- library/http.server.po | 34 +- library/idle.po | 49 +- library/imaplib.po | 18 +- library/imp.po | 18 +- library/importlib.po | 10 +- library/internet.po | 22 +- library/io.po | 22 +- library/linecache.po | 14 +- library/locale.po | 14 +- library/logging.po | 11 +- library/marshal.po | 26 +- library/mimetypes.po | 22 +- library/msilib.po | 10 +- library/multiprocessing.shared_memory.po | 14 +- library/nntplib.po | 14 +- library/os.path.po | 42 +- library/os.po | 144 +++- library/pathlib.po | 10 +- library/pdb.po | 38 +- library/pickle.po | 62 +- library/plistlib.po | 14 +- library/poplib.po | 10 +- library/posix.po | 18 +- library/pprint.po | 18 +- library/profile.po | 10 +- library/pwd.po | 10 +- library/py_compile.po | 10 +- library/pydoc.po | 18 +- library/pyexpat.po | 14 +- library/quopri.po | 18 +- library/re.po | 227 +++++- library/reprlib.po | 10 +- library/runpy.po | 10 +- library/sched.po | 6 +- library/security_warnings.po | 6 +- library/select.po | 14 +- library/shelve.po | 18 +- library/shutil.po | 22 +- library/site.po | 65 +- library/smtplib.po | 14 +- library/sndhdr.po | 10 +- library/socket.po | 26 +- library/sqlite3.po | 14 +- library/ssl.po | 36 +- library/stdtypes.po | 761 +++++++++++++++++- library/string.po | 90 ++- library/struct.po | 51 +- library/subprocess.po | 10 +- library/sys.po | 62 +- library/sysconfig.po | 6 +- library/telnetlib.po | 11 +- library/tempfile.po | 14 +- library/termios.po | 14 +- library/textwrap.po | 10 +- library/threading.po | 14 +- library/time.po | 56 +- library/timeit.po | 10 +- library/tk.po | 19 +- library/tkinter.po | 40 +- library/tkinter.tix.po | 6 +- library/tkinter.ttk.po | 12 +- library/traceback.po | 18 +- library/types.po | 10 +- library/typing.po | 338 ++++---- library/unicodedata.po | 14 +- library/urllib.parse.po | 26 +- library/urllib.request.po | 18 +- library/urllib.robotparser.po | 18 +- library/uu.po | 10 +- library/uuid.po | 22 +- library/venv.po | 10 +- library/warnings.po | 6 +- library/winreg.po | 10 +- library/xdrlib.po | 14 +- library/zipapp.po | 6 +- library/zlib.po | 10 +- reference/compound_stmts.po | 407 +++++++++- reference/datamodel.po | 953 ++++++++++++++++++++++- reference/executionmodel.po | 112 ++- reference/expressions.po | 770 +++++++++++++++++- reference/import.po | 95 ++- reference/introduction.po | 27 +- reference/lexical_analysis.po | 430 +++++++++- reference/simple_stmts.po | 474 ++++++++++- reference/toplevel_components.po | 60 +- tutorial/classes.po | 19 +- tutorial/controlflow.po | 94 ++- tutorial/inputoutput.po | 58 +- tutorial/introduction.po | 10 +- tutorial/modules.po | 28 +- tutorial/stdlib.po | 10 +- whatsnew/2.3.po | 10 +- whatsnew/2.4.po | 10 +- whatsnew/2.5.po | 10 +- whatsnew/2.6.po | 10 +- whatsnew/3.3.po | 10 +- 176 files changed, 8880 insertions(+), 869 deletions(-) diff --git a/c-api/buffer.po b/c-api/buffer.po index 4fdef3e1c6..8a579f15df 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -686,3 +686,38 @@ msgid "" "*exporter* MUST be set to the exporting object and *flags* must be passed " "unmodified. Otherwise, *exporter* MUST be ``NULL``." msgstr "" + +#: ../../c-api/buffer.rst:3 +#, fuzzy +msgid "buffer protocol" +msgstr "緩衝協定 (Buffer Protocol)" + +#: ../../c-api/buffer.rst:3 +msgid "buffer interface" +msgstr "" + +#: ../../c-api/buffer.rst:3 +#, fuzzy +msgid "(see buffer protocol)" +msgstr "緩衝協定 (Buffer Protocol)" + +#: ../../c-api/buffer.rst:3 +msgid "buffer object" +msgstr "" + +#: ../../c-api/buffer.rst:32 +#, fuzzy +msgid "PyBufferProcs" +msgstr "緩衝協定 (Buffer Protocol)" + +#: ../../c-api/buffer.rst:284 +msgid "contiguous" +msgstr "" + +#: ../../c-api/buffer.rst:284 +msgid "C-contiguous" +msgstr "" + +#: ../../c-api/buffer.rst:284 +msgid "Fortran contiguous" +msgstr "" diff --git a/c-api/bytearray.po b/c-api/bytearray.po index 9705300c75..1cd9622aa9 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,3 +99,11 @@ msgstr "" #: ../../c-api/bytearray.rst:85 msgid "Similar to :c:func:`PyByteArray_Size`, but without error checking." msgstr "" + +#: ../../c-api/bytearray.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/bytearray.rst:8 +msgid "bytearray" +msgstr "" diff --git a/c-api/bytes.po b/c-api/bytes.po index 41d6262d9e..edefdb588c 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -217,9 +217,9 @@ msgstr "const void\\*" #: ../../c-api/bytes.rst:102 msgid "" -"The hex representation of a C pointer. Mostly equivalent to ``printf(\"%p" -"\")`` except that it is guaranteed to start with the literal ``0x`` " -"regardless of what the platform's ``printf`` yields." +"The hex representation of a C pointer. Mostly equivalent to " +"``printf(\"%p\")`` except that it is guaranteed to start with the literal " +"``0x`` regardless of what the platform's ``printf`` yields." msgstr "" #: ../../c-api/bytes.rst:111 @@ -323,7 +323,15 @@ msgid "" "address of an existing bytes object as an lvalue (it may be written into), " "and the new size desired. On success, *\\*bytes* holds the resized bytes " "object and ``0`` is returned; the address in *\\*bytes* may differ from its " -"input value. If the reallocation fails, the original bytes object at *" -"\\*bytes* is deallocated, *\\*bytes* is set to ``NULL``, :exc:`MemoryError` " +"input value. If the reallocation fails, the original bytes object at " +"*\\*bytes* is deallocated, *\\*bytes* is set to ``NULL``, :exc:`MemoryError` " "is set, and ``-1`` is returned." msgstr "" + +#: ../../c-api/bytes.rst:11 +msgid "object" +msgstr "" + +#: ../../c-api/bytes.rst:11 +msgid "bytes" +msgstr "" diff --git a/c-api/capsule.po b/c-api/capsule.po index 5f39a543e1..5629d0d17c 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -202,3 +202,11 @@ msgid "" "Set the void pointer inside *capsule* to *pointer*. The pointer may not be " "``NULL``." msgstr "" + +#: ../../c-api/capsule.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/capsule.rst:8 +msgid "Capsule" +msgstr "" diff --git a/c-api/code.po b/c-api/code.po index 29fa006aae..e9e11c57b8 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-05 00:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -140,3 +140,15 @@ msgid "" "reference to a :c:type:`PyTupleObject` containing the names of the free " "variables. On error, ``NULL`` is returned and an exception is raised." msgstr "" + +#: ../../c-api/code.rst:3 +msgid "object" +msgstr "" + +#: ../../c-api/code.rst:3 +msgid "code" +msgstr "" + +#: ../../c-api/code.rst:3 +msgid "code object" +msgstr "" diff --git a/c-api/complex.po b/c-api/complex.po index 01b6cbf657..c1370ccea6 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -159,3 +159,11 @@ msgstr "" #: ../../c-api/complex.rst:137 msgid "Use :meth:`__index__` if available." msgstr "" + +#: ../../c-api/complex.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/complex.rst:8 +msgid "complex number" +msgstr "" diff --git a/c-api/concrete.po b/c-api/concrete.po index 4d1e2e3453..44e11bc836 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -76,3 +76,20 @@ msgstr "函式物件" #: ../../c-api/concrete.rst:102 msgid "Other Objects" msgstr "其他物件" + +#: ../../c-api/concrete.rst:43 ../../c-api/concrete.rst:58 +#: ../../c-api/concrete.rst:80 +msgid "object" +msgstr "" + +#: ../../c-api/concrete.rst:43 +msgid "numeric" +msgstr "" + +#: ../../c-api/concrete.rst:58 +msgid "sequence" +msgstr "" + +#: ../../c-api/concrete.rst:80 +msgid "mapping" +msgstr "" diff --git a/c-api/dict.po b/c-api/dict.po index e77a7e603c..43356ce73f 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:32+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -237,3 +237,24 @@ msgid "" "*override* is true, else the first wins. Return ``0`` on success or ``-1`` " "if an exception was raised. Equivalent Python (except for the return value)::" msgstr "" + +#: ../../c-api/dict.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/dict.rst:8 +#, fuzzy +msgid "dictionary" +msgstr "字典物件" + +#: ../../c-api/dict.rst:73 +msgid "PyUnicode_FromString()" +msgstr "" + +#: ../../c-api/dict.rst:157 +msgid "built-in function" +msgstr "" + +#: ../../c-api/dict.rst:157 +msgid "len" +msgstr "" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 123e125b37..368a060951 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -1523,5 +1523,363 @@ msgstr ":c:data:`PyExc_ResourceWarning`." msgid "This is a base class for other standard warning categories." msgstr "" +#: ../../c-api/exceptions.rst:150 +msgid "strerror()" +msgstr "" + +#: ../../c-api/exceptions.rst:545 ../../c-api/exceptions.rst:576 +#: ../../c-api/exceptions.rst:591 +msgid "module" +msgstr "" + +#: ../../c-api/exceptions.rst:545 ../../c-api/exceptions.rst:576 +#: ../../c-api/exceptions.rst:591 +msgid "signal" +msgstr "" + +#: ../../c-api/exceptions.rst:545 ../../c-api/exceptions.rst:576 +msgid "SIGINT" +msgstr "" + +#: ../../c-api/exceptions.rst:545 ../../c-api/exceptions.rst:576 +#: ../../c-api/exceptions.rst:591 +msgid "KeyboardInterrupt (built-in exception)" +msgstr "" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_BaseException" +msgstr ":c:data:`PyExc_BaseException`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_Exception" +msgstr ":c:data:`PyExc_Exception`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ArithmeticError" +msgstr ":c:data:`PyExc_ArithmeticError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_AssertionError" +msgstr ":c:data:`PyExc_AssertionError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_AttributeError" +msgstr ":c:data:`PyExc_AttributeError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_BlockingIOError" +msgstr ":c:data:`PyExc_BlockingIOError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_BrokenPipeError" +msgstr ":c:data:`PyExc_BrokenPipeError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_BufferError" +msgstr ":c:data:`PyExc_BufferError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ChildProcessError" +msgstr ":c:data:`PyExc_ChildProcessError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ConnectionAbortedError" +msgstr ":c:data:`PyExc_ConnectionAbortedError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ConnectionError" +msgstr ":c:data:`PyExc_ConnectionError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ConnectionRefusedError" +msgstr ":c:data:`PyExc_ConnectionRefusedError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ConnectionResetError" +msgstr ":c:data:`PyExc_ConnectionResetError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_EOFError" +msgstr ":c:data:`PyExc_EOFError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_FileExistsError" +msgstr ":c:data:`PyExc_FileExistsError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_FileNotFoundError" +msgstr ":c:data:`PyExc_FileNotFoundError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_FloatingPointError" +msgstr ":c:data:`PyExc_FloatingPointError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_GeneratorExit" +msgstr ":c:data:`PyExc_GeneratorExit`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ImportError" +msgstr ":c:data:`PyExc_ImportError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_IndentationError" +msgstr ":c:data:`PyExc_IndentationError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_IndexError" +msgstr ":c:data:`PyExc_IndexError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_InterruptedError" +msgstr ":c:data:`PyExc_InterruptedError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_IsADirectoryError" +msgstr ":c:data:`PyExc_IsADirectoryError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_KeyError" +msgstr ":c:data:`PyExc_KeyError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_KeyboardInterrupt" +msgstr ":c:data:`PyExc_KeyboardInterrupt`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_LookupError" +msgstr ":c:data:`PyExc_LookupError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_MemoryError" +msgstr ":c:data:`PyExc_MemoryError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ModuleNotFoundError" +msgstr ":c:data:`PyExc_ModuleNotFoundError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_NameError" +msgstr ":c:data:`PyExc_NameError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_NotADirectoryError" +msgstr ":c:data:`PyExc_NotADirectoryError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_NotImplementedError" +msgstr ":c:data:`PyExc_NotImplementedError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_OSError" +msgstr ":c:data:`PyExc_OSError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_OverflowError" +msgstr ":c:data:`PyExc_OverflowError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_PermissionError" +msgstr ":c:data:`PyExc_PermissionError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ProcessLookupError" +msgstr ":c:data:`PyExc_ProcessLookupError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_RecursionError" +msgstr ":c:data:`PyExc_RecursionError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ReferenceError" +msgstr ":c:data:`PyExc_ReferenceError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_RuntimeError" +msgstr ":c:data:`PyExc_RuntimeError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_StopAsyncIteration" +msgstr ":c:data:`PyExc_StopAsyncIteration`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_StopIteration" +msgstr ":c:data:`PyExc_StopIteration`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_SyntaxError" +msgstr ":c:data:`PyExc_SyntaxError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_SystemError" +msgstr ":c:data:`PyExc_SystemError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_SystemExit" +msgstr ":c:data:`PyExc_SystemExit`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_TabError" +msgstr ":c:data:`PyExc_TabError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_TimeoutError" +msgstr ":c:data:`PyExc_TimeoutError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_TypeError" +msgstr ":c:data:`PyExc_TypeError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_UnboundLocalError" +msgstr ":c:data:`PyExc_UnboundLocalError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_UnicodeDecodeError" +msgstr ":c:data:`PyExc_UnicodeDecodeError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_UnicodeEncodeError" +msgstr ":c:data:`PyExc_UnicodeEncodeError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_UnicodeError" +msgstr ":c:data:`PyExc_UnicodeError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_UnicodeTranslateError" +msgstr ":c:data:`PyExc_UnicodeTranslateError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ValueError" +msgstr ":c:data:`PyExc_ValueError`" + +#: ../../c-api/exceptions.rst:854 +#, fuzzy +msgid "PyExc_ZeroDivisionError" +msgstr ":c:data:`PyExc_ZeroDivisionError`" + +#: ../../c-api/exceptions.rst:1037 +#, fuzzy +msgid "PyExc_EnvironmentError" +msgstr ":c:data:`PyExc_EnvironmentError`" + +#: ../../c-api/exceptions.rst:1037 +#, fuzzy +msgid "PyExc_IOError" +msgstr ":c:data:`PyExc_IOError`" + +#: ../../c-api/exceptions.rst:1037 +#, fuzzy +msgid "PyExc_WindowsError" +msgstr ":c:data:`PyExc_WindowsError`" + +#: ../../c-api/exceptions.rst:1074 +#, fuzzy +msgid "PyExc_Warning" +msgstr ":c:data:`PyExc_Warning`" + +#: ../../c-api/exceptions.rst:1074 +#, fuzzy +msgid "PyExc_BytesWarning" +msgstr ":c:data:`PyExc_BytesWarning`" + +#: ../../c-api/exceptions.rst:1074 +#, fuzzy +msgid "PyExc_DeprecationWarning" +msgstr ":c:data:`PyExc_DeprecationWarning`" + +#: ../../c-api/exceptions.rst:1074 +#, fuzzy +msgid "PyExc_FutureWarning" +msgstr ":c:data:`PyExc_FutureWarning`" + +#: ../../c-api/exceptions.rst:1074 +#, fuzzy +msgid "PyExc_ImportWarning" +msgstr ":c:data:`PyExc_ImportWarning`" + +#: ../../c-api/exceptions.rst:1074 +#, fuzzy +msgid "PyExc_PendingDeprecationWarning" +msgstr ":c:data:`PyExc_PendingDeprecationWarning`" + +#: ../../c-api/exceptions.rst:1074 +#, fuzzy +msgid "PyExc_ResourceWarning" +msgstr ":c:data:`PyExc_ResourceWarning`" + +#: ../../c-api/exceptions.rst:1074 +#, fuzzy +msgid "PyExc_RuntimeWarning" +msgstr ":c:data:`PyExc_RuntimeWarning`" + +#: ../../c-api/exceptions.rst:1074 +#, fuzzy +msgid "PyExc_SyntaxWarning" +msgstr ":c:data:`PyExc_SyntaxWarning`" + +#: ../../c-api/exceptions.rst:1074 +#, fuzzy +msgid "PyExc_UnicodeWarning" +msgstr ":c:data:`PyExc_UnicodeWarning`" + +#: ../../c-api/exceptions.rst:1074 +#, fuzzy +msgid "PyExc_UserWarning" +msgstr ":c:data:`PyExc_UserWarning`" + #~ msgid "3.11" #~ msgstr "3.11" diff --git a/c-api/file.po b/c-api/file.po index 4ebb3e47c4..ba13045f8f 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -137,3 +137,19 @@ msgid "" msgstr "" "寫入字串 *s* 到 檔案物件 *p*\\ 。當成功時回傳 0,而當失敗時回傳 -1,並會設定" "合適的例外狀況。" + +#: ../../c-api/file.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/file.rst:8 +msgid "file" +msgstr "" + +#: ../../c-api/file.rst:50 +msgid "EOFError (built-in exception)" +msgstr "" + +#: ../../c-api/file.rst:93 +msgid "Py_PRINT_RAW" +msgstr "" diff --git a/c-api/float.po b/c-api/float.po index 3e722bd2ce..142017c66b 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -211,3 +211,12 @@ msgstr "" #: ../../c-api/float.rst:164 msgid "Unpack the IEEE 754 binary64 double precision format as a C double." msgstr "" + +#: ../../c-api/float.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/float.rst:8 +#, fuzzy +msgid "floating point" +msgstr "浮點數(Floating Point)物件" diff --git a/c-api/function.po b/c-api/function.po index 00ac8fe8bd..32396acd58 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -136,3 +136,15 @@ msgid "" "dictionary or ``Py_None``." msgstr "" "設定函數物件 *op* 的標註。\\ *annotations* 必須是一個字典或 *Py_None*\\ 。" + +#: ../../c-api/function.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/function.rst:8 +msgid "function" +msgstr "" + +#: ../../c-api/function.rst:20 +msgid "MethodType (in module types)" +msgstr "" diff --git a/c-api/import.po b/c-api/import.po index 164542d5ad..f5caeb7201 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -327,3 +327,35 @@ msgid "" "or :c:func:`PyImport_ExtendInittab` must be called before each Python " "initialization." msgstr "" + +#: ../../c-api/import.rst:11 +msgid "package variable" +msgstr "" + +#: ../../c-api/import.rst:11 +msgid "__all__" +msgstr "" + +#: ../../c-api/import.rst:11 +msgid "__all__ (package variable)" +msgstr "" + +#: ../../c-api/import.rst:11 +msgid "modules (in module sys)" +msgstr "" + +#: ../../c-api/import.rst:44 ../../c-api/import.rst:123 +msgid "built-in function" +msgstr "" + +#: ../../c-api/import.rst:44 +msgid "__import__" +msgstr "" + +#: ../../c-api/import.rst:123 +msgid "compile" +msgstr "" + +#: ../../c-api/import.rst:248 +msgid "freeze utility" +msgstr "" diff --git a/c-api/init.po b/c-api/init.po index 305a32e40c..185285d931 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2126,3 +2126,179 @@ msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" + +#: ../../c-api/init.rst:231 ../../c-api/init.rst:386 ../../c-api/init.rst:461 +#, fuzzy +msgid "Py_SetProgramName()" +msgstr ":c:func:`Py_SetProgramName`" + +#: ../../c-api/init.rst:231 +msgid "PyEval_InitThreads()" +msgstr "" + +#: ../../c-api/init.rst:231 +msgid "modules (in module sys)" +msgstr "" + +#: ../../c-api/init.rst:231 ../../c-api/init.rst:480 ../../c-api/init.rst:506 +msgid "path (in module sys)" +msgstr "" + +#: ../../c-api/init.rst:231 ../../c-api/init.rst:480 ../../c-api/init.rst:506 +#: ../../c-api/init.rst:945 ../../c-api/init.rst:1387 +msgid "module" +msgstr "" + +#: ../../c-api/init.rst:231 ../../c-api/init.rst:1387 +msgid "builtins" +msgstr "" + +#: ../../c-api/init.rst:231 ../../c-api/init.rst:1387 +msgid "__main__" +msgstr "" + +#: ../../c-api/init.rst:231 ../../c-api/init.rst:1387 +msgid "sys" +msgstr "" + +#: ../../c-api/init.rst:231 ../../c-api/init.rst:480 ../../c-api/init.rst:506 +msgid "search" +msgstr "" + +#: ../../c-api/init.rst:231 ../../c-api/init.rst:480 ../../c-api/init.rst:506 +msgid "path" +msgstr "" + +#: ../../c-api/init.rst:231 +msgid "PySys_SetArgv()" +msgstr "" + +#: ../../c-api/init.rst:231 +msgid "PySys_SetArgvEx()" +msgstr "" + +#: ../../c-api/init.rst:231 ../../c-api/init.rst:1416 ../../c-api/init.rst:1451 +msgid "Py_FinalizeEx()" +msgstr "" + +#: ../../c-api/init.rst:321 ../../c-api/init.rst:358 ../../c-api/init.rst:1416 +#, fuzzy +msgid "Py_Initialize()" +msgstr ":c:func:`Py_IsInitialized`" + +#: ../../c-api/init.rst:321 ../../c-api/init.rst:358 ../../c-api/init.rst:614 +msgid "main()" +msgstr "" + +#: ../../c-api/init.rst:321 +msgid "stdin" +msgstr "" + +#: ../../c-api/init.rst:321 +msgid "stdout" +msgstr "" + +#: ../../c-api/init.rst:321 +msgid "sdterr" +msgstr "" + +#: ../../c-api/init.rst:358 ../../c-api/init.rst:506 +msgid "Py_GetPath()" +msgstr "" + +#: ../../c-api/init.rst:461 +msgid "executable (in module sys)" +msgstr "" + +#: ../../c-api/init.rst:480 +#, fuzzy +msgid "Py_SetPath()" +msgstr ":c:func:`Py_SetPath`" + +#: ../../c-api/init.rst:549 ../../c-api/init.rst:591 ../../c-api/init.rst:605 +msgid "version (in module sys)" +msgstr "" + +#: ../../c-api/init.rst:561 +msgid "platform (in module sys)" +msgstr "" + +#: ../../c-api/init.rst:578 +msgid "copyright (in module sys)" +msgstr "" + +#: ../../c-api/init.rst:614 +msgid "Py_FatalError()" +msgstr "" + +#: ../../c-api/init.rst:614 +msgid "argv (in module sys)" +msgstr "" + +#: ../../c-api/init.rst:730 +msgid "global interpreter lock" +msgstr "" + +#: ../../c-api/init.rst:730 +msgid "interpreter lock" +msgstr "" + +#: ../../c-api/init.rst:730 +msgid "lock, interpreter" +msgstr "" + +#: ../../c-api/init.rst:743 +msgid "setswitchinterval() (in module sys)" +msgstr "" + +#: ../../c-api/init.rst:752 +msgid "PyThreadState" +msgstr "" + +#: ../../c-api/init.rst:779 +msgid "Py_BEGIN_ALLOW_THREADS" +msgstr "" + +#: ../../c-api/init.rst:779 +msgid "Py_END_ALLOW_THREADS" +msgstr "" + +#: ../../c-api/init.rst:795 ../../c-api/init.rst:923 +msgid "PyEval_RestoreThread()" +msgstr "" + +#: ../../c-api/init.rst:795 ../../c-api/init.rst:923 +msgid "PyEval_SaveThread()" +msgstr "" + +#: ../../c-api/init.rst:923 +msgid "PyEval_AcquireThread()" +msgstr "" + +#: ../../c-api/init.rst:923 +msgid "PyEval_ReleaseThread()" +msgstr "" + +#: ../../c-api/init.rst:945 +msgid "_thread" +msgstr "" + +#: ../../c-api/init.rst:1387 +msgid "stdout (in module sys)" +msgstr "" + +#: ../../c-api/init.rst:1387 +msgid "stderr (in module sys)" +msgstr "" + +#: ../../c-api/init.rst:1387 +msgid "stdin (in module sys)" +msgstr "" + +#: ../../c-api/init.rst:1446 +msgid "close() (in module os)" +msgstr "" + +#: ../../c-api/init.rst:1501 +msgid "Py_AddPendingCall()" +msgstr "" diff --git a/c-api/intro.po b/c-api/intro.po index 8e64c0c45b..4d881eb525 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-16 00:34+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -782,3 +782,131 @@ msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." msgstr "" + +#: ../../c-api/intro.rst:264 +msgid "object" +msgstr "" + +#: ../../c-api/intro.rst:264 +msgid "type" +msgstr "" + +#: ../../c-api/intro.rst:301 +msgid "Py_INCREF()" +msgstr "" + +#: ../../c-api/intro.rst:301 +msgid "Py_DECREF()" +msgstr "" + +#: ../../c-api/intro.rst:372 +msgid "PyList_SetItem()" +msgstr "" + +#: ../../c-api/intro.rst:372 +msgid "PyTuple_SetItem()" +msgstr "" + +#: ../../c-api/intro.rst:443 +msgid "set_all()" +msgstr "" + +#: ../../c-api/intro.rst:462 +msgid "PyList_GetItem()" +msgstr "" + +#: ../../c-api/intro.rst:462 +msgid "PySequence_GetItem()" +msgstr "" + +#: ../../c-api/intro.rst:492 +msgid "sum_list()" +msgstr "" + +#: ../../c-api/intro.rst:524 ../../c-api/intro.rst:616 +msgid "sum_sequence()" +msgstr "" + +#: ../../c-api/intro.rst:559 +msgid "PyErr_Occurred()" +msgstr "" + +#: ../../c-api/intro.rst:572 +msgid "PyErr_SetString()" +msgstr "" + +#: ../../c-api/intro.rst:572 ../../c-api/intro.rst:680 +msgid "PyErr_Clear()" +msgstr "" + +#: ../../c-api/intro.rst:596 +msgid "exc_info() (in module sys)" +msgstr "" + +#: ../../c-api/intro.rst:631 ../../c-api/intro.rst:678 +msgid "incr_item()" +msgstr "" + +#: ../../c-api/intro.rst:680 +msgid "PyErr_ExceptionMatches()" +msgstr "" + +#: ../../c-api/intro.rst:680 +msgid "Py_XDECREF()" +msgstr "" + +#: ../../c-api/intro.rst:706 +msgid "Py_Initialize()" +msgstr "" + +#: ../../c-api/intro.rst:706 +msgid "module" +msgstr "" + +#: ../../c-api/intro.rst:706 +msgid "builtins" +msgstr "" + +#: ../../c-api/intro.rst:706 +msgid "__main__" +msgstr "" + +#: ../../c-api/intro.rst:706 +msgid "sys" +msgstr "" + +#: ../../c-api/intro.rst:706 +msgid "search" +msgstr "" + +#: ../../c-api/intro.rst:706 +msgid "path" +msgstr "" + +#: ../../c-api/intro.rst:706 +msgid "path (in module sys)" +msgstr "" + +#: ../../c-api/intro.rst:741 +msgid "Py_SetProgramName()" +msgstr "" + +#: ../../c-api/intro.rst:741 +msgid "Py_GetPath()" +msgstr "" + +#: ../../c-api/intro.rst:741 +msgid "Py_GetPrefix()" +msgstr "" + +#: ../../c-api/intro.rst:741 +msgid "Py_GetExecPrefix()" +msgstr "" + +#: ../../c-api/intro.rst:741 +msgid "Py_GetProgramFullPath()" +msgstr "" + +#: ../../c-api/intro.rst:756 +msgid "Py_IsInitialized()" +msgstr "" diff --git a/c-api/list.po b/c-api/list.po index 4e27de7f5b..4fd5e9ea4e 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Nkeys Syu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -153,3 +153,23 @@ msgid "" "Return a new tuple object containing the contents of *list*; equivalent to " "``tuple(list)``." msgstr "" + +#: ../../c-api/list.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/list.rst:8 +msgid "list" +msgstr "" + +#: ../../c-api/list.rst:48 ../../c-api/list.rst:141 +msgid "built-in function" +msgstr "" + +#: ../../c-api/list.rst:48 +msgid "len" +msgstr "" + +#: ../../c-api/list.rst:141 +msgid "tuple" +msgstr "" diff --git a/c-api/long.po b/c-api/long.po index d9ea55afe4..64850771ed 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-25 00:31+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -332,3 +332,36 @@ msgstr "" msgid "" "Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" + +#: ../../c-api/long.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/long.rst:8 +msgid "long integer" +msgstr "" + +#: ../../c-api/long.rst:8 +msgid "integer" +msgstr "" + +#: ../../c-api/long.rst:118 +msgid "LONG_MAX" +msgstr "" + +#: ../../c-api/long.rst:118 ../../c-api/long.rst:160 ../../c-api/long.rst:203 +#: ../../c-api/long.rst:218 ../../c-api/long.rst:234 ../../c-api/long.rst:250 +msgid "OverflowError (built-in exception)" +msgstr "" + +#: ../../c-api/long.rst:203 +msgid "PY_SSIZE_T_MAX" +msgstr "" + +#: ../../c-api/long.rst:218 +msgid "ULONG_MAX" +msgstr "" + +#: ../../c-api/long.rst:234 +msgid "SIZE_MAX" +msgstr "" diff --git a/c-api/mapping.po b/c-api/mapping.po index bb230d7994..4f06e262b7 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -114,3 +114,11 @@ msgid "" "On success, return a list of the items in object *o*, where each item is a " "tuple containing a key-value pair. On failure, return ``NULL``." msgstr "" + +#: ../../c-api/mapping.rst:23 +msgid "built-in function" +msgstr "" + +#: ../../c-api/mapping.rst:23 +msgid "len" +msgstr "" diff --git a/c-api/memory.po b/c-api/memory.po index 2ee8aaa954..2559680691 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-04 00:20+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -802,9 +802,9 @@ msgid "" "Let *S* = ``sizeof(size_t)``. ``2*S`` bytes are added at each end of each " "block of *N* bytes requested. The memory layout is like so, where p " "represents the address returned by a malloc-like or realloc-like function " -"(``p[i:j]`` means the slice of bytes from ``*(p+i)`` inclusive up to ``*(p" -"+j)`` exclusive; note that the treatment of negative indices differs from a " -"Python slice):" +"(``p[i:j]`` means the slice of bytes from ``*(p+i)`` inclusive up to " +"``*(p+j)`` exclusive; note that the treatment of negative indices differs " +"from a Python slice):" msgstr "" #: ../../c-api/memory.rst:555 @@ -1060,3 +1060,20 @@ msgid "" "These will be explained in the next chapter on defining and implementing new " "object types in C." msgstr "" + +#: ../../c-api/memory.rst:43 +#, fuzzy +msgid "malloc()" +msgstr "``malloc``" + +#: ../../c-api/memory.rst:43 +msgid "calloc()" +msgstr "" + +#: ../../c-api/memory.rst:43 +msgid "realloc()" +msgstr "" + +#: ../../c-api/memory.rst:43 +msgid "free()" +msgstr "" diff --git a/c-api/memoryview.po b/c-api/memoryview.po index 3a51a26c34..bdfe705ecd 100644 --- a/c-api/memoryview.po +++ b/c-api/memoryview.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -80,3 +80,11 @@ msgid "" "func:`PyMemoryView_FromMemory` or :c:func:`PyMemoryView_FromBuffer`. *mview* " "**must** be a memoryview instance." msgstr "" + +#: ../../c-api/memoryview.rst:5 +msgid "object" +msgstr "" + +#: ../../c-api/memoryview.rst:5 +msgid "memoryview" +msgstr "" diff --git a/c-api/method.po b/c-api/method.po index b225d2a8a6..1bd663854d 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-01-24 22:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -107,8 +107,8 @@ msgid "" "called when the method is called. *self* must not be ``NULL``." msgstr "" "回傳一個新的方法物件,\\ *func* 應為任意可呼叫物件,\\ *self* 為該方法應繫結" -"的實例。在方法被呼叫時,\\ *func* 函式也會被呼叫。\\ *self* 必須不為 ``NULL``" -"\\ 。" +"的實例。在方法被呼叫時,\\ *func* 函式也會被呼叫。\\ *self* 必須不為 " +"``NULL``\\ 。" #: ../../c-api/method.rst:80 msgid "Return the function object associated with the method *meth*." @@ -126,3 +126,21 @@ msgstr "回傳關聯到方法 *meth* 的實例。" #: ../../c-api/method.rst:95 msgid "Macro version of :c:func:`PyMethod_Self` which avoids error checking." msgstr "巨集版本的 :c:func:`PyMethod_Self`\\ ,忽略了錯誤檢查。" + +#: ../../c-api/method.rst:8 ../../c-api/method.rst:50 +#, fuzzy +msgid "object" +msgstr "方法物件 (Method Objects)" + +#: ../../c-api/method.rst:8 +#, fuzzy +msgid "instancemethod" +msgstr "實例方法物件 (Instance Method Objects)" + +#: ../../c-api/method.rst:50 +msgid "method" +msgstr "" + +#: ../../c-api/method.rst:59 +msgid "MethodType (in module types)" +msgstr "" diff --git a/c-api/module.po b/c-api/module.po index 524f8c3178..9f8d4f0161 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-18 00:33+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -655,3 +655,44 @@ msgid "" "Removes the module object created from *def* from the interpreter state. " "Return 0 on success or -1 on failure." msgstr "" + +#: ../../c-api/module.rst:8 +#, fuzzy +msgid "object" +msgstr "模組物件模組" + +#: ../../c-api/module.rst:8 +msgid "module" +msgstr "" + +#: ../../c-api/module.rst:13 +msgid "ModuleType (in module types)" +msgstr "" + +#: ../../c-api/module.rst:33 ../../c-api/module.rst:74 +msgid "__name__ (module attribute)" +msgstr "" + +#: ../../c-api/module.rst:33 +msgid "__doc__ (module attribute)" +msgstr "" + +#: ../../c-api/module.rst:33 ../../c-api/module.rst:104 +msgid "__file__ (module attribute)" +msgstr "" + +#: ../../c-api/module.rst:33 +msgid "__package__ (module attribute)" +msgstr "" + +#: ../../c-api/module.rst:33 +msgid "__loader__ (module attribute)" +msgstr "" + +#: ../../c-api/module.rst:60 +msgid "__dict__ (module attribute)" +msgstr "" + +#: ../../c-api/module.rst:74 ../../c-api/module.rst:104 +msgid "SystemError (built-in exception)" +msgstr "" diff --git a/c-api/none.po b/c-api/none.po index fe0652bc5f..355e099dc4 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,3 +43,11 @@ msgid "" "Properly handle returning :c:data:`Py_None` from within a C function (that " "is, increment the reference count of ``None`` and return it.)" msgstr "" + +#: ../../c-api/none.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/none.rst:8 +msgid "None" +msgstr "" diff --git a/c-api/number.po b/c-api/number.po index 9319bad052..6a4e22789f 100644 --- a/c-api/number.po +++ b/c-api/number.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -300,3 +300,29 @@ msgid "" "``tp_as_number`` structure filled in), and ``0`` otherwise. This function " "always succeeds." msgstr "" + +#: ../../c-api/number.rst:67 ../../c-api/number.rst:75 +#: ../../c-api/number.rst:97 ../../c-api/number.rst:195 +#: ../../c-api/number.rst:241 ../../c-api/number.rst:249 +msgid "built-in function" +msgstr "" + +#: ../../c-api/number.rst:67 +msgid "divmod" +msgstr "" + +#: ../../c-api/number.rst:75 ../../c-api/number.rst:195 +msgid "pow" +msgstr "" + +#: ../../c-api/number.rst:97 +msgid "abs" +msgstr "" + +#: ../../c-api/number.rst:241 +msgid "int" +msgstr "" + +#: ../../c-api/number.rst:249 +msgid "float" +msgstr "" diff --git a/c-api/object.po b/c-api/object.po index 1012cee1e2..989c9ca760 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-23 00:31+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -413,3 +413,41 @@ msgid "" "`AsyncIterator`, this returns itself. Raises :exc:`TypeError` and returns " "``NULL`` if the object cannot be iterated." msgstr "" + +#: ../../c-api/object.rst:193 ../../c-api/object.rst:205 +#: ../../c-api/object.rst:230 ../../c-api/object.rst:281 +#: ../../c-api/object.rst:315 ../../c-api/object.rst:335 +msgid "built-in function" +msgstr "" + +#: ../../c-api/object.rst:193 +msgid "repr" +msgstr "" + +#: ../../c-api/object.rst:205 +msgid "ascii" +msgstr "" + +#: ../../c-api/object.rst:213 +msgid "string" +msgstr "" + +#: ../../c-api/object.rst:213 +msgid "PyObject_Str (C function)" +msgstr "" + +#: ../../c-api/object.rst:230 +msgid "bytes" +msgstr "" + +#: ../../c-api/object.rst:281 +msgid "hash" +msgstr "" + +#: ../../c-api/object.rst:315 +msgid "type" +msgstr "" + +#: ../../c-api/object.rst:335 +msgid "len" +msgstr "" diff --git a/c-api/sequence.po b/c-api/sequence.po index f659420d67..ff27449584 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -199,3 +199,15 @@ msgid "" "`PySequence_Check` on *o* is true and without adjustment for negative " "indices." msgstr "" + +#: ../../c-api/sequence.rst:21 ../../c-api/sequence.rst:123 +msgid "built-in function" +msgstr "" + +#: ../../c-api/sequence.rst:21 +msgid "len" +msgstr "" + +#: ../../c-api/sequence.rst:123 +msgid "tuple" +msgstr "" diff --git a/c-api/set.po b/c-api/set.po index b33147260e..ba4d06bf15 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -185,3 +185,23 @@ msgstr "" #: ../../c-api/set.rst:166 msgid "Empty an existing set of all elements." msgstr "" + +#: ../../c-api/set.rst:11 +msgid "object" +msgstr "" + +#: ../../c-api/set.rst:11 +msgid "set" +msgstr "" + +#: ../../c-api/set.rst:11 +msgid "frozenset" +msgstr "" + +#: ../../c-api/set.rst:110 +msgid "built-in function" +msgstr "" + +#: ../../c-api/set.rst:110 +msgid "len" +msgstr "" diff --git a/c-api/structures.po b/c-api/structures.po index cd571e57bc..421b1bf503 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-18 00:16+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -733,3 +733,15 @@ msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." msgstr "" + +#: ../../c-api/structures.rst:369 ../../c-api/structures.rst:379 +msgid "built-in function" +msgstr "" + +#: ../../c-api/structures.rst:369 +msgid "classmethod" +msgstr "" + +#: ../../c-api/structures.rst:379 +msgid "staticmethod" +msgstr "" diff --git a/c-api/sys.po b/c-api/sys.po index 60a7b1bced..44af86d370 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -516,3 +516,20 @@ msgid "" "finalization will have completed before the cleanup function, no Python APIs " "should be called by *func*." msgstr "" + +#: ../../c-api/sys.rst:409 +msgid "abort()" +msgstr "" + +#: ../../c-api/sys.rst:428 ../../c-api/sys.rst:442 +msgid "Py_FinalizeEx()" +msgstr "" + +#: ../../c-api/sys.rst:428 +msgid "exit()" +msgstr "" + +#: ../../c-api/sys.rst:442 +#, fuzzy +msgid "cleanup functions" +msgstr "系統函式" diff --git a/c-api/tuple.po b/c-api/tuple.po index 15522c3b93..1d2a1bcf9b 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -274,3 +274,11 @@ msgid "" "Similar to :c:func:`PyStructSequence_SetItem`, but implemented as a static " "inlined function." msgstr "" + +#: ../../c-api/tuple.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/tuple.rst:8 +msgid "tuple" +msgstr "" diff --git a/c-api/type.po b/c-api/type.po index 0d2e3be55b..8e9e1dc266 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -398,6 +398,14 @@ msgstr "" msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``." msgstr "" +#: ../../c-api/type.rst:8 +msgid "object" +msgstr "" + +#: ../../c-api/type.rst:8 +msgid "type" +msgstr "" + #~ msgid ":c:member:`~PyBufferProcs.bf_getbuffer`" #~ msgstr ":c:member:`~PyBufferProcs.bf_getbuffer`" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index d4d75f272b..55fe6f6c18 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-05 00:16+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3455,3 +3455,17 @@ msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" msgstr "" + +#: ../../c-api/typeobj.rst:806 ../../c-api/typeobj.rst:871 +msgid "built-in function" +msgstr "" + +#: ../../c-api/typeobj.rst:806 +#, fuzzy +msgid "repr" +msgstr "__repr__" + +#: ../../c-api/typeobj.rst:871 +#, fuzzy +msgid "hash" +msgstr "__hash__" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 260c29dcf4..e77cdab3ab 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -147,8 +147,8 @@ msgstr "" #: ../../c-api/veryhigh.rst:122 msgid "" -"On Windows, *fp* should be opened as binary mode (e.g. ``fopen(filename, \"rb" -"\")``). Otherwise, Python may not handle script file with LF line ending " +"On Windows, *fp* should be opened as binary mode (e.g. ``fopen(filename, " +"\"rb\")``). Otherwise, Python may not handle script file with LF line ending " "correctly." msgstr "" @@ -413,3 +413,8 @@ msgid "" "This bit can be set in *flags* to cause division operator ``/`` to be " "interpreted as \"true division\" according to :pep:`238`." msgstr "" + +#: ../../c-api/veryhigh.rst:317 ../../c-api/veryhigh.rst:325 +#: ../../c-api/veryhigh.rst:334 +msgid "Py_CompileString()" +msgstr "" diff --git a/distributing/index.po b/distributing/index.po index dca6e88393..6448bb19b4 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2021-07-04 18:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -316,3 +316,15 @@ msgid "" msgstr "" "`Python 封裝使用者指南:二進制擴充 `__" + +#: ../../distributing/index.rst:116 +msgid "Python Package Index (PyPI)" +msgstr "" + +#: ../../distributing/index.rst:116 +msgid "PyPI" +msgstr "" + +#: ../../distributing/index.rst:116 +msgid "(see Python Package Index (PyPI))" +msgstr "" diff --git a/extending/extending.po b/extending/extending.po index e5f8cb1c46..83258b224c 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -106,8 +106,8 @@ msgstr "" msgid "" "All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` " "or ``PY``, except those defined in standard header files. For convenience, " -"and since they are used extensively by the Python interpreter, ``\"Python.h" -"\"`` includes a few standard header files: ````, ````, " +"and since they are used extensively by the Python interpreter, ``\"Python." +"h\"`` includes a few standard header files: ````, ````, " "````, and ````. If the latter header file does not exist " "on your system, it declares the functions :c:func:`malloc`, :c:func:`free` " "and :c:func:`realloc` directly." @@ -1294,3 +1294,19 @@ msgid "" "These guarantees don't hold when you use the \"old\" style calling " "convention --- this is still found in much existing code." msgstr "" + +#: ../../extending/extending.rst:539 +msgid "PyObject_CallObject()" +msgstr "" + +#: ../../extending/extending.rst:630 +msgid "PyArg_ParseTuple()" +msgstr "" + +#: ../../extending/extending.rst:722 +msgid "PyArg_ParseTupleAndKeywords()" +msgstr "" + +#: ../../extending/extending.rst:743 +msgid "Philbrick, Geoff" +msgstr "" diff --git a/extending/newtypes.po b/extending/newtypes.po index 9789c1e496..ba4233f9b5 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-07 00:27+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -641,3 +641,69 @@ msgstr "" #: ../../extending/newtypes.rst:638 msgid "https://github.com/python/cpython" msgstr "https://github.com/python/cpython" + +#: ../../extending/newtypes.rst:56 +msgid "object" +msgstr "" + +#: ../../extending/newtypes.rst:56 +msgid "deallocation" +msgstr "" + +#: ../../extending/newtypes.rst:56 +msgid "deallocation, object" +msgstr "" + +#: ../../extending/newtypes.rst:56 +msgid "finalization" +msgstr "" + +#: ../../extending/newtypes.rst:56 +msgid "finalization, of objects" +msgstr "" + +#: ../../extending/newtypes.rst:91 +msgid "PyErr_Fetch()" +msgstr "" + +#: ../../extending/newtypes.rst:91 +msgid "PyErr_Restore()" +msgstr "" + +#: ../../extending/newtypes.rst:150 +msgid "string" +msgstr "" + +#: ../../extending/newtypes.rst:150 +msgid "object representation" +msgstr "" + +#: ../../extending/newtypes.rst:150 +msgid "built-in function" +msgstr "" + +#: ../../extending/newtypes.rst:150 +msgid "repr" +msgstr "" + +#: ../../extending/newtypes.rst:313 +#, fuzzy +msgid "READONLY" +msgstr ":const:`READONLY`" + +#: ../../extending/newtypes.rst:313 +msgid "READ_RESTRICTED" +msgstr "" + +#: ../../extending/newtypes.rst:313 +msgid "WRITE_RESTRICTED" +msgstr "" + +#: ../../extending/newtypes.rst:313 +msgid "RESTRICTED" +msgstr "" + +#: ../../extending/newtypes.rst:313 +#, fuzzy +msgid "PY_AUDIT_READ" +msgstr ":const:`PY_AUDIT_READ`" diff --git a/faq/programming.po b/faq/programming.po index 37bfdc12b5..8f5c360ed1 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2401,5 +2401,21 @@ msgid "" "the class objects::" msgstr "" +#: ../../faq/programming.rst:408 +msgid "argument" +msgstr "" + +#: ../../faq/programming.rst:408 +msgid "difference from parameter" +msgstr "" + +#: ../../faq/programming.rst:408 +msgid "parameter" +msgstr "" + +#: ../../faq/programming.rst:408 +msgid "difference from argument" +msgstr "" + #~ msgid "Dictionaries" #~ msgstr "字典" diff --git a/glossary.po b/glossary.po index fac1f36056..2ab53cfec6 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-10-23 20:00+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,12 +99,12 @@ msgid "" "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:" +"抽象基底類別(又稱為 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。" @@ -137,9 +137,9 @@ msgid "" "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`\\ 。" +"請參閱 :term:`variable annotation`\\ 、\\ :term:`function " +"annotation`\\ 、\\ :pep:`484` 和 :pep:`526`,這些章節皆有此功能的說明。關於註" +"釋的最佳實踐方法也請參閱 :ref:`annotations-howto`\\ 。" #: ../../glossary.rst:62 msgid "argument" @@ -1019,8 +1019,8 @@ msgid "" msgstr "" "一連串的陳述式,它能夠向呼叫者回傳一些值。它也可以被傳遞零個或多個\\ :term:`" "引數 `\\ ,這些引數可被使用於函式本體的執行。另請參閱 :term:" -"`parameter`\\ (參數)、\\ :term:`method`\\ (方法),以及\\ :ref:`function`" -"\\ 章節。" +"`parameter`\\ (參數)、\\ :term:`method`\\ (方法),以及\\ :ref:" +"`function`\\ 章節。" #: ../../glossary.rst:451 msgid "function annotation" @@ -1092,7 +1092,7 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:490 +#: ../../glossary.rst:489 ../../glossary.rst:490 msgid "generator" msgstr "generator(產生器)" @@ -1135,7 +1135,7 @@ msgstr "" "中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" "那些每次調用時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:511 +#: ../../glossary.rst:510 ../../glossary.rst:511 msgid "generator expression" msgstr "generator expression(產生器運算式)" @@ -1192,8 +1192,8 @@ msgid "" "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:537 msgid "GIL" @@ -1465,12 +1465,12 @@ msgid "" "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` 或自行處理疊代器物" -"件。``for`` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變數,用" -"於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、\\ :term:" +"可疊代物件可用於 :keyword:`for` 迴圈和許多其他需要一個序列的地方 (:func:" +"`zip`\\ 、\\ :func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函式 :" +"func:`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行一遍 " +"(one pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理疊代器" +"物件。``for`` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變數," +"用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、\\ :term:" "`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" #: ../../glossary.rst:660 @@ -1494,10 +1494,10 @@ msgid "" "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:" +"一個表示資料流的物件。重複地呼叫疊代器的 :meth:`~iterator.__next__` method" +"(或是將它傳遞給內建函式 :func:`next`\\ )會依序回傳資料流中的各項目。當不再" +"有資料時,則會引發 :exc:`StopIteration` 例外。此時,該疊代器物件已被用盡,而" +"任何對其 :meth:`__next__` method 的進一步呼叫,都只會再次引發 :exc:" "`StopIteration`\\ 。疊代器必須有一個 :meth:`__iter__` method,它會回傳疊代器" "物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊代物件" "的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程式碼。" @@ -1540,8 +1540,8 @@ msgid "" "nlargest`, and :func:`itertools.groupby`." msgstr "" "Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包括 :" -"func:`min`\\ 、\\ :func:`max`\\ 、\\ :func:`sorted`\\ 、\\ :meth:`list.sort`" -"\\ 、\\ :func:`heapq.merge`\\ 、\\ :func:`heapq.nsmallest`\\ 、\\ :func:" +"func:`min`\\ 、\\ :func:`max`\\ 、\\ :func:`sorted`\\ 、\\ :meth:`list." +"sort`\\ 、\\ :func:`heapq.merge`\\ 、\\ :func:`heapq.nsmallest`\\ 、\\ :func:" "`heapq.nlargest` 和 :func:`itertools.groupby`\\ 。" #: ../../glossary.rst:696 @@ -1735,8 +1735,8 @@ msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" -"關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`" -"\\ 。" +"關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc." +"MetaPathFinder`\\ 。" #: ../../glossary.rst:775 msgid "metaclass" @@ -1766,7 +1766,7 @@ msgstr "" msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:788 +#: ../../glossary.rst:756 ../../glossary.rst:788 ../../glossary.rst:1120 msgid "method" msgstr "method(方法)" @@ -1995,8 +1995,8 @@ msgstr "" #: ../../glossary.rst:888 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" -"另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace package`" -"\\ (命名空間套件)。" +"另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " +"package`\\ (命名空間套件)。" #: ../../glossary.rst:889 msgid "parameter" @@ -2405,11 +2405,11 @@ msgid "" msgstr "" "一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`__getitem__` special " "method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一個 :meth:" -"`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:`list`" -"\\ 、\\ :class:`str`\\ 、\\ :class:`tuple` 和 :class:`bytes`\\ 。請注意,雖" -"然 :class:`dict` 也支援 :meth:`__getitem__` 和 :meth:`__len__`\\ ,但它被視為" -"對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` 鍵," -"而不是整數。" +"`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:" +"`list`\\ 、\\ :class:`str`\\ 、\\ :class:`tuple` 和 :class:`bytes`\\ 。請注" +"意,雖然 :class:`dict` 也支援 :meth:`__getitem__` 和 :meth:`__len__`\\ ,但它" +"被視為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:" +"`immutable` 鍵,而不是整數。" #: ../../glossary.rst:1095 msgid "" @@ -2530,8 +2530,8 @@ msgstr "text encoding(文字編碼)" #: ../../glossary.rst:1145 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 " +"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 " "serialized as a sequence of bytes." msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " @@ -2770,6 +2770,25 @@ msgstr "" "Python 設計原則與哲學的列表,其內容有助於理解和使用此語言。此列表可以透過在互" "動式提式字元後輸入「``import this``」來找到它。" +#: ../../glossary.rst:263 +#, fuzzy +msgid "C-contiguous" +msgstr "contiguous(連續的)" + +#: ../../glossary.rst:263 +#, fuzzy +msgid "Fortran contiguous" +msgstr "contiguous(連續的)" + +#: ../../glossary.rst:756 +msgid "magic" +msgstr "" + +#: ../../glossary.rst:1120 +#, fuzzy +msgid "special" +msgstr "special method(特殊方法)" + #~ msgid "coercion" #~ msgstr "coercion(強制轉型)" diff --git a/howto/clinic.po b/howto/clinic.po index 9316afc22c..168b13219b 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -844,16 +844,16 @@ msgid "" "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:763 ../../howto/clinic.rst:1313 +#: ../../howto/clinic.rst:763 ../../howto/clinic.rst:1328 msgid "``c_default``" msgstr "``c_default``" #: ../../howto/clinic.rst:759 msgid "" "The default value for this parameter when defined in C. Specifically, this " -"will be the initializer for the variable declared in the \"parse function" -"\". See :ref:`the section on default values ` for how to " -"use this. Specified as a string." +"will be the initializer for the variable declared in the \"parse " +"function\". See :ref:`the section on default values ` for " +"how to use this. Specified as a string." msgstr "" #: ../../howto/clinic.rst:768 @@ -899,7 +899,7 @@ msgid "" "even for negative values." msgstr "" -#: ../../howto/clinic.rst:789 ../../howto/clinic.rst:1327 +#: ../../howto/clinic.rst:789 ../../howto/clinic.rst:1342 msgid "``converter``" msgstr "``converter``" @@ -930,15 +930,15 @@ msgid "" "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:803 ../../howto/clinic.rst:1299 +#: ../../howto/clinic.rst:803 ../../howto/clinic.rst:1314 msgid "``type``" msgstr "``type``" #: ../../howto/clinic.rst:801 msgid "" "Only supported for the ``object`` and ``self`` converters. Specifies the C " -"type that will be used to declare the variable. Default value is ``" -"\"PyObject *\"``." +"type that will be used to declare the variable. Default value is " +"``\"PyObject *\"``." msgstr "" #: ../../howto/clinic.rst:809 @@ -1502,38 +1502,46 @@ msgstr "" #: ../../howto/clinic.rst:1028 msgid "" -"By default the impl function Argument Clinic generates for you returns " -"``PyObject *``. But your C function often computes some C type, then " -"converts it into the ``PyObject *`` at the last moment. Argument Clinic " -"handles converting your inputs from Python types into native C types—why not " -"have it convert your return value from a native C type into a Python type " -"too?" +"By default, the impl function Argument Clinic generates for you returns :c:" +"type:`PyObject * `. But your C function often computes some C " +"type, then converts it into the :c:type:`!PyObject *` at the last moment. " +"Argument Clinic handles converting your inputs from Python types into native " +"C types—why not have it convert your return value from a native C type into " +"a Python type too?" msgstr "" -#: ../../howto/clinic.rst:1034 +#: ../../howto/clinic.rst:1036 msgid "" "That's what a \"return converter\" does. It changes your impl function to " "return some C type, then adds code to the generated (non-impl) function to " -"handle converting that value into the appropriate ``PyObject *``." +"handle converting that value into the appropriate :c:type:`!PyObject *`." msgstr "" -#: ../../howto/clinic.rst:1038 +#: ../../howto/clinic.rst:1040 msgid "" "The syntax for return converters is similar to that of parameter converters. " "You specify the return converter like it was a return annotation on the " -"function itself. Return converters behave much the same as parameter " -"converters; they take arguments, the arguments are all keyword-only, and if " -"you're not changing any of the default arguments you can omit the " -"parentheses." +"function itself, using ``->`` notation." msgstr "" #: ../../howto/clinic.rst:1044 +msgid "For example:" +msgstr "" + +#: ../../howto/clinic.rst:1057 +msgid "" +"Return converters behave much the same as parameter converters; they take " +"arguments, the arguments are all keyword-only, and if you're not changing " +"any of the default arguments you can omit the parentheses." +msgstr "" + +#: ../../howto/clinic.rst:1061 msgid "" "(If you use both ``\"as\"`` *and* a return converter for your function, the " "``\"as\"`` should come before the return converter.)" msgstr "" -#: ../../howto/clinic.rst:1047 +#: ../../howto/clinic.rst:1064 msgid "" "There's one additional complication when using return converters: how do you " "indicate an error has occurred? Normally, a function returns a valid (non-" @@ -1546,18 +1554,17 @@ msgid "" "you return like normal." msgstr "" -#: ../../howto/clinic.rst:1056 +#: ../../howto/clinic.rst:1073 msgid "Currently Argument Clinic supports only a few return converters:" msgstr "" -#: ../../howto/clinic.rst:1071 +#: ../../howto/clinic.rst:1087 msgid "" -"None of these take parameters. For the first three, return -1 to indicate " -"error. For ``DecodeFSDefault``, the return type is ``const char *``; return " -"a ``NULL`` pointer to indicate an error." +"None of these take parameters. For all of these, return ``-1`` to indicate " +"error." msgstr "" -#: ../../howto/clinic.rst:1075 +#: ../../howto/clinic.rst:1090 msgid "" "(There's also an experimental ``NoneType`` converter, which lets you return " "``Py_None`` on success or ``NULL`` on failure, without having to increment " @@ -1565,117 +1572,117 @@ msgid "" "be worth using.)" msgstr "" -#: ../../howto/clinic.rst:1080 +#: ../../howto/clinic.rst:1095 msgid "" "To see all the return converters Argument Clinic supports, along with their " "parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " "the full list." msgstr "" -#: ../../howto/clinic.rst:1086 +#: ../../howto/clinic.rst:1101 msgid "Cloning existing functions" msgstr "" -#: ../../howto/clinic.rst:1088 +#: ../../howto/clinic.rst:1103 msgid "" "If you have a number of functions that look similar, you may be able to use " "Clinic's \"clone\" feature. When you clone an existing function, you reuse:" msgstr "" -#: ../../howto/clinic.rst:1092 +#: ../../howto/clinic.rst:1107 msgid "its parameters, including" msgstr "" -#: ../../howto/clinic.rst:1094 +#: ../../howto/clinic.rst:1109 msgid "their names," msgstr "" -#: ../../howto/clinic.rst:1096 +#: ../../howto/clinic.rst:1111 msgid "their converters, with all parameters," msgstr "" -#: ../../howto/clinic.rst:1098 +#: ../../howto/clinic.rst:1113 msgid "their default values," msgstr "" -#: ../../howto/clinic.rst:1100 +#: ../../howto/clinic.rst:1115 msgid "their per-parameter docstrings," msgstr "" -#: ../../howto/clinic.rst:1102 +#: ../../howto/clinic.rst:1117 msgid "" "their *kind* (whether they're positional only, positional or keyword, or " "keyword only), and" msgstr "" -#: ../../howto/clinic.rst:1105 +#: ../../howto/clinic.rst:1120 msgid "its return converter." msgstr "" -#: ../../howto/clinic.rst:1107 +#: ../../howto/clinic.rst:1122 msgid "" "The only thing not copied from the original function is its docstring; the " "syntax allows you to specify a new docstring." msgstr "" -#: ../../howto/clinic.rst:1110 +#: ../../howto/clinic.rst:1125 msgid "Here's the syntax for cloning a function::" msgstr "" -#: ../../howto/clinic.rst:1118 +#: ../../howto/clinic.rst:1133 msgid "" "(The functions can be in different modules or classes. I wrote ``module." "class`` in the sample just to illustrate that you must use the full path to " "*both* functions.)" msgstr "" -#: ../../howto/clinic.rst:1122 +#: ../../howto/clinic.rst:1137 msgid "" "Sorry, there's no syntax for partially cloning a function, or cloning a " "function then modifying it. Cloning is an all-or nothing proposition." msgstr "" -#: ../../howto/clinic.rst:1125 +#: ../../howto/clinic.rst:1140 msgid "" "Also, the function you are cloning from must have been previously defined in " "the current file." msgstr "" -#: ../../howto/clinic.rst:1129 +#: ../../howto/clinic.rst:1144 msgid "Calling Python code" msgstr "" -#: ../../howto/clinic.rst:1131 +#: ../../howto/clinic.rst:1146 msgid "" "The rest of the advanced topics require you to write Python code which lives " "inside your C file and modifies Argument Clinic's runtime state. This is " "simple: you simply define a Python block." msgstr "" -#: ../../howto/clinic.rst:1135 +#: ../../howto/clinic.rst:1150 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1142 +#: ../../howto/clinic.rst:1157 msgid "" "All the code inside the Python block is executed at the time it's parsed. " -"All text written to stdout inside the block is redirected into the \"output" -"\" after the block." +"All text written to stdout inside the block is redirected into the " +"\"output\" after the block." msgstr "" -#: ../../howto/clinic.rst:1146 +#: ../../howto/clinic.rst:1161 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1157 +#: ../../howto/clinic.rst:1172 msgid "Using a \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1159 +#: ../../howto/clinic.rst:1174 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " @@ -1686,13 +1693,13 @@ msgid "" "a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1168 +#: ../../howto/clinic.rst:1183 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1171 +#: ../../howto/clinic.rst:1186 msgid "" "How do you specify the custom type you want to cast ``self`` to? If you only " "have one or two functions with the same type for ``self``, you can directly " @@ -1700,18 +1707,18 @@ msgid "" "want to use as the ``type`` parameter::" msgstr "" -#: ../../howto/clinic.rst:1187 +#: ../../howto/clinic.rst:1202 msgid "" "On the other hand, if you have a lot of functions that will use the same " "type for ``self``, it's best to create your own converter, subclassing " "``self_converter`` but overwriting the ``type`` member::" msgstr "" -#: ../../howto/clinic.rst:1209 +#: ../../howto/clinic.rst:1224 msgid "Using a \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1211 +#: ../../howto/clinic.rst:1226 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1721,25 +1728,25 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1217 +#: ../../howto/clinic.rst:1232 msgid "" "Example from ``Modules/zlibmodule.c``. First, ``defining_class`` is added " "to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1229 +#: ../../howto/clinic.rst:1244 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1239 +#: ../../howto/clinic.rst:1254 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1245 +#: ../../howto/clinic.rst:1260 msgid "" "Each method may only have one argument using this converter, and it must " "appear after ``self``, or, if ``self`` is not used, as the first argument. " @@ -1747,13 +1754,13 @@ msgid "" "appear in the ``__text_signature__``." msgstr "" -#: ../../howto/clinic.rst:1250 +#: ../../howto/clinic.rst:1265 msgid "" "The ``defining_class`` converter is not compatible with ``__init__`` and " "``__new__`` methods, which cannot use the ``METH_METHOD`` convention." msgstr "" -#: ../../howto/clinic.rst:1253 +#: ../../howto/clinic.rst:1268 msgid "" "It is not possible to use ``defining_class`` with slot methods. In order to " "fetch the module state from such methods, use :c:func:" @@ -1762,15 +1769,15 @@ msgid "" "``setattro`` slot method in ``Modules/_threadmodule.c``::" msgstr "" -#: ../../howto/clinic.rst:1268 +#: ../../howto/clinic.rst:1283 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1272 +#: ../../howto/clinic.rst:1287 msgid "Writing a custom converter" msgstr "" -#: ../../howto/clinic.rst:1274 +#: ../../howto/clinic.rst:1289 msgid "" "As we hinted at in the previous section... you can write your own " "converters! A converter is simply a Python class that inherits from " @@ -1779,7 +1786,7 @@ msgid "" "a :c:func:`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1280 +#: ../../howto/clinic.rst:1295 msgid "" "Your converter class should be named ``*something*_converter``. If the name " "follows this convention, then your converter class will be automatically " @@ -1788,7 +1795,7 @@ msgid "" "metaclass.)" msgstr "" -#: ../../howto/clinic.rst:1286 +#: ../../howto/clinic.rst:1301 msgid "" "You shouldn't subclass ``CConverter.__init__``. Instead, you should write a " "``converter_init()`` function. ``converter_init()`` always accepts a " @@ -1797,50 +1804,50 @@ msgid "" "passed along to your ``converter_init()``." msgstr "" -#: ../../howto/clinic.rst:1293 +#: ../../howto/clinic.rst:1308 msgid "" "There are some additional members of ``CConverter`` you may wish to specify " "in your subclass. Here's the current list:" msgstr "" -#: ../../howto/clinic.rst:1297 +#: ../../howto/clinic.rst:1312 msgid "" "The C type to use for this variable. ``type`` should be a Python string " "specifying the type, e.g. ``int``. If this is a pointer type, the type " "string should end with ``' *'``." msgstr "" -#: ../../howto/clinic.rst:1303 +#: ../../howto/clinic.rst:1318 msgid "``default``" msgstr "``default``" -#: ../../howto/clinic.rst:1302 +#: ../../howto/clinic.rst:1317 msgid "" "The Python default value for this parameter, as a Python value. Or the magic " "value ``unspecified`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1308 +#: ../../howto/clinic.rst:1323 msgid "``py_default``" msgstr "``py_default``" -#: ../../howto/clinic.rst:1306 +#: ../../howto/clinic.rst:1321 msgid "" "``default`` as it should appear in Python code, as a string. Or ``None`` if " "there is no default." msgstr "" -#: ../../howto/clinic.rst:1311 +#: ../../howto/clinic.rst:1326 msgid "" "``default`` as it should appear in C code, as a string. Or ``None`` if there " "is no default." msgstr "" -#: ../../howto/clinic.rst:1324 +#: ../../howto/clinic.rst:1339 msgid "``c_ignored_default``" msgstr "``c_ignored_default``" -#: ../../howto/clinic.rst:1316 +#: ../../howto/clinic.rst:1331 msgid "" "The default value used to initialize the C variable when there is no " "default, but not specifying a default may result in an \"uninitialized " @@ -1851,37 +1858,37 @@ msgid "" "non-empty string." msgstr "" -#: ../../howto/clinic.rst:1327 +#: ../../howto/clinic.rst:1342 msgid "The name of the C converter function, as a string." msgstr "" -#: ../../howto/clinic.rst:1332 +#: ../../howto/clinic.rst:1347 msgid "``impl_by_reference``" msgstr "``impl_by_reference``" -#: ../../howto/clinic.rst:1330 +#: ../../howto/clinic.rst:1345 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into the impl function." msgstr "" -#: ../../howto/clinic.rst:1338 +#: ../../howto/clinic.rst:1353 msgid "``parse_by_reference``" msgstr "``parse_by_reference``" -#: ../../howto/clinic.rst:1335 +#: ../../howto/clinic.rst:1350 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into :c:func:`PyArg_ParseTuple`." msgstr "" -#: ../../howto/clinic.rst:1340 +#: ../../howto/clinic.rst:1355 msgid "" "Here's the simplest example of a custom converter, from ``Modules/zlibmodule." "c``::" msgstr "" -#: ../../howto/clinic.rst:1351 +#: ../../howto/clinic.rst:1366 msgid "" "This block adds a converter to Argument Clinic named ``ssize_t``. " "Parameters declared as ``ssize_t`` will be declared as type :c:type:" @@ -1890,25 +1897,25 @@ msgid "" "automatically support default values." msgstr "" -#: ../../howto/clinic.rst:1357 +#: ../../howto/clinic.rst:1372 msgid "" "More sophisticated custom converters can insert custom C code to handle " "initialization and cleanup. You can see more examples of custom converters " "in the CPython source tree; grep the C files for the string ``CConverter``." msgstr "" -#: ../../howto/clinic.rst:1363 +#: ../../howto/clinic.rst:1378 msgid "Writing a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1365 +#: ../../howto/clinic.rst:1380 msgid "" "Writing a custom return converter is much like writing a custom converter. " "Except it's somewhat simpler, because return converters are themselves much " "simpler." msgstr "" -#: ../../howto/clinic.rst:1369 +#: ../../howto/clinic.rst:1384 msgid "" "Return converters must subclass ``CReturnConverter``. There are no examples " "yet of custom return converters, because they are not widely used yet. If " @@ -1917,59 +1924,59 @@ msgid "" "its subclasses." msgstr "" -#: ../../howto/clinic.rst:1377 +#: ../../howto/clinic.rst:1392 msgid "METH_O and METH_NOARGS" msgstr "" -#: ../../howto/clinic.rst:1379 +#: ../../howto/clinic.rst:1394 msgid "" "To convert a function using ``METH_O``, make sure the function's single " "argument is using the ``object`` converter, and mark the arguments as " "positional-only::" msgstr "" -#: ../../howto/clinic.rst:1391 +#: ../../howto/clinic.rst:1406 msgid "" "To convert a function using ``METH_NOARGS``, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1394 +#: ../../howto/clinic.rst:1409 msgid "" "You can still use a self converter, a return converter, and specify a " "``type`` argument to the object converter for ``METH_O``." msgstr "" -#: ../../howto/clinic.rst:1398 +#: ../../howto/clinic.rst:1413 msgid "tp_new and tp_init functions" msgstr "" -#: ../../howto/clinic.rst:1400 +#: ../../howto/clinic.rst:1415 msgid "" "You can convert ``tp_new`` and ``tp_init`` functions. Just name them " "``__new__`` or ``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1403 +#: ../../howto/clinic.rst:1418 msgid "" "The function name generated for ``__new__`` doesn't end in ``__new__`` like " "it would by default. It's just the name of the class, converted into a " "valid C identifier." msgstr "" -#: ../../howto/clinic.rst:1407 +#: ../../howto/clinic.rst:1422 msgid "No ``PyMethodDef`` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1409 +#: ../../howto/clinic.rst:1424 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1411 +#: ../../howto/clinic.rst:1426 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1413 +#: ../../howto/clinic.rst:1428 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -1978,11 +1985,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1420 +#: ../../howto/clinic.rst:1435 msgid "Changing and redirecting Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1422 +#: ../../howto/clinic.rst:1437 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -1991,7 +1998,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1428 +#: ../../howto/clinic.rst:1443 msgid "" "While changing Clinic's output in this manner can be a boon to readability, " "it may result in Clinic code using types before they are defined, or your " @@ -2003,15 +2010,15 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1437 +#: ../../howto/clinic.rst:1452 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1464 +#: ../../howto/clinic.rst:1479 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1440 +#: ../../howto/clinic.rst:1455 msgid "" "A field, in this context, is a subsection of Clinic's output. For example, " "the ``#define`` for the ``PyMethodDef`` structure is a field, called " @@ -2019,7 +2026,7 @@ msgid "" "function definition:" msgstr "" -#: ../../howto/clinic.rst:1455 +#: ../../howto/clinic.rst:1470 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2027,50 +2034,50 @@ msgid "" "of statement the field is. Field names that end in ``\"_prototype\"`` " "represent forward declarations of that thing, without the actual body/data " "of the thing; field names that end in ``\"_definition\"`` represent the " -"actual definition of the thing, with the body/data of the thing. (``" -"\"methoddef\"`` is special, it's the only one that ends with ``\"_define" -"\"``, representing that it's a preprocessor #define.)" +"actual definition of the thing, with the body/data of the thing. " +"(``\"methoddef\"`` is special, it's the only one that ends with " +"``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1498 +#: ../../howto/clinic.rst:1513 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1467 +#: ../../howto/clinic.rst:1482 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1472 ../../howto/clinic.rst:1547 -#: ../../howto/clinic.rst:1625 +#: ../../howto/clinic.rst:1487 ../../howto/clinic.rst:1562 +#: ../../howto/clinic.rst:1640 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1471 +#: ../../howto/clinic.rst:1486 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1478 ../../howto/clinic.rst:1574 -#: ../../howto/clinic.rst:1628 +#: ../../howto/clinic.rst:1493 ../../howto/clinic.rst:1589 +#: ../../howto/clinic.rst:1643 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1475 +#: ../../howto/clinic.rst:1490 msgid "" "A text buffer where you can save text for later. Text sent here is appended " "to the end of any existing text. It's an error to have any text left in the " "buffer when Clinic finishes processing a file." msgstr "" -#: ../../howto/clinic.rst:1489 ../../howto/clinic.rst:1560 -#: ../../howto/clinic.rst:1654 +#: ../../howto/clinic.rst:1504 ../../howto/clinic.rst:1575 +#: ../../howto/clinic.rst:1669 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1481 +#: ../../howto/clinic.rst:1496 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " @@ -2079,65 +2086,65 @@ msgid "" "for ``_pickle.c`` would be written to ``_pickle.clinic.c``.)" msgstr "" -#: ../../howto/clinic.rst:1488 +#: ../../howto/clinic.rst:1503 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1494 ../../howto/clinic.rst:1587 -#: ../../howto/clinic.rst:1658 +#: ../../howto/clinic.rst:1509 ../../howto/clinic.rst:1602 +#: ../../howto/clinic.rst:1673 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1492 +#: ../../howto/clinic.rst:1507 msgid "" "A buffer like ``buffer``. However, a two-pass buffer can only be dumped " "once, and it prints out all text sent to it during all processing, even from " "Clinic blocks *after* the dumping point." msgstr "" -#: ../../howto/clinic.rst:1498 ../../howto/clinic.rst:1621 +#: ../../howto/clinic.rst:1513 ../../howto/clinic.rst:1636 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1497 +#: ../../howto/clinic.rst:1512 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1500 +#: ../../howto/clinic.rst:1515 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1502 +#: ../../howto/clinic.rst:1517 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1508 +#: ../../howto/clinic.rst:1523 msgid "" "This dumps the current contents of the named destination into the output of " "the current block, and empties it. This only works with ``buffer`` and " "``two-pass`` destinations." msgstr "" -#: ../../howto/clinic.rst:1512 +#: ../../howto/clinic.rst:1527 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1519 +#: ../../howto/clinic.rst:1534 msgid "" "This tells Clinic to output *field* to *destination*. ``output`` also " "supports a special meta-destination, called ``everything``, which tells " "Clinic to output *all* fields to that *destination*." msgstr "" -#: ../../howto/clinic.rst:1523 +#: ../../howto/clinic.rst:1538 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1532 +#: ../../howto/clinic.rst:1547 msgid "" "``output push`` and ``output pop`` allow you to push and pop configurations " "on an internal configuration stack, so that you can temporarily modify the " @@ -2146,25 +2153,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1539 +#: ../../howto/clinic.rst:1554 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1543 +#: ../../howto/clinic.rst:1558 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1546 +#: ../../howto/clinic.rst:1561 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1550 +#: ../../howto/clinic.rst:1565 msgid "" "Designed to write everything to the \"clinic file\" that it can. You then " "``#include`` this file near the top of your file. You may need to rearrange " @@ -2172,17 +2179,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1556 +#: ../../howto/clinic.rst:1571 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1560 +#: ../../howto/clinic.rst:1575 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1563 +#: ../../howto/clinic.rst:1578 msgid "" "Save up most of the output from Clinic, to be written into your file near " "the end. For Python files implementing modules or builtin types, it's " @@ -2192,14 +2199,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1572 +#: ../../howto/clinic.rst:1587 msgid "" "Suppress the ``parser_prototype``, ``impl_prototype``, and " "``docstring_prototype``, write the ``impl_definition`` to ``block``, and " "write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1577 +#: ../../howto/clinic.rst:1592 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2208,18 +2215,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1584 +#: ../../howto/clinic.rst:1599 msgid "" "Suppresses the ``impl_prototype``, write the ``impl_definition`` to " "``block``, write ``docstring_prototype``, ``methoddef_define``, and " "``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." msgstr "" -#: ../../howto/clinic.rst:1598 +#: ../../howto/clinic.rst:1613 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1590 +#: ../../howto/clinic.rst:1605 msgid "" "Similar to the ``buffer`` preset, but writes more things to ``block``, only " "writing the really big chunks of generated code to ``buffer``. This avoids " @@ -2229,137 +2236,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1597 +#: ../../howto/clinic.rst:1612 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1600 +#: ../../howto/clinic.rst:1615 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1606 +#: ../../howto/clinic.rst:1621 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1608 +#: ../../howto/clinic.rst:1623 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1610 +#: ../../howto/clinic.rst:1625 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1616 +#: ../../howto/clinic.rst:1631 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1618 +#: ../../howto/clinic.rst:1633 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1621 +#: ../../howto/clinic.rst:1636 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1624 +#: ../../howto/clinic.rst:1639 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1628 +#: ../../howto/clinic.rst:1643 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1631 +#: ../../howto/clinic.rst:1646 msgid "" "A text file. The file destination takes an extra argument, a template to " "use for building the filename, like so:" msgstr "" -#: ../../howto/clinic.rst:1634 +#: ../../howto/clinic.rst:1649 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1636 +#: ../../howto/clinic.rst:1651 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1639 +#: ../../howto/clinic.rst:1654 msgid "{path}" msgstr "" -#: ../../howto/clinic.rst:1640 +#: ../../howto/clinic.rst:1655 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1641 +#: ../../howto/clinic.rst:1656 msgid "{dirname}" msgstr "" -#: ../../howto/clinic.rst:1642 +#: ../../howto/clinic.rst:1657 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1643 +#: ../../howto/clinic.rst:1658 msgid "{basename}" msgstr "" -#: ../../howto/clinic.rst:1644 +#: ../../howto/clinic.rst:1659 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1646 +#: ../../howto/clinic.rst:1661 msgid "{basename_root}" msgstr "" -#: ../../howto/clinic.rst:1646 +#: ../../howto/clinic.rst:1661 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1650 +#: ../../howto/clinic.rst:1665 msgid "{basename_extension}" msgstr "" -#: ../../howto/clinic.rst:1649 +#: ../../howto/clinic.rst:1664 msgid "" "The last '.' and everything after it. If the basename does not contain a " "period, this will be the empty string." msgstr "" -#: ../../howto/clinic.rst:1652 +#: ../../howto/clinic.rst:1667 msgid "" "If there are no periods in the filename, {basename} and {filename} are the " "same, and {extension} is empty. \"{basename}{extension}\" is always exactly " "the same as \"{filename}\".\"" msgstr "" -#: ../../howto/clinic.rst:1657 +#: ../../howto/clinic.rst:1672 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1660 +#: ../../howto/clinic.rst:1675 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1666 +#: ../../howto/clinic.rst:1681 msgid "" "It removes all the accumulated text up to this point in the destination. (I " "don't know what you'd need this for, but I thought maybe it'd be useful " "while someone's experimenting.)" msgstr "" -#: ../../howto/clinic.rst:1670 +#: ../../howto/clinic.rst:1685 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1677 +#: ../../howto/clinic.rst:1692 msgid "" "``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " "string that will be prepended to every line of Clinic's output; " @@ -2367,35 +2374,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1681 +#: ../../howto/clinic.rst:1696 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1684 +#: ../../howto/clinic.rst:1699 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1684 +#: ../../howto/clinic.rst:1699 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1687 +#: ../../howto/clinic.rst:1702 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1687 +#: ../../howto/clinic.rst:1702 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1689 +#: ../../howto/clinic.rst:1704 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1696 +#: ../../howto/clinic.rst:1711 msgid "" "This tells Clinic that the current contents of the output should be kept, " "unmodified. This is used internally by Clinic when dumping output into " @@ -2404,36 +2411,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1703 +#: ../../howto/clinic.rst:1718 msgid "The #ifdef trick" msgstr "" -#: ../../howto/clinic.rst:1705 +#: ../../howto/clinic.rst:1720 msgid "" "If you're converting a function that isn't available on all platforms, " "there's a trick you can use to make life a little easier. The existing code " "probably looks like this::" msgstr "" -#: ../../howto/clinic.rst:1716 +#: ../../howto/clinic.rst:1731 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1725 +#: ../../howto/clinic.rst:1740 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1739 +#: ../../howto/clinic.rst:1754 msgid "" "Then, remove those three lines from the ``PyMethodDef`` structure, replacing " "them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1746 +#: ../../howto/clinic.rst:1761 msgid "" "(You can find the real name for this macro inside the generated code. Or you " "can calculate it yourself: it's the name of your function as defined on the " @@ -2441,27 +2448,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1751 +#: ../../howto/clinic.rst:1766 msgid "" "Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " "``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" msgstr "" -#: ../../howto/clinic.rst:1754 +#: ../../howto/clinic.rst:1769 msgid "" "Here's where Argument Clinic gets very clever. It actually detects that the " "Argument Clinic block might be deactivated by the ``#ifdef``. When that " "happens, it generates a little extra code that looks like this::" msgstr "" -#: ../../howto/clinic.rst:1762 +#: ../../howto/clinic.rst:1777 msgid "" "That means the macro always works. If the function is defined, this turns " "into the correct structure, including the trailing comma. If the function " "is undefined, this turns into nothing." msgstr "" -#: ../../howto/clinic.rst:1766 +#: ../../howto/clinic.rst:1781 msgid "" "However, this causes one ticklish problem: where should Argument Clinic put " "this extra code when using the \"block\" output preset? It can't go in the " @@ -2469,24 +2476,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1770 +#: ../../howto/clinic.rst:1785 msgid "" "In this situation, Argument Clinic writes the extra code to the \"buffer\" " "destination. This may mean that you get a complaint from Argument Clinic:" msgstr "" -#: ../../howto/clinic.rst:1778 +#: ../../howto/clinic.rst:1793 msgid "" "When this happens, just open your file, find the ``dump buffer`` block that " "Argument Clinic added to your file (it'll be at the very bottom), then move " "it above the ``PyMethodDef`` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1785 +#: ../../howto/clinic.rst:1800 msgid "Using Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1787 +#: ../../howto/clinic.rst:1802 msgid "" "It's actually possible to use Argument Clinic to preprocess Python files. " "There's no point to using Argument Clinic blocks, of course, as the output " @@ -2494,7 +2501,7 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1792 +#: ../../howto/clinic.rst:1807 msgid "" "Since Python comments are different from C comments, Argument Clinic blocks " "embedded in Python files look slightly different. They look like this:" diff --git a/library/_thread.po b/library/_thread.po index b29bceb633..16e9e55da9 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -277,3 +277,39 @@ msgid "" "that :keyword:`try` ... :keyword:`finally` clauses are honored), and the " "standard I/O files are not flushed." msgstr "" + +#: ../../library/_thread.rst:7 +msgid "light-weight processes" +msgstr "" + +#: ../../library/_thread.rst:7 +msgid "processes, light-weight" +msgstr "" + +#: ../../library/_thread.rst:7 +msgid "binary semaphores" +msgstr "" + +#: ../../library/_thread.rst:7 +msgid "semaphores, binary" +msgstr "" + +#: ../../library/_thread.rst:22 +msgid "pthreads" +msgstr "" + +#: ../../library/_thread.rst:22 +msgid "threads" +msgstr "" + +#: ../../library/_thread.rst:22 +msgid "POSIX" +msgstr "" + +#: ../../library/_thread.rst:209 +msgid "module" +msgstr "" + +#: ../../library/_thread.rst:209 +msgid "signal" +msgstr "" diff --git a/library/aifc.po b/library/aifc.po index 26db513174..70ec62c091 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-05-22 01:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -260,3 +260,27 @@ msgid "" "actual size of the audio data. After calling this method, the object can no " "longer be used." msgstr "" + +#: ../../library/aifc.rst:10 +msgid "Audio Interchange File Format" +msgstr "" + +#: ../../library/aifc.rst:10 +msgid "AIFF" +msgstr "" + +#: ../../library/aifc.rst:10 +msgid "AIFF-C" +msgstr "" + +#: ../../library/aifc.rst:190 +msgid "u-LAW" +msgstr "" + +#: ../../library/aifc.rst:190 +msgid "A-LAW" +msgstr "" + +#: ../../library/aifc.rst:190 +msgid "G.722" +msgstr "" diff --git a/library/argparse.po b/library/argparse.po index 8da538c75e..abe5b0c348 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-25 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -2046,3 +2046,20 @@ msgstr "" msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" + +#: ../../library/argparse.rst:970 +msgid "? (question mark)" +msgstr "" + +#: ../../library/argparse.rst:970 ../../library/argparse.rst:1004 +#: ../../library/argparse.rst:1018 +msgid "in argparse module" +msgstr "" + +#: ../../library/argparse.rst:1004 +msgid "* (asterisk)" +msgstr "" + +#: ../../library/argparse.rst:1018 +msgid "+ (plus)" +msgstr "" diff --git a/library/array.po b/library/array.po index ff021b95fb..be40811ad3 100644 --- a/library/array.po +++ b/library/array.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2021-11-23 18:40+0800\n" "Last-Translator: Benson Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -515,5 +515,9 @@ msgstr "`NumPy `_" msgid "The NumPy package defines another array type." msgstr "NumPy 套件定義了另一個陣列型別" +#: ../../library/array.rst:7 +msgid "arrays" +msgstr "" + #~ msgid "The following data items and methods are also supported:" #~ msgstr "提供下方的資料物件與方法:" diff --git a/library/ast.po b/library/ast.po index 26c440c285..a5f073c74d 100644 --- a/library/ast.po +++ b/library/ast.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -984,8 +984,8 @@ msgstr "" #: ../../library/ast.rst:1969 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" -"新增 ``type_comments``\\ 、\\ ``mode='func_type'`` 與 ``feature_version``" -"\\ 。" +"新增 ``type_comments``\\ 、\\ ``mode='func_type'`` 與 " +"``feature_version``\\ 。" #: ../../library/ast.rst:1975 msgid "" @@ -1231,10 +1231,10 @@ msgstr "" #: ../../library/ast.rst:2185 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " -"pretty-printed with that indent level. An indent level of 0, negative, or ``" -"\"\"`` will only insert newlines. ``None`` (the default) selects the single " -"line representation. Using a positive integer indent indents that many " -"spaces per level. If *indent* is a string (such as ``\"\\t\"``), that " +"pretty-printed with that indent level. An indent level of 0, negative, or " +"``\"\"`` will only insert newlines. ``None`` (the default) selects the " +"single line representation. Using a positive integer indent indents that " +"many spaces per level. If *indent* is a string (such as ``\"\\t\"``), that " "string is used to indent each level." msgstr "" @@ -1347,3 +1347,15 @@ msgid "" "multiple Python versions). Parso is also able to list multiple syntax errors " "in your python file." msgstr "" + +#: ../../library/ast.rst:59 +msgid "? (question mark)" +msgstr "" + +#: ../../library/ast.rst:59 ../../library/ast.rst:60 +msgid "in AST grammar" +msgstr "" + +#: ../../library/ast.rst:60 +msgid "* (asterisk)" +msgstr "" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 84233e679c..13b59c3f0f 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-25 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -241,11 +241,11 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1012 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1013 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" -#: ../../library/asyncio-task.rst:289 +#: ../../library/asyncio-task.rst:289 ../../library/asyncio-task.rst:1020 msgid "Added the *context* parameter." msgstr "新增 *context* 參數。" @@ -949,97 +949,98 @@ msgstr "" #: ../../library/asyncio-task.rst:1005 msgid "" -"Tasks support the :mod:`contextvars` module. When a Task is created it " -"copies the current context and later runs its coroutine in the copied " -"context." +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *coro* to run in. If no *context* is " +"provided, the Task copies the current context and later runs its coroutine " +"in the copied context." msgstr "" -#: ../../library/asyncio-task.rst:1009 +#: ../../library/asyncio-task.rst:1010 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1015 +#: ../../library/asyncio-task.rst:1016 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1021 +#: ../../library/asyncio-task.rst:1025 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1023 +#: ../../library/asyncio-task.rst:1027 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1028 +#: ../../library/asyncio-task.rst:1032 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1030 +#: ../../library/asyncio-task.rst:1034 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:1034 ../../library/asyncio-task.rst:1048 +#: ../../library/asyncio-task.rst:1038 ../../library/asyncio-task.rst:1052 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1037 +#: ../../library/asyncio-task.rst:1041 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1042 +#: ../../library/asyncio-task.rst:1046 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1044 +#: ../../library/asyncio-task.rst:1048 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1051 +#: ../../library/asyncio-task.rst:1055 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1056 +#: ../../library/asyncio-task.rst:1060 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1058 ../../library/asyncio-task.rst:1067 +#: ../../library/asyncio-task.rst:1062 ../../library/asyncio-task.rst:1071 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1060 +#: ../../library/asyncio-task.rst:1064 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1065 +#: ../../library/asyncio-task.rst:1069 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1069 +#: ../../library/asyncio-task.rst:1073 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1074 +#: ../../library/asyncio-task.rst:1078 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1076 +#: ../../library/asyncio-task.rst:1080 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1047,15 +1048,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1082 +#: ../../library/asyncio-task.rst:1086 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1084 +#: ../../library/asyncio-task.rst:1088 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1086 +#: ../../library/asyncio-task.rst:1090 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1064,66 +1065,66 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1095 +#: ../../library/asyncio-task.rst:1099 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1097 +#: ../../library/asyncio-task.rst:1101 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1100 +#: ../../library/asyncio-task.rst:1104 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1102 +#: ../../library/asyncio-task.rst:1106 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" -#: ../../library/asyncio-task.rst:1107 +#: ../../library/asyncio-task.rst:1111 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1113 +#: ../../library/asyncio-task.rst:1117 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1115 +#: ../../library/asyncio-task.rst:1119 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:1123 +#: ../../library/asyncio-task.rst:1127 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1125 +#: ../../library/asyncio-task.rst:1129 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1128 +#: ../../library/asyncio-task.rst:1132 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1135 +#: ../../library/asyncio-task.rst:1139 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1137 +#: ../../library/asyncio-task.rst:1141 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1140 +#: ../../library/asyncio-task.rst:1144 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1135,46 +1136,46 @@ msgid "" "addition to catching the exception." msgstr "" -#: ../../library/asyncio-task.rst:1150 +#: ../../library/asyncio-task.rst:1154 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1153 +#: ../../library/asyncio-task.rst:1157 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1158 +#: ../../library/asyncio-task.rst:1162 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1197 +#: ../../library/asyncio-task.rst:1201 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1199 +#: ../../library/asyncio-task.rst:1203 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:1205 +#: ../../library/asyncio-task.rst:1209 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1207 +#: ../../library/asyncio-task.rst:1211 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1209 +#: ../../library/asyncio-task.rst:1213 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1214 +#: ../../library/asyncio-task.rst:1218 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1183,7 +1184,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1232 +#: ../../library/asyncio-task.rst:1236 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1192,20 +1193,20 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1238 +#: ../../library/asyncio-task.rst:1242 msgid "" "If end-user code is, for some reason, suppresing cancellation by catching :" "exc:`CancelledError`, it needs to call this method to remove the " "cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:1244 +#: ../../library/asyncio-task.rst:1248 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: ../../library/asyncio-task.rst:1248 +#: ../../library/asyncio-task.rst:1252 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1214,7 +1215,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1254 +#: ../../library/asyncio-task.rst:1258 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." diff --git a/library/audioop.po b/library/audioop.po index e71ff77ba8..b6a3ad756f 100644 --- a/library/audioop.po +++ b/library/audioop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-05-22 02:00+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,8 @@ msgid "" "The :mod:`audioop` module is deprecated (see :pep:`PEP 594 <594#audioop>` " "for details)." msgstr "" -":mod:`audioop` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#audioop>`" -"\\ )。" +":mod:`audioop` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +"<594#audioop>`\\ )。" #: ../../library/audioop.rst:14 msgid "" @@ -142,8 +142,9 @@ msgstr "" #: ../../library/audioop.rst:120 msgid "" "Search *fragment* for a slice of length *length* samples (not bytes!) with " -"maximum energy, i.e., return *i* for which ``rms(fragment[i*2:(i" -"+length)*2])`` is maximal. The fragments should both contain 2-byte samples." +"maximum energy, i.e., return *i* for which ``rms(fragment[i*2:" +"(i+length)*2])`` is maximal. The fragments should both contain 2-byte " +"samples." msgstr "" #: ../../library/audioop.rst:124 @@ -314,3 +315,19 @@ msgid "" "is to pick the most energetic piece of the output sample, locate that in the " "input sample and subtract the whole output sample from the input sample::" msgstr "" + +#: ../../library/audioop.rst:24 +msgid "Intel/DVI ADPCM" +msgstr "" + +#: ../../library/audioop.rst:24 +msgid "ADPCM, Intel/DVI" +msgstr "" + +#: ../../library/audioop.rst:24 +msgid "a-LAW" +msgstr "" + +#: ../../library/audioop.rst:24 +msgid "u-LAW" +msgstr "" diff --git a/library/audit_events.po b/library/audit_events.po index c501587f31..d60beabc08 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-12-11 08:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2021-12-06 21:50+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -126,3 +126,8 @@ msgstr "ctypes.PyObj_FromPtr" #: ../../library/audit_events.rst:46 msgid "``obj``" msgstr "``obj``" + +#: ../../library/audit_events.rst:3 +#, fuzzy +msgid "audit events" +msgstr "稽核事件" diff --git a/library/base64.po b/library/base64.po index fb3c220252..8e3901b891 100644 --- a/library/base64.po +++ b/library/base64.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-14 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -389,3 +389,19 @@ msgid "" "Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition " "of the base64 encoding." msgstr "" + +#: ../../library/base64.rst:10 +msgid "base64" +msgstr "" + +#: ../../library/base64.rst:10 +msgid "encoding" +msgstr "" + +#: ../../library/base64.rst:10 +msgid "MIME" +msgstr "" + +#: ../../library/base64.rst:10 +msgid "base64 encoding" +msgstr "" diff --git a/library/binascii.po b/library/binascii.po index cc120aeb58..cb2d5f0e0d 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -232,5 +232,17 @@ msgstr ":mod:`quopri` 模組" msgid "Support for quoted-printable encoding used in MIME email messages." msgstr "" +#: ../../library/binascii.rst:8 +msgid "module" +msgstr "" + +#: ../../library/binascii.rst:8 +msgid "uu" +msgstr "" + +#: ../../library/binascii.rst:8 +msgid "base64" +msgstr "" + #~ msgid "Module :mod:`binhex`" #~ msgstr ":mod:`binhex` 模組" diff --git a/library/bisect.po b/library/bisect.po index 5152f08340..ed0495eeac 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-26 00:21+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-08-27 16:41+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,11 +44,11 @@ msgstr "" "算法實作。模組的原始碼是這個演算法的一個完善的實作(邊界條件已經是正確的" "了)。" -#: ../../library/bisect.rst:21 +#: ../../library/bisect.rst:23 msgid "The following functions are provided:" msgstr "此模組提供下面的函式:" -#: ../../library/bisect.rst:26 +#: ../../library/bisect.rst:28 msgid "" "Locate the insertion point for *x* in *a* to maintain sorted order. The " "parameters *lo* and *hi* may be used to specify a subset of the list which " @@ -62,7 +62,7 @@ msgstr "" "有 *x* 出現,插入的位置會在所有 *x* 的前面(左邊)。回傳值可以被當作 ``list." "insert()`` 的第一個參數,但列表 *a* 必須先排序過。" -#: ../../library/bisect.rst:33 +#: ../../library/bisect.rst:35 msgid "" "The returned insertion point *i* partitions the array *a* into two halves so " "that ``all(val < x for val in a[lo : i])`` for the left side and ``all(val " @@ -71,7 +71,7 @@ msgstr "" "回傳的插入位置 *i* 將陣列 *a* 分為兩半,使得 ``all(val < x for val in a[lo : " "i])`` 都在左側且 ``all(val >= x for val in a[i : hi])`` 都在右側。" -#: ../../library/bisect.rst:37 ../../library/bisect.rst:58 +#: ../../library/bisect.rst:39 ../../library/bisect.rst:60 msgid "" "*key* specifies a :term:`key function` of one argument that is used to " "extract a comparison key from each element in the array. To support " @@ -81,26 +81,27 @@ msgstr "" "所有元素以得到比較值來計算順位。注意此 function 只會套用在陣列中的元素,不會" "套用在 *x*。" -#: ../../library/bisect.rst:41 ../../library/bisect.rst:62 +#: ../../library/bisect.rst:43 ../../library/bisect.rst:64 msgid "" "If *key* is ``None``, the elements are compared directly with no intervening " "function call." msgstr "若 *key* 為 ``None``,則排序順位將直接以陣列中元素值決定。" -#: ../../library/bisect.rst:44 ../../library/bisect.rst:65 -#: ../../library/bisect.rst:83 ../../library/bisect.rst:103 +#: ../../library/bisect.rst:46 ../../library/bisect.rst:67 +#: ../../library/bisect.rst:85 ../../library/bisect.rst:105 msgid "Added the *key* parameter." msgstr "新增 *key* 參數。" -#: ../../library/bisect.rst:51 +#: ../../library/bisect.rst:53 +#, fuzzy msgid "" -"Similar to :func:`bisect_left`, but returns an insertion point which comes " -"after (to the right of) any existing entries of *x* in *a*." +"Similar to :py:func:`~bisect.bisect_left`, but returns an insertion point " +"which comes after (to the right of) any existing entries of *x* in *a*." msgstr "" "類似 :func:`bisect_left` ,但回傳的插入位置會在所有 *a* 當中的 *x* 的後面(右" "邊)。" -#: ../../library/bisect.rst:54 +#: ../../library/bisect.rst:56 msgid "" "The returned insertion point *i* partitions the array *a* into two halves so " "that ``all(val <= x for val in a[lo : i])`` for the left side and ``all(val " @@ -109,90 +110,93 @@ msgstr "" "回傳的插入位置 *i* 將陣列 *a* 分為兩半,使得 ``all(val <= x for val in " "a[lo : i])`` 都在左側且 ``all(val > x for val in a[i : hi])`` 都在右側。" -#: ../../library/bisect.rst:71 +#: ../../library/bisect.rst:73 msgid "Insert *x* in *a* in sorted order." msgstr "將元素 *x* 插入 list *a*,並維持順序。" -#: ../../library/bisect.rst:73 +#: ../../library/bisect.rst:75 +#, fuzzy msgid "" -"This function first runs :func:`bisect_left` to locate an insertion point. " -"Next, it runs the :meth:`insert` method on *a* to insert *x* at the " -"appropriate position to maintain sort order." +"This function first runs :py:func:`~bisect.bisect_left` to locate an " +"insertion point. Next, it runs the :meth:`insert` method on *a* to insert " +"*x* at the appropriate position to maintain sort order." msgstr "" "此函式先使用 :func:`bisect_left` 搜索插入位置,接著用 :meth:`insert` 將 *x* " "插入,以能維持添加元素後的順序。" -#: ../../library/bisect.rst:77 ../../library/bisect.rst:97 +#: ../../library/bisect.rst:79 ../../library/bisect.rst:99 msgid "" "To support inserting records in a table, the *key* function (if any) is " "applied to *x* for the search step but not for the insertion step." msgstr "此函式只有在搜索時會使用 *key* 函式,插入時不會。" -#: ../../library/bisect.rst:80 ../../library/bisect.rst:100 +#: ../../library/bisect.rst:82 ../../library/bisect.rst:102 msgid "" "Keep in mind that the ``O(log n)`` search is dominated by the slow O(n) " "insertion step." msgstr "" "注意雖然搜索是 ``O(log n)``,但插入是 O(n),因此此函式整體時間複雜度是 O(n)。" -#: ../../library/bisect.rst:90 +#: ../../library/bisect.rst:92 +#, fuzzy msgid "" -"Similar to :func:`insort_left`, but inserting *x* in *a* after any existing " -"entries of *x*." +"Similar to :py:func:`~bisect.insort_left`, but inserting *x* in *a* after " +"any existing entries of *x*." msgstr "" "類似 :func:`insort_left` ,但插入的位置會在所有 *a* 當中的 *x* 的後面(右" "邊)。" -#: ../../library/bisect.rst:93 +#: ../../library/bisect.rst:95 +#, fuzzy msgid "" -"This function first runs :func:`bisect_right` to locate an insertion point. " -"Next, it runs the :meth:`insert` method on *a* to insert *x* at the " -"appropriate position to maintain sort order." +"This function first runs :py:func:`~bisect.bisect_right` to locate an " +"insertion point. Next, it runs the :meth:`insert` method on *a* to insert " +"*x* at the appropriate position to maintain sort order." msgstr "" "此函式先使用 :func:`bisect_right` 搜索插入位置,接著用 :meth:`insert` 將 *x* " "插入,以能維持添加元素後的順序。" -#: ../../library/bisect.rst:108 +#: ../../library/bisect.rst:110 msgid "Performance Notes" msgstr "效能考量" -#: ../../library/bisect.rst:110 +#: ../../library/bisect.rst:112 msgid "" "When writing time sensitive code using *bisect()* and *insort()*, keep these " "thoughts in mind:" msgstr "" -#: ../../library/bisect.rst:113 +#: ../../library/bisect.rst:115 msgid "" "Bisection is effective for searching ranges of values. For locating specific " "values, dictionaries are more performant." msgstr "" -#: ../../library/bisect.rst:116 +#: ../../library/bisect.rst:118 msgid "" "The *insort()* functions are ``O(n)`` because the logarithmic search step is " "dominated by the linear time insertion step." msgstr "" -#: ../../library/bisect.rst:119 +#: ../../library/bisect.rst:121 msgid "" "The search functions are stateless and discard key function results after " "they are used. Consequently, if the search functions are used in a loop, " "the key function may be called again and again on the same array elements. " -"If the key function isn't fast, consider wrapping it with :func:`functools." -"cache` to avoid duplicate computations. Alternatively, consider searching " -"an array of precomputed keys to locate the insertion point (as shown in the " -"examples section below)." +"If the key function isn't fast, consider wrapping it with :py:func:" +"`functools.cache` to avoid duplicate computations. Alternatively, consider " +"searching an array of precomputed keys to locate the insertion point (as " +"shown in the examples section below)." msgstr "" -#: ../../library/bisect.rst:129 +#: ../../library/bisect.rst:131 msgid "" "`Sorted Collections `_ is a " "high performance module that uses *bisect* to managed sorted collections of " "data." msgstr "" -#: ../../library/bisect.rst:133 +#: ../../library/bisect.rst:135 msgid "" "The `SortedCollection recipe `_ uses bisect to build a full-featured collection class " @@ -201,38 +205,38 @@ msgid "" "searches." msgstr "" -#: ../../library/bisect.rst:141 +#: ../../library/bisect.rst:143 msgid "Searching Sorted Lists" msgstr "搜尋一個已排序的 list" -#: ../../library/bisect.rst:143 +#: ../../library/bisect.rst:145 msgid "" -"The above :func:`bisect` functions are useful for finding insertion points " -"but can be tricky or awkward to use for common searching tasks. The " -"following five functions show how to transform them into the standard " -"lookups for sorted lists::" +"The above `bisect functions`_ are useful for finding insertion points but " +"can be tricky or awkward to use for common searching tasks. The following " +"five functions show how to transform them into the standard lookups for " +"sorted lists::" msgstr "" -#: ../../library/bisect.rst:185 +#: ../../library/bisect.rst:187 msgid "Examples" msgstr "範例" -#: ../../library/bisect.rst:189 +#: ../../library/bisect.rst:191 msgid "" -"The :func:`bisect` function can be useful for numeric table lookups. This " -"example uses :func:`bisect` to look up a letter grade for an exam score " -"(say) based on a set of ordered numeric breakpoints: 90 and up is an 'A', 80 " -"to 89 is a 'B', and so on::" +"The :py:func:`~bisect.bisect` function can be useful for numeric table " +"lookups. This example uses :py:func:`~bisect.bisect` to look up a letter " +"grade for an exam score (say) based on a set of ordered numeric breakpoints: " +"90 and up is an 'A', 80 to 89 is a 'B', and so on::" msgstr "" -#: ../../library/bisect.rst:201 +#: ../../library/bisect.rst:203 msgid "" -"The :func:`bisect` and :func:`insort` functions also work with lists of " -"tuples. The *key* argument can serve to extract the field used for ordering " -"records in a table::" +"The :py:func:`~bisect.bisect` and :py:func:`~bisect.insort` functions also " +"work with lists of tuples. The *key* argument can serve to extract the " +"field used for ordering records in a table::" msgstr "" -#: ../../library/bisect.rst:235 +#: ../../library/bisect.rst:237 msgid "" "If the key function is expensive, it is possible to avoid repeated function " "calls by searching a list of precomputed keys to find the index of a record::" diff --git a/library/cgi.po b/library/cgi.po index d42d98d54c..7e92ea7278 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-05-22 02:01+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -702,3 +702,48 @@ msgid "" "received from a conforming browser, or even from a browser at all, is " "tedious and error-prone." msgstr "" + +#: ../../library/cgi.rst:10 +msgid "WWW" +msgstr "" + +#: ../../library/cgi.rst:10 +msgid "server" +msgstr "" + +#: ../../library/cgi.rst:10 ../../library/cgi.rst:389 ../../library/cgi.rst:462 +msgid "CGI" +msgstr "" + +#: ../../library/cgi.rst:10 +msgid "protocol" +msgstr "" + +#: ../../library/cgi.rst:10 +msgid "HTTP" +msgstr "" + +#: ../../library/cgi.rst:10 +msgid "MIME" +msgstr "" + +#: ../../library/cgi.rst:10 +msgid "headers" +msgstr "" + +#: ../../library/cgi.rst:10 +msgid "URL" +msgstr "" + +#: ../../library/cgi.rst:10 +#, fuzzy +msgid "Common Gateway Interface" +msgstr ":mod:`cgi` --- 通用閘道器介面支援" + +#: ../../library/cgi.rst:389 +msgid "security" +msgstr "" + +#: ../../library/cgi.rst:462 +msgid "debugging" +msgstr "" diff --git a/library/cgitb.po b/library/cgitb.po index b9890b30ee..348a3c229f 100644 --- a/library/cgitb.po +++ b/library/cgitb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-05-22 02:02+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -75,8 +75,8 @@ msgid "" "argument *context* is the number of lines of context to display around the " "current line of source code in the traceback; this defaults to ``5``. If the " "optional argument *format* is ``\"html\"``, the output is formatted as " -"HTML. Any other value forces plain text output. The default value is ``" -"\"html\"``." +"HTML. Any other value forces plain text output. The default value is " +"``\"html\"``." msgstr "" #: ../../library/cgitb.rst:64 @@ -107,3 +107,23 @@ msgid "" "func:`sys.exc_info`. If the *info* argument is not supplied, the current " "exception is obtained from :func:`sys.exc_info`." msgstr "" + +#: ../../library/cgitb.rst:13 +msgid "CGI" +msgstr "" + +#: ../../library/cgitb.rst:13 +msgid "exceptions" +msgstr "" + +#: ../../library/cgitb.rst:13 +msgid "tracebacks" +msgstr "" + +#: ../../library/cgitb.rst:13 +msgid "in CGI scripts" +msgstr "" + +#: ../../library/cgitb.rst:47 +msgid "excepthook() (in module sys)" +msgstr "" diff --git a/library/chunk.po b/library/chunk.po index 47c3cf71d3..ede848f273 100644 --- a/library/chunk.po +++ b/library/chunk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-05-22 02:03+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -203,3 +203,23 @@ msgid "" "\"EA IFF 85\" Standard for Interchange Format Files, Jerry Morrison, " "Electronic Arts, January 1985." msgstr "" + +#: ../../library/chunk.rst:13 +msgid "Audio Interchange File Format" +msgstr "" + +#: ../../library/chunk.rst:13 +msgid "AIFF" +msgstr "" + +#: ../../library/chunk.rst:13 +msgid "AIFF-C" +msgstr "" + +#: ../../library/chunk.rst:13 +msgid "Real Media File Format" +msgstr "" + +#: ../../library/chunk.rst:13 +msgid "RMFF" +msgstr "" diff --git a/library/cmath.po b/library/cmath.po index abf0fe1f87..bd32a9cc9e 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-27 00:34+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -347,3 +347,11 @@ msgid "" "nothing's sign bit. In Iserles, A., and Powell, M. (eds.), The state of the " "art in numerical analysis. Clarendon Press (1987) pp165--211." msgstr "" + +#: ../../library/cmath.rst:304 +msgid "module" +msgstr "" + +#: ../../library/cmath.rst:304 +msgid "math" +msgstr "" diff --git a/library/cmd.po b/library/cmd.po index 1ccbbcd028..b798422419 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -134,8 +134,8 @@ msgid "" "method, called with an argument ``'bar'``, invokes the corresponding method :" "meth:`help_bar`, and if that is not present, prints the docstring of :meth:" "`do_bar`, if available. With no argument, :meth:`do_help` lists all " -"available help topics (that is, all commands with corresponding :meth:`help_" -"\\*` methods or commands that have docstrings), and also lists any " +"available help topics (that is, all commands with corresponding :meth:" +"`help_\\*` methods or commands that have docstrings), and also lists any " "undocumented commands." msgstr "" @@ -312,3 +312,15 @@ msgid "" "using blank lines to repeat commands, and the simple record and playback " "facility:" msgstr "" + +#: ../../library/cmd.rst:64 +msgid "? (question mark)" +msgstr "" + +#: ../../library/cmd.rst:64 +msgid "in a command interpreter" +msgstr "" + +#: ../../library/cmd.rst:64 +msgid "! (exclamation)" +msgstr "" diff --git a/library/codecs.po b/library/codecs.po index 774ff7f0fe..32658c68a6 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -462,7 +462,7 @@ msgid "" "In addition, the following error handler is specific to the given codecs:" msgstr "" -#: ../../library/codecs.rst:391 +#: ../../library/codecs.rst:13 ../../library/codecs.rst:391 msgid "Codecs" msgstr "" @@ -2680,3 +2680,102 @@ msgid "" "decoding, an optional UTF-8 encoded BOM at the start of the data will be " "skipped." msgstr "" + +#: ../../library/codecs.rst:13 +msgid "Unicode" +msgstr "" + +#: ../../library/codecs.rst:13 +#, fuzzy +msgid "encode" +msgstr "hex_codec" + +#: ../../library/codecs.rst:13 +#, fuzzy +msgid "decode" +msgstr "hex_codec" + +#: ../../library/codecs.rst:13 +msgid "streams" +msgstr "" + +#: ../../library/codecs.rst:13 +msgid "stackable" +msgstr "" + +#: ../../library/codecs.rst:312 +#, fuzzy +msgid "strict" +msgstr "``'strict'``" + +#: ../../library/codecs.rst:312 ../../library/codecs.rst:363 +#: ../../library/codecs.rst:385 +msgid "error handler's name" +msgstr "" + +#: ../../library/codecs.rst:312 +#, fuzzy +msgid "ignore" +msgstr "``'ignore'``" + +#: ../../library/codecs.rst:312 +#, fuzzy +msgid "replace" +msgstr "``'replace'``" + +#: ../../library/codecs.rst:312 +#, fuzzy +msgid "backslashreplace" +msgstr "``'backslashreplace'``" + +#: ../../library/codecs.rst:312 +#, fuzzy +msgid "surrogateescape" +msgstr "``'surrogateescape'``" + +#: ../../library/codecs.rst:312 +msgid "? (question mark)" +msgstr "" + +#: ../../library/codecs.rst:312 +msgid "replacement character" +msgstr "" + +#: ../../library/codecs.rst:312 +msgid "\\ (backslash)" +msgstr "" + +#: ../../library/codecs.rst:312 ../../library/codecs.rst:363 +msgid "escape sequence" +msgstr "" + +#: ../../library/codecs.rst:312 +msgid "\\x" +msgstr "" + +#: ../../library/codecs.rst:312 +msgid "\\u" +msgstr "" + +#: ../../library/codecs.rst:312 +msgid "\\U" +msgstr "" + +#: ../../library/codecs.rst:363 +#, fuzzy +msgid "xmlcharrefreplace" +msgstr "``'xmlcharrefreplace'``" + +#: ../../library/codecs.rst:363 +#, fuzzy +msgid "namereplace" +msgstr "``'namereplace'``" + +#: ../../library/codecs.rst:363 +msgid "\\N" +msgstr "" + +#: ../../library/codecs.rst:385 +#, fuzzy +msgid "surrogatepass" +msgstr "``'surrogatepass'``" diff --git a/library/configparser.po b/library/configparser.po index 62f1a1de1b..1f2c993f5f 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-17 00:37+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1192,3 +1192,35 @@ msgid "" "changing the behaviour outlined by the footnote reference, consult the " "`Customizing Parser Behaviour`_ section." msgstr "" + +#: ../../library/configparser.rst:16 +msgid ".ini" +msgstr "" + +#: ../../library/configparser.rst:16 +msgid "file" +msgstr "" + +#: ../../library/configparser.rst:16 +msgid "configuration" +msgstr "" + +#: ../../library/configparser.rst:16 +msgid "ini file" +msgstr "" + +#: ../../library/configparser.rst:16 +msgid "Windows ini file" +msgstr "" + +#: ../../library/configparser.rst:335 +msgid "% (percent)" +msgstr "" + +#: ../../library/configparser.rst:335 ../../library/configparser.rst:368 +msgid "interpolation in configuration files" +msgstr "" + +#: ../../library/configparser.rst:368 +msgid "$ (dollar)" +msgstr "" diff --git a/library/constants.po b/library/constants.po index 2fc8b00829..7237db8f97 100644 --- a/library/constants.po +++ b/library/constants.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2021-11-19 23:36+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -179,3 +179,11 @@ msgid "" msgstr "" "當印出此物件時,會印出訊息 \"Type license() to see the full license text\" 。" "當被呼叫時,則會以分頁形式印出完整的許可證文字(一次一整個畫面)。" + +#: ../../library/constants.rst:61 +msgid "..." +msgstr "" + +#: ../../library/constants.rst:61 +msgid "ellipsis literal" +msgstr "" diff --git a/library/copy.po b/library/copy.po index 72c95de47d..f5f17051a1 100644 --- a/library/copy.po +++ b/library/copy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-15 00:09+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-01-20 18:49+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -147,9 +147,9 @@ msgid "" "information on these methods. In fact, the :mod:`copy` module uses the " "registered pickle functions from the :mod:`copyreg` module." msgstr "" -"類別可以使用與操作 pickle 相同的介面來控制複製操作,關於這些方法的描述資" -"訊請參考 :mod:`pickle` 模組。實際上,:mod:`copy` 模組使用的正是從 :mod:" -"`copyreg` 模組中註冊的 pickle 函式。" +"類別可以使用與操作 pickle 相同的介面來控制複製操作,關於這些方法的描述資訊請" +"參考 :mod:`pickle` 模組。實際上,:mod:`copy` 模組使用的正是從 :mod:`copyreg` " +"模組中註冊的 pickle 函式。" #: ../../library/copy.rst:82 msgid "" @@ -181,3 +181,19 @@ msgid "" msgstr "" "支援物件之狀態檢索 (state retrieval) 和恢復 (restoration) 相關特殊方法的討" "論。" + +#: ../../library/copy.rst:71 +msgid "module" +msgstr "" + +#: ../../library/copy.rst:71 +msgid "pickle" +msgstr "" + +#: ../../library/copy.rst:78 +msgid "__copy__() (copy protocol)" +msgstr "" + +#: ../../library/copy.rst:78 +msgid "__deepcopy__() (copy protocol)" +msgstr "" diff --git a/library/copyreg.po b/library/copyreg.po index 2617ec82ae..2bbeacbc10 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -71,3 +71,15 @@ msgid "" "The example below would like to show how to register a pickle function and " "how it will be used:" msgstr "" + +#: ../../library/copyreg.rst:9 +msgid "module" +msgstr "" + +#: ../../library/copyreg.rst:9 +msgid "pickle" +msgstr "" + +#: ../../library/copyreg.rst:9 +msgid "copy" +msgstr "" diff --git a/library/crypt.po b/library/crypt.po index aba1d17f83..11475dfe79 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -209,5 +209,18 @@ msgid "" "check it against the original::" msgstr "" +#: ../../library/crypt.rst:15 ../../library/crypt.rst:32 +#: ../../library/crypt.rst:118 +msgid "crypt(3)" +msgstr "" + +#: ../../library/crypt.rst:15 +msgid "cipher" +msgstr "" + +#: ../../library/crypt.rst:15 +msgid "DES" +msgstr "" + #~ msgid "The :mod:`crypt` module is deprecated (see :pep:`594` for details)." #~ msgstr ":mod:`crypt` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" diff --git a/library/crypto.po b/library/crypto.po index b5594ab6e4..87bde87e6e 100644 --- a/library/crypto.po +++ b/library/crypto.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-02-15 18:06+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,3 +32,7 @@ msgid "" msgstr "" "本章所描述的模組 (module) 實作了多種加密演算法。它們可以在安裝時選擇是否一同" "安裝。在 Unix 系統上,\\ :mod:`crypt` 模組也有機會能夠被使用。以下為概述:" + +#: ../../library/crypto.rst:7 +msgid "cryptography" +msgstr "" diff --git a/library/csv.po b/library/csv.po index d2c698b7b2..5d3881dc77 100644 --- a/library/csv.po +++ b/library/csv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -606,3 +606,23 @@ msgid "" "safe to specify ``newline=''``, since the csv module does its own (:term:" "`universal `) newline handling." msgstr "" + +#: ../../library/csv.rst:11 +msgid "csv" +msgstr "" + +#: ../../library/csv.rst:11 +msgid "data" +msgstr "" + +#: ../../library/csv.rst:11 +msgid "tabular" +msgstr "" + +#: ../../library/csv.rst:53 +msgid "universal newlines" +msgstr "" + +#: ../../library/csv.rst:53 +msgid "csv.reader function" +msgstr "" diff --git a/library/curses.ascii.po b/library/curses.ascii.po index 5308f46610..e70a61490a 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-04 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -327,6 +327,18 @@ msgid "" "mnemonic ``SP`` for the space character." msgstr "" +#: ../../library/curses.ascii.rst:212 +msgid "^ (caret)" +msgstr "" + +#: ../../library/curses.ascii.rst:212 +msgid "in curses module" +msgstr "" + +#: ../../library/curses.ascii.rst:212 +msgid "! (exclamation)" +msgstr "" + #~ msgid ":const:`NUL`" #~ msgstr ":const:`NUL`" diff --git a/library/datetime.po b/library/datetime.po index dc8cef1777..75b49f653a 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:32+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3169,6 +3169,15 @@ msgid "" "not a leap year." msgstr "" +#: ../../library/datetime.rst:2285 +msgid "% (percent)" +msgstr "" + +#: ../../library/datetime.rst:2285 +#, fuzzy +msgid "datetime format" +msgstr "``strftime(format)``" + #~ msgid "This is equivalent to::" #~ msgstr "" #~ "這等價於:\n" diff --git a/library/dbm.po b/library/dbm.po index 254f93f6e6..c679e133cc 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -455,3 +455,7 @@ msgstr "" #: ../../library/dbm.rst:407 msgid "Close the ``dumbdbm`` database." msgstr "" + +#: ../../library/dbm.rst:325 +msgid "databases" +msgstr "" diff --git a/library/dis.po b/library/dis.po index 9e95cfebeb..fd7773aabe 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:32+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1433,3 +1433,11 @@ msgstr "" #: ../../library/dis.rst:1432 msgid "Sequence of bytecodes of Boolean operations." msgstr "" + +#: ../../library/dis.rst:1271 +msgid "built-in function" +msgstr "" + +#: ../../library/dis.rst:1271 +msgid "slice" +msgstr "" diff --git a/library/doctest.po b/library/doctest.po index 4231c527a4..ab7b4a64e3 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -965,8 +965,8 @@ msgstr "" #: ../../library/doctest.rst:955 msgid "" -"Optional argument *name* is used in failure messages, and defaults to ``" -"\"NoName\"``." +"Optional argument *name* is used in failure messages, and defaults to " +"``\"NoName\"``." msgstr "" #: ../../library/doctest.rst:958 @@ -2044,3 +2044,43 @@ msgid "" "Trying to guess where one ends and the other begins is too error-prone, and " "that also makes for a confusing test." msgstr "" + +#: ../../library/doctest.rst:318 +msgid ">>>" +msgstr "" + +#: ../../library/doctest.rst:318 +msgid "interpreter prompt" +msgstr "" + +#: ../../library/doctest.rst:318 ../../library/doctest.rst:554 +msgid "..." +msgstr "" + +#: ../../library/doctest.rst:482 +msgid "^ (caret)" +msgstr "" + +#: ../../library/doctest.rst:482 +msgid "marker" +msgstr "" + +#: ../../library/doctest.rst:534 +msgid "" +msgstr "" + +#: ../../library/doctest.rst:554 ../../library/doctest.rst:684 +msgid "in doctests" +msgstr "" + +#: ../../library/doctest.rst:684 +msgid "# (hash)" +msgstr "" + +#: ../../library/doctest.rst:684 +msgid "+ (plus)" +msgstr "" + +#: ../../library/doctest.rst:684 +msgid "- (minus)" +msgstr "" diff --git a/library/exceptions.po b/library/exceptions.po index 996dfd7133..f4bd3bae70 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-24 00:18+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -1113,3 +1113,32 @@ msgstr "" #: ../../library/exceptions.rst:999 msgid "The class hierarchy for built-in exceptions is:" msgstr "" + +#: ../../library/exceptions.rst:6 ../../library/exceptions.rst:17 +#: ../../library/exceptions.rst:178 +msgid "statement" +msgstr "" + +#: ../../library/exceptions.rst:6 +msgid "try" +msgstr "" + +#: ../../library/exceptions.rst:6 +msgid "except" +msgstr "" + +#: ../../library/exceptions.rst:17 +msgid "raise" +msgstr "" + +#: ../../library/exceptions.rst:178 +msgid "assert" +msgstr "" + +#: ../../library/exceptions.rst:321 +msgid "module" +msgstr "" + +#: ../../library/exceptions.rst:321 +msgid "errno" +msgstr "" diff --git a/library/fcntl.po b/library/fcntl.po index 1d783e7c7c..9009d35594 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -292,3 +292,15 @@ msgid "" "present in the :mod:`os` module (on BSD only), the :func:`os.open` function " "provides an alternative to the :func:`lockf` and :func:`flock` functions." msgstr "" + +#: ../../library/fcntl.rst:10 +msgid "UNIX" +msgstr "" + +#: ../../library/fcntl.rst:10 +msgid "file control" +msgstr "" + +#: ../../library/fcntl.rst:10 +msgid "I/O control" +msgstr "" diff --git a/library/fnmatch.po b/library/fnmatch.po index 5c977a3147..06a4e3c2d5 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-29 00:17+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -141,3 +141,47 @@ msgstr ":mod:`glob` 模組" #: ../../library/fnmatch.rst:105 msgid "Unix shell-style path expansion." msgstr "" + +#: ../../library/fnmatch.rst:9 +msgid "filenames" +msgstr "" + +#: ../../library/fnmatch.rst:9 +msgid "wildcard expansion" +msgstr "" + +#: ../../library/fnmatch.rst:11 ../../library/fnmatch.rst:41 +msgid "module" +msgstr "" + +#: ../../library/fnmatch.rst:11 +msgid "re" +msgstr "" + +#: ../../library/fnmatch.rst:19 +msgid "* (asterisk)" +msgstr "" + +#: ../../library/fnmatch.rst:19 +msgid "in glob-style wildcards" +msgstr "" + +#: ../../library/fnmatch.rst:19 +msgid "? (question mark)" +msgstr "" + +#: ../../library/fnmatch.rst:19 +msgid "[] (square brackets)" +msgstr "" + +#: ../../library/fnmatch.rst:19 +msgid "! (exclamation)" +msgstr "" + +#: ../../library/fnmatch.rst:19 +msgid "- (minus)" +msgstr "" + +#: ../../library/fnmatch.rst:41 +msgid "glob" +msgstr "" diff --git a/library/ftplib.po b/library/ftplib.po index d5d0569b4e..c13fbb3d40 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -470,3 +470,15 @@ msgstr "" #: ../../library/ftplib.rst:467 msgid "Set up clear text data connection." msgstr "" + +#: ../../library/ftplib.rst:9 +msgid "FTP" +msgstr "" + +#: ../../library/ftplib.rst:9 +msgid "protocol" +msgstr "" + +#: ../../library/ftplib.rst:9 +msgid "ftplib (standard module)" +msgstr "" diff --git a/library/functions.po b/library/functions.po index 57acdbef5b..e8d766fccc 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2023-01-04 14:53+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2003,7 +2003,7 @@ msgstr "寫入,如果文件存在則在末尾追加寫入內容" msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1191 +#: ../../library/functions.rst:1191 ../../library/functions.rst:1335 msgid "binary mode" msgstr "二進制模式" @@ -3078,5 +3078,119 @@ msgstr "" "剖析器只接受 Unix 風格的行結束符。如果您從檔案中讀取程式碼,請確保用換行符轉" "換模式轉換 Windows 或 Mac 風格的換行符。" +#: ../../library/functions.rst:152 +msgid "Boolean" +msgstr "" + +#: ../../library/functions.rst:152 ../../library/functions.rst:1825 +msgid "type" +msgstr "" + +#: ../../library/functions.rst:564 +#, fuzzy +msgid "built-in function" +msgstr "內建函式" + +#: ../../library/functions.rst:564 +msgid "exec" +msgstr "" + +#: ../../library/functions.rst:641 +msgid "NaN" +msgstr "" + +#: ../../library/functions.rst:641 +msgid "Infinity" +msgstr "" + +#: ../../library/functions.rst:706 +msgid "__format__" +msgstr "" + +#: ../../library/functions.rst:706 ../../library/functions.rst:1714 +msgid "string" +msgstr "" + +#: ../../library/functions.rst:706 +#, fuzzy +msgid "format() (built-in function)" +msgstr "內建函式" + +#: ../../library/functions.rst:1153 +msgid "file object" +msgstr "" + +#: ../../library/functions.rst:1153 ../../library/functions.rst:1274 +#, fuzzy +msgid "open() built-in function" +msgstr "內建函式" + +#: ../../library/functions.rst:1181 +msgid "file" +msgstr "" + +#: ../../library/functions.rst:1181 +msgid "modes" +msgstr "" + +#: ../../library/functions.rst:1274 +msgid "universal newlines" +msgstr "" + +#: ../../library/functions.rst:1335 +msgid "line-buffered I/O" +msgstr "" + +#: ../../library/functions.rst:1335 +msgid "unbuffered I/O" +msgstr "" + +#: ../../library/functions.rst:1335 +msgid "buffer size, I/O" +msgstr "" + +#: ../../library/functions.rst:1335 +msgid "I/O control" +msgstr "" + +#: ../../library/functions.rst:1335 +msgid "buffering" +msgstr "" + +#: ../../library/functions.rst:1335 +#, fuzzy +msgid "text mode" +msgstr "文字模式(預設)" + +#: ../../library/functions.rst:1335 ../../library/functions.rst:1980 +msgid "module" +msgstr "" + +#: ../../library/functions.rst:1335 +msgid "sys" +msgstr "" + +#: ../../library/functions.rst:1714 +#, fuzzy +msgid "str() (built-in function)" +msgstr "內建函式" + +#: ../../library/functions.rst:1825 +#, fuzzy +msgid "object" +msgstr ":func:`object`" + +#: ../../library/functions.rst:1980 +msgid "statement" +msgstr "" + +#: ../../library/functions.rst:1980 +msgid "import" +msgstr "" + +#: ../../library/functions.rst:1980 +msgid "builtins" +msgstr "" + #~ msgid "The ``'U'`` mode." #~ msgstr "``'U'`` 模式。" diff --git a/library/functools.po b/library/functools.po index e373f1a9b4..e0cc49977a 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-23 00:33+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,21 +53,21 @@ msgid "" "`lru_cache()` with a size limit." msgstr "" -#: ../../library/functools.rst:39 ../../library/functools.rst:283 +#: ../../library/functools.rst:39 ../../library/functools.rst:275 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/functools.rst:52 ../../library/functools.rst:151 +#: ../../library/functools.rst:52 ../../library/functools.rst:143 msgid "" "The cache is threadsafe so that the wrapped function can be used in multiple " "threads. This means that the underlying data structure will remain coherent " "during concurrent updates." msgstr "" -#: ../../library/functools.rst:56 ../../library/functools.rst:155 +#: ../../library/functools.rst:56 ../../library/functools.rst:147 msgid "" "It is possible for the wrapped function to be called more than once if " "another thread makes an additional call before the initial call has been " @@ -82,8 +82,8 @@ msgid "" "computed properties of instances that are otherwise effectively immutable." msgstr "" -#: ../../library/functools.rst:70 ../../library/functools.rst:135 -#: ../../library/functools.rst:375 +#: ../../library/functools.rst:70 ../../library/functools.rst:127 +#: ../../library/functools.rst:367 msgid "Example::" msgstr "" "範例:\n" @@ -132,11 +132,13 @@ msgstr "" #: ../../library/functools.rst:105 msgid "" "If a mutable mapping is not available or if space-efficient key sharing is " -"desired, an effect similar to :func:`cached_property` can be achieved by a " -"stacking :func:`property` on top of :func:`cache`::" +"desired, an effect similar to :func:`cached_property` can also be achieved " +"by stacking :func:`property` on top of :func:`lru_cache`. See :ref:`faq-" +"cache-method-calls` for more details on how this differs from :func:" +"`cached_property`." msgstr "" -#: ../../library/functools.rst:123 +#: ../../library/functools.rst:115 msgid "" "Transform an old-style comparison function to a :term:`key function`. Used " "with tools that accept key functions (such as :func:`sorted`, :func:`min`, :" @@ -146,7 +148,7 @@ msgid "" "comparison functions." msgstr "" -#: ../../library/functools.rst:130 +#: ../../library/functools.rst:122 msgid "" "A comparison function is any callable that accepts two arguments, compares " "them, and returns a negative number for less-than, zero for equality, or a " @@ -154,25 +156,25 @@ msgid "" "one argument and returns another value to be used as the sort key." msgstr "" -#: ../../library/functools.rst:139 +#: ../../library/functools.rst:131 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functools.rst:147 +#: ../../library/functools.rst:139 msgid "" "Decorator to wrap a function with a memoizing callable that saves up to the " "*maxsize* most recent calls. It can save time when an expensive or I/O " "bound function is periodically called with the same arguments." msgstr "" -#: ../../library/functools.rst:159 +#: ../../library/functools.rst:151 msgid "" "Since a dictionary is used to cache results, the positional and keyword " "arguments to the function must be :term:`hashable`." msgstr "" -#: ../../library/functools.rst:162 +#: ../../library/functools.rst:154 msgid "" "Distinct argument patterns may be considered to be distinct calls with " "separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)`` " @@ -180,20 +182,20 @@ msgid "" "entries." msgstr "" -#: ../../library/functools.rst:167 +#: ../../library/functools.rst:159 msgid "" "If *user_function* is specified, it must be a callable. This allows the " "*lru_cache* decorator to be applied directly to a user function, leaving the " "*maxsize* at its default value of 128::" msgstr "" -#: ../../library/functools.rst:175 +#: ../../library/functools.rst:167 msgid "" "If *maxsize* is set to ``None``, the LRU feature is disabled and the cache " "can grow without bound." msgstr "" -#: ../../library/functools.rst:178 +#: ../../library/functools.rst:170 msgid "" "If *typed* is set to true, function arguments of different types will be " "cached separately. If *typed* is false, the implementation will usually " @@ -201,7 +203,7 @@ msgid "" "such as *str* and *int* may be cached separately even when *typed* is false.)" msgstr "" -#: ../../library/functools.rst:184 +#: ../../library/functools.rst:176 msgid "" "Note, type specificity applies only to the function's immediate arguments " "rather than their contents. The scalar arguments, ``Decimal(42)`` and " @@ -210,7 +212,7 @@ msgid "" "Fraction(42))`` are treated as equivalent." msgstr "" -#: ../../library/functools.rst:190 +#: ../../library/functools.rst:182 msgid "" "The wrapped function is instrumented with a :func:`cache_parameters` " "function that returns a new :class:`dict` showing the values for *maxsize* " @@ -218,7 +220,7 @@ msgid "" "has no effect." msgstr "" -#: ../../library/functools.rst:195 +#: ../../library/functools.rst:187 msgid "" "To help measure the effectiveness of the cache and tune the *maxsize* " "parameter, the wrapped function is instrumented with a :func:`cache_info` " @@ -226,32 +228,32 @@ msgid "" "*maxsize* and *currsize*." msgstr "" -#: ../../library/functools.rst:200 +#: ../../library/functools.rst:192 msgid "" "The decorator also provides a :func:`cache_clear` function for clearing or " "invalidating the cache." msgstr "" -#: ../../library/functools.rst:203 +#: ../../library/functools.rst:195 msgid "" "The original underlying function is accessible through the :attr:" "`__wrapped__` attribute. This is useful for introspection, for bypassing " "the cache, or for rewrapping the function with a different cache." msgstr "" -#: ../../library/functools.rst:207 +#: ../../library/functools.rst:199 msgid "" "The cache keeps references to the arguments and return values until they age " "out of the cache or until the cache is cleared." msgstr "" -#: ../../library/functools.rst:210 +#: ../../library/functools.rst:202 msgid "" "If a method is cached, the ``self`` instance argument is included in the " "cache. See :ref:`faq-cache-method-calls`" msgstr "" -#: ../../library/functools.rst:213 +#: ../../library/functools.rst:205 msgid "" "An `LRU (least recently used) cache `_ works best when the " @@ -261,7 +263,7 @@ msgid "" "long-running processes such as web servers." msgstr "" -#: ../../library/functools.rst:220 +#: ../../library/functools.rst:212 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 " @@ -269,44 +271,44 @@ msgid "" "objects on each call, or impure functions such as time() or random()." msgstr "" -#: ../../library/functools.rst:225 +#: ../../library/functools.rst:217 msgid "Example of an LRU cache for static web content::" msgstr "" -#: ../../library/functools.rst:244 +#: ../../library/functools.rst:236 msgid "" "Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " "programming `_ technique::" msgstr "" -#: ../../library/functools.rst:264 +#: ../../library/functools.rst:256 msgid "Added the *typed* option." msgstr "新增 *typed* 選項。" -#: ../../library/functools.rst:267 +#: ../../library/functools.rst:259 msgid "Added the *user_function* option." msgstr "新增 *user_function* 選項。" -#: ../../library/functools.rst:270 +#: ../../library/functools.rst:262 msgid "Added the function :func:`cache_parameters`" msgstr "新增 :func:`cache_parameters` 函式。" -#: ../../library/functools.rst:275 +#: ../../library/functools.rst:267 msgid "" "Given a class defining one or more rich comparison ordering methods, this " "class decorator supplies the rest. This simplifies the effort involved in " "specifying all of the possible rich comparison operations:" msgstr "" -#: ../../library/functools.rst:279 +#: ../../library/functools.rst:271 msgid "" "The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, " "or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` " "method." msgstr "" -#: ../../library/functools.rst:303 +#: ../../library/functools.rst:295 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 " @@ -315,7 +317,7 @@ msgid "" "rich comparison methods instead is likely to provide an easy speed boost." msgstr "" -#: ../../library/functools.rst:312 +#: ../../library/functools.rst:304 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 " @@ -323,13 +325,13 @@ msgid "" "the original method is abstract." msgstr "" -#: ../../library/functools.rst:319 +#: ../../library/functools.rst:311 msgid "" "Returning NotImplemented from the underlying comparison function for " "unrecognised types is now supported." msgstr "" -#: ../../library/functools.rst:325 +#: ../../library/functools.rst:317 msgid "" "Return a new :ref:`partial object` which when called will " "behave like *func* called with the positional arguments *args* and keyword " @@ -338,7 +340,7 @@ msgid "" "extend and override *keywords*. Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:341 +#: ../../library/functools.rst:333 msgid "" "The :func:`partial` is used for partial function application which " "\"freezes\" some portion of a function's arguments and/or keywords resulting " @@ -347,20 +349,20 @@ msgid "" "where the *base* argument defaults to two:" msgstr "" -#: ../../library/functools.rst:356 +#: ../../library/functools.rst:348 msgid "" "Return a new :class:`partialmethod` descriptor which behaves like :class:" "`partial` except that it is designed to be used as a method definition " "rather than being directly callable." msgstr "" -#: ../../library/functools.rst:360 +#: ../../library/functools.rst:352 msgid "" "*func* must be a :term:`descriptor` or a callable (objects which are both, " "like normal functions, are handled as descriptors)." msgstr "" -#: ../../library/functools.rst:363 +#: ../../library/functools.rst:355 msgid "" "When *func* is a descriptor (such as a normal Python function, :func:" "`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another " @@ -369,7 +371,7 @@ msgid "" "objects>` returned as the result." msgstr "" -#: ../../library/functools.rst:369 +#: ../../library/functools.rst:361 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 " @@ -378,7 +380,7 @@ msgid "" "`partialmethod` constructor." msgstr "" -#: ../../library/functools.rst:400 +#: ../../library/functools.rst:392 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 " @@ -391,30 +393,30 @@ msgid "" "the first item is returned." msgstr "" -#: ../../library/functools.rst:409 +#: ../../library/functools.rst:401 msgid "Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:421 +#: ../../library/functools.rst:413 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " "intermediate values." msgstr "" -#: ../../library/functools.rst:426 +#: ../../library/functools.rst:418 msgid "" "Transform a function into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:429 +#: ../../library/functools.rst:421 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " "decorator. When defining a function using ``@singledispatch``, note that the " "dispatch happens on the type of the first argument::" msgstr "" -#: ../../library/functools.rst:440 +#: ../../library/functools.rst:432 msgid "" "To add overloaded implementations to the function, use the :func:`register` " "attribute of the generic function, which can be used as a decorator. For " @@ -422,36 +424,36 @@ msgid "" "first argument automatically::" msgstr "" -#: ../../library/functools.rst:458 +#: ../../library/functools.rst:450 msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::" msgstr "" -#: ../../library/functools.rst:475 +#: ../../library/functools.rst:467 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:486 +#: ../../library/functools.rst:478 msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " "the :func:`register` attribute can also be used in a functional form::" msgstr "" -#: ../../library/functools.rst:494 +#: ../../library/functools.rst:486 msgid "" "The :func:`register` attribute returns the undecorated function. This " "enables decorator stacking, :mod:`pickling`, and the creation of " "unit tests for each variant independently::" msgstr "" -#: ../../library/functools.rst:508 +#: ../../library/functools.rst:500 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "" -#: ../../library/functools.rst:528 +#: ../../library/functools.rst:520 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 " @@ -460,42 +462,42 @@ msgid "" "found." msgstr "" -#: ../../library/functools.rst:534 +#: ../../library/functools.rst:526 msgid "" "If an implementation is registered to an :term:`abstract base class`, " "virtual subclasses of the base class will be dispatched to that " "implementation::" msgstr "" -#: ../../library/functools.rst:549 +#: ../../library/functools.rst:541 msgid "" "To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" -#: ../../library/functools.rst:557 +#: ../../library/functools.rst:549 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "" -#: ../../library/functools.rst:571 +#: ../../library/functools.rst:563 msgid "The :func:`register` attribute now supports using type annotations." msgstr "" -#: ../../library/functools.rst:574 +#: ../../library/functools.rst:566 msgid "" "The :func:`register` attribute now supports :data:`types.UnionType` and :" "data:`typing.Union` as type annotations." msgstr "" -#: ../../library/functools.rst:581 +#: ../../library/functools.rst:573 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:584 +#: ../../library/functools.rst:576 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. When defining a function using ``@singledispatchmethod``, note " @@ -503,7 +505,7 @@ msgid "" "argument::" msgstr "" -#: ../../library/functools.rst:602 +#: ../../library/functools.rst:594 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" "func:`@classmethod`. Note that to allow for ``dispatcher." @@ -512,14 +514,14 @@ msgid "" "rather than an instance of the class::" msgstr "" -#: ../../library/functools.rst:624 +#: ../../library/functools.rst:616 msgid "" "The same pattern can be used for other similar decorators: :func:" "`@staticmethod`, :func:`@abstractmethod`, " "and others." msgstr "" -#: ../../library/functools.rst:633 +#: ../../library/functools.rst:625 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -533,7 +535,7 @@ msgid "" "``__dict__``, i.e. the instance dictionary)." msgstr "" -#: ../../library/functools.rst:643 +#: ../../library/functools.rst:635 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -541,7 +543,7 @@ msgid "" "that refers to the function being wrapped." msgstr "" -#: ../../library/functools.rst:648 +#: ../../library/functools.rst:640 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 " @@ -550,7 +552,7 @@ msgid "" "is typically less than helpful." msgstr "" -#: ../../library/functools.rst:654 +#: ../../library/functools.rst:646 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 " @@ -559,26 +561,26 @@ msgid "" "wrapper function itself is missing any attributes named in *updated*." msgstr "" -#: ../../library/functools.rst:660 +#: ../../library/functools.rst:652 msgid "Automatic addition of the ``__wrapped__`` attribute." msgstr "" -#: ../../library/functools.rst:663 +#: ../../library/functools.rst:655 msgid "Copying of the ``__annotations__`` attribute by default." msgstr "" -#: ../../library/functools.rst:666 +#: ../../library/functools.rst:658 msgid "Missing attributes no longer trigger an :exc:`AttributeError`." msgstr "" -#: ../../library/functools.rst:669 +#: ../../library/functools.rst:661 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -#: ../../library/functools.rst:677 +#: ../../library/functools.rst:669 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -586,42 +588,42 @@ msgid "" "updated=updated)``. For example::" msgstr "" -#: ../../library/functools.rst:703 +#: ../../library/functools.rst:695 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" "`example` would have been lost." msgstr "" -#: ../../library/functools.rst:711 +#: ../../library/functools.rst:703 msgid ":class:`partial` Objects" msgstr ":class:`partial` 物件" -#: ../../library/functools.rst:713 +#: ../../library/functools.rst:705 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" msgstr "" -#: ../../library/functools.rst:719 +#: ../../library/functools.rst:711 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." msgstr "" -#: ../../library/functools.rst:725 +#: ../../library/functools.rst:717 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." msgstr "" -#: ../../library/functools.rst:731 +#: ../../library/functools.rst:723 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" -#: ../../library/functools.rst:734 +#: ../../library/functools.rst:726 msgid "" ":class:`partial` objects are like :class:`function` objects in that they are " "callable, weak referencable, and can have attributes. There are some " diff --git a/library/gettext.po b/library/gettext.po index 39887b18d1..5b990832ec 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -761,3 +761,15 @@ msgstr "" #: ../../library/gettext.rst:649 msgid "See the footnote for :func:`bindtextdomain` above." msgstr "請見上方 :func:`bindtextdomain` 之註解。" + +#: ../../library/gettext.rst:56 +msgid "_ (underscore)" +msgstr "" + +#: ../../library/gettext.rst:56 +msgid "gettext" +msgstr "" + +#: ../../library/gettext.rst:397 +msgid "GNOME" +msgstr "" diff --git a/library/glob.po b/library/glob.po index b4ac2edb63..9f8739884d 100644 --- a/library/glob.po +++ b/library/glob.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -162,3 +162,43 @@ msgstr ":mod:`fnmatch` 模組" #: ../../library/glob.rst:151 msgid "Shell-style filename (not path) expansion" msgstr "" + +#: ../../library/glob.rst:9 +msgid "filenames" +msgstr "" + +#: ../../library/glob.rst:9 +msgid "pathname expansion" +msgstr "" + +#: ../../library/glob.rst:13 +msgid "* (asterisk)" +msgstr "" + +#: ../../library/glob.rst:13 ../../library/glob.rst:63 +msgid "in glob-style wildcards" +msgstr "" + +#: ../../library/glob.rst:13 +msgid "? (question mark)" +msgstr "" + +#: ../../library/glob.rst:13 +msgid "[] (square brackets)" +msgstr "" + +#: ../../library/glob.rst:13 +msgid "! (exclamation)" +msgstr "" + +#: ../../library/glob.rst:13 +msgid "- (minus)" +msgstr "" + +#: ../../library/glob.rst:13 +msgid ". (dot)" +msgstr "" + +#: ../../library/glob.rst:63 +msgid "**" +msgstr "" diff --git a/library/hashlib.po b/library/hashlib.po index cadc52c2c5..64c54e7963 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -876,3 +876,23 @@ msgstr "" #: ../../library/hashlib.rst:804 msgid "NIST Recommendation for Password-Based Key Derivation." msgstr "" + +#: ../../library/hashlib.rst:12 +msgid "message digest, MD5" +msgstr "" + +#: ../../library/hashlib.rst:12 +msgid "secure hash algorithm, SHA1, SHA224, SHA256, SHA384, SHA512" +msgstr "" + +#: ../../library/hashlib.rst:64 +msgid "OpenSSL" +msgstr "" + +#: ../../library/hashlib.rst:64 +msgid "(use in module hashlib)" +msgstr "" + +#: ../../library/hashlib.rst:343 +msgid "blake2b, blake2s" +msgstr "" diff --git a/library/html.parser.po b/library/html.parser.po index b0698b90f0..596168dd88 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-18 00:10+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -133,8 +133,8 @@ msgstr "" #: ../../library/html.parser.rst:129 msgid "" -"This method is called to handle the start tag of an element (e.g. ``
``)." +"This method is called to handle the start tag of an element (e.g. ``
``)." msgstr "" #: ../../library/html.parser.rst:131 @@ -303,3 +303,11 @@ msgstr "" #: ../../library/html.parser.rst:331 msgid "Parsing invalid HTML (e.g. unquoted attributes) also works::" msgstr "" + +#: ../../library/html.parser.rst:9 +msgid "HTML" +msgstr "" + +#: ../../library/html.parser.rst:9 +msgid "XHTML" +msgstr "" diff --git a/library/http.client.po b/library/http.client.po index 0c31f7b75c..36afdd2ff7 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -626,3 +626,23 @@ msgid "" "An :class:`http.client.HTTPMessage` instance holds the headers from an HTTP " "response. It is implemented using the :class:`email.message.Message` class." msgstr "" + +#: ../../library/http.client.rst:9 +msgid "HTTP" +msgstr "" + +#: ../../library/http.client.rst:9 +msgid "protocol" +msgstr "" + +#: ../../library/http.client.rst:9 +msgid "http.client (standard module)" +msgstr "" + +#: ../../library/http.client.rst:13 +msgid "module" +msgstr "" + +#: ../../library/http.client.rst:13 +msgid "urllib.request" +msgstr "" diff --git a/library/http.po b/library/http.po index b125c79d38..67abda0d47 100644 --- a/library/http.po +++ b/library/http.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-26 00:17+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -966,6 +966,18 @@ msgstr "``PATCH``" msgid "HTTP/1.1 :rfc:`5789`" msgstr "HTTP/1.1 :rfc:`5789`" +#: ../../library/http.rst:9 +msgid "HTTP" +msgstr "" + +#: ../../library/http.rst:9 +msgid "protocol" +msgstr "" + +#: ../../library/http.rst:9 +msgid "http (standard module)" +msgstr "" + #~ msgid "" #~ ":mod:`http` is also a module that defines a number of HTTP status codes " #~ "and associated messages through the :class:`http.HTTPStatus` enum:" diff --git a/library/http.server.po b/library/http.server.po index a3f615ef16..9ccca9664e 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -634,3 +634,35 @@ msgstr "" #: ../../library/http.server.rst:522 msgid "Control characters are scrubbed in stderr logs." msgstr "" + +#: ../../library/http.server.rst:9 +msgid "WWW" +msgstr "" + +#: ../../library/http.server.rst:9 +msgid "server" +msgstr "" + +#: ../../library/http.server.rst:9 +msgid "HTTP" +msgstr "" + +#: ../../library/http.server.rst:9 +msgid "protocol" +msgstr "" + +#: ../../library/http.server.rst:9 +msgid "URL" +msgstr "" + +#: ../../library/http.server.rst:9 +msgid "httpd" +msgstr "" + +#: ../../library/http.server.rst:510 +msgid "http.server" +msgstr "" + +#: ../../library/http.server.rst:510 +msgid "security" +msgstr "" diff --git a/library/idle.po b/library/idle.po index f8aa0de1f6..ba18ee12a9 100644 --- a/library/idle.po +++ b/library/idle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-12 00:15+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/idle.rst:4 +#: ../../library/idle.rst:4 ../../library/idle.rst:10 msgid "IDLE" msgstr "IDLE" @@ -244,7 +244,8 @@ msgstr "選擇全部" msgid "Select the entire contents of the current window." msgstr "" -#: ../../library/idle.rst:124 ../../library/idle.rst:370 +#: ../../library/idle.rst:124 ../../library/idle.rst:355 +#: ../../library/idle.rst:370 msgid "Cut" msgstr "剪下" @@ -253,7 +254,8 @@ msgid "" "Copy selection into the system-wide clipboard; then delete the selection." msgstr "" -#: ../../library/idle.rst:127 ../../library/idle.rst:373 +#: ../../library/idle.rst:127 ../../library/idle.rst:355 +#: ../../library/idle.rst:373 msgid "Copy" msgstr "複製" @@ -261,7 +263,8 @@ msgstr "複製" msgid "Copy selection into the system-wide clipboard." msgstr "" -#: ../../library/idle.rst:130 ../../library/idle.rst:376 +#: ../../library/idle.rst:130 ../../library/idle.rst:355 +#: ../../library/idle.rst:376 msgid "Paste" msgstr "貼上" @@ -736,7 +739,7 @@ msgid "" "directory." msgstr "" -#: ../../library/idle.rst:384 +#: ../../library/idle.rst:355 ../../library/idle.rst:384 msgid "Set Breakpoint" msgstr "" @@ -744,7 +747,7 @@ msgstr "" msgid "Set a breakpoint on the current line." msgstr "" -#: ../../library/idle.rst:387 +#: ../../library/idle.rst:355 ../../library/idle.rst:387 msgid "Clear Breakpoint" msgstr "" @@ -1632,3 +1635,35 @@ msgid "" "listed under 'Startup', the idlelib code is 'private' in sense that feature " "changes can be backported (see :pep:`434`)." msgstr "" + +#: ../../library/idle.rst:10 +msgid "Python Editor" +msgstr "" + +#: ../../library/idle.rst:10 +msgid "Integrated Development Environment" +msgstr "" + +#: ../../library/idle.rst:70 +msgid "Module browser" +msgstr "" + +#: ../../library/idle.rst:70 +msgid "Path browser" +msgstr "" + +#: ../../library/idle.rst:212 +msgid "Run script" +msgstr "" + +#: ../../library/idle.rst:279 +msgid "debugger" +msgstr "" + +#: ../../library/idle.rst:279 +msgid "stack viewer" +msgstr "" + +#: ../../library/idle.rst:355 +msgid "breakpoints" +msgstr "" diff --git a/library/imaplib.po b/library/imaplib.po index 96e6744672..685d9dfd03 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -689,3 +689,19 @@ msgid "" "Here is a minimal example (without error checking) that opens a mailbox and " "retrieves and prints all messages::" msgstr "" + +#: ../../library/imaplib.rst:16 +msgid "IMAP4" +msgstr "" + +#: ../../library/imaplib.rst:16 +msgid "protocol" +msgstr "" + +#: ../../library/imaplib.rst:16 +msgid "IMAP4_SSL" +msgstr "" + +#: ../../library/imaplib.rst:16 +msgid "IMAP4_stream" +msgstr "" diff --git a/library/imp.po b/library/imp.po index 4e8483c865..bbe4240300 100644 --- a/library/imp.po +++ b/library/imp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -459,3 +459,19 @@ msgid "" "work in that version, since :func:`find_module` has been extended and :func:" "`load_module` has been added in 1.4.) ::" msgstr "" + +#: ../../library/imp.rst:13 +msgid "statement" +msgstr "" + +#: ../../library/imp.rst:13 +msgid "import" +msgstr "" + +#: ../../library/imp.rst:23 +msgid "file" +msgstr "" + +#: ../../library/imp.rst:23 +msgid "byte-code" +msgstr "" diff --git a/library/importlib.po b/library/importlib.po index 3ade64a5de..3948e88467 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-11 00:28+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1782,6 +1782,14 @@ msgid "" "approximate implementation of :func:`importlib.import_module`::" msgstr "" +#: ../../library/importlib.rst:551 +msgid "universal newlines" +msgstr "" + +#: ../../library/importlib.rst:551 +msgid "importlib.abc.InspectLoader.get_source method" +msgstr "" + #~ msgid "**Source code:** :source:`Lib/importlib/resources.py`" #~ msgstr "**原始碼:**\\ :source:`Lib/importlib/resources.py`" diff --git a/library/internet.po b/library/internet.po index db59da1d68..a59fbcf424 100644 --- a/library/internet.po +++ b/library/internet.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,3 +30,23 @@ msgid "" "`socket`, which is currently supported on most popular platforms. Here is " "an overview:" msgstr "" + +#: ../../library/internet.rst:7 +msgid "WWW" +msgstr "" + +#: ../../library/internet.rst:7 +msgid "Internet" +msgstr "" + +#: ../../library/internet.rst:7 +msgid "World Wide Web" +msgstr "" + +#: ../../library/internet.rst:12 +msgid "module" +msgstr "" + +#: ../../library/internet.rst:12 +msgid "socket" +msgstr "" diff --git a/library/io.po b/library/io.po index b0cd8728a7..b1a2298b7a 100644 --- a/library/io.po +++ b/library/io.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1551,3 +1551,23 @@ msgid "" "includes standard streams and therefore affects the built-in :func:`print()` " "function as well." msgstr "" + +#: ../../library/io.rst:24 +msgid "file object" +msgstr "" + +#: ../../library/io.rst:24 +msgid "io module" +msgstr "" + +#: ../../library/io.rst:970 ../../library/io.rst:1094 +msgid "universal newlines" +msgstr "" + +#: ../../library/io.rst:970 +msgid "io.TextIOWrapper class" +msgstr "" + +#: ../../library/io.rst:1094 +msgid "io.IncrementalNewlineDecoder class" +msgstr "" diff --git a/library/linecache.po b/library/linecache.po index 6e5adcb472..8d0756bc93 100644 --- a/library/linecache.po +++ b/library/linecache.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -90,3 +90,15 @@ msgstr "" "範例:\n" "\n" "::" + +#: ../../library/linecache.rst:31 +msgid "module" +msgstr "" + +#: ../../library/linecache.rst:31 +msgid "search" +msgstr "" + +#: ../../library/linecache.rst:31 +msgid "path" +msgstr "" diff --git a/library/locale.po b/library/locale.po index 17e1640962..dc10b3f180 100644 --- a/library/locale.po +++ b/library/locale.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-06 00:16+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -869,3 +869,15 @@ msgid "" "necessary to bind the text domain, so that the libraries can properly locate " "their message catalogs." msgstr "" + +#: ../../library/locale.rst:19 ../../library/locale.rst:479 +msgid "module" +msgstr "" + +#: ../../library/locale.rst:19 +msgid "_locale" +msgstr "" + +#: ../../library/locale.rst:479 +msgid "string" +msgstr "" diff --git a/library/logging.po b/library/logging.po index be59a4b686..f49f5872c3 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-25 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2068,3 +2068,12 @@ msgid "" "2.1.x and 2.2.x, which do not include the :mod:`logging` package in the " "standard library." msgstr "" + +#: ../../library/logging.rst:12 +#, fuzzy +msgid "Errors" +msgstr "*errors*" + +#: ../../library/logging.rst:12 +msgid "logging" +msgstr "" diff --git a/library/marshal.po b/library/marshal.po index 97f9b8f47f..8fa80c5368 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2021-12-15 12:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -245,3 +245,27 @@ msgstr "" "\"marshal\" 來表示自包含 (self-contained) 形式資料的傳輸。嚴格來說,將資料從" "內部形式轉換為外部形式 (例如用於 RPC 緩衝區) 稱為 \"marshal\",而其反向過程則" "稱為 \"unmarshal\"。" + +#: ../../library/marshal.rst:17 +msgid "module" +msgstr "" + +#: ../../library/marshal.rst:17 +msgid "pickle" +msgstr "" + +#: ../../library/marshal.rst:17 +msgid "shelve" +msgstr "" + +#: ../../library/marshal.rst:37 +msgid "object" +msgstr "" + +#: ../../library/marshal.rst:37 +msgid "code" +msgstr "" + +#: ../../library/marshal.rst:37 +msgid "code object" +msgstr "" diff --git a/library/mimetypes.po b/library/mimetypes.po index 3e6b637c47..2318ad94ef 100644 --- a/library/mimetypes.po +++ b/library/mimetypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2016-11-19 00:32+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -315,3 +315,23 @@ msgstr "" #: ../../library/mimetypes.rst:269 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" + +#: ../../library/mimetypes.rst:11 ../../library/mimetypes.rst:31 +msgid "MIME" +msgstr "" + +#: ../../library/mimetypes.rst:11 +msgid "content type" +msgstr "" + +#: ../../library/mimetypes.rst:31 +msgid "headers" +msgstr "" + +#: ../../library/mimetypes.rst:130 +msgid "file" +msgstr "" + +#: ../../library/mimetypes.rst:130 +msgid "mime.types" +msgstr "" diff --git a/library/msilib.po b/library/msilib.po index 4166097ece..3c4fb16175 100644 --- a/library/msilib.po +++ b/library/msilib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,8 +31,8 @@ msgid "" "The :mod:`msilib` module is deprecated (see :pep:`PEP 594 <594#msilib>` for " "details)." msgstr "" -":mod:`msilib` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#msilib>`" -"\\ )。" +":mod:`msilib` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +"<594#msilib>`\\ )。" #: ../../library/msilib.rst:22 msgid "" @@ -617,3 +617,7 @@ msgid "" "This module contains definitions for the UIText and ActionText tables, for " "the standard installer actions." msgstr "" + +#: ../../library/msilib.rst:14 +msgid "msi" +msgstr "" diff --git a/library/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index 9af34a406c..06768793bf 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-26 00:21+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -276,3 +276,15 @@ msgid "" "deserialized object has the same unique name and is just attached to an " "existing object with the same name (if the object is still alive):" msgstr "" + +#: ../../library/multiprocessing.shared_memory.rst:11 +msgid "Shared Memory" +msgstr "" + +#: ../../library/multiprocessing.shared_memory.rst:11 +msgid "POSIX Shared Memory" +msgstr "" + +#: ../../library/multiprocessing.shared_memory.rst:11 +msgid "Named Shared Memory" +msgstr "" diff --git a/library/nntplib.po b/library/nntplib.po index 3c99595c58..f3a1e9cacc 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -570,3 +570,15 @@ msgid "" "returned. Using this function is recommended to display some headers in a " "human readable form::" msgstr "" + +#: ../../library/nntplib.rst:10 +msgid "NNTP" +msgstr "" + +#: ../../library/nntplib.rst:10 +msgid "protocol" +msgstr "" + +#: ../../library/nntplib.rst:10 +msgid "Network News Transfer Protocol" +msgstr "" diff --git a/library/os.path.po b/library/os.path.po index c692e51960..7895528685 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -494,3 +494,43 @@ msgid "" "``True`` if arbitrary Unicode strings can be used as file names (within " "limitations imposed by the file system)." msgstr "" + +#: ../../library/os.path.rst:10 +msgid "path" +msgstr "" + +#: ../../library/os.path.rst:10 +msgid "operations" +msgstr "" + +#: ../../library/os.path.rst:155 +msgid "~ (tilde)" +msgstr "" + +#: ../../library/os.path.rst:155 +msgid "home directory expansion" +msgstr "" + +#: ../../library/os.path.rst:162 +msgid "module" +msgstr "" + +#: ../../library/os.path.rst:162 +msgid "pwd" +msgstr "" + +#: ../../library/os.path.rst:183 +msgid "$ (dollar)" +msgstr "" + +#: ../../library/os.path.rst:183 +msgid "environment variables expansion" +msgstr "" + +#: ../../library/os.path.rst:183 +msgid "% (percent)" +msgstr "" + +#: ../../library/os.path.rst:183 +msgid "environment variables expansion (Windows)" +msgstr "" diff --git a/library/os.po b/library/os.po index 9359a5c375..68d47da3e9 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -5532,3 +5532,145 @@ msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." msgstr "" + +#: ../../library/os.rst:363 ../../library/os.rst:518 ../../library/os.rst:682 +msgid "user" +msgstr "" + +#: ../../library/os.rst:363 +msgid "effective id" +msgstr "" + +#: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 +#: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:617 +#: ../../library/os.rst:3916 ../../library/os.rst:3943 +msgid "process" +msgstr "" + +#: ../../library/os.rst:372 ../../library/os.rst:438 +msgid "group" +msgstr "" + +#: ../../library/os.rst:447 ../../library/os.rst:518 +msgid "id" +msgstr "" + +#: ../../library/os.rst:456 +msgid "id of parent" +msgstr "" + +#: ../../library/os.rst:470 ../../library/os.rst:617 +msgid "scheduling priority" +msgstr "" + +#: ../../library/os.rst:541 ../../library/os.rst:747 +msgid "environment variables" +msgstr "" + +#: ../../library/os.rst:541 +msgid "setting" +msgstr "" + +#: ../../library/os.rst:682 +msgid "id, setting" +msgstr "" + +#: ../../library/os.rst:715 +msgid "gethostname() (in module socket)" +msgstr "" + +#: ../../library/os.rst:715 +msgid "gethostbyaddr() (in module socket)" +msgstr "" + +#: ../../library/os.rst:747 ../../library/os.rst:2357 +msgid "deleting" +msgstr "" + +#: ../../library/os.rst:1188 ../../library/os.rst:2710 +msgid "module" +msgstr "" + +#: ../../library/os.rst:1188 +msgid "pty" +msgstr "" + +#: ../../library/os.rst:1824 ../../library/os.rst:2155 +#: ../../library/os.rst:2357 ../../library/os.rst:3208 +#: ../../library/os.rst:3307 +msgid "directory" +msgstr "" + +#: ../../library/os.rst:1824 +msgid "changing" +msgstr "" + +#: ../../library/os.rst:2155 +msgid "creating" +msgstr "" + +#: ../../library/os.rst:2155 +msgid "UNC paths" +msgstr "" + +#: ../../library/os.rst:2155 +msgid "and os.makedirs()" +msgstr "" + +#: ../../library/os.rst:2710 +msgid "stat" +msgstr "" + +#: ../../library/os.rst:3208 ../../library/os.rst:3307 +msgid "walking" +msgstr "" + +#: ../../library/os.rst:3208 ../../library/os.rst:3307 +msgid "traversal" +msgstr "" + +#: ../../library/os.rst:3916 ../../library/os.rst:3943 +msgid "killing" +msgstr "" + +#: ../../library/os.rst:3916 ../../library/os.rst:3943 +msgid "signalling" +msgstr "" + +#: ../../library/os.rst:4921 ../../library/os.rst:4957 +msgid ". (dot)" +msgstr "" + +#: ../../library/os.rst:4921 ../../library/os.rst:4929 +#: ../../library/os.rst:4937 ../../library/os.rst:4948 +#: ../../library/os.rst:4957 +msgid "in pathnames" +msgstr "" + +#: ../../library/os.rst:4929 +msgid ".." +msgstr "" + +#: ../../library/os.rst:4937 ../../library/os.rst:4948 +msgid "/ (slash)" +msgstr "" + +#: ../../library/os.rst:4938 +msgid "\\ (backslash)" +msgstr "" + +#: ../../library/os.rst:4938 +msgid "in pathnames (Windows)" +msgstr "" + +#: ../../library/os.rst:4964 +msgid ": (colon)" +msgstr "" + +#: ../../library/os.rst:4964 +msgid "path separator (POSIX)" +msgstr "" + +#: ../../library/os.rst:4964 +msgid "; (semicolon)" +msgstr "" diff --git a/library/pathlib.po b/library/pathlib.po index 2c00aabca9..c683d0c190 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1207,3 +1207,11 @@ msgid "" ":meth:`PurePath.relative_to` requires ``self`` to be the subpath of the " "argument, but :func:`os.path.relpath` does not." msgstr "" + +#: ../../library/pathlib.rst:12 +msgid "path" +msgstr "" + +#: ../../library/pathlib.rst:12 +msgid "operations" +msgstr "" diff --git a/library/pdb.po b/library/pdb.po index e7970946a9..c68ce511d4 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -690,3 +690,39 @@ msgid "" "Whether a frame is considered to originate in a certain module is determined " "by the ``__name__`` in the frame globals." msgstr "" + +#: ../../library/pdb.rst:11 +msgid "debugging" +msgstr "" + +#: ../../library/pdb.rst:21 +msgid "Pdb (class in pdb)" +msgstr "" + +#: ../../library/pdb.rst:21 +msgid "module" +msgstr "" + +#: ../../library/pdb.rst:21 +msgid "bdb" +msgstr "" + +#: ../../library/pdb.rst:21 +msgid "cmd" +msgstr "" + +#: ../../library/pdb.rst:266 +msgid ".pdbrc" +msgstr "" + +#: ../../library/pdb.rst:266 +msgid "file" +msgstr "" + +#: ../../library/pdb.rst:266 +msgid "debugger" +msgstr "" + +#: ../../library/pdb.rst:266 +msgid "configuration" +msgstr "" diff --git a/library/pickle.po b/library/pickle.po index 2225cbf6da..bd4514ebb2 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1403,3 +1403,63 @@ msgid "" "kind of newline characters occurs in persistent IDs, the resulting pickled " "data will become unreadable." msgstr "" + +#: ../../library/pickle.rst:12 +msgid "persistence" +msgstr "" + +#: ../../library/pickle.rst:12 +msgid "persistent" +msgstr "" + +#: ../../library/pickle.rst:12 +msgid "objects" +msgstr "" + +#: ../../library/pickle.rst:12 +msgid "serializing" +msgstr "" + +#: ../../library/pickle.rst:12 +msgid "marshalling" +msgstr "" + +#: ../../library/pickle.rst:12 +msgid "flattening" +msgstr "" + +#: ../../library/pickle.rst:12 +msgid "pickling" +msgstr "" + +#: ../../library/pickle.rst:123 +msgid "External Data Representation" +msgstr "" + +#: ../../library/pickle.rst:663 +msgid "copy" +msgstr "" + +#: ../../library/pickle.rst:663 +msgid "protocol" +msgstr "" + +#: ../../library/pickle.rst:746 +msgid "persistent_id (pickle protocol)" +msgstr "" + +#: ../../library/pickle.rst:746 +msgid "persistent_load (pickle protocol)" +msgstr "" + +#: ../../library/pickle.rst:822 +msgid "__getstate__() (copy protocol)" +msgstr "" + +#: ../../library/pickle.rst:822 +msgid "__setstate__() (copy protocol)" +msgstr "" + +#: ../../library/pickle.rst:1067 +msgid "find_class() (pickle protocol)" +msgstr "" diff --git a/library/plistlib.po b/library/plistlib.po index 824c46c83e..6abe3a32a9 100644 --- a/library/plistlib.po +++ b/library/plistlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2016-01-31 07:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -224,3 +224,15 @@ msgstr "" #: ../../library/plistlib.rst:182 msgid "Parsing a plist::" msgstr "" + +#: ../../library/plistlib.rst:13 +msgid "plist" +msgstr "" + +#: ../../library/plistlib.rst:13 +msgid "file" +msgstr "" + +#: ../../library/plistlib.rst:13 +msgid "property list" +msgstr "" diff --git a/library/poplib.po b/library/poplib.po index a3764f5e2f..911c723bd1 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -329,3 +329,11 @@ msgid "" "At the end of the module, there is a test section that contains a more " "extensive example of usage." msgstr "" + +#: ../../library/poplib.rst:12 +msgid "POP3" +msgstr "" + +#: ../../library/poplib.rst:12 +msgid "protocol" +msgstr "" diff --git a/library/posix.po b/library/posix.po index 87b6f328f2..4c88ffb801 100644 --- a/library/posix.po +++ b/library/posix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -113,3 +113,19 @@ msgid "" "module version of this is recommended over direct access to the :mod:`posix` " "module." msgstr "" + +#: ../../library/posix.rst:14 +msgid "module" +msgstr "" + +#: ../../library/posix.rst:14 +msgid "os" +msgstr "" + +#: ../../library/posix.rst:34 +msgid "large files" +msgstr "" + +#: ../../library/posix.rst:34 +msgid "file" +msgstr "" diff --git a/library/pprint.po b/library/pprint.po index c79aae4d28..2402d59936 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -287,3 +287,19 @@ msgid "" "Additionally, maximum character *width* can be suggested. If a long object " "cannot be split, the specified width will be exceeded::" msgstr "" + +#: ../../library/pprint.rst:39 +msgid "..." +msgstr "" + +#: ../../library/pprint.rst:39 +msgid "placeholder" +msgstr "" + +#: ../../library/pprint.rst:162 ../../library/pprint.rst:217 +msgid "built-in function" +msgstr "" + +#: ../../library/pprint.rst:162 ../../library/pprint.rst:217 +msgid "eval" +msgstr "" diff --git a/library/profile.po b/library/profile.po index a840dc1566..29864f6294 100644 --- a/library/profile.po +++ b/library/profile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-03 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -963,3 +963,11 @@ msgid "" "make precise measurements of process or wall-clock time. For example, see :" "func:`time.perf_counter`." msgstr "" + +#: ../../library/profile.rst:16 +msgid "deterministic profiling" +msgstr "" + +#: ../../library/profile.rst:16 +msgid "profiling, deterministic" +msgstr "" diff --git a/library/pwd.po b/library/pwd.po index 22f8ac986d..0037de05d6 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -192,3 +192,11 @@ msgstr ":mod:`spwd` 模組" #: ../../library/pwd.rst:77 msgid "An interface to the shadow password database, similar to this." msgstr "" + +#: ../../library/pwd.rst:42 +msgid "module" +msgstr "" + +#: ../../library/pwd.rst:42 +msgid "crypt" +msgstr "" diff --git a/library/py_compile.po b/library/py_compile.po index feda0b5b85..9f79373643 100644 --- a/library/py_compile.po +++ b/library/py_compile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-30 00:15+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -206,3 +206,11 @@ msgstr ":mod:`compileall` 模組" #: ../../library/py_compile.rst:161 msgid "Utilities to compile all Python source files in a directory tree." msgstr "" + +#: ../../library/py_compile.rst:12 +msgid "file" +msgstr "" + +#: ../../library/py_compile.rst:12 +msgid "byte-code" +msgstr "" diff --git a/library/pydoc.po b/library/pydoc.po index 2ff4f04c55..972614d5ae 100644 --- a/library/pydoc.po +++ b/library/pydoc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-30 00:15+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -157,3 +157,19 @@ msgstr "" #: ../../library/pydoc.rst:108 msgid "Added the ``-n`` option." msgstr "新增 ``-n`` 選項。" + +#: ../../library/pydoc.rst:12 +msgid "documentation" +msgstr "" + +#: ../../library/pydoc.rst:12 +msgid "generation" +msgstr "" + +#: ../../library/pydoc.rst:12 +msgid "online" +msgstr "" + +#: ../../library/pydoc.rst:12 +msgid "help" +msgstr "" diff --git a/library/pyexpat.po b/library/pyexpat.po index f568d05c00..aa5672e90c 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -839,3 +839,15 @@ msgid "" "www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl and https://www.iana." "org/assignments/character-sets/character-sets.xhtml." msgstr "" + +#: ../../library/pyexpat.rst:26 +msgid "Expat" +msgstr "" + +#: ../../library/pyexpat.rst:36 +msgid "module" +msgstr "" + +#: ../../library/pyexpat.rst:36 +msgid "pyexpat" +msgstr "" diff --git a/library/quopri.po b/library/quopri.po index 41f00a0bef..464620c7a6 100644 --- a/library/quopri.po +++ b/library/quopri.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -79,3 +79,19 @@ msgstr ":mod:`base64` 模組" #: ../../library/quopri.rst:63 msgid "Encode and decode MIME base64 data" msgstr "" + +#: ../../library/quopri.rst:9 +msgid "quoted-printable" +msgstr "" + +#: ../../library/quopri.rst:9 +msgid "encoding" +msgstr "" + +#: ../../library/quopri.rst:9 +msgid "MIME" +msgstr "" + +#: ../../library/quopri.rst:9 +msgid "quoted-printable encoding" +msgstr "" diff --git a/library/re.po b/library/re.po index 82b0c16b44..30cb0d393f 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-05 00:37+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1943,3 +1943,228 @@ msgid "" "first edition covered writing good regular expression patterns in great " "detail." msgstr "" + +#: ../../library/re.rst:99 +msgid ". (dot)" +msgstr "" + +#: ../../library/re.rst:99 ../../library/re.rst:106 ../../library/re.rst:112 +#: ../../library/re.rst:123 ../../library/re.rst:130 ../../library/re.rst:137 +#: ../../library/re.rst:143 ../../library/re.rst:157 ../../library/re.rst:181 +#: ../../library/re.rst:220 ../../library/re.rst:235 ../../library/re.rst:244 +#: ../../library/re.rst:257 ../../library/re.rst:263 ../../library/re.rst:296 +#: ../../library/re.rst:309 ../../library/re.rst:319 ../../library/re.rst:345 +#: ../../library/re.rst:394 ../../library/re.rst:425 ../../library/re.rst:431 +#: ../../library/re.rst:436 ../../library/re.rst:443 ../../library/re.rst:450 +#: ../../library/re.rst:477 ../../library/re.rst:487 ../../library/re.rst:508 +#: ../../library/re.rst:520 ../../library/re.rst:525 ../../library/re.rst:541 +#: ../../library/re.rst:552 ../../library/re.rst:564 ../../library/re.rst:571 +#: ../../library/re.rst:585 ../../library/re.rst:592 ../../library/re.rst:606 +#: ../../library/re.rst:615 ../../library/re.rst:620 ../../library/re.rst:784 +#: ../../library/re.rst:990 +msgid "in regular expressions" +msgstr "" + +#: ../../library/re.rst:106 ../../library/re.rst:263 +msgid "^ (caret)" +msgstr "" + +#: ../../library/re.rst:112 +msgid "$ (dollar)" +msgstr "" + +#: ../../library/re.rst:123 +msgid "* (asterisk)" +msgstr "" + +#: ../../library/re.rst:130 +msgid "+ (plus)" +msgstr "" + +#: ../../library/re.rst:137 +msgid "? (question mark)" +msgstr "" + +#: ../../library/re.rst:143 +msgid "*?" +msgstr "" + +#: ../../library/re.rst:143 +msgid "+?" +msgstr "" + +#: ../../library/re.rst:143 +msgid "??" +msgstr "" + +#: ../../library/re.rst:157 +msgid "*+" +msgstr "" + +#: ../../library/re.rst:157 +msgid "++" +msgstr "" + +#: ../../library/re.rst:157 +msgid "?+" +msgstr "" + +#: ../../library/re.rst:181 +msgid "{} (curly brackets)" +msgstr "" + +#: ../../library/re.rst:220 ../../library/re.rst:257 ../../library/re.rst:508 +msgid "\\ (backslash)" +msgstr "" + +#: ../../library/re.rst:235 +msgid "[] (square brackets)" +msgstr "" + +#: ../../library/re.rst:244 +msgid "- (minus)" +msgstr "" + +#: ../../library/re.rst:296 +msgid "| (vertical bar)" +msgstr "" + +#: ../../library/re.rst:309 +msgid "() (parentheses)" +msgstr "" + +#: ../../library/re.rst:319 +msgid "(?" +msgstr "" + +#: ../../library/re.rst:345 +msgid "(?:" +msgstr "" + +#: ../../library/re.rst:394 +msgid "(?P<" +msgstr "" + +#: ../../library/re.rst:425 +msgid "(?P=" +msgstr "" + +#: ../../library/re.rst:431 +msgid "(?#" +msgstr "" + +#: ../../library/re.rst:436 +msgid "(?=" +msgstr "" + +#: ../../library/re.rst:443 +msgid "(?!" +msgstr "" + +#: ../../library/re.rst:450 +msgid "(?<=" +msgstr "" + +#: ../../library/re.rst:477 +msgid "(?\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -158,3 +158,11 @@ msgid "" "modify the handling of types already supported. This example shows how " "special support for file objects could be added::" msgstr "" + +#: ../../library/reprlib.rst:46 +msgid "..." +msgstr "" + +#: ../../library/reprlib.rst:46 +msgid "placeholder" +msgstr "" diff --git a/library/runpy.po b/library/runpy.po index 1ee62822b9..c1beaaa76f 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-16 00:14+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -259,3 +259,11 @@ msgstr "" #: ../../library/runpy.rst:179 msgid "The :func:`importlib.import_module` function" msgstr "" + +#: ../../library/runpy.rst:32 ../../library/runpy.rst:98 +msgid "module" +msgstr "" + +#: ../../library/runpy.rst:32 ../../library/runpy.rst:98 +msgid "__main__" +msgstr "" diff --git a/library/sched.po b/library/sched.po index 2ee4573c28..9efeb4a2ca 100644 --- a/library/sched.po +++ b/library/sched.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-25 00:16+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -154,3 +154,7 @@ msgid "" "will be run. Each event is shown as a :term:`named tuple` with the " "following fields: time, priority, action, argument, kwargs." msgstr "" + +#: ../../library/sched.rst:11 +msgid "event scheduling" +msgstr "" diff --git a/library/security_warnings.po b/library/security_warnings.po index b095f78d8f..0abd4bba9d 100644 --- a/library/security_warnings.po +++ b/library/security_warnings.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -111,3 +111,7 @@ msgid "" "potentially unsafe path to :data:`sys.path` such as the current directory, " "the script's directory or an empty string." msgstr "" + +#: ../../library/security_warnings.rst:3 +msgid "security considerations" +msgstr "" diff --git a/library/select.po b/library/select.po index 0248edacbe..f7ec95723f 100644 --- a/library/select.po +++ b/library/select.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1000,3 +1000,15 @@ msgstr "" #: ../../library/select.rst:650 msgid "User defined value." msgstr "" + +#: ../../library/select.rst:141 +msgid "socket() (in module socket)" +msgstr "" + +#: ../../library/select.rst:141 +msgid "popen() (in module os)" +msgstr "" + +#: ../../library/select.rst:154 +msgid "WinSock" +msgstr "" diff --git a/library/shelve.po b/library/shelve.po index e4f13be88e..c7aea2cb91 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -241,3 +241,19 @@ msgstr ":mod:`pickle` 模組" #: ../../library/shelve.rst:218 msgid "Object serialization used by :mod:`shelve`." msgstr "" + +#: ../../library/shelve.rst:9 ../../library/shelve.rst:97 +msgid "module" +msgstr "" + +#: ../../library/shelve.rst:9 +msgid "pickle" +msgstr "" + +#: ../../library/shelve.rst:97 +msgid "dbm.ndbm" +msgstr "" + +#: ../../library/shelve.rst:97 +msgid "dbm.gnu" +msgstr "" diff --git a/library/shutil.po b/library/shutil.po index 85a281540a..a0f16658e8 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-29 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -992,3 +992,23 @@ msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." msgstr "" + +#: ../../library/shutil.rst:12 +msgid "file" +msgstr "" + +#: ../../library/shutil.rst:12 +msgid "copying" +msgstr "" + +#: ../../library/shutil.rst:12 +msgid "copying files" +msgstr "" + +#: ../../library/shutil.rst:297 +msgid "directory" +msgstr "" + +#: ../../library/shutil.rst:297 +msgid "deleting" +msgstr "" diff --git a/library/site.po b/library/site.po index caf8069b6d..73a7aad23e 100644 --- a/library/site.po +++ b/library/site.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -69,9 +69,9 @@ msgid "" "If a file named \"pyvenv.cfg\" exists one directory above sys.executable, " "sys.prefix and sys.exec_prefix are set to that directory and it is also " "checked for site-packages (sys.base_prefix and sys.base_exec_prefix will " -"always be the \"real\" prefixes of the Python installation). If \"pyvenv.cfg" -"\" (a bootstrap configuration file) contains the key \"include-system-site-" -"packages\" set to anything other than \"true\" (case-insensitive), the " +"always be the \"real\" prefixes of the Python installation). If \"pyvenv." +"cfg\" (a bootstrap configuration file) contains the key \"include-system-" +"site-packages\" set to anything other than \"true\" (case-insensitive), the " "system-level prefixes will not be searched for site-packages; otherwise they " "will." msgstr "" @@ -303,3 +303,60 @@ msgstr "" #: ../../library/site.rst:280 msgid ":ref:`sys-path-init` -- The initialization of :data:`sys.path`." msgstr "" + +#: ../../library/site.rst:16 ../../library/site.rst:112 +#: ../../library/site.rst:124 +msgid "module" +msgstr "" + +#: ../../library/site.rst:16 +msgid "search" +msgstr "" + +#: ../../library/site.rst:16 ../../library/site.rst:77 +msgid "path" +msgstr "" + +#: ../../library/site.rst:28 +msgid "site-packages" +msgstr "" + +#: ../../library/site.rst:28 +msgid "directory" +msgstr "" + +#: ../../library/site.rst:52 +msgid "# (hash)" +msgstr "" + +#: ../../library/site.rst:52 +msgid "comment" +msgstr "" + +#: ../../library/site.rst:52 +msgid "statement" +msgstr "" + +#: ../../library/site.rst:52 +msgid "import" +msgstr "" + +#: ../../library/site.rst:77 +msgid "package" +msgstr "" + +#: ../../library/site.rst:77 +msgid "configuration" +msgstr "" + +#: ../../library/site.rst:77 +msgid "file" +msgstr "" + +#: ../../library/site.rst:112 +msgid "sitecustomize" +msgstr "" + +#: ../../library/site.rst:124 +msgid "usercustomize" +msgstr "" diff --git a/library/smtplib.po b/library/smtplib.po index 64dee19da5..24449115b8 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 00:32+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -736,3 +736,15 @@ msgid "" "construct an email message, which you can then send via :meth:`~smtplib.SMTP." "send_message`; see :ref:`email-examples`." msgstr "" + +#: ../../library/smtplib.rst:11 +msgid "SMTP" +msgstr "" + +#: ../../library/smtplib.rst:11 +msgid "protocol" +msgstr "" + +#: ../../library/smtplib.rst:11 +msgid "Simple Mail Transfer Protocol" +msgstr "" diff --git a/library/sndhdr.po b/library/sndhdr.po index c8d756a432..ff04c9f4ae 100644 --- a/library/sndhdr.po +++ b/library/sndhdr.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-06-11 15:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -207,3 +207,11 @@ msgstr "" #: ../../library/sndhdr.rst:95 msgid "Example:" msgstr "範例:" + +#: ../../library/sndhdr.rst:13 +msgid "A-LAW" +msgstr "" + +#: ../../library/sndhdr.rst:13 +msgid "u-LAW" +msgstr "" diff --git a/library/socket.po b/library/socket.po index 78f628157c..fb66f147ad 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -2263,3 +2263,27 @@ msgid "" "readers may want to refer to :rfc:`3493` titled Basic Socket Interface " "Extensions for IPv6." msgstr "" + +#: ../../library/socket.rst:22 +msgid "object" +msgstr "" + +#: ../../library/socket.rst:22 +msgid "socket" +msgstr "" + +#: ../../library/socket.rst:1477 +msgid "I/O control" +msgstr "" + +#: ../../library/socket.rst:1477 +msgid "buffering" +msgstr "" + +#: ../../library/socket.rst:1832 +msgid "module" +msgstr "" + +#: ../../library/socket.rst:1832 +msgid "struct" +msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 8e5d32cb93..2c82c93358 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-29 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -2100,3 +2100,15 @@ msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" + +#: ../../library/sqlite3.rst:1333 +msgid "? (question mark)" +msgstr "" + +#: ../../library/sqlite3.rst:1333 ../../library/sqlite3.rst:1334 +msgid "in SQL statements" +msgstr "" + +#: ../../library/sqlite3.rst:1334 +msgid ": (colon)" +msgstr "" diff --git a/library/ssl.po b/library/ssl.po index b024ff7578..f7c4a0bb3b 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+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-" @@ -3129,3 +3129,37 @@ msgstr "" #: ../../library/ssl.rst:2777 msgid "Mozilla" msgstr "Mozilla" + +#: ../../library/ssl.rst:12 +msgid "OpenSSL" +msgstr "" + +#: ../../library/ssl.rst:12 +msgid "(use in module ssl)" +msgstr "" + +#: ../../library/ssl.rst:14 +#, fuzzy +msgid "TLS" +msgstr "*TLSv1*" + +#: ../../library/ssl.rst:14 +#, fuzzy +msgid "SSL" +msgstr "*SSLv2*" + +#: ../../library/ssl.rst:14 +msgid "Transport Layer Security" +msgstr "" + +#: ../../library/ssl.rst:14 +msgid "Secure Sockets Layer" +msgstr "" + +#: ../../library/ssl.rst:2085 +msgid "certificates" +msgstr "" + +#: ../../library/ssl.rst:2087 +msgid "X509 certificate" +msgstr "" diff --git a/library/stdtypes.po b/library/stdtypes.po index b31973a7f8..3137e985e9 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-17 00:32+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -6105,3 +6105,762 @@ msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." msgstr "" + +#: ../../library/stdtypes.rst:13 +#, fuzzy +msgid "built-in" +msgstr "內建型別" + +#: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:315 +#: ../../library/stdtypes.rst:390 ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:1096 +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:5326 +msgid "types" +msgstr "" + +#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:4369 +msgid "statement" +msgstr "" + +#: ../../library/stdtypes.rst:34 +msgid "if" +msgstr "" + +#: ../../library/stdtypes.rst:34 +msgid "while" +msgstr "" + +#: ../../library/stdtypes.rst:34 +msgid "truth" +msgstr "" + +#: ../../library/stdtypes.rst:34 +msgid "value" +msgstr "" + +#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:80 +#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:5390 +msgid "Boolean" +msgstr "" + +#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:80 +#: ../../library/stdtypes.rst:390 +msgid "operations" +msgstr "" + +#: ../../library/stdtypes.rst:34 +msgid "false" +msgstr "" + +#: ../../library/stdtypes.rst:44 +msgid "true" +msgstr "" + +#: ../../library/stdtypes.rst:51 +msgid "None (Built-in object)" +msgstr "" + +#: ../../library/stdtypes.rst:51 +msgid "False (Built-in object)" +msgstr "" + +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:97 +#: ../../library/stdtypes.rst:122 ../../library/stdtypes.rst:194 +#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:907 +msgid "operator" +msgstr "" + +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:97 +msgid "or" +msgstr "" + +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:97 +#, fuzzy +msgid "and" +msgstr "" +"和:\n" +"\n" +"::" + +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5390 +msgid "False" +msgstr "" + +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5390 +msgid "True" +msgstr "" + +#: ../../library/stdtypes.rst:97 +msgid "not" +msgstr "" + +#: ../../library/stdtypes.rst:122 +msgid "chaining" +msgstr "" + +#: ../../library/stdtypes.rst:122 +msgid "comparisons" +msgstr "" + +#: ../../library/stdtypes.rst:122 +msgid "comparison" +msgstr "" + +#: ../../library/stdtypes.rst:122 +msgid "==" +msgstr "" + +#: ../../library/stdtypes.rst:122 +msgid "< (less)" +msgstr "" + +#: ../../library/stdtypes.rst:122 +msgid "<=" +msgstr "" + +#: ../../library/stdtypes.rst:122 +msgid "> (greater)" +msgstr "" + +#: ../../library/stdtypes.rst:122 +msgid ">=" +msgstr "" + +#: ../../library/stdtypes.rst:122 +msgid "!=" +msgstr "" + +#: ../../library/stdtypes.rst:122 +msgid "is" +msgstr "" + +#: ../../library/stdtypes.rst:122 +#, fuzzy +msgid "is not" +msgstr "``is not``" + +#: ../../library/stdtypes.rst:162 ../../library/stdtypes.rst:207 +#: ../../library/stdtypes.rst:891 ../../library/stdtypes.rst:1074 +#: ../../library/stdtypes.rst:1096 ../../library/stdtypes.rst:1216 +#: ../../library/stdtypes.rst:1295 ../../library/stdtypes.rst:1339 +#: ../../library/stdtypes.rst:1461 ../../library/stdtypes.rst:1497 +#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:2485 +#: ../../library/stdtypes.rst:2592 ../../library/stdtypes.rst:4168 +#: ../../library/stdtypes.rst:4369 ../../library/stdtypes.rst:4838 +#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:5290 +msgid "object" +msgstr "" + +#: ../../library/stdtypes.rst:162 ../../library/stdtypes.rst:207 +#: ../../library/stdtypes.rst:228 ../../library/stdtypes.rst:315 +#: ../../library/stdtypes.rst:332 +msgid "numeric" +msgstr "" + +#: ../../library/stdtypes.rst:162 +msgid "objects" +msgstr "" + +#: ../../library/stdtypes.rst:162 +msgid "comparing" +msgstr "" + +#: ../../library/stdtypes.rst:172 +msgid "__eq__() (instance method)" +msgstr "" + +#: ../../library/stdtypes.rst:172 +msgid "__ne__() (instance method)" +msgstr "" + +#: ../../library/stdtypes.rst:172 +msgid "__lt__() (instance method)" +msgstr "" + +#: ../../library/stdtypes.rst:172 +msgid "__le__() (instance method)" +msgstr "" + +#: ../../library/stdtypes.rst:172 +msgid "__gt__() (instance method)" +msgstr "" + +#: ../../library/stdtypes.rst:172 +msgid "__ge__() (instance method)" +msgstr "" + +#: ../../library/stdtypes.rst:194 ../../library/stdtypes.rst:907 +msgid "in" +msgstr "" + +#: ../../library/stdtypes.rst:194 ../../library/stdtypes.rst:907 +#, fuzzy +msgid "not in" +msgstr "``x not in s``" + +#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:228 +#: ../../library/stdtypes.rst:390 +msgid "integer" +msgstr "" + +#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:228 +msgid "floating point" +msgstr "" + +#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:228 +msgid "complex number" +msgstr "" + +#: ../../library/stdtypes.rst:207 +msgid "C" +msgstr "" + +#: ../../library/stdtypes.rst:207 +msgid "language" +msgstr "" + +#: ../../library/stdtypes.rst:228 +msgid "literals" +msgstr "" + +#: ../../library/stdtypes.rst:228 +msgid "hexadecimal" +msgstr "" + +#: ../../library/stdtypes.rst:228 +msgid "octal" +msgstr "" + +#: ../../library/stdtypes.rst:228 +msgid "binary" +msgstr "" + +#: ../../library/stdtypes.rst:245 +msgid "arithmetic" +msgstr "" + +#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:5297 ../../library/stdtypes.rst:5311 +#: ../../library/stdtypes.rst:5326 +msgid "built-in function" +msgstr "" + +#: ../../library/stdtypes.rst:245 +msgid "int" +msgstr "" + +#: ../../library/stdtypes.rst:245 +msgid "float" +msgstr "" + +#: ../../library/stdtypes.rst:245 +#, fuzzy +msgid "complex" +msgstr ":func:`complex`" + +#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2342 +#: ../../library/stdtypes.rst:3560 +msgid "+ (plus)" +msgstr "" + +#: ../../library/stdtypes.rst:245 +msgid "unary operator" +msgstr "" + +#: ../../library/stdtypes.rst:245 +msgid "binary operator" +msgstr "" + +#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2342 +#: ../../library/stdtypes.rst:3560 +msgid "- (minus)" +msgstr "" + +#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2299 +#: ../../library/stdtypes.rst:3517 +msgid "* (asterisk)" +msgstr "" + +#: ../../library/stdtypes.rst:245 +msgid "/ (slash)" +msgstr "" + +#: ../../library/stdtypes.rst:245 +msgid "//" +msgstr "" + +#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2269 +#: ../../library/stdtypes.rst:3485 +msgid "% (percent)" +msgstr "" + +#: ../../library/stdtypes.rst:245 +msgid "**" +msgstr "" + +#: ../../library/stdtypes.rst:315 ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:4369 +msgid "operations on" +msgstr "" + +#: ../../library/stdtypes.rst:315 +msgid "conjugate() (complex number method)" +msgstr "" + +#: ../../library/stdtypes.rst:332 ../../library/stdtypes.rst:1563 +#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:5326 +#, fuzzy +msgid "module" +msgstr "模組" + +#: ../../library/stdtypes.rst:332 +msgid "math" +msgstr "" + +#: ../../library/stdtypes.rst:332 +msgid "floor() (in module math)" +msgstr "" + +#: ../../library/stdtypes.rst:332 +msgid "ceil() (in module math)" +msgstr "" + +#: ../../library/stdtypes.rst:332 +msgid "trunc() (in module math)" +msgstr "" + +#: ../../library/stdtypes.rst:332 +msgid "conversions" +msgstr "" + +#: ../../library/stdtypes.rst:390 +msgid "bitwise" +msgstr "" + +#: ../../library/stdtypes.rst:390 +msgid "shifting" +msgstr "" + +#: ../../library/stdtypes.rst:390 +msgid "masking" +msgstr "" + +#: ../../library/stdtypes.rst:390 +msgid "| (vertical bar)" +msgstr "" + +#: ../../library/stdtypes.rst:390 +msgid "^ (caret)" +msgstr "" + +#: ../../library/stdtypes.rst:390 +msgid "& (ampersand)" +msgstr "" + +#: ../../library/stdtypes.rst:390 +msgid "<<" +msgstr "" + +#: ../../library/stdtypes.rst:390 +msgid ">>" +msgstr "" + +#: ../../library/stdtypes.rst:390 +msgid "~ (tilde)" +msgstr "" + +#: ../../library/stdtypes.rst:804 +msgid "iterator protocol" +msgstr "" + +#: ../../library/stdtypes.rst:804 ../../library/stdtypes.rst:4753 +msgid "protocol" +msgstr "" + +#: ../../library/stdtypes.rst:804 +msgid "iterator" +msgstr "" + +#: ../../library/stdtypes.rst:804 ../../library/stdtypes.rst:891 +#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:1074 +#: ../../library/stdtypes.rst:1096 ../../library/stdtypes.rst:1111 +msgid "sequence" +msgstr "" + +#: ../../library/stdtypes.rst:804 +#, fuzzy +msgid "iteration" +msgstr "描述" + +#: ../../library/stdtypes.rst:804 +msgid "container" +msgstr "" + +#: ../../library/stdtypes.rst:804 +msgid "iteration over" +msgstr "" + +#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:4369 +msgid "len" +msgstr "" + +#: ../../library/stdtypes.rst:907 +msgid "min" +msgstr "" + +#: ../../library/stdtypes.rst:907 +msgid "max" +msgstr "" + +#: ../../library/stdtypes.rst:907 +msgid "concatenation" +msgstr "" + +#: ../../library/stdtypes.rst:907 +#, fuzzy +msgid "operation" +msgstr "描述" + +#: ../../library/stdtypes.rst:907 +msgid "repetition" +msgstr "" + +#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:1111 +#, fuzzy +msgid "subscript" +msgstr "描述" + +#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:1111 +msgid "slice" +msgstr "" + +#: ../../library/stdtypes.rst:907 +msgid "count() (sequence method)" +msgstr "" + +#: ../../library/stdtypes.rst:907 +msgid "index() (sequence method)" +msgstr "" + +#: ../../library/stdtypes.rst:963 +msgid "loop" +msgstr "" + +#: ../../library/stdtypes.rst:963 +msgid "over mutable sequence" +msgstr "" + +#: ../../library/stdtypes.rst:963 +msgid "mutable sequence" +msgstr "" + +#: ../../library/stdtypes.rst:963 +msgid "loop over" +msgstr "" + +#: ../../library/stdtypes.rst:1074 +msgid "immutable" +msgstr "" + +#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:1295 +msgid "tuple" +msgstr "" + +#: ../../library/stdtypes.rst:1074 +msgid "hash" +msgstr "" + +#: ../../library/stdtypes.rst:1096 +msgid "mutable" +msgstr "" + +#: ../../library/stdtypes.rst:1096 ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:1216 +msgid "list" +msgstr "" + +#: ../../library/stdtypes.rst:1096 ../../library/stdtypes.rst:2466 +#: ../../library/stdtypes.rst:2592 ../../library/stdtypes.rst:2664 +#: ../../library/stdtypes.rst:3485 +msgid "bytearray" +msgstr "" + +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5326 +msgid "type" +msgstr "" + +#: ../../library/stdtypes.rst:1111 +msgid "assignment" +msgstr "" + +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 +msgid "del" +msgstr "" + +#: ../../library/stdtypes.rst:1111 +msgid "append() (sequence method)" +msgstr "" + +#: ../../library/stdtypes.rst:1111 +msgid "clear() (sequence method)" +msgstr "" + +#: ../../library/stdtypes.rst:1111 +msgid "copy() (sequence method)" +msgstr "" + +#: ../../library/stdtypes.rst:1111 +msgid "extend() (sequence method)" +msgstr "" + +#: ../../library/stdtypes.rst:1111 +msgid "insert() (sequence method)" +msgstr "" + +#: ../../library/stdtypes.rst:1111 +msgid "pop() (sequence method)" +msgstr "" + +#: ../../library/stdtypes.rst:1111 +msgid "remove() (sequence method)" +msgstr "" + +#: ../../library/stdtypes.rst:1111 +msgid "reverse() (sequence method)" +msgstr "" + +#: ../../library/stdtypes.rst:1339 +msgid "range" +msgstr "" + +#: ../../library/stdtypes.rst:1461 ../../library/stdtypes.rst:1510 +#: ../../library/stdtypes.rst:1555 ../../library/stdtypes.rst:2269 +msgid "string" +msgstr "" + +#: ../../library/stdtypes.rst:1461 +msgid "text sequence type" +msgstr "" + +#: ../../library/stdtypes.rst:1461 ../../library/stdtypes.rst:1510 +#: ../../library/stdtypes.rst:1528 +msgid "str (built-in class)" +msgstr "" + +#: ../../library/stdtypes.rst:1461 +msgid "(see also string)" +msgstr "" + +#: ../../library/stdtypes.rst:1497 +msgid "io.StringIO" +msgstr "" + +#: ../../library/stdtypes.rst:1528 ../../library/stdtypes.rst:2458 +msgid "buffer protocol" +msgstr "" + +#: ../../library/stdtypes.rst:1528 ../../library/stdtypes.rst:2466 +#: ../../library/stdtypes.rst:2485 ../../library/stdtypes.rst:2664 +#: ../../library/stdtypes.rst:3485 +msgid "bytes" +msgstr "" + +#: ../../library/stdtypes.rst:1555 ../../library/stdtypes.rst:2664 +msgid "methods" +msgstr "" + +#: ../../library/stdtypes.rst:1563 +msgid "re" +msgstr "" + +#: ../../library/stdtypes.rst:2078 ../../library/stdtypes.rst:3339 +msgid "universal newlines" +msgstr "" + +#: ../../library/stdtypes.rst:2078 +msgid "str.splitlines method" +msgstr "" + +#: ../../library/stdtypes.rst:2269 +msgid "formatting, string (%)" +msgstr "" + +#: ../../library/stdtypes.rst:2269 +msgid "interpolation, string (%)" +msgstr "" + +#: ../../library/stdtypes.rst:2269 +msgid "formatting, printf" +msgstr "" + +#: ../../library/stdtypes.rst:2269 +msgid "interpolation, printf" +msgstr "" + +#: ../../library/stdtypes.rst:2269 ../../library/stdtypes.rst:3485 +msgid "printf-style formatting" +msgstr "" + +#: ../../library/stdtypes.rst:2269 ../../library/stdtypes.rst:3485 +msgid "sprintf-style formatting" +msgstr "" + +#: ../../library/stdtypes.rst:2299 ../../library/stdtypes.rst:3517 +msgid "() (parentheses)" +msgstr "" + +#: ../../library/stdtypes.rst:2299 ../../library/stdtypes.rst:2342 +#: ../../library/stdtypes.rst:3517 ../../library/stdtypes.rst:3560 +msgid "in printf-style formatting" +msgstr "" + +#: ../../library/stdtypes.rst:2299 ../../library/stdtypes.rst:3517 +msgid ". (dot)" +msgstr "" + +#: ../../library/stdtypes.rst:2342 ../../library/stdtypes.rst:3560 +msgid "# (hash)" +msgstr "" + +#: ../../library/stdtypes.rst:2342 ../../library/stdtypes.rst:3560 +msgid "space" +msgstr "" + +#: ../../library/stdtypes.rst:2458 +msgid "binary sequence types" +msgstr "" + +#: ../../library/stdtypes.rst:2466 +msgid "memoryview" +msgstr "" + +#: ../../library/stdtypes.rst:2466 +msgid "array" +msgstr "" + +#: ../../library/stdtypes.rst:3339 +msgid "bytes.splitlines method" +msgstr "" + +#: ../../library/stdtypes.rst:3339 +msgid "bytearray.splitlines method" +msgstr "" + +#: ../../library/stdtypes.rst:3485 +msgid "formatting" +msgstr "" + +#: ../../library/stdtypes.rst:3485 +msgid "bytes (%)" +msgstr "" + +#: ../../library/stdtypes.rst:3485 +msgid "bytearray (%)" +msgstr "" + +#: ../../library/stdtypes.rst:3485 +msgid "interpolation" +msgstr "" + +#: ../../library/stdtypes.rst:4168 +msgid "set" +msgstr "" + +#: ../../library/stdtypes.rst:4369 +msgid "mapping" +msgstr "" + +#: ../../library/stdtypes.rst:4369 +msgid "dictionary" +msgstr "" + +#: ../../library/stdtypes.rst:4452 +msgid "__missing__()" +msgstr "" + +#: ../../library/stdtypes.rst:4753 +msgid "context manager" +msgstr "" + +#: ../../library/stdtypes.rst:4753 +msgid "context management protocol" +msgstr "" + +#: ../../library/stdtypes.rst:4753 +msgid "context management" +msgstr "" + +#: ../../library/stdtypes.rst:4826 +msgid "annotation" +msgstr "" + +#: ../../library/stdtypes.rst:4826 +msgid "type annotation; type hint" +msgstr "" + +#: ../../library/stdtypes.rst:4838 +msgid "GenericAlias" +msgstr "" + +#: ../../library/stdtypes.rst:4838 +msgid "Generic" +msgstr "" + +#: ../../library/stdtypes.rst:4838 +msgid "Alias" +msgstr "" + +#: ../../library/stdtypes.rst:5093 +msgid "Union" +msgstr "" + +#: ../../library/stdtypes.rst:5093 +msgid "union" +msgstr "" + +#: ../../library/stdtypes.rst:5251 +msgid "method" +msgstr "" + +#: ../../library/stdtypes.rst:5290 +msgid "code" +msgstr "" + +#: ../../library/stdtypes.rst:5290 +msgid "code object" +msgstr "" + +#: ../../library/stdtypes.rst:5297 +msgid "compile" +msgstr "" + +#: ../../library/stdtypes.rst:5297 +msgid "__code__ (function object attribute)" +msgstr "" + +#: ../../library/stdtypes.rst:5311 +msgid "exec" +msgstr "" + +#: ../../library/stdtypes.rst:5311 +msgid "eval" +msgstr "" + +#: ../../library/stdtypes.rst:5350 +msgid "..." +msgstr "" + +#: ../../library/stdtypes.rst:5350 +msgid "ellipsis literal" +msgstr "" + +#: ../../library/stdtypes.rst:5390 +msgid "values" +msgstr "" diff --git a/library/string.po b/library/string.po index 06b167553c..983b683bc2 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -480,7 +480,7 @@ msgid "" "default behavior)." msgstr "" -#: ../../library/string.rst:379 +#: ../../library/string.rst:365 ../../library/string.rst:379 msgid "space" msgstr "" @@ -925,11 +925,12 @@ msgstr "" #: ../../library/string.rst:750 msgid "" -"``$identifier`` names a substitution placeholder matching a mapping key of ``" -"\"identifier\"``. By default, ``\"identifier\"`` is restricted to any case-" -"insensitive ASCII alphanumeric string (including underscores) that starts " -"with an underscore or ASCII letter. The first non-identifier character " -"after the ``$`` character terminates this placeholder specification." +"``$identifier`` names a substitution placeholder matching a mapping key of " +"``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any " +"case-insensitive ASCII alphanumeric string (including underscores) that " +"starts with an underscore or ASCII letter. The first non-identifier " +"character after the ``$`` character terminates this placeholder " +"specification." msgstr "" #: ../../library/string.rst:757 @@ -1117,3 +1118,78 @@ msgid "" "trailing whitespace are removed, otherwise *sep* is used to split and join " "the words." msgstr "" + +#: ../../library/string.rst:195 +msgid "{} (curly brackets)" +msgstr "" + +#: ../../library/string.rst:195 ../../library/string.rst:333 +#: ../../library/string.rst:365 ../../library/string.rst:384 +#: ../../library/string.rst:393 ../../library/string.rst:407 +#: ../../library/string.rst:416 +msgid "in string formatting" +msgstr "" + +#: ../../library/string.rst:195 +msgid ". (dot)" +msgstr "" + +#: ../../library/string.rst:195 +msgid "[] (square brackets)" +msgstr "" + +#: ../../library/string.rst:195 +msgid "! (exclamation)" +msgstr "" + +#: ../../library/string.rst:195 +msgid ": (colon)" +msgstr "" + +#: ../../library/string.rst:333 +msgid "< (less)" +msgstr "" + +#: ../../library/string.rst:333 +msgid "> (greater)" +msgstr "" + +#: ../../library/string.rst:333 +msgid "= (equals)" +msgstr "" + +#: ../../library/string.rst:333 +msgid "^ (caret)" +msgstr "" + +#: ../../library/string.rst:365 +msgid "+ (plus)" +msgstr "" + +#: ../../library/string.rst:365 +msgid "- (minus)" +msgstr "" + +#: ../../library/string.rst:384 +msgid "z" +msgstr "" + +#: ../../library/string.rst:393 +msgid "# (hash)" +msgstr "" + +#: ../../library/string.rst:407 +msgid ", (comma)" +msgstr "" + +#: ../../library/string.rst:416 +msgid "_ (underscore)" +msgstr "" + +#: ../../library/string.rst:744 +msgid "$ (dollar)" +msgstr "" + +#: ../../library/string.rst:744 +msgid "in template strings" +msgstr "" diff --git a/library/struct.po b/library/struct.po index 7caea91920..4b319c7d86 100644 --- a/library/struct.po +++ b/library/struct.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-23 00:17+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -927,3 +927,52 @@ msgid "" "The calculated size of the struct (and hence of the bytes object produced by " "the :meth:`pack` method) corresponding to :attr:`format`." msgstr "" + +#: ../../library/struct.rst:9 +msgid "C" +msgstr "" + +#: ../../library/struct.rst:9 +msgid "structures" +msgstr "" + +#: ../../library/struct.rst:9 +msgid "packing" +msgstr "" + +#: ../../library/struct.rst:9 +msgid "binary" +msgstr "" + +#: ../../library/struct.rst:9 +msgid "data" +msgstr "" + +#: ../../library/struct.rst:132 +msgid "@ (at)" +msgstr "" + +#: ../../library/struct.rst:132 ../../library/struct.rst:261 +#: ../../library/struct.rst:348 +msgid "in struct format strings" +msgstr "" + +#: ../../library/struct.rst:132 +msgid "= (equals)" +msgstr "" + +#: ../../library/struct.rst:132 +msgid "< (less)" +msgstr "" + +#: ../../library/struct.rst:132 +msgid "> (greater)" +msgstr "" + +#: ../../library/struct.rst:132 +msgid "! (exclamation)" +msgstr "" + +#: ../../library/struct.rst:261 ../../library/struct.rst:348 +msgid "? (question mark)" +msgstr "" diff --git a/library/subprocess.po b/library/subprocess.po index d594421690..0223fbdbc0 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-26 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1822,3 +1822,11 @@ msgstr "``_USE_POSIX_SPAWN``" #: ../../library/subprocess.rst:1637 msgid "``_USE_VFORK``" msgstr "``_USE_VFORK``" + +#: ../../library/subprocess.rst:291 +msgid "universal newlines" +msgstr "" + +#: ../../library/subprocess.rst:291 +msgid "subprocess module" +msgstr "" diff --git a/library/sys.po b/library/sys.po index 1072248740..e14bb31020 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2638,6 +2638,66 @@ msgid "" "n1256.pdf\\ ." msgstr "" +#: ../../library/sys.rst:97 +msgid "auditing" +msgstr "" + +#: ../../library/sys.rst:443 +msgid "object" +msgstr "" + +#: ../../library/sys.rst:443 +msgid "traceback" +msgstr "" + +#: ../../library/sys.rst:813 ../../library/sys.rst:1359 +msgid "profile function" +msgstr "" + +#: ../../library/sys.rst:813 ../../library/sys.rst:1359 +msgid "profiler" +msgstr "" + +#: ../../library/sys.rst:822 ../../library/sys.rst:1436 +msgid "trace function" +msgstr "" + +#: ../../library/sys.rst:822 ../../library/sys.rst:1436 +msgid "debugger" +msgstr "" + +#: ../../library/sys.rst:1178 +msgid "module" +msgstr "" + +#: ../../library/sys.rst:1178 +msgid "search" +msgstr "" + +#: ../../library/sys.rst:1178 +msgid "path" +msgstr "" + +#: ../../library/sys.rst:1323 +msgid "interpreter prompts" +msgstr "" + +#: ../../library/sys.rst:1323 +msgid "prompts, interpreter" +msgstr "" + +#: ../../library/sys.rst:1323 +msgid ">>>" +msgstr "" + +#: ../../library/sys.rst:1323 +msgid "interpreter prompt" +msgstr "" + +#: ../../library/sys.rst:1323 +msgid "..." +msgstr "" + #~ msgid ":const:`dig`" #~ msgstr ":const:`dig`" diff --git a/library/sysconfig.po b/library/sysconfig.po index fcb48fb66c..26faf0ffd7 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -473,3 +473,7 @@ msgid "" "func:`get_platform`, :func:`get_python_version`, :func:`get_path` and :func:" "`get_config_vars`." msgstr "" + +#: ../../library/sysconfig.rst:14 +msgid "configuration information" +msgstr "" diff --git a/library/telnetlib.po b/library/telnetlib.po index 182939aa8e..81efb4f59e 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-05-22 02:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -300,3 +300,12 @@ msgstr "Telnet 範例" #: ../../library/telnetlib.rst:241 msgid "A simple example illustrating typical use::" msgstr "" + +#: ../../library/telnetlib.rst:12 +msgid "protocol" +msgstr "" + +#: ../../library/telnetlib.rst:12 +#, fuzzy +msgid "Telnet" +msgstr "Telnet 範例" diff --git a/library/tempfile.po b/library/tempfile.po index 92a5e07eaa..c38fab5057 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-28 00:31+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -593,5 +593,17 @@ msgstr "" "\n" "::" +#: ../../library/tempfile.rst:11 +msgid "temporary" +msgstr "" + +#: ../../library/tempfile.rst:11 +msgid "file name" +msgstr "" + +#: ../../library/tempfile.rst:11 +msgid "file" +msgstr "" + #~ msgid ":func:`mkdtemp` returns the absolute pathname of the new directory." #~ msgstr ":func:`mkdtemp` 回傳新目錄的絕對路徑。" diff --git a/library/termios.po b/library/termios.po index 64ea4d2942..c64c2dc7cf 100644 --- a/library/termios.po +++ b/library/termios.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -130,3 +130,15 @@ msgid "" "`try` ... :keyword:`finally` statement to ensure that the old tty attributes " "are restored exactly no matter what happens::" msgstr "" + +#: ../../library/termios.rst:8 +msgid "POSIX" +msgstr "" + +#: ../../library/termios.rst:8 +msgid "I/O control" +msgstr "" + +#: ../../library/termios.rst:8 +msgid "tty" +msgstr "" diff --git a/library/textwrap.po b/library/textwrap.po index 6a458bd916..d77ec68ba2 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-20 00:13+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -324,3 +324,11 @@ msgid "" "Wraps the single paragraph in *text*, and returns a single string containing " "the wrapped paragraph." msgstr "" + +#: ../../library/textwrap.rst:285 +msgid "..." +msgstr "" + +#: ../../library/textwrap.rst:285 +msgid "placeholder" +msgstr "" diff --git a/library/threading.po b/library/threading.po index b7c667f8fe..ab3e27b2c3 100644 --- a/library/threading.po +++ b/library/threading.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-11 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1423,3 +1423,15 @@ msgid "" "`Semaphore`, and :class:`BoundedSemaphore` objects may be used as :keyword:" "`with` statement context managers." msgstr "" + +#: ../../library/threading.rst:155 ../../library/threading.rst:164 +msgid "trace function" +msgstr "" + +#: ../../library/threading.rst:164 +msgid "debugger" +msgstr "" + +#: ../../library/threading.rst:175 ../../library/threading.rst:184 +msgid "profile function" +msgstr "" diff --git a/library/time.po b/library/time.po index a7c2a46d79..fec37b0bf1 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -144,8 +144,9 @@ msgstr "" msgid "Use" msgstr "" -#: ../../library/time.rst:100 ../../library/time.rst:103 -#: ../../library/time.rst:106 ../../library/time.rst:109 +#: ../../library/time.rst:29 ../../library/time.rst:100 +#: ../../library/time.rst:103 ../../library/time.rst:106 +#: ../../library/time.rst:109 msgid "seconds since the epoch" msgstr "" @@ -1376,3 +1377,52 @@ msgid "" "the 4-digit year has been first recommended by :rfc:`1123` and then mandated " "by :rfc:`2822`." msgstr "" + +#: ../../library/time.rst:22 +msgid "epoch" +msgstr "" + +#: ../../library/time.rst:36 +msgid "Year 2038" +msgstr "" + +#: ../../library/time.rst:42 +msgid "2-digit years" +msgstr "" + +#: ../../library/time.rst:50 +msgid "UTC" +msgstr "" + +#: ../../library/time.rst:50 +msgid "Coordinated Universal Time" +msgstr "" + +#: ../../library/time.rst:50 +msgid "Greenwich Mean Time" +msgstr "" + +#: ../../library/time.rst:59 +msgid "Daylight Saving Time" +msgstr "" + +#: ../../library/time.rst:308 ../../library/time.rst:334 +#: ../../library/time.rst:642 +msgid "benchmarking" +msgstr "" + +#: ../../library/time.rst:334 ../../library/time.rst:642 +msgid "CPU time" +msgstr "" + +#: ../../library/time.rst:334 ../../library/time.rst:642 +msgid "processor time" +msgstr "" + +#: ../../library/time.rst:392 ../../library/time.rst:526 +msgid "% (percent)" +msgstr "" + +#: ../../library/time.rst:392 ../../library/time.rst:526 +msgid "datetime format" +msgstr "" diff --git a/library/timeit.po b/library/timeit.po index d1f065ba5e..f309e79fee 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -336,3 +336,11 @@ msgid "" "will cause the code to be executed within your current global namespace. " "This can be more convenient than individually specifying imports::" msgstr "" + +#: ../../library/timeit.rst:9 +msgid "Benchmarking" +msgstr "" + +#: ../../library/timeit.rst:9 +msgid "Performance" +msgstr "" diff --git a/library/tk.po b/library/tk.po index 6257459c90..1808f11498 100644 --- a/library/tk.po +++ b/library/tk.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,3 +51,20 @@ msgid "" "alternative `GUI frameworks and tools `_." msgstr "" + +#: ../../library/tk.rst:7 +msgid "GUI" +msgstr "" + +#: ../../library/tk.rst:7 +#, fuzzy +msgid "Graphical User Interface" +msgstr "以 Tk 打造 GUI" + +#: ../../library/tk.rst:7 +msgid "Tkinter" +msgstr "" + +#: ../../library/tk.rst:7 +msgid "Tk" +msgstr "" diff --git a/library/tkinter.po b/library/tkinter.po index 9c59fad450..eba5f7aff2 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1235,15 +1235,15 @@ msgstr "" "\n" "::" -#: ../../library/tkinter.rst:789 +#: ../../library/tkinter.rst:789 ../../library/tkinter.rst:791 msgid "Tk Option Data Types" msgstr "" #: ../../library/tkinter.rst:794 msgid "" -"Legal values are points of the compass: ``\"n\"``, ``\"ne\"``, ``\"e\"``, ``" -"\"se\"``, ``\"s\"``, ``\"sw\"``, ``\"w\"``, ``\"nw\"``, and also ``\"center" -"\"``." +"Legal values are points of the compass: ``\"n\"``, ``\"ne\"``, ``\"e\"``, " +"``\"se\"``, ``\"s\"``, ``\"sw\"``, ``\"w\"``, ``\"nw\"``, and also " +"``\"center\"``." msgstr "" #: ../../library/tkinter.rst:801 @@ -1281,10 +1281,10 @@ msgstr "" #: ../../library/tkinter.rst:814 msgid "" "Colors can be given as the names of X colors in the rgb.txt file, or as " -"strings representing RGB values in 4 bit: ``\"#RGB\"``, 8 bit: ``\"#RRGGBB" -"\"``, 12 bit: ``\"#RRRGGGBBB\"``, or 16 bit: ``\"#RRRRGGGGBBBB\"`` ranges, " -"where R,G,B here represent any legal hex digit. See page 160 of " -"Ousterhout's book for details." +"strings representing RGB values in 4 bit: ``\"#RGB\"``, 8 bit: " +"``\"#RRGGBB\"``, 12 bit: ``\"#RRRGGGBBB\"``, or 16 bit: " +"``\"#RRRRGGGGBBBB\"`` ranges, where R,G,B here represent any legal hex " +"digit. See page 160 of Ousterhout's book for details." msgstr "" #: ../../library/tkinter.rst:823 @@ -1361,9 +1361,9 @@ msgstr "" #: ../../library/tkinter.rst:852 msgid "" -"Determines what the border style of a widget will be. Legal values are: ``" -"\"raised\"``, ``\"sunken\"``, ``\"flat\"``, ``\"groove\"``, and ``\"ridge" -"\"``." +"Determines what the border style of a widget will be. Legal values are: " +"``\"raised\"``, ``\"sunken\"``, ``\"flat\"``, ``\"groove\"``, and " +"``\"ridge\"``." msgstr "" #: ../../library/tkinter.rst:857 @@ -1736,3 +1736,19 @@ msgstr "" #: ../../library/tkinter.rst:1041 msgid "Constants used in the *mask* arguments." msgstr "" + +#: ../../library/tkinter.rst:637 +msgid "packing (widgets)" +msgstr "" + +#: ../../library/tkinter.rst:750 +msgid "window manager (widgets)" +msgstr "" + +#: ../../library/tkinter.rst:867 +msgid "bind (widgets)" +msgstr "" + +#: ../../library/tkinter.rst:867 +msgid "events (widgets)" +msgstr "" diff --git a/library/tkinter.tix.po b/library/tkinter.tix.po index c39adf1c4b..5236f78aa8 100644 --- a/library/tkinter.tix.po +++ b/library/tkinter.tix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-10-01 14:35+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -517,3 +517,7 @@ msgid "" "sets using the :meth:`tix_config` method. Instead, the :meth:" "`tix_resetoptions` method must be used." msgstr "" + +#: ../../library/tkinter.tix.rst:11 +msgid "Tix" +msgstr "" diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 3232f039cc..7c19b82a8e 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -798,9 +798,9 @@ msgstr "" #: ../../library/tkinter.ttk.rst:511 msgid "" "Specifies how the child window is positioned within the pane area. Value is " -"a string containing zero or more of the characters \"n\", \"s\", \"e\" or \"w" -"\". Each letter refers to a side (north, south, east or west) that the child " -"window will stick to, as per the :meth:`grid` geometry manager." +"a string containing zero or more of the characters \"n\", \"s\", \"e\" or " +"\"w\". Each letter refers to a side (north, south, east or west) that the " +"child window will stick to, as per the :meth:`grid` geometry manager." msgstr "" #: ../../library/tkinter.ttk.rst:517 @@ -2147,3 +2147,7 @@ msgid "" "tuple (or other sequence type) where the first item is the layout name, and " "the other is a `Layout`_." msgstr "" + +#: ../../library/tkinter.ttk.rst:11 +msgid "ttk" +msgstr "" diff --git a/library/traceback.po b/library/traceback.po index cd842f0334..bfe91bc9c6 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-22 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -485,3 +485,19 @@ msgstr "" #: ../../library/traceback.rst:529 msgid "This last example demonstrates the final few formatting functions:" msgstr "" + +#: ../../library/traceback.rst:17 +msgid "object" +msgstr "" + +#: ../../library/traceback.rst:17 +msgid "traceback" +msgstr "" + +#: ../../library/traceback.rst:57 +msgid "^ (caret)" +msgstr "" + +#: ../../library/traceback.rst:57 +msgid "marker" +msgstr "" diff --git a/library/types.po b/library/types.po index 327dc5f3d4..fd3b74ec05 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-26 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -569,3 +569,11 @@ msgid "" "wrapped in an *awaitable* proxy object. All other types of objects will be " "returned as is." msgstr "" + +#: ../../library/types.rst:149 +msgid "built-in function" +msgstr "" + +#: ../../library/types.rst:149 +msgid "compile" +msgstr "" diff --git a/library/typing.po b/library/typing.po index 06b5f74d79..04f63a308f 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -351,7 +351,7 @@ msgid "" msgstr "" #: ../../library/typing.rst:229 ../../library/typing.rst:1171 -#: ../../library/typing.rst:2825 +#: ../../library/typing.rst:2819 msgid "For example::" msgstr "" "舉例來說:\n" @@ -671,7 +671,7 @@ msgid "" "``LiteralString``-typed objects is also acceptable as a ``LiteralString``." msgstr "" -#: ../../library/typing.rst:622 ../../library/typing.rst:2467 +#: ../../library/typing.rst:622 ../../library/typing.rst:2461 msgid "Example::" msgstr "" "舉例來說:\n" @@ -1038,7 +1038,7 @@ msgid "" "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1038 ../../library/typing.rst:2708 +#: ../../library/typing.rst:1038 ../../library/typing.rst:2702 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1969,398 +1969,388 @@ msgid "" msgstr "" #: ../../library/typing.rst:2093 -msgid "A generic version of :class:`collections.abc.ByteString`." -msgstr "" - -#: ../../library/typing.rst:2095 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2098 +#: ../../library/typing.rst:2097 msgid "" -"As a shorthand for this type, :class:`bytes` can be used to annotate " -"arguments of any of the types mentioned above." +"Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " +"| memoryview``." msgstr "" #: ../../library/typing.rst:2101 -msgid "" -":class:`collections.abc.ByteString` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:2107 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:2111 +#: ../../library/typing.rst:2105 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2117 +#: ../../library/typing.rst:2111 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2119 +#: ../../library/typing.rst:2113 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2125 +#: ../../library/typing.rst:2119 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2127 +#: ../../library/typing.rst:2121 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2133 +#: ../../library/typing.rst:2127 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2135 +#: ../../library/typing.rst:2129 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2141 +#: ../../library/typing.rst:2135 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:2147 +#: ../../library/typing.rst:2141 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2153 +#: ../../library/typing.rst:2147 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2149 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2161 +#: ../../library/typing.rst:2155 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2163 +#: ../../library/typing.rst:2157 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2170 +#: ../../library/typing.rst:2164 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2172 +#: ../../library/typing.rst:2166 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2179 +#: ../../library/typing.rst:2173 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2181 +#: ../../library/typing.rst:2175 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2187 +#: ../../library/typing.rst:2181 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2189 +#: ../../library/typing.rst:2183 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2195 +#: ../../library/typing.rst:2189 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2197 +#: ../../library/typing.rst:2191 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2202 +#: ../../library/typing.rst:2196 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2206 +#: ../../library/typing.rst:2200 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2208 +#: ../../library/typing.rst:2202 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2214 +#: ../../library/typing.rst:2208 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2216 +#: ../../library/typing.rst:2210 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2222 +#: ../../library/typing.rst:2216 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2231 +#: ../../library/typing.rst:2225 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2235 +#: ../../library/typing.rst:2229 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2243 +#: ../../library/typing.rst:2237 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2251 +#: ../../library/typing.rst:2245 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2257 +#: ../../library/typing.rst:2251 msgid "An alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2261 +#: ../../library/typing.rst:2255 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2263 +#: ../../library/typing.rst:2257 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2269 +#: ../../library/typing.rst:2263 msgid "An alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2272 +#: ../../library/typing.rst:2266 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2276 +#: ../../library/typing.rst:2270 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:2288 +#: ../../library/typing.rst:2282 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2294 +#: ../../library/typing.rst:2288 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2303 +#: ../../library/typing.rst:2297 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2307 +#: ../../library/typing.rst:2301 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2315 +#: ../../library/typing.rst:2309 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2325 +#: ../../library/typing.rst:2319 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2332 +#: ../../library/typing.rst:2326 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2336 +#: ../../library/typing.rst:2330 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2342 +#: ../../library/typing.rst:2336 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2346 +#: ../../library/typing.rst:2340 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2352 +#: ../../library/typing.rst:2346 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2356 +#: ../../library/typing.rst:2350 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2362 +#: ../../library/typing.rst:2356 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2366 +#: ../../library/typing.rst:2360 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2371 +#: ../../library/typing.rst:2365 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2378 +#: ../../library/typing.rst:2372 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2383 +#: ../../library/typing.rst:2377 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2389 +#: ../../library/typing.rst:2383 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2391 +#: ../../library/typing.rst:2385 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2395 +#: ../../library/typing.rst:2389 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2400 +#: ../../library/typing.rst:2394 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2404 +#: ../../library/typing.rst:2398 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2408 +#: ../../library/typing.rst:2402 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2412 +#: ../../library/typing.rst:2406 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2418 +#: ../../library/typing.rst:2412 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2422 +#: ../../library/typing.rst:2416 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2426 +#: ../../library/typing.rst:2420 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2430 +#: ../../library/typing.rst:2424 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2432 +#: ../../library/typing.rst:2426 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2439 +#: ../../library/typing.rst:2433 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2441 +#: ../../library/typing.rst:2435 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2444 +#: ../../library/typing.rst:2438 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2451 +#: ../../library/typing.rst:2445 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2465 +#: ../../library/typing.rst:2459 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2478 +#: ../../library/typing.rst:2472 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " @@ -2373,53 +2363,53 @@ msgid "" "bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2490 +#: ../../library/typing.rst:2484 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2493 +#: ../../library/typing.rst:2487 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2501 +#: ../../library/typing.rst:2495 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2503 +#: ../../library/typing.rst:2497 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2509 +#: ../../library/typing.rst:2503 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2512 +#: ../../library/typing.rst:2506 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2517 +#: ../../library/typing.rst:2511 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2522 +#: ../../library/typing.rst:2516 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2532 +#: ../../library/typing.rst:2526 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -2428,19 +2418,19 @@ msgid "" "`dataclasses.dataclass`-like behaviors." msgstr "" -#: ../../library/typing.rst:2538 +#: ../../library/typing.rst:2532 msgid "Example usage with a decorator function::" msgstr "" -#: ../../library/typing.rst:2552 +#: ../../library/typing.rst:2546 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2561 +#: ../../library/typing.rst:2555 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2566 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*. *func* is the function object for the implementation of the " @@ -2586,25 +2576,25 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2674 +#: ../../library/typing.rst:2668 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2682 +#: ../../library/typing.rst:2676 msgid "" "Clear all registered overloads in the internal registry. This can be used to " "reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2690 +#: ../../library/typing.rst:2684 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2713 +#: ../../library/typing.rst:2707 msgid "" "The decorator will now set the ``__final__`` attribute to ``True`` on the " "decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2614,59 +2604,59 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2724 +#: ../../library/typing.rst:2718 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2726 +#: ../../library/typing.rst:2720 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods and classes defined in that class (but not to " "methods defined in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2730 +#: ../../library/typing.rst:2724 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2734 +#: ../../library/typing.rst:2728 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2736 +#: ../../library/typing.rst:2730 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2741 +#: ../../library/typing.rst:2735 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2743 +#: ../../library/typing.rst:2737 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2754 +#: ../../library/typing.rst:2748 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2758 +#: ../../library/typing.rst:2752 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2762 +#: ../../library/typing.rst:2756 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2765 +#: ../../library/typing.rst:2759 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2675,36 +2665,36 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2771 +#: ../../library/typing.rst:2765 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2786 +#: ../../library/typing.rst:2780 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2791 +#: ../../library/typing.rst:2785 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2794 +#: ../../library/typing.rst:2788 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2802 +#: ../../library/typing.rst:2796 msgid "Provide basic introspection for generic types and special typing forms." msgstr "" -#: ../../library/typing.rst:2804 +#: ../../library/typing.rst:2798 msgid "" "For a typing object of the form ``X[Y, Z, ...]`` these functions return " "``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" @@ -2715,11 +2705,11 @@ msgid "" "and ``()`` correspondingly. Examples::" msgstr "" -#: ../../library/typing.rst:2823 +#: ../../library/typing.rst:2817 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2838 +#: ../../library/typing.rst:2832 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2727,24 +2717,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2844 +#: ../../library/typing.rst:2838 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2851 +#: ../../library/typing.rst:2845 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2855 +#: ../../library/typing.rst:2849 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2864 +#: ../../library/typing.rst:2858 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2752,7 +2742,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2871 +#: ../../library/typing.rst:2865 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2760,11 +2750,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2880 +#: ../../library/typing.rst:2874 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:2882 +#: ../../library/typing.rst:2876 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2772,62 +2762,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:2887 +#: ../../library/typing.rst:2881 msgid "Feature" msgstr "" -#: ../../library/typing.rst:2887 +#: ../../library/typing.rst:2881 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:2887 +#: ../../library/typing.rst:2881 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:2887 +#: ../../library/typing.rst:2881 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2883 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2883 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2883 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2883 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:2892 +#: ../../library/typing.rst:2886 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:2892 +#: ../../library/typing.rst:2886 ../../library/typing.rst:2889 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:2892 ../../library/typing.rst:2895 +#: ../../library/typing.rst:2886 ../../library/typing.rst:2891 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:2892 +#: ../../library/typing.rst:2886 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:2895 +#: ../../library/typing.rst:2889 +#, fuzzy +msgid "``typing.ByteString``" +msgstr "``typing.Text``" + +#: ../../library/typing.rst:2889 +msgid "3.14" +msgstr "" + +#: ../../library/typing.rst:2889 +#, fuzzy +msgid ":gh:`91896`" +msgstr ":gh:`92332`" + +#: ../../library/typing.rst:2891 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2895 +#: ../../library/typing.rst:2891 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:2895 +#: ../../library/typing.rst:2891 msgid ":gh:`92332`" msgstr ":gh:`92332`" diff --git a/library/unicodedata.po b/library/unicodedata.po index a86aa8edf0..b017e682a5 100644 --- a/library/unicodedata.po +++ b/library/unicodedata.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -194,3 +194,15 @@ msgstr "https://www.unicode.org/Public/14.0.0/ucd/NameAliases.txt" #: ../../library/unicodedata.rst:180 msgid "https://www.unicode.org/Public/14.0.0/ucd/NamedSequences.txt" msgstr "https://www.unicode.org/Public/14.0.0/ucd/NamedSequences.txt" + +#: ../../library/unicodedata.rst:11 +msgid "Unicode" +msgstr "" + +#: ../../library/unicodedata.rst:11 +msgid "character" +msgstr "" + +#: ../../library/unicodedata.rst:11 +msgid "database" +msgstr "" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 9bf562b9d6..5a597e613b 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-08 00:21+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -407,8 +407,8 @@ msgstr "" #: ../../library/urllib.parse.rst:327 msgid "" -"Following the `WHATWG spec`_ that updates RFC 3986, ASCII newline ``\\n``, ``" -"\\r`` and tab ``\\t`` characters are stripped from the URL." +"Following the `WHATWG spec`_ that updates RFC 3986, ASCII newline ``\\n``, " +"``\\r`` and tab ``\\t`` characters are stripped from the URL." msgstr "" #: ../../library/urllib.parse.rst:338 @@ -886,3 +886,23 @@ msgstr "" #: ../../library/urllib.parse.rst:722 msgid "This specifies the formal syntax and semantics of absolute URLs." msgstr "" + +#: ../../library/urllib.parse.rst:9 +msgid "WWW" +msgstr "" + +#: ../../library/urllib.parse.rst:9 +msgid "World Wide Web" +msgstr "" + +#: ../../library/urllib.parse.rst:9 +msgid "URL" +msgstr "" + +#: ../../library/urllib.parse.rst:9 +msgid "parsing" +msgstr "" + +#: ../../library/urllib.parse.rst:9 +msgid "relative" +msgstr "" diff --git a/library/urllib.request.po b/library/urllib.request.po index a179b31946..227103af56 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1923,3 +1923,19 @@ msgstr "" #: ../../library/urllib.request.rst:1630 ../../library/urllib.request.rst:1635 msgid "Deprecated in favor of :attr:`~addinfourl.status`." msgstr "" + +#: ../../library/urllib.request.rst:1539 ../../library/urllib.request.rst:1562 +msgid "HTTP" +msgstr "" + +#: ../../library/urllib.request.rst:1539 ../../library/urllib.request.rst:1562 +msgid "protocol" +msgstr "" + +#: ../../library/urllib.request.rst:1539 ../../library/urllib.request.rst:1573 +msgid "FTP" +msgstr "" + +#: ../../library/urllib.request.rst:1562 +msgid "HTML" +msgstr "" diff --git a/library/urllib.robotparser.po b/library/urllib.robotparser.po index e83df1a07e..1b19c8a204 100644 --- a/library/urllib.robotparser.po +++ b/library/urllib.robotparser.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-01-27 13:40+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -124,3 +124,19 @@ msgstr "" "下面的範例展示了 :class:`RobotFileParser` 類別的基本用法:\n" "\n" "::" + +#: ../../library/urllib.robotparser.rst:12 +msgid "WWW" +msgstr "" + +#: ../../library/urllib.robotparser.rst:12 +msgid "World Wide Web" +msgstr "" + +#: ../../library/urllib.robotparser.rst:12 +msgid "URL" +msgstr "" + +#: ../../library/urllib.robotparser.rst:12 +msgid "robots.txt" +msgstr "" diff --git a/library/uu.po b/library/uu.po index fee8b5f3f4..7e9b8b98ef 100644 --- a/library/uu.po +++ b/library/uu.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-05-22 02:22+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -100,3 +100,11 @@ msgstr ":mod:`binascii` 模組" msgid "" "Support module containing ASCII-to-binary and binary-to-ASCII conversions." msgstr "" + +#: ../../library/uu.rst:28 +msgid "Jansen, Jack" +msgstr "" + +#: ../../library/uu.rst:28 +msgid "Ellinghouse, Lance" +msgstr "" diff --git a/library/uuid.po b/library/uuid.po index 3c578bfb97..053735f559 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -329,3 +329,23 @@ msgstr "範例" #: ../../library/uuid.rst:269 msgid "Here are some examples of typical usage of the :mod:`uuid` module::" msgstr "" + +#: ../../library/uuid.rst:173 +msgid "getnode" +msgstr "" + +#: ../../library/uuid.rst:183 +msgid "uuid1" +msgstr "" + +#: ../../library/uuid.rst:191 +msgid "uuid3" +msgstr "" + +#: ../../library/uuid.rst:198 +msgid "uuid4" +msgstr "" + +#: ../../library/uuid.rst:206 +msgid "uuid5" +msgstr "" diff --git a/library/venv.po b/library/venv.po index 07f51d10be..b2af51cee4 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-02 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -645,3 +645,11 @@ msgid "" "This script is also available for download `online `_." msgstr "" + +#: ../../library/venv.rst:14 +msgid "Environments" +msgstr "" + +#: ../../library/venv.rst:14 +msgid "virtual" +msgstr "" diff --git a/library/warnings.po b/library/warnings.po index 99f852257a..72656846b9 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -711,3 +711,7 @@ msgstr "" #: ../../library/warnings.rst:528 msgid "Added the *action*, *category*, *lineno*, and *append* parameters." msgstr "" + +#: ../../library/warnings.rst:9 +msgid "warnings" +msgstr "" diff --git a/library/winreg.po b/library/winreg.po index 19684b210c..aac381cf84 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -953,3 +953,11 @@ msgstr "" msgid "" "will automatically close *key* when control leaves the :keyword:`with` block." msgstr "" + +#: ../../library/winreg.rst:242 +msgid "% (percent)" +msgstr "" + +#: ../../library/winreg.rst:242 +msgid "environment variables expansion (Windows)" +msgstr "" diff --git a/library/xdrlib.po b/library/xdrlib.po index 319f16afd0..bc45c3b036 100644 --- a/library/xdrlib.po +++ b/library/xdrlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2016-01-31 07:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,8 +31,8 @@ msgid "" "The :mod:`xdrlib` module is deprecated (see :pep:`PEP 594 <594#xdrlib>` for " "details)." msgstr "" -":mod:`xdrlib` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#xdrlib>`" -"\\ )。" +":mod:`xdrlib` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +"<594#xdrlib>`\\ )。" #: ../../library/xdrlib.rst:20 msgid "" @@ -311,3 +311,11 @@ msgstr "" #: ../../library/xdrlib.rst:275 msgid "Here is an example of how you would catch one of these exceptions::" msgstr "" + +#: ../../library/xdrlib.rst:10 +msgid "XDR" +msgstr "" + +#: ../../library/xdrlib.rst:10 +msgid "External Data Representation" +msgstr "" diff --git a/library/zipapp.po b/library/zipapp.po index 266101774a..db0d3eca1a 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-09 00:34+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -540,3 +540,7 @@ msgid "" "application archives - the module is a convenience, but archives in the " "above format created by any means are acceptable to Python." msgstr "" + +#: ../../library/zipapp.rst:11 +msgid "Executable Zip Files" +msgstr "" diff --git a/library/zlib.po b/library/zlib.po index edb167bbce..538e15ffc5 100644 --- a/library/zlib.po +++ b/library/zlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -454,3 +454,11 @@ msgid "" "The zlib manual explains the semantics and usage of the library's many " "functions." msgstr "" + +#: ../../library/zlib.rst:123 +msgid "Cyclic Redundancy Check" +msgstr "" + +#: ../../library/zlib.rst:123 +msgid "checksum" +msgstr "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 16cfca57dc..61bb4d9b1b 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1827,3 +1827,408 @@ msgid "" "transformed into the namespace's ``__doc__`` item and therefore the class's :" "term:`docstring`." msgstr "" + +#: ../../reference/compound_stmts.rst:7 +msgid "compound" +msgstr "" + +#: ../../reference/compound_stmts.rst:7 ../../reference/compound_stmts.rst:86 +#: ../../reference/compound_stmts.rst:111 +#: ../../reference/compound_stmts.rst:129 +#: ../../reference/compound_stmts.rst:144 +#: ../../reference/compound_stmts.rst:169 +#: ../../reference/compound_stmts.rst:207 +#: ../../reference/compound_stmts.rst:391 +#: ../../reference/compound_stmts.rst:438 +#: ../../reference/compound_stmts.rst:472 +#: ../../reference/compound_stmts.rst:589 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1468 +#: ../../reference/compound_stmts.rst:1502 +#: ../../reference/compound_stmts.rst:1547 +msgid "statement" +msgstr "" + +#: ../../reference/compound_stmts.rst:21 +msgid "clause" +msgstr "" + +#: ../../reference/compound_stmts.rst:21 +msgid "suite" +msgstr "" + +#: ../../reference/compound_stmts.rst:21 +msgid "; (semicolon)" +msgstr "" + +#: ../../reference/compound_stmts.rst:64 +msgid "NEWLINE token" +msgstr "" + +#: ../../reference/compound_stmts.rst:64 +msgid "DEDENT token" +msgstr "" + +#: ../../reference/compound_stmts.rst:64 +msgid "dangling" +msgstr "" + +#: ../../reference/compound_stmts.rst:64 ../../reference/compound_stmts.rst:86 +#: ../../reference/compound_stmts.rst:111 +#: ../../reference/compound_stmts.rst:144 +#: ../../reference/compound_stmts.rst:207 +#: ../../reference/compound_stmts.rst:391 +msgid "else" +msgstr "" + +#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:589 +msgid "if" +msgstr "" + +#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:111 +#: ../../reference/compound_stmts.rst:144 +#: ../../reference/compound_stmts.rst:207 +#: ../../reference/compound_stmts.rst:328 +#: ../../reference/compound_stmts.rst:391 +#: ../../reference/compound_stmts.rst:409 +#: ../../reference/compound_stmts.rst:472 +#: ../../reference/compound_stmts.rst:589 +#: ../../reference/compound_stmts.rst:1478 +msgid "keyword" +msgstr "" + +#: ../../reference/compound_stmts.rst:86 +msgid "elif" +msgstr "" + +#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:111 +#: ../../reference/compound_stmts.rst:144 +#: ../../reference/compound_stmts.rst:207 +#: ../../reference/compound_stmts.rst:472 +#: ../../reference/compound_stmts.rst:589 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1311 +#: ../../reference/compound_stmts.rst:1367 +msgid ": (colon)" +msgstr "" + +#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:111 +#: ../../reference/compound_stmts.rst:144 +#: ../../reference/compound_stmts.rst:207 +#: ../../reference/compound_stmts.rst:472 +#: ../../reference/compound_stmts.rst:589 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1367 +msgid "compound statement" +msgstr "" + +#: ../../reference/compound_stmts.rst:111 +msgid "while" +msgstr "" + +#: ../../reference/compound_stmts.rst:111 +#: ../../reference/compound_stmts.rst:144 +msgid "loop" +msgstr "" + +#: ../../reference/compound_stmts.rst:129 +#: ../../reference/compound_stmts.rst:169 +#: ../../reference/compound_stmts.rst:391 +#: ../../reference/compound_stmts.rst:438 +msgid "break" +msgstr "" + +#: ../../reference/compound_stmts.rst:129 +#: ../../reference/compound_stmts.rst:169 +#: ../../reference/compound_stmts.rst:391 +#: ../../reference/compound_stmts.rst:438 +msgid "continue" +msgstr "" + +#: ../../reference/compound_stmts.rst:144 +msgid "for" +msgstr "" + +#: ../../reference/compound_stmts.rst:144 +msgid "in" +msgstr "" + +#: ../../reference/compound_stmts.rst:144 +msgid "target" +msgstr "" + +#: ../../reference/compound_stmts.rst:144 +msgid "list" +msgstr "" + +#: ../../reference/compound_stmts.rst:144 +#: ../../reference/compound_stmts.rst:299 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1367 +msgid "object" +msgstr "" + +#: ../../reference/compound_stmts.rst:144 +msgid "sequence" +msgstr "" + +#: ../../reference/compound_stmts.rst:190 +msgid "built-in function" +msgstr "" + +#: ../../reference/compound_stmts.rst:190 +msgid "range" +msgstr "" + +#: ../../reference/compound_stmts.rst:207 +msgid "try" +msgstr "" + +#: ../../reference/compound_stmts.rst:207 +msgid "except" +msgstr "" + +#: ../../reference/compound_stmts.rst:207 +#: ../../reference/compound_stmts.rst:409 +msgid "finally" +msgstr "" + +#: ../../reference/compound_stmts.rst:207 +#: ../../reference/compound_stmts.rst:266 +#: ../../reference/compound_stmts.rst:472 +#: ../../reference/compound_stmts.rst:589 +msgid "as" +msgstr "" + +#: ../../reference/compound_stmts.rst:266 +msgid "except clause" +msgstr "" + +#: ../../reference/compound_stmts.rst:299 +msgid "module" +msgstr "" + +#: ../../reference/compound_stmts.rst:299 +msgid "sys" +msgstr "" + +#: ../../reference/compound_stmts.rst:299 +msgid "traceback" +msgstr "" + +#: ../../reference/compound_stmts.rst:328 +msgid "except_star" +msgstr "" + +#: ../../reference/compound_stmts.rst:391 +#: ../../reference/compound_stmts.rst:438 +msgid "return" +msgstr "" + +#: ../../reference/compound_stmts.rst:472 +msgid "with" +msgstr "" + +#: ../../reference/compound_stmts.rst:472 +msgid "with statement" +msgstr "" + +#: ../../reference/compound_stmts.rst:472 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1367 +msgid ", (comma)" +msgstr "" + +#: ../../reference/compound_stmts.rst:589 +msgid "match" +msgstr "" + +#: ../../reference/compound_stmts.rst:589 +msgid "case" +msgstr "" + +#: ../../reference/compound_stmts.rst:589 +#, fuzzy +msgid "pattern matching" +msgstr ":ref:`class-pattern-matching`" + +#: ../../reference/compound_stmts.rst:589 +msgid "match statement" +msgstr "" + +#: ../../reference/compound_stmts.rst:693 +msgid "guard" +msgstr "" + +#: ../../reference/compound_stmts.rst:732 +msgid "irrefutable case block" +msgstr "" + +#: ../../reference/compound_stmts.rst:732 +msgid "case block" +msgstr "" + +#: ../../reference/compound_stmts.rst:756 +msgid "! patterns" +msgstr "" + +#: ../../reference/compound_stmts.rst:756 +msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" +msgstr "" + +#: ../../reference/compound_stmts.rst:1185 +#: ../../reference/compound_stmts.rst:1261 +msgid "parameter" +msgstr "" + +#: ../../reference/compound_stmts.rst:1185 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1235 +#: ../../reference/compound_stmts.rst:1261 +#: ../../reference/compound_stmts.rst:1290 +#, fuzzy +msgid "function definition" +msgstr "函式定義" + +#: ../../reference/compound_stmts.rst:1194 +msgid "def" +msgstr "" + +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1311 +msgid "function" +msgstr "" + +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1367 +#, fuzzy +msgid "definition" +msgstr "函式定義" + +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1367 +msgid "name" +msgstr "" + +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1367 +msgid "binding" +msgstr "" + +#: ../../reference/compound_stmts.rst:1194 +msgid "user-defined function" +msgstr "" + +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1367 +msgid "() (parentheses)" +msgstr "" + +#: ../../reference/compound_stmts.rst:1194 +msgid "parameter list" +msgstr "" + +#: ../../reference/compound_stmts.rst:1235 +#: ../../reference/compound_stmts.rst:1417 +msgid "@ (at)" +msgstr "" + +#: ../../reference/compound_stmts.rst:1261 +msgid "default" +msgstr "" + +#: ../../reference/compound_stmts.rst:1261 +msgid "value" +msgstr "" + +#: ../../reference/compound_stmts.rst:1261 +msgid "argument" +msgstr "" + +#: ../../reference/compound_stmts.rst:1261 +msgid "= (equals)" +msgstr "" + +#: ../../reference/compound_stmts.rst:1290 +msgid "/ (slash)" +msgstr "" + +#: ../../reference/compound_stmts.rst:1290 +msgid "* (asterisk)" +msgstr "" + +#: ../../reference/compound_stmts.rst:1290 +msgid "**" +msgstr "" + +#: ../../reference/compound_stmts.rst:1311 +msgid "annotations" +msgstr "" + +#: ../../reference/compound_stmts.rst:1311 +msgid "->" +msgstr "" + +#: ../../reference/compound_stmts.rst:1311 +#, fuzzy +msgid "function annotations" +msgstr "函式定義" + +#: ../../reference/compound_stmts.rst:1329 +msgid "lambda" +msgstr "" + +#: ../../reference/compound_stmts.rst:1329 +msgid "expression" +msgstr "" + +#: ../../reference/compound_stmts.rst:1367 +msgid "class" +msgstr "" + +#: ../../reference/compound_stmts.rst:1367 +msgid "execution" +msgstr "" + +#: ../../reference/compound_stmts.rst:1367 +msgid "frame" +msgstr "" + +#: ../../reference/compound_stmts.rst:1367 +msgid "inheritance" +msgstr "" + +#: ../../reference/compound_stmts.rst:1367 +msgid "docstring" +msgstr "" + +#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1417 +#, fuzzy +msgid "class definition" +msgstr "函式定義" + +#: ../../reference/compound_stmts.rst:1367 +msgid "expression list" +msgstr "" + +#: ../../reference/compound_stmts.rst:1468 +msgid "async def" +msgstr "" + +#: ../../reference/compound_stmts.rst:1478 +msgid "async" +msgstr "" + +#: ../../reference/compound_stmts.rst:1478 +msgid "await" +msgstr "" + +#: ../../reference/compound_stmts.rst:1502 +msgid "async for" +msgstr "" + +#: ../../reference/compound_stmts.rst:1547 +msgid "async with" +msgstr "" diff --git a/reference/datamodel.po b/reference/datamodel.po index 37514e7cd0..e18a0a5256 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -158,7 +158,7 @@ msgid "" "future." msgstr "" -#: ../../reference/datamodel.rst:150 +#: ../../reference/datamodel.rst:145 ../../reference/datamodel.rst:150 msgid "None" msgstr "" @@ -170,7 +170,7 @@ msgid "" "functions that don't explicitly return anything. Its truth value is false." msgstr "" -#: ../../reference/datamodel.rst:170 +#: ../../reference/datamodel.rst:153 ../../reference/datamodel.rst:170 msgid "NotImplemented" msgstr "NotImplemented" @@ -195,7 +195,7 @@ msgid "" "will raise a :exc:`TypeError` in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:179 +#: ../../reference/datamodel.rst:173 ../../reference/datamodel.rst:179 msgid "Ellipsis" msgstr "" @@ -3543,3 +3543,948 @@ msgid "" "method -- such as :meth:`~object.__add__` -- fails then the overall " "operation is not supported, which is why the reflected method is not called." msgstr "" + +#: ../../reference/datamodel.rst:14 ../../reference/datamodel.rst:145 +#: ../../reference/datamodel.rst:153 ../../reference/datamodel.rst:173 +#: ../../reference/datamodel.rst:182 ../../reference/datamodel.rst:212 +#: ../../reference/datamodel.rst:227 ../../reference/datamodel.rst:244 +#: ../../reference/datamodel.rst:259 ../../reference/datamodel.rst:269 +#: ../../reference/datamodel.rst:295 ../../reference/datamodel.rst:330 +#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:366 +#: ../../reference/datamodel.rst:386 ../../reference/datamodel.rst:405 +#: ../../reference/datamodel.rst:412 ../../reference/datamodel.rst:420 +#: ../../reference/datamodel.rst:434 ../../reference/datamodel.rst:467 +#: ../../reference/datamodel.rst:477 ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:690 ../../reference/datamodel.rst:705 +#: ../../reference/datamodel.rst:729 ../../reference/datamodel.rst:807 +#: ../../reference/datamodel.rst:867 ../../reference/datamodel.rst:894 +#: ../../reference/datamodel.rst:944 ../../reference/datamodel.rst:998 +#: ../../reference/datamodel.rst:1055 ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1499 ../../reference/datamodel.rst:2504 +msgid "object" +msgstr "" + +#: ../../reference/datamodel.rst:14 ../../reference/datamodel.rst:122 +msgid "data" +msgstr "" + +#: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:269 +#: ../../reference/datamodel.rst:310 ../../reference/datamodel.rst:386 +#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:690 +#: ../../reference/datamodel.rst:910 ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1413 ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1499 ../../reference/datamodel.rst:2050 +#: ../../reference/datamodel.rst:2474 ../../reference/datamodel.rst:2632 +#: ../../reference/datamodel.rst:2667 ../../reference/datamodel.rst:2681 +#: ../../reference/datamodel.rst:2728 ../../reference/datamodel.rst:2738 +#: ../../reference/datamodel.rst:2766 +msgid "built-in function" +msgstr "" + +#: ../../reference/datamodel.rst:23 +msgid "id" +msgstr "" + +#: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 +#: ../../reference/datamodel.rst:2050 +msgid "type" +msgstr "" + +#: ../../reference/datamodel.rst:23 +msgid "identity of an object" +msgstr "" + +#: ../../reference/datamodel.rst:23 +msgid "value of an object" +msgstr "" + +#: ../../reference/datamodel.rst:23 +msgid "type of an object" +msgstr "" + +#: ../../reference/datamodel.rst:23 +msgid "mutable object" +msgstr "" + +#: ../../reference/datamodel.rst:23 +msgid "immutable object" +msgstr "" + +#: ../../reference/datamodel.rst:60 +msgid "garbage collection" +msgstr "" + +#: ../../reference/datamodel.rst:60 +msgid "reference counting" +msgstr "" + +#: ../../reference/datamodel.rst:60 +msgid "unreachable object" +msgstr "" + +#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:807 +msgid "container" +msgstr "" + +#: ../../reference/datamodel.rst:122 +msgid "hierarchy" +msgstr "" + +#: ../../reference/datamodel.rst:122 +msgid "extension" +msgstr "" + +#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:380 +#: ../../reference/datamodel.rst:453 ../../reference/datamodel.rst:729 +#: ../../reference/datamodel.rst:748 ../../reference/datamodel.rst:910 +#, fuzzy +msgid "module" +msgstr "模組" + +#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:244 +#: ../../reference/datamodel.rst:690 +msgid "C" +msgstr "" + +#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:244 +#: ../../reference/datamodel.rst:690 +msgid "language" +msgstr "" + +#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:807 +#: ../../reference/datamodel.rst:824 ../../reference/datamodel.rst:867 +#: ../../reference/datamodel.rst:887 +#, fuzzy +msgid "attribute" +msgstr "屬性" + +#: ../../reference/datamodel.rst:135 +msgid "special" +msgstr "" + +#: ../../reference/datamodel.rst:135 +msgid "generic" +msgstr "" + +#: ../../reference/datamodel.rst:173 +msgid "..." +msgstr "" + +#: ../../reference/datamodel.rst:173 +msgid "ellipsis literal" +msgstr "" + +#: ../../reference/datamodel.rst:182 ../../reference/datamodel.rst:894 +msgid "numeric" +msgstr "" + +#: ../../reference/datamodel.rst:212 ../../reference/datamodel.rst:238 +#: ../../reference/datamodel.rst:310 +msgid "integer" +msgstr "" + +#: ../../reference/datamodel.rst:227 +msgid "Boolean" +msgstr "" + +#: ../../reference/datamodel.rst:227 +msgid "False" +msgstr "" + +#: ../../reference/datamodel.rst:227 +msgid "True" +msgstr "" + +#: ../../reference/datamodel.rst:238 +msgid "representation" +msgstr "" + +#: ../../reference/datamodel.rst:244 +msgid "floating point" +msgstr "" + +#: ../../reference/datamodel.rst:244 ../../reference/datamodel.rst:259 +msgid "number" +msgstr "" + +#: ../../reference/datamodel.rst:244 +msgid "Java" +msgstr "" + +#: ../../reference/datamodel.rst:259 ../../reference/datamodel.rst:2738 +msgid "complex" +msgstr "" + +#: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:386 +#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:2474 +msgid "len" +msgstr "" + +#: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:894 +msgid "sequence" +msgstr "" + +#: ../../reference/datamodel.rst:269 +msgid "index operation" +msgstr "" + +#: ../../reference/datamodel.rst:269 +msgid "item selection" +msgstr "" + +#: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:352 +#: ../../reference/datamodel.rst:420 +msgid "subscription" +msgstr "" + +#: ../../reference/datamodel.rst:281 ../../reference/datamodel.rst:352 +msgid "slicing" +msgstr "" + +#: ../../reference/datamodel.rst:295 +msgid "immutable sequence" +msgstr "" + +#: ../../reference/datamodel.rst:295 +msgid "immutable" +msgstr "" + +#: ../../reference/datamodel.rst:306 ../../reference/datamodel.rst:1388 +#: ../../reference/datamodel.rst:1418 +#, fuzzy +msgid "string" +msgstr "字串 (String)" + +#: ../../reference/datamodel.rst:306 +msgid "immutable sequences" +msgstr "" + +#: ../../reference/datamodel.rst:310 +msgid "chr" +msgstr "" + +#: ../../reference/datamodel.rst:310 +msgid "ord" +msgstr "" + +#: ../../reference/datamodel.rst:310 +msgid "character" +msgstr "" + +#: ../../reference/datamodel.rst:310 +msgid "Unicode" +msgstr "" + +#: ../../reference/datamodel.rst:330 +msgid "tuple" +msgstr "" + +#: ../../reference/datamodel.rst:330 +msgid "singleton" +msgstr "" + +#: ../../reference/datamodel.rst:330 +msgid "empty" +msgstr "" + +#: ../../reference/datamodel.rst:343 ../../reference/datamodel.rst:1413 +msgid "bytes" +msgstr "" + +#: ../../reference/datamodel.rst:343 +msgid "byte" +msgstr "" + +#: ../../reference/datamodel.rst:352 +msgid "mutable sequence" +msgstr "" + +#: ../../reference/datamodel.rst:352 +msgid "mutable" +msgstr "" + +#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:824 +#: ../../reference/datamodel.rst:887 +msgid "assignment" +msgstr "" + +#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:729 +#: ../../reference/datamodel.rst:1149 ../../reference/datamodel.rst:1309 +#: ../../reference/datamodel.rst:2793 +msgid "statement" +msgstr "" + +#: ../../reference/datamodel.rst:366 +msgid "list" +msgstr "" + +#: ../../reference/datamodel.rst:373 +msgid "bytearray" +msgstr "" + +#: ../../reference/datamodel.rst:380 +msgid "array" +msgstr "" + +#: ../../reference/datamodel.rst:386 +msgid "set type" +msgstr "" + +#: ../../reference/datamodel.rst:405 +msgid "set" +msgstr "" + +#: ../../reference/datamodel.rst:412 +msgid "frozenset" +msgstr "" + +#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:894 +msgid "mapping" +msgstr "" + +#: ../../reference/datamodel.rst:434 ../../reference/datamodel.rst:807 +#: ../../reference/datamodel.rst:1499 +#, fuzzy +msgid "dictionary" +msgstr "字典" + +#: ../../reference/datamodel.rst:453 +msgid "dbm.ndbm" +msgstr "" + +#: ../../reference/datamodel.rst:453 +msgid "dbm.gnu" +msgstr "" + +#: ../../reference/datamodel.rst:467 +msgid "callable" +msgstr "" + +#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:477 +#: ../../reference/datamodel.rst:645 ../../reference/datamodel.rst:660 +#: ../../reference/datamodel.rst:670 ../../reference/datamodel.rst:690 +msgid "function" +msgstr "" + +#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:807 +#: ../../reference/datamodel.rst:829 ../../reference/datamodel.rst:2427 +msgid "call" +msgstr "" + +#: ../../reference/datamodel.rst:467 +msgid "invocation" +msgstr "" + +#: ../../reference/datamodel.rst:467 +msgid "argument" +msgstr "" + +#: ../../reference/datamodel.rst:477 ../../reference/datamodel.rst:582 +msgid "user-defined" +msgstr "" + +#: ../../reference/datamodel.rst:477 +msgid "user-defined function" +msgstr "" + +#: ../../reference/datamodel.rst:491 +msgid "__doc__ (function attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:491 +msgid "__name__ (function attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:491 +msgid "__module__ (function attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:491 +msgid "__dict__ (function attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:491 +msgid "__defaults__ (function attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:491 +msgid "__closure__ (function attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:491 +msgid "__code__ (function attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:491 +msgid "__globals__ (function attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:491 +msgid "__annotations__ (function attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:491 +msgid "__kwdefaults__ (function attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:491 +msgid "global" +msgstr "" + +#: ../../reference/datamodel.rst:491 ../../reference/datamodel.rst:748 +msgid "namespace" +msgstr "" + +#: ../../reference/datamodel.rst:582 ../../reference/datamodel.rst:705 +msgid "method" +msgstr "" + +#: ../../reference/datamodel.rst:582 +msgid "user-defined method" +msgstr "" + +#: ../../reference/datamodel.rst:590 +msgid "__func__ (method attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:590 +msgid "__self__ (method attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:590 +msgid "__doc__ (method attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:590 +msgid "__name__ (method attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:590 +msgid "__module__ (method attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:645 ../../reference/datamodel.rst:998 +msgid "generator" +msgstr "" + +#: ../../reference/datamodel.rst:645 +msgid "iterator" +msgstr "" + +#: ../../reference/datamodel.rst:660 ../../reference/datamodel.rst:2939 +#, fuzzy +msgid "coroutine" +msgstr "協程" + +#: ../../reference/datamodel.rst:670 +msgid "asynchronous generator" +msgstr "" + +#: ../../reference/datamodel.rst:670 +msgid "asynchronous iterator" +msgstr "" + +#: ../../reference/datamodel.rst:705 +msgid "built-in method" +msgstr "" + +#: ../../reference/datamodel.rst:705 +msgid "built-in" +msgstr "" + +#: ../../reference/datamodel.rst:729 +msgid "import" +msgstr "" + +#: ../../reference/datamodel.rst:748 +msgid "__name__ (module attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:748 +msgid "__doc__ (module attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:748 +msgid "__file__ (module attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:748 +msgid "__annotations__ (module attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:779 +msgid "__dict__ (module attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:807 ../../reference/datamodel.rst:824 +#: ../../reference/datamodel.rst:867 ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:2157 +msgid "class" +msgstr "" + +#: ../../reference/datamodel.rst:807 ../../reference/datamodel.rst:867 +#: ../../reference/datamodel.rst:887 +msgid "class instance" +msgstr "" + +#: ../../reference/datamodel.rst:807 ../../reference/datamodel.rst:867 +#: ../../reference/datamodel.rst:2427 +msgid "instance" +msgstr "" + +#: ../../reference/datamodel.rst:807 ../../reference/datamodel.rst:829 +msgid "class object" +msgstr "" + +#: ../../reference/datamodel.rst:833 +msgid "__name__ (class attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:833 +msgid "__module__ (class attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:833 +msgid "__dict__ (class attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:833 +msgid "__bases__ (class attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:833 +msgid "__doc__ (class attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:833 +msgid "__annotations__ (class attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:902 +msgid "__dict__ (instance attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:902 +msgid "__class__ (instance attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:910 +msgid "open" +msgstr "" + +#: ../../reference/datamodel.rst:910 +msgid "io" +msgstr "" + +#: ../../reference/datamodel.rst:910 +msgid "popen() (in module os)" +msgstr "" + +#: ../../reference/datamodel.rst:910 +msgid "makefile() (socket method)" +msgstr "" + +#: ../../reference/datamodel.rst:910 +msgid "sys.stdin" +msgstr "" + +#: ../../reference/datamodel.rst:910 +msgid "sys.stdout" +msgstr "" + +#: ../../reference/datamodel.rst:910 +msgid "sys.stderr" +msgstr "" + +#: ../../reference/datamodel.rst:910 +msgid "stdio" +msgstr "" + +#: ../../reference/datamodel.rst:910 +msgid "stdin (in module sys)" +msgstr "" + +#: ../../reference/datamodel.rst:910 +msgid "stdout (in module sys)" +msgstr "" + +#: ../../reference/datamodel.rst:910 +msgid "stderr (in module sys)" +msgstr "" + +#: ../../reference/datamodel.rst:936 +msgid "internal type" +msgstr "" + +#: ../../reference/datamodel.rst:936 +msgid "types, internal" +msgstr "" + +#: ../../reference/datamodel.rst:944 +msgid "bytecode" +msgstr "" + +#: ../../reference/datamodel.rst:944 +msgid "code" +msgstr "" + +#: ../../reference/datamodel.rst:944 +msgid "code object" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_argcount (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_posonlyargcount (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_kwonlyargcount (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_code (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_consts (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_filename (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_firstlineno (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_flags (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_lnotab (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_name (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_names (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_nlocals (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_stacksize (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_varnames (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_cellvars (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_freevars (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:956 +msgid "co_qualname (code object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1014 +msgid "documentation string" +msgstr "" + +#: ../../reference/datamodel.rst:1055 +msgid "frame" +msgstr "" + +#: ../../reference/datamodel.rst:1060 +msgid "f_back (frame attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1060 +msgid "f_code (frame attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1060 +msgid "f_globals (frame attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1060 +msgid "f_locals (frame attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1060 +msgid "f_lasti (frame attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1060 +msgid "f_builtins (frame attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1079 +msgid "f_trace (frame attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1079 +msgid "f_trace_lines (frame attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1079 +msgid "f_trace_opcodes (frame attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1079 +msgid "f_lineno (frame attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1117 +msgid "traceback" +msgstr "" + +#: ../../reference/datamodel.rst:1117 +msgid "stack" +msgstr "" + +#: ../../reference/datamodel.rst:1117 +msgid "trace" +msgstr "" + +#: ../../reference/datamodel.rst:1117 +msgid "exception" +msgstr "" + +#: ../../reference/datamodel.rst:1117 +msgid "handler" +msgstr "" + +#: ../../reference/datamodel.rst:1117 +msgid "execution" +msgstr "" + +#: ../../reference/datamodel.rst:1117 +msgid "exc_info (in module sys)" +msgstr "" + +#: ../../reference/datamodel.rst:1117 +msgid "last_traceback (in module sys)" +msgstr "" + +#: ../../reference/datamodel.rst:1117 +msgid "sys.exc_info" +msgstr "" + +#: ../../reference/datamodel.rst:1117 +msgid "sys.exception" +msgstr "" + +#: ../../reference/datamodel.rst:1117 +msgid "sys.last_traceback" +msgstr "" + +#: ../../reference/datamodel.rst:1149 +msgid "tb_frame (traceback attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1149 +msgid "tb_lineno (traceback attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1149 +msgid "tb_lasti (traceback attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1149 +msgid "try" +msgstr "" + +#: ../../reference/datamodel.rst:1167 +msgid "tb_next (traceback attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1179 ../../reference/datamodel.rst:2504 +msgid "slice" +msgstr "" + +#: ../../reference/datamodel.rst:1185 +msgid "start (slice object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1185 +msgid "stop (slice object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1185 +msgid "step (slice object attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1227 +msgid "operator" +msgstr "" + +#: ../../reference/datamodel.rst:1227 +msgid "overloading" +msgstr "" + +#: ../../reference/datamodel.rst:1227 +msgid "__getitem__() (mapping object method)" +msgstr "" + +#: ../../reference/datamodel.rst:1263 +msgid "subclassing" +msgstr "" + +#: ../../reference/datamodel.rst:1263 +msgid "immutable types" +msgstr "" + +#: ../../reference/datamodel.rst:1292 +msgid "constructor" +msgstr "" + +#: ../../reference/datamodel.rst:1309 +msgid "destructor" +msgstr "" + +#: ../../reference/datamodel.rst:1309 +msgid "finalizer" +msgstr "" + +#: ../../reference/datamodel.rst:1309 +msgid "del" +msgstr "" + +#: ../../reference/datamodel.rst:1371 +msgid "repr() (built-in function)" +msgstr "" + +#: ../../reference/datamodel.rst:1371 +msgid "__repr__() (object method)" +msgstr "" + +#: ../../reference/datamodel.rst:1388 +msgid "__str__() (object method)" +msgstr "" + +#: ../../reference/datamodel.rst:1388 +msgid "format() (built-in function)" +msgstr "" + +#: ../../reference/datamodel.rst:1388 +msgid "print() (built-in function)" +msgstr "" + +#: ../../reference/datamodel.rst:1418 +msgid "__format__() (object method)" +msgstr "" + +#: ../../reference/datamodel.rst:1418 +msgid "conversion" +msgstr "" + +#: ../../reference/datamodel.rst:1418 +msgid "print" +msgstr "" + +#: ../../reference/datamodel.rst:1457 +msgid "comparisons" +msgstr "" + +#: ../../reference/datamodel.rst:1499 +msgid "hash" +msgstr "" + +#: ../../reference/datamodel.rst:1580 +msgid "__len__() (mapping object method)" +msgstr "" + +#: ../../reference/datamodel.rst:1683 +msgid "__getattr__ (module attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1683 +msgid "__dir__ (module attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:1683 +msgid "__class__ (module attribute)" +msgstr "" + +#: ../../reference/datamodel.rst:2050 +msgid "metaclass" +msgstr "" + +#: ../../reference/datamodel.rst:2050 +msgid "= (equals)" +msgstr "" + +#: ../../reference/datamodel.rst:2050 +msgid "class definition" +msgstr "" + +#: ../../reference/datamodel.rst:2110 +msgid "metaclass hint" +msgstr "" + +#: ../../reference/datamodel.rst:2133 +msgid "__prepare__ (metaclass method)" +msgstr "" + +#: ../../reference/datamodel.rst:2157 +msgid "body" +msgstr "" + +#: ../../reference/datamodel.rst:2177 +msgid "__class__ (method cell)" +msgstr "" + +#: ../../reference/datamodel.rst:2177 +msgid "__classcell__ (class namespace entry)" +msgstr "" + +#: ../../reference/datamodel.rst:2474 +msgid "__bool__() (object method)" +msgstr "" + +#: ../../reference/datamodel.rst:2632 ../../reference/datamodel.rst:2667 +msgid "divmod" +msgstr "" + +#: ../../reference/datamodel.rst:2632 ../../reference/datamodel.rst:2667 +#: ../../reference/datamodel.rst:2681 +msgid "pow" +msgstr "" + +#: ../../reference/datamodel.rst:2728 +msgid "abs" +msgstr "" + +#: ../../reference/datamodel.rst:2738 +msgid "int" +msgstr "" + +#: ../../reference/datamodel.rst:2738 +msgid "float" +msgstr "" + +#: ../../reference/datamodel.rst:2766 +msgid "round" +msgstr "" + +#: ../../reference/datamodel.rst:2793 +msgid "with" +msgstr "" + +#: ../../reference/datamodel.rst:2793 +msgid "context manager" +msgstr "" diff --git a/reference/executionmodel.po b/reference/executionmodel.po index 1cae2001cb..a183fc1f6f 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-23 00:16+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -345,3 +345,113 @@ msgid "" "This limitation occurs because the code that is executed by these operations " "is not available at the time the module is compiled." msgstr "" + +#: ../../reference/executionmodel.rst:8 +msgid "execution model" +msgstr "" + +#: ../../reference/executionmodel.rst:8 +msgid "code" +msgstr "" + +#: ../../reference/executionmodel.rst:8 ../../reference/executionmodel.rst:17 +msgid "block" +msgstr "" + +#: ../../reference/executionmodel.rst:31 ../../reference/executionmodel.rst:179 +#, fuzzy +msgid "execution" +msgstr "例外" + +#: ../../reference/executionmodel.rst:31 +msgid "frame" +msgstr "" + +#: ../../reference/executionmodel.rst:42 +msgid "namespace" +msgstr "" + +#: ../../reference/executionmodel.rst:42 ../../reference/executionmodel.rst:101 +msgid "scope" +msgstr "" + +#: ../../reference/executionmodel.rst:51 +msgid "name" +msgstr "" + +#: ../../reference/executionmodel.rst:51 +msgid "binding" +msgstr "" + +#: ../../reference/executionmodel.rst:57 +msgid "from" +msgstr "" + +#: ../../reference/executionmodel.rst:57 +msgid "import statement" +msgstr "" + +#: ../../reference/executionmodel.rst:85 +msgid "free" +msgstr "" + +#: ../../reference/executionmodel.rst:85 +msgid "variable" +msgstr "" + +#: ../../reference/executionmodel.rst:109 +msgid "environment" +msgstr "" + +#: ../../reference/executionmodel.rst:115 +msgid "NameError (built-in exception)" +msgstr "" + +#: ../../reference/executionmodel.rst:115 +msgid "UnboundLocalError" +msgstr "" + +#: ../../reference/executionmodel.rst:154 +msgid "module" +msgstr "" + +#: ../../reference/executionmodel.rst:154 +msgid "__main__" +msgstr "" + +#: ../../reference/executionmodel.rst:179 +msgid "restricted" +msgstr "" + +#: ../../reference/executionmodel.rst:226 +#, fuzzy +msgid "exception" +msgstr "例外" + +#: ../../reference/executionmodel.rst:228 +msgid "raise an exception" +msgstr "" + +#: ../../reference/executionmodel.rst:228 +msgid "handle an exception" +msgstr "" + +#: ../../reference/executionmodel.rst:228 +msgid "exception handler" +msgstr "" + +#: ../../reference/executionmodel.rst:228 +msgid "errors" +msgstr "" + +#: ../../reference/executionmodel.rst:228 +msgid "error handling" +msgstr "" + +#: ../../reference/executionmodel.rst:249 +msgid "termination model" +msgstr "" + +#: ../../reference/executionmodel.rst:256 +msgid "SystemExit (built-in exception)" +msgstr "" diff --git a/reference/expressions.po b/reference/expressions.po index 550c9f813f..fb52f3ca3e 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-03 00:16+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2229,3 +2229,771 @@ msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." msgstr "" + +#: ../../reference/expressions.rst:8 ../../reference/expressions.rst:362 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1695 +#: ../../reference/expressions.rst:1782 ../../reference/expressions.rst:1808 +#: ../../reference/expressions.rst:1836 +#, fuzzy +msgid "expression" +msgstr "``(expressions...)``," + +#: ../../reference/expressions.rst:8 +msgid "BNF" +msgstr "" + +#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1196 +#: ../../reference/expressions.rst:1244 +msgid "arithmetic" +msgstr "" + +#: ../../reference/expressions.rst:28 +msgid "conversion" +msgstr "" + +#: ../../reference/expressions.rst:51 +msgid "atom" +msgstr "" + +#: ../../reference/expressions.rst:68 ../../reference/expressions.rst:82 +msgid "name" +msgstr "" + +#: ../../reference/expressions.rst:68 +msgid "identifier" +msgstr "" + +#: ../../reference/expressions.rst:74 ../../reference/expressions.rst:537 +#: ../../reference/expressions.rst:587 ../../reference/expressions.rst:709 +#: ../../reference/expressions.rst:755 ../../reference/expressions.rst:801 +#: ../../reference/expressions.rst:1233 ../../reference/expressions.rst:1279 +#: ../../reference/expressions.rst:1369 +#, fuzzy +msgid "exception" +msgstr "描述" + +#: ../../reference/expressions.rst:74 +msgid "NameError" +msgstr "" + +#: ../../reference/expressions.rst:82 +msgid "mangling" +msgstr "" + +#: ../../reference/expressions.rst:82 +msgid "private" +msgstr "" + +#: ../../reference/expressions.rst:82 +msgid "names" +msgstr "" + +#: ../../reference/expressions.rst:104 +msgid "literal" +msgstr "" + +#: ../../reference/expressions.rst:117 ../../reference/expressions.rst:341 +msgid "immutable" +msgstr "" + +#: ../../reference/expressions.rst:117 +msgid "data" +msgstr "" + +#: ../../reference/expressions.rst:117 +msgid "type" +msgstr "" + +#: ../../reference/expressions.rst:117 ../../reference/expressions.rst:244 +#: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 +#: ../../reference/expressions.rst:341 ../../reference/expressions.rst:362 +#: ../../reference/expressions.rst:525 ../../reference/expressions.rst:699 +#: ../../reference/expressions.rst:801 ../../reference/expressions.rst:824 +#: ../../reference/expressions.rst:897 ../../reference/expressions.rst:941 +#: ../../reference/expressions.rst:1089 ../../reference/expressions.rst:1102 +#: ../../reference/expressions.rst:1116 ../../reference/expressions.rst:1123 +#: ../../reference/expressions.rst:1660 ../../reference/expressions.rst:1846 +msgid "object" +msgstr "" + +#: ../../reference/expressions.rst:133 +msgid "parenthesized form" +msgstr "" + +#: ../../reference/expressions.rst:133 ../../reference/expressions.rst:362 +#: ../../reference/expressions.rst:941 +msgid "() (parentheses)" +msgstr "" + +#: ../../reference/expressions.rst:133 +msgid "tuple display" +msgstr "" + +#: ../../reference/expressions.rst:146 ../../reference/expressions.rst:244 +msgid "empty" +msgstr "" + +#: ../../reference/expressions.rst:146 ../../reference/expressions.rst:824 +#: ../../reference/expressions.rst:897 ../../reference/expressions.rst:1846 +msgid "tuple" +msgstr "" + +#: ../../reference/expressions.rst:152 ../../reference/expressions.rst:1865 +msgid "comma" +msgstr "" + +#: ../../reference/expressions.rst:152 ../../reference/expressions.rst:244 +#: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 +#: ../../reference/expressions.rst:891 ../../reference/expressions.rst:941 +#: ../../reference/expressions.rst:1836 +msgid ", (comma)" +msgstr "" + +#: ../../reference/expressions.rst:167 ../../reference/expressions.rst:244 +#: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 +msgid "comprehensions" +msgstr "" + +#: ../../reference/expressions.rst:177 +msgid "for" +msgstr "" + +#: ../../reference/expressions.rst:177 ../../reference/expressions.rst:212 +msgid "in comprehensions" +msgstr "" + +#: ../../reference/expressions.rst:177 ../../reference/expressions.rst:1782 +msgid "if" +msgstr "" + +#: ../../reference/expressions.rst:177 +msgid "async for" +msgstr "" + +#: ../../reference/expressions.rst:212 ../../reference/expressions.rst:1141 +msgid "await" +msgstr "" + +#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:801 +#: ../../reference/expressions.rst:824 ../../reference/expressions.rst:897 +#: ../../reference/expressions.rst:1836 +msgid "list" +msgstr "" + +#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:270 +#: ../../reference/expressions.rst:298 +msgid "display" +msgstr "" + +#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:820 +msgid "[] (square brackets)" +msgstr "" + +#: ../../reference/expressions.rst:244 +msgid "list expression" +msgstr "" + +#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:270 +#: ../../reference/expressions.rst:1836 +#, fuzzy +msgid "expression list" +msgstr "``(expressions...)``," + +#: ../../reference/expressions.rst:270 +msgid "set" +msgstr "" + +#: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 +msgid "{} (curly brackets)" +msgstr "" + +#: ../../reference/expressions.rst:270 +msgid "set expression" +msgstr "" + +#: ../../reference/expressions.rst:298 ../../reference/expressions.rst:324 +#: ../../reference/expressions.rst:824 +msgid "dictionary" +msgstr "" + +#: ../../reference/expressions.rst:298 +msgid "key" +msgstr "" + +#: ../../reference/expressions.rst:298 +msgid "datum" +msgstr "" + +#: ../../reference/expressions.rst:298 +msgid "key/datum pair" +msgstr "" + +#: ../../reference/expressions.rst:298 +msgid "dictionary expression" +msgstr "" + +#: ../../reference/expressions.rst:298 ../../reference/expressions.rst:891 +#: ../../reference/expressions.rst:1808 +msgid ": (colon)" +msgstr "" + +#: ../../reference/expressions.rst:298 +msgid "in dictionary expressions" +msgstr "" + +#: ../../reference/expressions.rst:298 ../../reference/expressions.rst:324 +msgid "in dictionary displays" +msgstr "" + +#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1024 +#: ../../reference/expressions.rst:1853 +msgid "unpacking" +msgstr "" + +#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1054 +#: ../../reference/expressions.rst:1161 +msgid "**" +msgstr "" + +#: ../../reference/expressions.rst:341 +msgid "hashable" +msgstr "" + +#: ../../reference/expressions.rst:362 ../../reference/expressions.rst:417 +#: ../../reference/expressions.rst:525 +msgid "generator" +msgstr "" + +#: ../../reference/expressions.rst:362 +msgid "generator expression" +msgstr "" + +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1141 +#, fuzzy +msgid "keyword" +msgstr ":keyword:`or`" + +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:600 +msgid "yield" +msgstr "" + +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:484 +msgid "from" +msgstr "" + +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1089 +#: ../../reference/expressions.rst:1102 ../../reference/expressions.rst:1808 +msgid "function" +msgstr "" + +#: ../../reference/expressions.rst:470 +msgid "coroutine" +msgstr "" + +#: ../../reference/expressions.rst:484 +msgid "yield from expression" +msgstr "" + +#: ../../reference/expressions.rst:537 +msgid "StopIteration" +msgstr "" + +#: ../../reference/expressions.rst:587 ../../reference/expressions.rst:755 +msgid "GeneratorExit" +msgstr "" + +#: ../../reference/expressions.rst:600 +#, fuzzy +msgid "examples" +msgstr "模組" + +#: ../../reference/expressions.rst:699 +msgid "asynchronous-generator" +msgstr "" + +#: ../../reference/expressions.rst:709 +msgid "StopAsyncIteration" +msgstr "" + +#: ../../reference/expressions.rst:778 +msgid "primary" +msgstr "" + +#: ../../reference/expressions.rst:792 +msgid "attribute" +msgstr "" + +#: ../../reference/expressions.rst:792 +msgid "reference" +msgstr "" + +#: ../../reference/expressions.rst:792 +msgid ". (dot)" +msgstr "" + +#: ../../reference/expressions.rst:792 +msgid "attribute reference" +msgstr "" + +#: ../../reference/expressions.rst:801 +msgid "AttributeError" +msgstr "" + +#: ../../reference/expressions.rst:801 +msgid "module" +msgstr "" + +#: ../../reference/expressions.rst:820 +#, fuzzy +msgid "subscription" +msgstr "描述" + +#: ../../reference/expressions.rst:824 ../../reference/expressions.rst:897 +#: ../../reference/expressions.rst:1660 +msgid "sequence" +msgstr "" + +#: ../../reference/expressions.rst:824 +msgid "mapping" +msgstr "" + +#: ../../reference/expressions.rst:824 ../../reference/expressions.rst:877 +#: ../../reference/expressions.rst:897 +msgid "string" +msgstr "" + +#: ../../reference/expressions.rst:824 ../../reference/expressions.rst:877 +msgid "item" +msgstr "" + +#: ../../reference/expressions.rst:877 +msgid "character" +msgstr "" + +#: ../../reference/expressions.rst:891 +msgid "slicing" +msgstr "" + +#: ../../reference/expressions.rst:891 +msgid "slice" +msgstr "" + +#: ../../reference/expressions.rst:923 +msgid "start (slice object attribute)" +msgstr "" + +#: ../../reference/expressions.rst:923 +msgid "stop (slice object attribute)" +msgstr "" + +#: ../../reference/expressions.rst:923 +msgid "step (slice object attribute)" +msgstr "" + +#: ../../reference/expressions.rst:941 +msgid "callable" +msgstr "" + +#: ../../reference/expressions.rst:941 ../../reference/expressions.rst:1089 +#: ../../reference/expressions.rst:1102 ../../reference/expressions.rst:1116 +#: ../../reference/expressions.rst:1123 ../../reference/expressions.rst:1133 +msgid "call" +msgstr "" + +#: ../../reference/expressions.rst:941 +msgid "argument" +msgstr "" + +#: ../../reference/expressions.rst:941 ../../reference/expressions.rst:974 +msgid "call semantics" +msgstr "" + +#: ../../reference/expressions.rst:941 +msgid "argument list" +msgstr "" + +#: ../../reference/expressions.rst:941 +msgid "= (equals)" +msgstr "" + +#: ../../reference/expressions.rst:941 ../../reference/expressions.rst:1024 +#: ../../reference/expressions.rst:1054 +msgid "in function calls" +msgstr "" + +#: ../../reference/expressions.rst:974 +msgid "parameter" +msgstr "" + +#: ../../reference/expressions.rst:1024 ../../reference/expressions.rst:1257 +#: ../../reference/expressions.rst:1853 +msgid "* (asterisk)" +msgstr "" + +#: ../../reference/expressions.rst:1089 +msgid "user-defined" +msgstr "" + +#: ../../reference/expressions.rst:1089 +msgid "user-defined function" +msgstr "" + +#: ../../reference/expressions.rst:1102 +msgid "built-in function" +msgstr "" + +#: ../../reference/expressions.rst:1102 +msgid "method" +msgstr "" + +#: ../../reference/expressions.rst:1102 +msgid "built-in method" +msgstr "" + +#: ../../reference/expressions.rst:1116 +msgid "class" +msgstr "" + +#: ../../reference/expressions.rst:1116 +msgid "class object" +msgstr "" + +#: ../../reference/expressions.rst:1123 +msgid "class instance" +msgstr "" + +#: ../../reference/expressions.rst:1123 ../../reference/expressions.rst:1133 +msgid "instance" +msgstr "" + +#: ../../reference/expressions.rst:1133 +msgid "__call__() (object method)" +msgstr "" + +#: ../../reference/expressions.rst:1161 +msgid "power" +msgstr "" + +#: ../../reference/expressions.rst:1161 ../../reference/expressions.rst:1196 +#: ../../reference/expressions.rst:1244 ../../reference/expressions.rst:1353 +#: ../../reference/expressions.rst:1380 ../../reference/expressions.rst:1695 +#, fuzzy +msgid "operation" +msgstr "描述" + +#: ../../reference/expressions.rst:1161 ../../reference/expressions.rst:1205 +#: ../../reference/expressions.rst:1214 ../../reference/expressions.rst:1222 +#: ../../reference/expressions.rst:1257 ../../reference/expressions.rst:1270 +#: ../../reference/expressions.rst:1279 ../../reference/expressions.rst:1295 +#: ../../reference/expressions.rst:1324 ../../reference/expressions.rst:1337 +#: ../../reference/expressions.rst:1353 ../../reference/expressions.rst:1389 +#: ../../reference/expressions.rst:1397 ../../reference/expressions.rst:1406 +#: ../../reference/expressions.rst:1421 ../../reference/expressions.rst:1660 +#: ../../reference/expressions.rst:1669 ../../reference/expressions.rst:1711 +#: ../../reference/expressions.rst:1716 ../../reference/expressions.rst:1721 +#: ../../reference/expressions.rst:1782 ../../reference/expressions.rst:1900 +msgid "operator" +msgstr "" + +#: ../../reference/expressions.rst:1196 +msgid "unary" +msgstr "" + +#: ../../reference/expressions.rst:1196 ../../reference/expressions.rst:1380 +#: ../../reference/expressions.rst:1389 ../../reference/expressions.rst:1397 +#: ../../reference/expressions.rst:1406 +msgid "bitwise" +msgstr "" + +#: ../../reference/expressions.rst:1205 +msgid "negation" +msgstr "" + +#: ../../reference/expressions.rst:1205 +msgid "minus" +msgstr "" + +#: ../../reference/expressions.rst:1205 ../../reference/expressions.rst:1337 +msgid "- (minus)" +msgstr "" + +#: ../../reference/expressions.rst:1205 ../../reference/expressions.rst:1214 +msgid "unary operator" +msgstr "" + +#: ../../reference/expressions.rst:1214 +msgid "plus" +msgstr "" + +#: ../../reference/expressions.rst:1214 ../../reference/expressions.rst:1324 +msgid "+ (plus)" +msgstr "" + +#: ../../reference/expressions.rst:1222 +msgid "inversion" +msgstr "" + +#: ../../reference/expressions.rst:1222 +msgid "~ (tilde)" +msgstr "" + +#: ../../reference/expressions.rst:1233 +msgid "TypeError" +msgstr "" + +#: ../../reference/expressions.rst:1244 ../../reference/expressions.rst:1380 +msgid "binary" +msgstr "" + +#: ../../reference/expressions.rst:1257 +msgid "multiplication" +msgstr "" + +#: ../../reference/expressions.rst:1270 +msgid "matrix multiplication" +msgstr "" + +#: ../../reference/expressions.rst:1270 +msgid "@ (at)" +msgstr "" + +#: ../../reference/expressions.rst:1279 +msgid "ZeroDivisionError" +msgstr "" + +#: ../../reference/expressions.rst:1279 +msgid "division" +msgstr "" + +#: ../../reference/expressions.rst:1279 +msgid "/ (slash)" +msgstr "" + +#: ../../reference/expressions.rst:1279 +msgid "//" +msgstr "" + +#: ../../reference/expressions.rst:1295 +msgid "modulo" +msgstr "" + +#: ../../reference/expressions.rst:1295 +msgid "% (percent)" +msgstr "" + +#: ../../reference/expressions.rst:1324 +msgid "addition" +msgstr "" + +#: ../../reference/expressions.rst:1324 ../../reference/expressions.rst:1337 +msgid "binary operator" +msgstr "" + +#: ../../reference/expressions.rst:1337 +msgid "subtraction" +msgstr "" + +#: ../../reference/expressions.rst:1353 +msgid "shifting" +msgstr "" + +#: ../../reference/expressions.rst:1353 +msgid "<<" +msgstr "" + +#: ../../reference/expressions.rst:1353 +msgid ">>" +msgstr "" + +#: ../../reference/expressions.rst:1369 +msgid "ValueError" +msgstr "" + +#: ../../reference/expressions.rst:1389 ../../reference/expressions.rst:1716 +msgid "and" +msgstr "" + +#: ../../reference/expressions.rst:1389 +msgid "& (ampersand)" +msgstr "" + +#: ../../reference/expressions.rst:1397 +msgid "xor" +msgstr "" + +#: ../../reference/expressions.rst:1397 +msgid "exclusive" +msgstr "" + +#: ../../reference/expressions.rst:1397 ../../reference/expressions.rst:1406 +#: ../../reference/expressions.rst:1721 +msgid "or" +msgstr "" + +#: ../../reference/expressions.rst:1397 +msgid "^ (caret)" +msgstr "" + +#: ../../reference/expressions.rst:1406 +msgid "inclusive" +msgstr "" + +#: ../../reference/expressions.rst:1406 +msgid "| (vertical bar)" +msgstr "" + +#: ../../reference/expressions.rst:1421 +msgid "comparison" +msgstr "" + +#: ../../reference/expressions.rst:1421 +msgid "C" +msgstr "" + +#: ../../reference/expressions.rst:1421 +msgid "language" +msgstr "" + +#: ../../reference/expressions.rst:1421 +msgid "< (less)" +msgstr "" + +#: ../../reference/expressions.rst:1421 +msgid "> (greater)" +msgstr "" + +#: ../../reference/expressions.rst:1421 +msgid "<=" +msgstr "" + +#: ../../reference/expressions.rst:1421 +msgid ">=" +msgstr "" + +#: ../../reference/expressions.rst:1421 +msgid "==" +msgstr "" + +#: ../../reference/expressions.rst:1421 +msgid "!=" +msgstr "" + +#: ../../reference/expressions.rst:1445 +msgid "chaining" +msgstr "" + +#: ../../reference/expressions.rst:1445 +msgid "comparisons" +msgstr "" + +#: ../../reference/expressions.rst:1660 +msgid "in" +msgstr "" + +#: ../../reference/expressions.rst:1660 +msgid "not in" +msgstr "" + +#: ../../reference/expressions.rst:1660 +msgid "membership" +msgstr "" + +#: ../../reference/expressions.rst:1660 ../../reference/expressions.rst:1669 +msgid "test" +msgstr "" + +#: ../../reference/expressions.rst:1669 +msgid "is" +msgstr "" + +#: ../../reference/expressions.rst:1669 +msgid "is not" +msgstr "" + +#: ../../reference/expressions.rst:1669 +msgid "identity" +msgstr "" + +#: ../../reference/expressions.rst:1695 +msgid "Conditional" +msgstr "" + +#: ../../reference/expressions.rst:1695 +msgid "Boolean" +msgstr "" + +#: ../../reference/expressions.rst:1711 +msgid "not" +msgstr "" + +#: ../../reference/expressions.rst:1735 +msgid ":= (colon equals)" +msgstr "" + +#: ../../reference/expressions.rst:1735 +msgid "assignment expression" +msgstr "" + +#: ../../reference/expressions.rst:1735 +msgid "walrus operator" +msgstr "" + +#: ../../reference/expressions.rst:1735 +msgid "named expression" +msgstr "" + +#: ../../reference/expressions.rst:1782 +msgid "conditional" +msgstr "" + +#: ../../reference/expressions.rst:1782 +msgid "ternary" +msgstr "" + +#: ../../reference/expressions.rst:1782 +msgid "conditional expression" +msgstr "" + +#: ../../reference/expressions.rst:1782 +msgid "else" +msgstr "" + +#: ../../reference/expressions.rst:1808 +msgid "lambda" +msgstr "" + +#: ../../reference/expressions.rst:1808 +msgid "form" +msgstr "" + +#: ../../reference/expressions.rst:1808 +msgid "anonymous" +msgstr "" + +#: ../../reference/expressions.rst:1808 +msgid "lambda expression" +msgstr "" + +#: ../../reference/expressions.rst:1853 +msgid "iterable" +msgstr "" + +#: ../../reference/expressions.rst:1853 +msgid "in expression lists" +msgstr "" + +#: ../../reference/expressions.rst:1865 +msgid "trailing" +msgstr "" + +#: ../../reference/expressions.rst:1879 +msgid "evaluation" +msgstr "" + +#: ../../reference/expressions.rst:1879 +msgid "order" +msgstr "" + +#: ../../reference/expressions.rst:1900 +msgid "precedence" +msgstr "" diff --git a/reference/import.po b/reference/import.po index 46db958063..a1ae919781 100644 --- a/reference/import.po +++ b/reference/import.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1386,3 +1386,96 @@ msgid "" "that code be changed to use ``None`` instead. See :ref:`portingpythoncode` " "for more details." msgstr "" + +#: ../../reference/import.rst:8 +msgid "import machinery" +msgstr "" + +#: ../../reference/import.rst:64 ../../reference/import.rst:95 +#: ../../reference/import.rst:129 +msgid "package" +msgstr "" + +#: ../../reference/import.rst:95 +msgid "regular" +msgstr "" + +#: ../../reference/import.rst:129 +msgid "namespace" +msgstr "" + +#: ../../reference/import.rst:129 +msgid "portion" +msgstr "" + +#: ../../reference/import.rst:175 +msgid "sys.modules" +msgstr "" + +#: ../../reference/import.rst:210 ../../reference/import.rst:276 +msgid "finder" +msgstr "" + +#: ../../reference/import.rst:210 +msgid "loader" +msgstr "" + +#: ../../reference/import.rst:210 +msgid "module spec" +msgstr "" + +#: ../../reference/import.rst:249 +msgid "import hooks" +msgstr "" + +#: ../../reference/import.rst:249 +msgid "meta hooks" +msgstr "" + +#: ../../reference/import.rst:249 +msgid "path hooks" +msgstr "" + +#: ../../reference/import.rst:249 +msgid "hooks" +msgstr "" + +#: ../../reference/import.rst:249 +msgid "import" +msgstr "" + +#: ../../reference/import.rst:249 +msgid "meta" +msgstr "" + +#: ../../reference/import.rst:249 +msgid "path" +msgstr "" + +#: ../../reference/import.rst:276 +msgid "sys.meta_path" +msgstr "" + +#: ../../reference/import.rst:276 +msgid "find_spec" +msgstr "" + +#: ../../reference/import.rst:727 +msgid "path based finder" +msgstr "" + +#: ../../reference/import.rst:776 +msgid "sys.path" +msgstr "" + +#: ../../reference/import.rst:776 +msgid "sys.path_hooks" +msgstr "" + +#: ../../reference/import.rst:776 +msgid "sys.path_importer_cache" +msgstr "" + +#: ../../reference/import.rst:776 +msgid "PYTHONPATH" +msgstr "" diff --git a/reference/introduction.po b/reference/introduction.po index 70f85cc759..0120d0d71a 100644 --- a/reference/introduction.po +++ b/reference/introduction.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -204,3 +204,28 @@ msgid "" "are lexical definitions; uses in subsequent chapters are syntactic " "definitions." msgstr "" + +#: ../../reference/introduction.rst:91 +msgid "BNF" +msgstr "" + +#: ../../reference/introduction.rst:91 +msgid "grammar" +msgstr "" + +#: ../../reference/introduction.rst:91 +msgid "syntax" +msgstr "" + +#: ../../reference/introduction.rst:91 +#, fuzzy +msgid "notation" +msgstr "簡介" + +#: ../../reference/introduction.rst:117 +msgid "lexical definitions" +msgstr "" + +#: ../../reference/introduction.rst:117 +msgid "ASCII" +msgstr "" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index dd239246a1..a9169fd153 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -469,8 +469,8 @@ msgstr "" #: ../../reference/lexical_analysis.rst:399 msgid "" -"Elsewhere, ``_`` is a regular identifier. It is often used to name \"special" -"\" items, but it is not special to Python itself." +"Elsewhere, ``_`` is a regular identifier. It is often used to name " +"\"special\" items, but it is not special to Python itself." msgstr "" #: ../../reference/lexical_analysis.rst:404 @@ -1144,3 +1144,427 @@ msgstr "註解" #: ../../reference/lexical_analysis.rst:1012 msgid "https://www.unicode.org/Public/11.0.0/ucd/NameAliases.txt" msgstr "https://www.unicode.org/Public/11.0.0/ucd/NameAliases.txt" + +#: ../../reference/lexical_analysis.rst:8 +msgid "lexical analysis" +msgstr "" + +#: ../../reference/lexical_analysis.rst:8 +msgid "parser" +msgstr "" + +#: ../../reference/lexical_analysis.rst:8 +msgid "token" +msgstr "" + +#: ../../reference/lexical_analysis.rst:25 +msgid "line structure" +msgstr "" + +#: ../../reference/lexical_analysis.rst:35 +msgid "logical line" +msgstr "" + +#: ../../reference/lexical_analysis.rst:35 +#: ../../reference/lexical_analysis.rst:115 +#: ../../reference/lexical_analysis.rst:529 +msgid "physical line" +msgstr "" + +#: ../../reference/lexical_analysis.rst:35 +#: ../../reference/lexical_analysis.rst:115 +msgid "line joining" +msgstr "" + +#: ../../reference/lexical_analysis.rst:35 +msgid "NEWLINE token" +msgstr "" + +#: ../../reference/lexical_analysis.rst:67 +msgid "comment" +msgstr "" + +#: ../../reference/lexical_analysis.rst:67 +msgid "hash character" +msgstr "" + +#: ../../reference/lexical_analysis.rst:67 +#: ../../reference/lexical_analysis.rst:81 +msgid "# (hash)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:81 +msgid "source character set" +msgstr "" + +#: ../../reference/lexical_analysis.rst:81 +msgid "encoding declarations (source file)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:81 +msgid "source encoding declaration" +msgstr "" + +#: ../../reference/lexical_analysis.rst:115 +msgid "line continuation" +msgstr "" + +#: ../../reference/lexical_analysis.rst:115 +msgid "backslash character" +msgstr "" + +#: ../../reference/lexical_analysis.rst:160 +msgid "blank line" +msgstr "" + +#: ../../reference/lexical_analysis.rst:175 +msgid "indentation" +msgstr "" + +#: ../../reference/lexical_analysis.rst:175 +msgid "leading whitespace" +msgstr "" + +#: ../../reference/lexical_analysis.rst:175 +msgid "space" +msgstr "" + +#: ../../reference/lexical_analysis.rst:175 +msgid "tab" +msgstr "" + +#: ../../reference/lexical_analysis.rst:175 +msgid "grouping" +msgstr "" + +#: ../../reference/lexical_analysis.rst:175 +msgid "statement grouping" +msgstr "" + +#: ../../reference/lexical_analysis.rst:203 +msgid "INDENT token" +msgstr "" + +#: ../../reference/lexical_analysis.rst:203 +msgid "DEDENT token" +msgstr "" + +#: ../../reference/lexical_analysis.rst:278 +msgid "identifier" +msgstr "" + +#: ../../reference/lexical_analysis.rst:278 +msgid "name" +msgstr "" + +#: ../../reference/lexical_analysis.rst:335 +#: ../../reference/lexical_analysis.rst:359 +msgid "keyword" +msgstr "" + +#: ../../reference/lexical_analysis.rst:335 +msgid "reserved word" +msgstr "" + +#: ../../reference/lexical_analysis.rst:359 +msgid "soft keyword" +msgstr "" + +#: ../../reference/lexical_analysis.rst:374 +msgid "_, identifiers" +msgstr "" + +#: ../../reference/lexical_analysis.rst:374 +msgid "__, identifiers" +msgstr "" + +#: ../../reference/lexical_analysis.rst:430 +msgid "literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:430 +msgid "constant" +msgstr "" + +#: ../../reference/lexical_analysis.rst:435 +#: ../../reference/lexical_analysis.rst:476 +msgid "string literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:435 +#: ../../reference/lexical_analysis.rst:487 +msgid "bytes literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:435 +msgid "ASCII" +msgstr "" + +#: ../../reference/lexical_analysis.rst:435 +msgid "' (single quote)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:435 +msgid "\" (double quote)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:435 +msgid "u'" +msgstr "" + +#: ../../reference/lexical_analysis.rst:435 +msgid "u\"" +msgstr "" + +#: ../../reference/lexical_analysis.rst:476 +msgid "triple-quoted string" +msgstr "" + +#: ../../reference/lexical_analysis.rst:476 +msgid "Unicode Consortium" +msgstr "" + +#: ../../reference/lexical_analysis.rst:476 +msgid "raw string" +msgstr "" + +#: ../../reference/lexical_analysis.rst:476 +msgid "\"\"\"" +msgstr "" + +#: ../../reference/lexical_analysis.rst:476 +msgid "'''" +msgstr "" + +#: ../../reference/lexical_analysis.rst:487 +msgid "b'" +msgstr "" + +#: ../../reference/lexical_analysis.rst:487 +msgid "b\"" +msgstr "" + +#: ../../reference/lexical_analysis.rst:496 +msgid "r'" +msgstr "" + +#: ../../reference/lexical_analysis.rst:496 +msgid "raw string literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:496 +msgid "r\"" +msgstr "" + +#: ../../reference/lexical_analysis.rst:516 +msgid "f'" +msgstr "" + +#: ../../reference/lexical_analysis.rst:516 +#: ../../reference/lexical_analysis.rst:682 +msgid "formatted string literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:516 +msgid "f\"" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "escape sequence" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "Standard C" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "C" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\ (backslash)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\\\" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\a" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\b" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\f" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\n" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\r" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\t" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\v" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\x" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\N" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\u" +msgstr "" + +#: ../../reference/lexical_analysis.rst:529 +msgid "\\U" +msgstr "" + +#: ../../reference/lexical_analysis.rst:635 +msgid "unrecognized escape sequence" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid "interpolated string literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid "string" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid "formatted literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid "interpolated literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid "f-string" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid "fstring" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid "{} (curly brackets)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid "in formatted string literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid "! (exclamation)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid ": (colon)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid "= (equals)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:682 +msgid "for help in debugging using string literals" +msgstr "" + +#: ../../reference/lexical_analysis.rst:845 +msgid "number" +msgstr "" + +#: ../../reference/lexical_analysis.rst:845 +msgid "numeric literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:858 +msgid "integer literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:845 +msgid "floating point literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:845 +msgid "hexadecimal literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:845 +msgid "octal literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:845 +msgid "binary literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:845 +msgid "decimal literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:845 +msgid "imaginary literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:845 +msgid "complex literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:858 +msgid "0b" +msgstr "" + +#: ../../reference/lexical_analysis.rst:858 +msgid "0o" +msgstr "" + +#: ../../reference/lexical_analysis.rst:858 +msgid "0x" +msgstr "" + +#: ../../reference/lexical_analysis.rst:858 +#: ../../reference/lexical_analysis.rst:904 +msgid "_ (underscore)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:858 +#: ../../reference/lexical_analysis.rst:904 +#: ../../reference/lexical_analysis.rst:936 +msgid "in numeric literal" +msgstr "" + +#: ../../reference/lexical_analysis.rst:904 +msgid ". (dot)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:904 +msgid "e" +msgstr "" + +#: ../../reference/lexical_analysis.rst:936 +msgid "j" +msgstr "" + +#: ../../reference/lexical_analysis.rst:962 +msgid "operators" +msgstr "" + +#: ../../reference/lexical_analysis.rst:979 +msgid "delimiters" +msgstr "" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index 6fae0ceade..3bea6bbeee 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-08 00:19+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1056,3 +1056,475 @@ msgstr "" #: ../../reference/simple_stmts.rst:1014 msgid "The specification for the :keyword:`nonlocal` statement." msgstr "" + +#: ../../reference/simple_stmts.rst:8 +msgid "simple" +msgstr "" + +#: ../../reference/simple_stmts.rst:8 ../../reference/simple_stmts.rst:38 +#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:321 ../../reference/simple_stmts.rst:378 +#: ../../reference/simple_stmts.rst:421 ../../reference/simple_stmts.rst:443 +#: ../../reference/simple_stmts.rst:456 ../../reference/simple_stmts.rst:482 +#: ../../reference/simple_stmts.rst:519 ../../reference/simple_stmts.rst:555 +#: ../../reference/simple_stmts.rst:669 ../../reference/simple_stmts.rst:703 +#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:858 +#: ../../reference/simple_stmts.rst:944 ../../reference/simple_stmts.rst:991 +msgid "statement" +msgstr "" + +#: ../../reference/simple_stmts.rst:38 ../../reference/simple_stmts.rst:41 +msgid "expression" +msgstr "" + +#: ../../reference/simple_stmts.rst:38 ../../reference/simple_stmts.rst:41 +#: ../../reference/simple_stmts.rst:104 ../../reference/simple_stmts.rst:115 +#: ../../reference/simple_stmts.rst:195 ../../reference/simple_stmts.rst:443 +msgid "list" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 ../../reference/simple_stmts.rst:972 +msgid "built-in function" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 +msgid "repr" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 ../../reference/simple_stmts.rst:74 +#: ../../reference/simple_stmts.rst:186 ../../reference/simple_stmts.rst:195 +#: ../../reference/simple_stmts.rst:206 ../../reference/simple_stmts.rst:577 +msgid "object" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 +msgid "None" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 +msgid "string" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 +msgid "conversion" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 +msgid "output" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 +msgid "standard" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 +msgid "writing" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 +msgid "values" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 +msgid "procedure" +msgstr "" + +#: ../../reference/simple_stmts.rst:55 +msgid "call" +msgstr "" + +#: ../../reference/simple_stmts.rst:74 +msgid "= (equals)" +msgstr "" + +#: ../../reference/simple_stmts.rst:74 +msgid "assignment statement" +msgstr "" + +#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:115 +#: ../../reference/simple_stmts.rst:158 ../../reference/simple_stmts.rst:186 +#: ../../reference/simple_stmts.rst:219 ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:321 +msgid "assignment" +msgstr "" + +#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:728 +#: ../../reference/simple_stmts.rst:783 ../../reference/simple_stmts.rst:944 +msgid "binding" +msgstr "" + +#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:456 +#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:783 +#: ../../reference/simple_stmts.rst:944 +msgid "name" +msgstr "" + +#: ../../reference/simple_stmts.rst:74 +msgid "rebinding" +msgstr "" + +#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:186 +msgid "mutable" +msgstr "" + +#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:158 +#: ../../reference/simple_stmts.rst:465 +msgid "attribute" +msgstr "" + +#: ../../reference/simple_stmts.rst:104 ../../reference/simple_stmts.rst:115 +#: ../../reference/simple_stmts.rst:443 ../../reference/simple_stmts.rst:682 +msgid "target" +msgstr "" + +#: ../../reference/simple_stmts.rst:115 ../../reference/simple_stmts.rst:378 +#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:944 +#: ../../reference/simple_stmts.rst:991 +msgid ", (comma)" +msgstr "" + +#: ../../reference/simple_stmts.rst:115 +msgid "in target list" +msgstr "" + +#: ../../reference/simple_stmts.rst:115 ../../reference/simple_stmts.rst:809 +msgid "* (asterisk)" +msgstr "" + +#: ../../reference/simple_stmts.rst:115 +msgid "in assignment target list" +msgstr "" + +#: ../../reference/simple_stmts.rst:115 +msgid "[] (square brackets)" +msgstr "" + +#: ../../reference/simple_stmts.rst:115 +msgid "() (parentheses)" +msgstr "" + +#: ../../reference/simple_stmts.rst:152 +msgid "destructor" +msgstr "" + +#: ../../reference/simple_stmts.rst:186 +msgid "subscription" +msgstr "" + +#: ../../reference/simple_stmts.rst:195 +msgid "sequence" +msgstr "" + +#: ../../reference/simple_stmts.rst:206 +msgid "mapping" +msgstr "" + +#: ../../reference/simple_stmts.rst:206 +msgid "dictionary" +msgstr "" + +#: ../../reference/simple_stmts.rst:219 +msgid "slicing" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "augmented" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "assignment, augmented" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "+=" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "augmented assignment" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "-=" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "*=" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "/=" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "%=" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "&=" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "^=" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "|=" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "**=" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "//=" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid ">>=" +msgstr "" + +#: ../../reference/simple_stmts.rst:262 +msgid "<<=" +msgstr "" + +#: ../../reference/simple_stmts.rst:321 +msgid "annotated" +msgstr "" + +#: ../../reference/simple_stmts.rst:321 +msgid "assignment, annotated" +msgstr "" + +#: ../../reference/simple_stmts.rst:321 +msgid ": (colon)" +msgstr "" + +#: ../../reference/simple_stmts.rst:321 +msgid "annotated variable" +msgstr "" + +#: ../../reference/simple_stmts.rst:378 +msgid "assert" +msgstr "" + +#: ../../reference/simple_stmts.rst:378 +msgid "debugging" +msgstr "" + +#: ../../reference/simple_stmts.rst:378 +msgid "assertions" +msgstr "" + +#: ../../reference/simple_stmts.rst:378 +msgid "expression list" +msgstr "" + +#: ../../reference/simple_stmts.rst:399 +msgid "__debug__" +msgstr "" + +#: ../../reference/simple_stmts.rst:399 ../../reference/simple_stmts.rst:519 +#: ../../reference/simple_stmts.rst:555 ../../reference/simple_stmts.rst:587 +#: ../../reference/simple_stmts.rst:728 +msgid "exception" +msgstr "" + +#: ../../reference/simple_stmts.rst:399 +msgid "AssertionError" +msgstr "" + +#: ../../reference/simple_stmts.rst:421 +msgid "pass" +msgstr "" + +#: ../../reference/simple_stmts.rst:421 +msgid "null" +msgstr "" + +#: ../../reference/simple_stmts.rst:421 +msgid "operation" +msgstr "" + +#: ../../reference/simple_stmts.rst:443 +msgid "del" +msgstr "" + +#: ../../reference/simple_stmts.rst:443 ../../reference/simple_stmts.rst:465 +msgid "deletion" +msgstr "" + +#: ../../reference/simple_stmts.rst:456 ../../reference/simple_stmts.rst:944 +msgid "global" +msgstr "" + +#: ../../reference/simple_stmts.rst:456 +msgid "unbinding" +msgstr "" + +#: ../../reference/simple_stmts.rst:482 +msgid "return" +msgstr "" + +#: ../../reference/simple_stmts.rst:482 ../../reference/simple_stmts.rst:519 +msgid "function" +msgstr "" + +#: ../../reference/simple_stmts.rst:482 +msgid "definition" +msgstr "" + +#: ../../reference/simple_stmts.rst:482 +msgid "class" +msgstr "" + +#: ../../reference/simple_stmts.rst:498 ../../reference/simple_stmts.rst:682 +#: ../../reference/simple_stmts.rst:691 ../../reference/simple_stmts.rst:703 +#: ../../reference/simple_stmts.rst:728 +msgid "keyword" +msgstr "" + +#: ../../reference/simple_stmts.rst:498 ../../reference/simple_stmts.rst:691 +#: ../../reference/simple_stmts.rst:703 +msgid "finally" +msgstr "" + +#: ../../reference/simple_stmts.rst:519 +msgid "yield" +msgstr "" + +#: ../../reference/simple_stmts.rst:519 +msgid "generator" +msgstr "" + +#: ../../reference/simple_stmts.rst:519 +msgid "iterator" +msgstr "" + +#: ../../reference/simple_stmts.rst:519 +msgid "StopIteration" +msgstr "" + +#: ../../reference/simple_stmts.rst:555 +msgid "raise" +msgstr "" + +#: ../../reference/simple_stmts.rst:555 +msgid "raising" +msgstr "" + +#: ../../reference/simple_stmts.rst:555 +msgid "__traceback__ (exception attribute)" +msgstr "" + +#: ../../reference/simple_stmts.rst:577 +msgid "traceback" +msgstr "" + +#: ../../reference/simple_stmts.rst:587 +msgid "chaining" +msgstr "" + +#: ../../reference/simple_stmts.rst:587 +msgid "__cause__ (exception attribute)" +msgstr "" + +#: ../../reference/simple_stmts.rst:587 +msgid "__context__ (exception attribute)" +msgstr "" + +#: ../../reference/simple_stmts.rst:669 +msgid "break" +msgstr "" + +#: ../../reference/simple_stmts.rst:669 ../../reference/simple_stmts.rst:703 +msgid "for" +msgstr "" + +#: ../../reference/simple_stmts.rst:669 ../../reference/simple_stmts.rst:703 +msgid "while" +msgstr "" + +#: ../../reference/simple_stmts.rst:669 ../../reference/simple_stmts.rst:703 +msgid "loop" +msgstr "" + +#: ../../reference/simple_stmts.rst:682 +msgid "else" +msgstr "" + +#: ../../reference/simple_stmts.rst:682 +msgid "loop control" +msgstr "" + +#: ../../reference/simple_stmts.rst:703 +msgid "continue" +msgstr "" + +#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:831 +msgid "import" +msgstr "" + +#: ../../reference/simple_stmts.rst:728 +msgid "module" +msgstr "" + +#: ../../reference/simple_stmts.rst:728 +msgid "importing" +msgstr "" + +#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:783 +msgid "from" +msgstr "" + +#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:770 +msgid "as" +msgstr "" + +#: ../../reference/simple_stmts.rst:728 +msgid "ImportError" +msgstr "" + +#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:770 +#: ../../reference/simple_stmts.rst:783 ../../reference/simple_stmts.rst:809 +msgid "import statement" +msgstr "" + +#: ../../reference/simple_stmts.rst:815 +msgid "__all__ (optional module attribute)" +msgstr "" + +#: ../../reference/simple_stmts.rst:831 +msgid "relative" +msgstr "" + +#: ../../reference/simple_stmts.rst:858 +msgid "future" +msgstr "" + +#: ../../reference/simple_stmts.rst:858 +msgid "__future__" +msgstr "" + +#: ../../reference/simple_stmts.rst:858 +msgid "future statement" +msgstr "" + +#: ../../reference/simple_stmts.rst:944 ../../reference/simple_stmts.rst:991 +msgid "identifier list" +msgstr "" + +#: ../../reference/simple_stmts.rst:972 +msgid "exec" +msgstr "" + +#: ../../reference/simple_stmts.rst:972 +msgid "eval" +msgstr "" + +#: ../../reference/simple_stmts.rst:972 +msgid "compile" +msgstr "" + +#: ../../reference/simple_stmts.rst:991 +msgid "nonlocal" +msgstr "" diff --git a/reference/toplevel_components.po b/reference/toplevel_components.po index bab1e59ff3..f3b4ddcc2b 100644 --- a/reference/toplevel_components.po +++ b/reference/toplevel_components.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -118,3 +118,61 @@ msgid "" ":func:`eval` is used for expression input. It ignores leading whitespace. " "The string argument to :func:`eval` must have the following form:" msgstr "" + +#: ../../reference/toplevel_components.rst:8 +msgid "interpreter" +msgstr "" + +#: ../../reference/toplevel_components.rst:21 +msgid "program" +msgstr "" + +#: ../../reference/toplevel_components.rst:23 +#: ../../reference/toplevel_components.rst:39 +msgid "module" +msgstr "" + +#: ../../reference/toplevel_components.rst:23 +msgid "sys" +msgstr "" + +#: ../../reference/toplevel_components.rst:23 +#: ../../reference/toplevel_components.rst:39 +msgid "__main__" +msgstr "" + +#: ../../reference/toplevel_components.rst:23 +msgid "builtins" +msgstr "" + +#: ../../reference/toplevel_components.rst:39 +msgid "interactive mode" +msgstr "" + +#: ../../reference/toplevel_components.rst:49 +msgid "UNIX" +msgstr "" + +#: ../../reference/toplevel_components.rst:49 +msgid "Windows" +msgstr "" + +#: ../../reference/toplevel_components.rst:49 +msgid "command line" +msgstr "" + +#: ../../reference/toplevel_components.rst:49 +msgid "standard input" +msgstr "" + +#: ../../reference/toplevel_components.rst:100 +msgid "input" +msgstr "" + +#: ../../reference/toplevel_components.rst:101 +msgid "built-in function" +msgstr "" + +#: ../../reference/toplevel_components.rst:101 +msgid "eval" +msgstr "" diff --git a/tutorial/classes.po b/tutorial/classes.po index 0836649e0e..58f090f2e4 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-25 00:16+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-12-26 23:12+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1281,3 +1281,20 @@ msgstr "" "它回傳用於實作模組命名空間的 dictionary;\\ :attr:`~object.__dict__` 這個名稱" "是一個屬性但不是全域名稱。顯然,使用此屬性將違反命名空間實作的抽象化,而應該" "僅限用於事後除錯器 (post-mortem debugger) 之類的東西。" + +#: ../../tutorial/classes.rst:347 +#, fuzzy +msgid "object" +msgstr "Method 物件" + +#: ../../tutorial/classes.rst:347 +msgid "method" +msgstr "" + +#: ../../tutorial/classes.rst:683 +msgid "name" +msgstr "" + +#: ../../tutorial/classes.rst:683 +msgid "mangling" +msgstr "" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 8836f54955..13e438f711 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-02 00:20+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -373,8 +373,8 @@ msgid "" msgstr "" "你可以將位置參數 (positional parameter) 與一些能夠排序其屬性的內建 class(例" "如 dataclasses)一起使用。你也可以透過在 class 中設定特殊屬性 " -"``__match_args__``,來定義模式中屬性們的特定位置。如果它被設定為 (\"x\", \"y" -"\"),則以下的模式都是等價的(且都會將屬性 ``y`` 連結到變數 ``var``):\n" +"``__match_args__``,來定義模式中屬性們的特定位置。如果它被設定為 (\"x\", " +"\"y\"),則以下的模式都是等價的(且都會將屬性 ``y`` 連結到變數 ``var``):\n" "\n" "::" @@ -443,8 +443,8 @@ msgstr "" #: ../../tutorial/controlflow.rst:380 msgid "" -"Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the ``" -"\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " +"Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " +"``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " "sequence patterns, extra keys are ignored. An unpacking like ``**rest`` is " "also supported. (But ``**_`` would be redundant, so it is not allowed.)" msgstr "" @@ -883,10 +883,10 @@ msgid "" "parameters. If there is no ``/`` in the function definition, there are no " "positional-only parameters." msgstr "" -"此處再詳述一些細節,特定參數可以標記為\\ *僅限位置*\\ 。若參數為\\ *僅限位置*" -"\\ 時,它們的順序很重要,且這些參數不能用關鍵字傳遞。僅限位置參數必須放在 ``/" -"``\\ (斜線)之前。\\ ``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函式" -"定義中沒有 ``/``\\ ,則表示沒有任何僅限位置參數。" +"此處再詳述一些細節,特定參數可以標記為\\ *僅限位置*\\ 。若參數為\\ *僅限位置" +"*\\ 時,它們的順序很重要,且這些參數不能用關鍵字傳遞。僅限位置參數必須放在 " +"``/``\\ (斜線)之前。\\ ``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函" +"式定義中沒有 ``/``\\ ,則表示沒有任何僅限位置參數。" #: ../../tutorial/controlflow.rst:745 msgid "" @@ -1173,11 +1173,11 @@ msgid "" "line *after* the first line of the string determines the amount of " "indentation for the entire documentation string. (We can't use the first " "line since it is generally adjacent to the string's opening quotes so its " -"indentation is not apparent in the string literal.) Whitespace \"equivalent" -"\" to this indentation is then stripped from the start of all lines of the " -"string. Lines that are indented less should not occur, but if they occur " -"all their leading whitespace should be stripped. Equivalence of whitespace " -"should be tested after expansion of tabs (to 8 spaces, normally)." +"indentation is not apparent in the string literal.) Whitespace " +"\"equivalent\" to this indentation is then stripped from the start of all " +"lines of the string. Lines that are indented less should not occur, but if " +"they occur all their leading whitespace should be stripped. Equivalence of " +"whitespace should be tested after expansion of tabs (to 8 spaces, normally)." msgstr "" "Python 剖析器 (parser) 不會去除 Python 中多行字串的縮排,因此,處理說明文件的" "工具應在必要時去除縮排。這項操作遵循以下慣例:在字串第一行\\ *之後*\\ 的第一" @@ -1344,3 +1344,69 @@ msgstr "" "實際上,\\ *傳址呼叫 (call by object reference)* 的說法可能較為貼切。因為,若" "傳遞的是一個可變物件時,呼叫者將看得見被呼叫者對物件做出的任何改變(例如被插" "入 list 內的新項目)。" + +#: ../../tutorial/controlflow.rst:48 +msgid "statement" +msgstr "" + +#: ../../tutorial/controlflow.rst:48 +msgid "for" +msgstr "" + +#: ../../tutorial/controlflow.rst:437 ../../tutorial/controlflow.rst:974 +#, fuzzy +msgid "documentation strings" +msgstr "說明文件字串 (Documentation Strings)" + +#: ../../tutorial/controlflow.rst:437 ../../tutorial/controlflow.rst:974 +#, fuzzy +msgid "docstrings" +msgstr "使用說明字串。" + +#: ../../tutorial/controlflow.rst:437 ../../tutorial/controlflow.rst:974 +msgid "strings, documentation" +msgstr "" + +#: ../../tutorial/controlflow.rst:878 +msgid "* (asterisk)" +msgstr "" + +#: ../../tutorial/controlflow.rst:878 ../../tutorial/controlflow.rst:922 +#, fuzzy +msgid "in function calls" +msgstr "函式範例" + +#: ../../tutorial/controlflow.rst:922 +msgid "**" +msgstr "" + +#: ../../tutorial/controlflow.rst:1026 +#, fuzzy +msgid "function" +msgstr "定義函式 (function)" + +#: ../../tutorial/controlflow.rst:1026 +#, fuzzy +msgid "annotations" +msgstr "函式註釋 (Function Annotations)" + +#: ../../tutorial/controlflow.rst:1026 +msgid "->" +msgstr "" + +#: ../../tutorial/controlflow.rst:1026 +#, fuzzy +msgid "function annotations" +msgstr "函式註釋 (Function Annotations)" + +#: ../../tutorial/controlflow.rst:1026 +msgid ": (colon)" +msgstr "" + +#: ../../tutorial/controlflow.rst:1060 +msgid "coding" +msgstr "" + +#: ../../tutorial/controlflow.rst:1060 +msgid "style" +msgstr "" diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 1d10a41249..14a7f17c9d 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-26 00:21+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-10-05 10:26+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,10 +66,10 @@ msgid "" "Inside this string, you can write a Python expression between ``{`` and ``}" "`` characters that can refer to variables or literal values." msgstr "" -"要使用\\ :ref:`格式化字串文本 (formatted string literals) `" -"\\ ,需在字串開始前的引號或連續三個引號前加上 ``f`` 或 ``F``。你可以在這個字" -"串中使用 ``{`` 與 ``}`` 包夾 Python 的運算式,引用變數或其他字面值 (literal " -"values)。" +"要使用\\ :ref:`格式化字串文本 (formatted string literals) `\\ ,需在字串開始前的引號或連續三個引號前加上 ``f`` 或 ``F``。你可以" +"在這個字串中使用 ``{`` 與 ``}`` 包夾 Python 的運算式,引用變數或其他字面值 " +"(literal values)。" #: ../../tutorial/inputoutput.rst:37 msgid "" @@ -179,9 +179,9 @@ msgid "" "a'`` applies :func:`ascii`, ``'!s'`` applies :func:`str`, and ``'!r'`` " "applies :func:`repr`::" msgstr "" -"還有一些修飾符號可以在格式化前先將值轉換過。\\ ``'!a'`` 會套用 :func:`ascii`" -"\\ ,\\ ``'!s'`` 會套用 :func:`str`\\ ,\\ ``'!r'`` 會套用 :func:`repr`\\ " -":\n" +"還有一些修飾符號可以在格式化前先將值轉換過。\\ ``'!a'`` 會套用 :func:" +"`ascii`\\ ,\\ ``'!s'`` 會套用 :func:`str`\\ ,\\ ``'!r'`` 會套用 :func:" +"`repr`\\ :\n" "\n" "::" @@ -420,19 +420,19 @@ msgid "" "file:`JPEG` or :file:`EXE` files. Be very careful to use binary mode when " "reading and writing such files." msgstr "" -"在文字模式 (text mode) 下,讀取時會預設把平台特定的行尾符號(Unix 上為 ``" -"\\n``,Windows 上為 ``\\r\\n``)轉換為 ``\\n``。在文字模式下寫入時,預設會把 " -"``\\n`` 出現之處轉換回平台特定的行尾符號。這種在幕後對檔案資料的修改方式對文" -"字檔案來說沒有問題,但會毀壞像是 :file:`JPEG` 或 :file:`EXE` 檔案中的二進制資" -"料。在讀寫此類檔案時,注意一定要使用二進制模式。" +"在文字模式 (text mode) 下,讀取時會預設把平台特定的行尾符號(Unix 上為 " +"``\\n``,Windows 上為 ``\\r\\n``)轉換為 ``\\n``。在文字模式下寫入時,預設會" +"把 ``\\n`` 出現之處轉換回平台特定的行尾符號。這種在幕後對檔案資料的修改方式對" +"文字檔案來說沒有問題,但會毀壞像是 :file:`JPEG` 或 :file:`EXE` 檔案中的二進制" +"資料。在讀寫此類檔案時,注意一定要使用二進制模式。" #: ../../tutorial/inputoutput.rst:331 msgid "" "It is good practice to use the :keyword:`with` keyword when dealing with " "file objects. The advantage is that the file is properly closed after its " "suite finishes, even if an exception is raised at some point. Using :" -"keyword:`!with` is also much shorter than writing equivalent :keyword:`try`" -"\\ -\\ :keyword:`finally` blocks::" +"keyword:`!with` is also much shorter than writing equivalent :keyword:" +"`try`\\ -\\ :keyword:`finally` blocks::" msgstr "" "在處理檔案物件時,使用 :keyword:`with` 關鍵字是個好習慣。優點是,當它的套件結" "束後,即使在某個時刻引發了例外,檔案仍會正確地被關閉。使用 :keyword:`!with` " @@ -502,8 +502,8 @@ msgstr "" #: ../../tutorial/inputoutput.rst:390 msgid "" -"``f.readline()`` reads a single line from the file; a newline character (``" -"\\n``) is left at the end of the string, and is only omitted on the last " +"``f.readline()`` reads a single line from the file; a newline character " +"(``\\n``) is left at the end of the string, and is only omitted on the last " "line of the file if the file doesn't end in a newline. This makes the " "return value unambiguous; if ``f.readline()`` returns an empty string, the " "end of the file has been reached, while a blank line is represented by " @@ -714,3 +714,27 @@ msgstr "" "件進行序列化的協定。因此,它為 Python 所特有,不能用於與其他語言編寫的應用程" "式溝通。在預設情況,它也是不安全的:如果資料是由手段高明的攻擊者精心設計,將" "這段來自於不受信任來源的 pickle 資料反序列化,可以執行任意的程式碼。" + +#: ../../tutorial/inputoutput.rst:287 +msgid "built-in function" +msgstr "" + +#: ../../tutorial/inputoutput.rst:287 +msgid "open" +msgstr "" + +#: ../../tutorial/inputoutput.rst:287 +msgid "object" +msgstr "" + +#: ../../tutorial/inputoutput.rst:287 +msgid "file" +msgstr "" + +#: ../../tutorial/inputoutput.rst:469 +msgid "module" +msgstr "" + +#: ../../tutorial/inputoutput.rst:469 +msgid "json" +msgstr "" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index efbc82663e..4d4c17307f 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-29 00:16+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -697,3 +697,11 @@ msgstr "" "不像其他語言,特殊符號如 ``\\n`` 在單 (``'...'``) 和雙 (``\"...\"``) 引號中有" "相同的意思。兩種引號的唯一差別,在於使用單引號時,不需要跳脫 ``\"``\\ (但必" "須跳脫 ``\\'``\\ ),反之亦同。" + +#: ../../tutorial/introduction.rst:21 +msgid "# (hash)" +msgstr "" + +#: ../../tutorial/introduction.rst:21 +msgid "comment" +msgstr "" diff --git a/tutorial/modules.po b/tutorial/modules.po index c1f2011426..ddfc0b192c 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-15 00:32+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-10-23 20:30+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -827,3 +827,29 @@ msgid "" msgstr "" "實際上,函式定義也是「被執行」的「陳述式」;在執行模組階層的函式定義時,會將" "函式名稱加到模組的全域命名空間。" + +#: ../../tutorial/modules.rst:184 ../../tutorial/modules.rst:267 +#: ../../tutorial/modules.rst:348 +#, fuzzy +msgid "module" +msgstr "模組 (Module)" + +#: ../../tutorial/modules.rst:184 +msgid "search" +msgstr "" + +#: ../../tutorial/modules.rst:184 +msgid "path" +msgstr "" + +#: ../../tutorial/modules.rst:267 +msgid "sys" +msgstr "" + +#: ../../tutorial/modules.rst:348 +msgid "builtins" +msgstr "" + +#: ../../tutorial/modules.rst:492 +msgid "__all__" +msgstr "" diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index 87e635db5a..a13fa81544 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2022-01-31 18:14+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -400,6 +400,14 @@ msgstr "" "有數種支援國際化的模組,包括 :mod:`gettext`\\ 、\\ :mod:`locale` 和 :mod:" "`codecs` 等套件。" +#: ../../tutorial/stdlib.rst:27 +msgid "built-in function" +msgstr "" + +#: ../../tutorial/stdlib.rst:27 +msgid "help" +msgstr "" + #~ msgid "" #~ "The :mod:`getopt` module processes *sys.argv* using the conventions of " #~ "the Unix :func:`getopt` function. More powerful and flexible command " diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index f821ec1caa..a7e7f16c62 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2349,3 +2349,11 @@ msgid "" "Norwitz, Hans Nowak, Chris Reedy, Francesco Ricciardi, Vinay Sajip, Neil " "Schemenauer, Roman Suzi, Jason Tishler, Just van Rossum." msgstr "" + +#: ../../whatsnew/2.3.rst:371 +msgid "universal newlines" +msgstr "" + +#: ../../whatsnew/2.3.rst:371 +msgid "What's new" +msgstr "" diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index cf2aecba40..686de50a63 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1804,3 +1804,11 @@ msgid "" "Koray Can, Hye-Shik Chang, Michael Dyck, Raymond Hettinger, Brian Hurt, " "Hamish Lawson, Fredrik Lundh, Sean Reifschneider, Sadruddin Rejeb." msgstr "" + +#: ../../whatsnew/2.4.rst:414 +msgid "universal newlines" +msgstr "" + +#: ../../whatsnew/2.4.rst:414 +msgid "What's new" +msgstr "" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index 0b2b1dd899..49a078f50d 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-07 00:27+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2748,3 +2748,11 @@ msgid "" "Paul Prescod, James Pryor, Mike Rovner, Scott Weikart, Barry Warsaw, Thomas " "Wouters." msgstr "" + +#: ../../whatsnew/2.5.rst:1342 +msgid "universal newlines" +msgstr "" + +#: ../../whatsnew/2.5.rst:1342 +msgid "What's new" +msgstr "" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 0a77dbcc82..cadadcf7de 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3693,5 +3693,13 @@ msgid "" "Johnson, Chris Lambacher, Martin Michlmayr, Antoine Pitrou, Brian Warner." msgstr "" +#: ../../whatsnew/2.6.rst:1072 +msgid "universal newlines" +msgstr "" + +#: ../../whatsnew/2.6.rst:1072 +msgid "What's new" +msgstr "" + #~ msgid "`Sphinx `__" #~ msgstr "`Sphinx `__" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 856aac9cbc..4e5a1a96a2 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-09 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3852,3 +3852,11 @@ msgstr "" msgid "" "(:issue:`11591`, contributed by Carl Meyer with editions by Éric Araujo.)" msgstr "" + +#: ../../whatsnew/3.3.rst:396 +msgid "yield" +msgstr "" + +#: ../../whatsnew/3.3.rst:396 +msgid "yield from (in What's New)" +msgstr "" From 3206dd8165a681393a9536d792e38b7946fa049b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 10 May 2023 00:31:13 +0000 Subject: [PATCH 082/130] sync with cpython 2fa14d47 --- howto/logging.po | 6 +- library/http.client.po | 125 +++++++++++++++++++++----------------- library/typing.po | 6 +- library/urllib.request.po | 10 +-- 4 files changed, 80 insertions(+), 67 deletions(-) diff --git a/howto/logging.po b/howto/logging.po index b19516e766..2f4fbde2ae 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-05-10 00:29+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-" @@ -426,8 +426,8 @@ msgid "" "If your logging needs are simple, then use the above examples to incorporate " "logging into your own scripts, and if you run into problems or don't " "understand something, please post a question on the comp.lang.python Usenet " -"group (available at https://groups.google.com/forum/#!forum/comp.lang." -"python) and you should receive help before too long." +"group (available at https://groups.google.com/g/comp.lang.python) and you " +"should receive help before too long." msgstr "" #: ../../howto/logging.rst:342 diff --git a/library/http.client.po b/library/http.client.po index 36afdd2ff7..b802f4ec2f 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-05-10 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -284,10 +284,13 @@ msgstr "" #: ../../library/http.client.rst:264 msgid "" "This will send a request to the server using the HTTP request method " -"*method* and the selector *url*." +"*method* and the request URI *url*. The provided *url* must be an absolute " +"path to conform with :rfc:`RFC 2616 §5.1.2 <2616#section-5.1.2>` (unless " +"connecting to an HTTP proxy server or using the ``OPTIONS`` or ``CONNECT`` " +"methods)." msgstr "" -#: ../../library/http.client.rst:267 +#: ../../library/http.client.rst:270 msgid "" "If *body* is specified, the specified data is sent after the headers are " "finished. It may be a :class:`str`, a :term:`bytes-like object`, an open :" @@ -302,13 +305,16 @@ msgid "" "iterable is exhausted." msgstr "" -#: ../../library/http.client.rst:279 +#: ../../library/http.client.rst:282 msgid "" "The *headers* argument should be a mapping of extra HTTP headers to send " -"with the request." +"with the request. A :rfc:`Host header <2616#section-14.23>` must be provided " +"to conform with :rfc:`RFC 2616 §5.1.2 <2616#section-5.1.2>` (unless " +"connecting to an HTTP proxy server or using the ``OPTIONS`` or ``CONNECT`` " +"methods)." msgstr "" -#: ../../library/http.client.rst:282 +#: ../../library/http.client.rst:288 msgid "" "If *headers* contains neither Content-Length nor Transfer-Encoding, but " "there is a request body, one of those header fields will be added " @@ -321,7 +327,7 @@ msgid "" "Length." msgstr "" -#: ../../library/http.client.rst:294 +#: ../../library/http.client.rst:300 msgid "" "The *encode_chunked* argument is only relevant if Transfer-Encoding is " "specified in *headers*. If *encode_chunked* is ``False``, the " @@ -329,7 +335,12 @@ msgid "" "code. If it is ``True``, the body will be chunk-encoded." msgstr "" -#: ../../library/http.client.rst:300 +#: ../../library/http.client.rst:305 +msgid "" +"For example, to perform a ``GET`` request to ``https://docs.python.org/3/``::" +msgstr "" + +#: ../../library/http.client.rst:316 msgid "" "Chunked transfer encoding has been added to the HTTP protocol version 1.1. " "Unless the HTTP server is known to handle HTTP 1.1, the caller must either " @@ -337,11 +348,11 @@ msgid "" "that is not also a file as the body representation." msgstr "" -#: ../../library/http.client.rst:306 +#: ../../library/http.client.rst:322 msgid "*body* can now be an iterable." msgstr "" -#: ../../library/http.client.rst:309 +#: ../../library/http.client.rst:325 msgid "" "If neither Content-Length nor Transfer-Encoding are set in *headers*, file " "and iterable *body* objects are now chunk-encoded. The *encode_chunked* " @@ -349,26 +360,26 @@ msgid "" "file objects." msgstr "" -#: ../../library/http.client.rst:318 +#: ../../library/http.client.rst:334 msgid "" "Should be called after a request is sent to get the response from the " "server. Returns an :class:`HTTPResponse` instance." msgstr "" -#: ../../library/http.client.rst:323 +#: ../../library/http.client.rst:339 msgid "" "Note that you must have read the whole response before you can send a new " "request to the server." msgstr "" -#: ../../library/http.client.rst:326 +#: ../../library/http.client.rst:342 msgid "" "If a :exc:`ConnectionError` or subclass is raised, the :class:" "`HTTPConnection` object will be ready to reconnect when a new request is " "sent." msgstr "" -#: ../../library/http.client.rst:334 +#: ../../library/http.client.rst:350 msgid "" "Set the debugging level. The default debug level is ``0``, meaning no " "debugging output is printed. Any value greater than ``0`` will cause all " @@ -376,26 +387,26 @@ msgid "" "is passed to any new :class:`HTTPResponse` objects that are created." msgstr "" -#: ../../library/http.client.rst:344 +#: ../../library/http.client.rst:360 msgid "" "Set the host and the port for HTTP Connect Tunnelling. This allows running " "the connection through a proxy server." msgstr "" -#: ../../library/http.client.rst:347 +#: ../../library/http.client.rst:363 msgid "" "The host and port arguments specify the endpoint of the tunneled connection " "(i.e. the address included in the CONNECT request, *not* the address of the " "proxy server)." msgstr "" -#: ../../library/http.client.rst:351 +#: ../../library/http.client.rst:367 msgid "" "The headers argument should be a mapping of extra HTTP headers to send with " "the CONNECT request." msgstr "" -#: ../../library/http.client.rst:354 +#: ../../library/http.client.rst:370 msgid "" "For example, to tunnel through a HTTPS proxy server running locally on port " "8080, we would pass the address of the proxy to the :class:`HTTPSConnection` " @@ -403,34 +414,34 @@ msgid "" "the :meth:`~HTTPConnection.set_tunnel` method::" msgstr "" -#: ../../library/http.client.rst:369 +#: ../../library/http.client.rst:385 msgid "" "Connect to the server specified when the object was created. By default, " "this is called automatically when making a request if the client does not " "already have a connection." msgstr "" -#: ../../library/http.client.rst:384 +#: ../../library/http.client.rst:400 msgid "" "Raises an :ref:`auditing event ` ``http.client.connect`` with " "arguments ``self``, ``host``, ``port``." msgstr "" -#: ../../library/http.client.rst:378 +#: ../../library/http.client.rst:394 msgid "Close the connection to the server." msgstr "" -#: ../../library/http.client.rst:383 +#: ../../library/http.client.rst:399 msgid "Buffer size in bytes for sending a file-like message body." msgstr "" -#: ../../library/http.client.rst:388 +#: ../../library/http.client.rst:404 msgid "" "As an alternative to using the :meth:`request` method described above, you " "can also send your request step by step, by using the four functions below." msgstr "" -#: ../../library/http.client.rst:395 +#: ../../library/http.client.rst:411 msgid "" "This should be the first call after the connection to the server has been " "made. It sends a line to the server consisting of the *method* string, the " @@ -440,7 +451,7 @@ msgid "" "with non-False values." msgstr "" -#: ../../library/http.client.rst:405 +#: ../../library/http.client.rst:421 msgid "" "Send an :rfc:`822`\\ -style header to the server. It sends a line to the " "server consisting of the header, a colon and a space, and the first " @@ -448,14 +459,14 @@ msgid "" "consisting of a tab and an argument." msgstr "" -#: ../../library/http.client.rst:413 +#: ../../library/http.client.rst:429 msgid "" "Send a blank line to the server, signalling the end of the headers. The " "optional *message_body* argument can be used to pass a message body " "associated with the request." msgstr "" -#: ../../library/http.client.rst:417 +#: ../../library/http.client.rst:433 msgid "" "If *encode_chunked* is ``True``, the result of each iteration of " "*message_body* will be chunk-encoded as specified in :rfc:`7230`, Section " @@ -468,7 +479,7 @@ msgid "" "the chunk-encoded data immediately after *message_body*." msgstr "" -#: ../../library/http.client.rst:428 +#: ../../library/http.client.rst:444 msgid "" "Due to the chunked encoding specification, empty chunks yielded by an " "iterator body will be ignored by the chunk-encoder. This is to avoid " @@ -476,50 +487,50 @@ msgid "" "malformed encoding." msgstr "" -#: ../../library/http.client.rst:433 +#: ../../library/http.client.rst:449 msgid "Chunked encoding support. The *encode_chunked* parameter was added." msgstr "" -#: ../../library/http.client.rst:440 +#: ../../library/http.client.rst:456 msgid "" "Send data to the server. This should be used directly only after the :meth:" "`endheaders` method has been called and before :meth:`getresponse` is called." msgstr "" -#: ../../library/http.client.rst:455 +#: ../../library/http.client.rst:471 msgid "" "Raises an :ref:`auditing event ` ``http.client.send`` with " "arguments ``self``, ``data``." msgstr "" -#: ../../library/http.client.rst:450 +#: ../../library/http.client.rst:466 msgid "HTTPResponse Objects" msgstr "HTTPResponse 物件" -#: ../../library/http.client.rst:452 +#: ../../library/http.client.rst:468 msgid "" "An :class:`HTTPResponse` instance wraps the HTTP response from the server. " "It provides access to the request headers and the entity body. The response " "is an iterable object and can be used in a with statement." msgstr "" -#: ../../library/http.client.rst:457 +#: ../../library/http.client.rst:473 msgid "" "The :class:`io.BufferedIOBase` interface is now implemented and all of its " "reader operations are supported." msgstr "" -#: ../../library/http.client.rst:464 +#: ../../library/http.client.rst:480 msgid "Reads and returns the response body, or up to the next *amt* bytes." msgstr "" -#: ../../library/http.client.rst:468 +#: ../../library/http.client.rst:484 msgid "" "Reads up to the next len(b) bytes of the response body into the buffer *b*. " "Returns the number of bytes read." msgstr "" -#: ../../library/http.client.rst:475 +#: ../../library/http.client.rst:491 msgid "" "Return the value of the header *name*, or *default* if there is no header " "matching *name*. If there is more than one header with the name *name*, " @@ -527,87 +538,87 @@ msgid "" "than a single string, its elements are similarly returned joined by commas." msgstr "" -#: ../../library/http.client.rst:482 +#: ../../library/http.client.rst:498 msgid "Return a list of (header, value) tuples." msgstr "" -#: ../../library/http.client.rst:486 +#: ../../library/http.client.rst:502 msgid "Return the ``fileno`` of the underlying socket." msgstr "" -#: ../../library/http.client.rst:490 +#: ../../library/http.client.rst:506 msgid "" "A :class:`http.client.HTTPMessage` instance containing the response " "headers. :class:`http.client.HTTPMessage` is a subclass of :class:`email." "message.Message`." msgstr "" -#: ../../library/http.client.rst:496 +#: ../../library/http.client.rst:512 msgid "" "HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1." msgstr "" -#: ../../library/http.client.rst:500 +#: ../../library/http.client.rst:516 msgid "" "URL of the resource retrieved, commonly used to determine if a redirect was " "followed." msgstr "" -#: ../../library/http.client.rst:504 +#: ../../library/http.client.rst:520 msgid "" "Headers of the response in the form of an :class:`email.message." "EmailMessage` instance." msgstr "" -#: ../../library/http.client.rst:508 +#: ../../library/http.client.rst:524 msgid "Status code returned by server." msgstr "" -#: ../../library/http.client.rst:512 +#: ../../library/http.client.rst:528 msgid "Reason phrase returned by server." msgstr "" -#: ../../library/http.client.rst:516 +#: ../../library/http.client.rst:532 msgid "" "A debugging hook. If :attr:`debuglevel` is greater than zero, messages will " "be printed to stdout as the response is read and parsed." msgstr "" -#: ../../library/http.client.rst:521 +#: ../../library/http.client.rst:537 msgid "Is ``True`` if the stream is closed." msgstr "" -#: ../../library/http.client.rst:525 +#: ../../library/http.client.rst:541 msgid "Deprecated in favor of :attr:`~HTTPResponse.url`." msgstr "" -#: ../../library/http.client.rst:530 +#: ../../library/http.client.rst:546 msgid "Deprecated in favor of :attr:`~HTTPResponse.headers`." msgstr "" -#: ../../library/http.client.rst:535 +#: ../../library/http.client.rst:551 msgid "Deprecated in favor of :attr:`~HTTPResponse.status`." msgstr "" -#: ../../library/http.client.rst:539 +#: ../../library/http.client.rst:555 msgid "Examples" msgstr "範例" -#: ../../library/http.client.rst:541 +#: ../../library/http.client.rst:557 msgid "Here is an example session that uses the ``GET`` method::" msgstr "" -#: ../../library/http.client.rst:566 +#: ../../library/http.client.rst:582 msgid "" "Here is an example session that uses the ``HEAD`` method. Note that the " "``HEAD`` method never returns any data. ::" msgstr "" -#: ../../library/http.client.rst:581 +#: ../../library/http.client.rst:597 msgid "Here is an example session that uses the ``POST`` method::" msgstr "" -#: ../../library/http.client.rst:597 +#: ../../library/http.client.rst:613 msgid "" "Client side HTTP ``PUT`` requests are very similar to ``POST`` requests. The " "difference lies only on the server side where HTTP servers will allow " @@ -617,11 +628,11 @@ msgid "" "``PUT`` method::" msgstr "" -#: ../../library/http.client.rst:618 +#: ../../library/http.client.rst:634 msgid "HTTPMessage Objects" msgstr "HTTPMessage 物件" -#: ../../library/http.client.rst:620 +#: ../../library/http.client.rst:636 msgid "" "An :class:`http.client.HTTPMessage` instance holds the headers from an HTTP " "response. It is implemented using the :class:`email.message.Message` class." diff --git a/library/typing.po b/library/typing.po index 04f63a308f..a680947e3e 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-05-10 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1976,8 +1976,8 @@ msgstr "" #: ../../library/typing.rst:2097 msgid "" -"Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " -"| memoryview``." +"Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " +"memoryview``." msgstr "" #: ../../library/typing.rst:2101 diff --git a/library/urllib.request.po b/library/urllib.request.po index 227103af56..7eb5bfff0a 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-05-10 00:29+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -62,9 +62,10 @@ msgid "The :mod:`urllib.request` module defines the following functions:" msgstr ":mod:`urllib.request` module 定義下列函式:" #: ../../library/urllib.request.rst:31 +#, fuzzy msgid "" -"Open the URL *url*, which can be either a string or a :class:`Request` " -"object." +"Open *url*, which can be either a string containing a valid, properly " +"encoded URL, or a :class:`Request` object." msgstr "打開 URL *url*,其值可以是一個字串或是一個 :class:`Request` 物件。" #: ../../library/urllib.request.rst:34 @@ -370,7 +371,8 @@ msgid "This class is an abstraction of a URL request." msgstr "這個 class 是一個 URL 請求的抽象 class。" #: ../../library/urllib.request.rst:195 -msgid "*url* should be a string containing a valid URL." +#, fuzzy +msgid "*url* should be a string containing a valid, properly encoded URL." msgstr "*url* 是一個包含有效 URL 的字串。" #: ../../library/urllib.request.rst:197 From 3ca3554c3ef6428eb0debb6e07addca1cbf149dd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 11 May 2023 00:32:35 +0000 Subject: [PATCH 083/130] sync with cpython 846a23d0 --- howto/logging.po | 280 ++++++++++++++-------------- library/hashlib.po | 118 ++++++------ library/pathlib.po | 454 ++++++++++++++++++++++----------------------- library/typing.po | 83 +++++---- 4 files changed, 470 insertions(+), 465 deletions(-) diff --git a/howto/logging.po b/howto/logging.po index 2f4fbde2ae..2c949dfd9d 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-10 00:29+0000\n" +"POT-Creation-Date: 2023-05-11 00:29+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-" @@ -134,7 +134,7 @@ msgid "" "described below (in increasing order of severity):" msgstr "" -#: ../../howto/logging.rst:69 ../../howto/logging.rst:862 +#: ../../howto/logging.rst:69 ../../howto/logging.rst:863 msgid "Level" msgstr "" @@ -142,7 +142,7 @@ msgstr "" msgid "When it's used" msgstr "" -#: ../../howto/logging.rst:71 ../../howto/logging.rst:872 +#: ../../howto/logging.rst:71 ../../howto/logging.rst:873 msgid "``DEBUG``" msgstr "``DEBUG``" @@ -151,7 +151,7 @@ msgid "" "Detailed information, typically of interest only when diagnosing problems." msgstr "" -#: ../../howto/logging.rst:74 ../../howto/logging.rst:870 +#: ../../howto/logging.rst:74 ../../howto/logging.rst:871 msgid "``INFO``" msgstr "``INFO``" @@ -159,7 +159,7 @@ msgstr "``INFO``" msgid "Confirmation that things are working as expected." msgstr "" -#: ../../howto/logging.rst:77 ../../howto/logging.rst:868 +#: ../../howto/logging.rst:77 ../../howto/logging.rst:869 msgid "``WARNING``" msgstr "``WARNING``" @@ -170,7 +170,7 @@ msgid "" "working as expected." msgstr "" -#: ../../howto/logging.rst:82 ../../howto/logging.rst:866 +#: ../../howto/logging.rst:82 ../../howto/logging.rst:867 msgid "``ERROR``" msgstr "``ERROR``" @@ -180,7 +180,7 @@ msgid "" "some function." msgstr "" -#: ../../howto/logging.rst:85 ../../howto/logging.rst:864 +#: ../../howto/logging.rst:85 ../../howto/logging.rst:865 msgid "``CRITICAL``" msgstr "``CRITICAL``" @@ -549,11 +549,11 @@ msgid "" "the following diagram." msgstr "" -#: ../../howto/logging.rst:420 +#: ../../howto/logging.rst:421 msgid "Loggers" msgstr "" -#: ../../howto/logging.rst:422 +#: ../../howto/logging.rst:423 msgid "" ":class:`Logger` objects have a threefold job. First, they expose several " "methods to application code so that applications can log messages at " @@ -563,17 +563,17 @@ msgid "" "handlers." msgstr "" -#: ../../howto/logging.rst:428 +#: ../../howto/logging.rst:429 msgid "" "The most widely used methods on logger objects fall into two categories: " "configuration and message sending." msgstr "" -#: ../../howto/logging.rst:431 +#: ../../howto/logging.rst:432 msgid "These are the most common configuration methods:" msgstr "" -#: ../../howto/logging.rst:433 +#: ../../howto/logging.rst:434 msgid "" ":meth:`Logger.setLevel` specifies the lowest-severity log message a logger " "will handle, where debug is the lowest built-in severity level and critical " @@ -582,32 +582,32 @@ msgid "" "messages and will ignore DEBUG messages." msgstr "" -#: ../../howto/logging.rst:439 +#: ../../howto/logging.rst:440 msgid "" ":meth:`Logger.addHandler` and :meth:`Logger.removeHandler` add and remove " "handler objects from the logger object. Handlers are covered in more detail " "in :ref:`handler-basic`." msgstr "" -#: ../../howto/logging.rst:443 +#: ../../howto/logging.rst:444 msgid "" ":meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove " "filter objects from the logger object. Filters are covered in more detail " "in :ref:`filter`." msgstr "" -#: ../../howto/logging.rst:447 +#: ../../howto/logging.rst:448 msgid "" "You don't need to always call these methods on every logger you create. See " "the last two paragraphs in this section." msgstr "" -#: ../../howto/logging.rst:450 +#: ../../howto/logging.rst:451 msgid "" "With the logger object configured, the following methods create log messages:" msgstr "" -#: ../../howto/logging.rst:452 +#: ../../howto/logging.rst:453 msgid "" ":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:" "`Logger.error`, and :meth:`Logger.critical` all create log records with a " @@ -620,14 +620,14 @@ msgid "" "exception information." msgstr "" -#: ../../howto/logging.rst:462 +#: ../../howto/logging.rst:463 msgid "" ":meth:`Logger.exception` creates a log message similar to :meth:`Logger." "error`. The difference is that :meth:`Logger.exception` dumps a stack trace " "along with it. Call this method only from an exception handler." msgstr "" -#: ../../howto/logging.rst:466 +#: ../../howto/logging.rst:467 msgid "" ":meth:`Logger.log` takes a log level as an explicit argument. This is a " "little more verbose for logging messages than using the log level " @@ -635,7 +635,7 @@ msgid "" "levels." msgstr "" -#: ../../howto/logging.rst:470 +#: ../../howto/logging.rst:471 msgid "" ":func:`getLogger` returns a reference to a logger instance with the " "specified name if it is provided, or ``root`` if not. The names are period-" @@ -647,7 +647,7 @@ msgid "" "descendants of ``foo``." msgstr "" -#: ../../howto/logging.rst:478 +#: ../../howto/logging.rst:479 msgid "" "Loggers have a concept of *effective level*. If a level is not explicitly " "set on a logger, the level of its parent is used instead as its effective " @@ -659,7 +659,7 @@ msgid "" "handlers." msgstr "" -#: ../../howto/logging.rst:486 +#: ../../howto/logging.rst:487 msgid "" "Child loggers propagate messages up to the handlers associated with their " "ancestor loggers. Because of this, it is unnecessary to define and configure " @@ -669,11 +669,11 @@ msgid "" "attribute of a logger to ``False``.)" msgstr "" -#: ../../howto/logging.rst:497 +#: ../../howto/logging.rst:498 msgid "Handlers" msgstr "" -#: ../../howto/logging.rst:499 +#: ../../howto/logging.rst:500 msgid "" ":class:`~logging.Handler` objects are responsible for dispatching the " "appropriate log messages (based on the log messages' severity) to the " @@ -686,14 +686,14 @@ msgid "" "of a specific severity to a specific location." msgstr "" -#: ../../howto/logging.rst:509 +#: ../../howto/logging.rst:510 msgid "" "The standard library includes quite a few handler types (see :ref:`useful-" "handlers`); the tutorials use mainly :class:`StreamHandler` and :class:" "`FileHandler` in its examples." msgstr "" -#: ../../howto/logging.rst:513 +#: ../../howto/logging.rst:514 msgid "" "There are very few methods in a handler for application developers to " "concern themselves with. The only handler methods that seem relevant for " @@ -701,7 +701,7 @@ msgid "" "not creating custom handlers) are the following configuration methods:" msgstr "" -#: ../../howto/logging.rst:518 +#: ../../howto/logging.rst:519 msgid "" "The :meth:`~Handler.setLevel` method, just as in logger objects, specifies " "the lowest severity that will be dispatched to the appropriate destination. " @@ -711,19 +711,19 @@ msgid "" "on." msgstr "" -#: ../../howto/logging.rst:524 +#: ../../howto/logging.rst:525 msgid "" ":meth:`~Handler.setFormatter` selects a Formatter object for this handler to " "use." msgstr "" -#: ../../howto/logging.rst:527 +#: ../../howto/logging.rst:528 msgid "" ":meth:`~Handler.addFilter` and :meth:`~Handler.removeFilter` respectively " "configure and deconfigure filter objects on handlers." msgstr "" -#: ../../howto/logging.rst:530 +#: ../../howto/logging.rst:531 msgid "" "Application code should not directly instantiate and use instances of :class:" "`Handler`. Instead, the :class:`Handler` class is a base class that defines " @@ -731,11 +731,11 @@ msgid "" "behavior that child classes can use (or override)." msgstr "" -#: ../../howto/logging.rst:537 +#: ../../howto/logging.rst:538 msgid "Formatters" msgstr "" -#: ../../howto/logging.rst:539 +#: ../../howto/logging.rst:540 msgid "" "Formatter objects configure the final order, structure, and contents of the " "log message. Unlike the base :class:`logging.Handler` class, application " @@ -745,20 +745,20 @@ msgid "" "string and a style indicator." msgstr "" -#: ../../howto/logging.rst:548 +#: ../../howto/logging.rst:549 msgid "" "If there is no message format string, the default is to use the raw " "message. If there is no date format string, the default date format is:" msgstr "" -#: ../../howto/logging.rst:555 +#: ../../howto/logging.rst:556 msgid "" "with the milliseconds tacked on at the end. The ``style`` is one of ``'%'``, " "``'{'``, or ``'$'``. If one of these is not specified, then ``'%'`` will be " "used." msgstr "" -#: ../../howto/logging.rst:558 +#: ../../howto/logging.rst:559 msgid "" "If the ``style`` is ``'%'``, the message format string uses ``%()s`` styled string substitution; the possible keys are documented in :" @@ -768,18 +768,18 @@ msgid "" "should conform to what is expected by :meth:`string.Template.substitute`." msgstr "" -#: ../../howto/logging.rst:565 +#: ../../howto/logging.rst:566 msgid "Added the ``style`` parameter." msgstr "新增 ``style`` 參數。" -#: ../../howto/logging.rst:568 +#: ../../howto/logging.rst:569 msgid "" "The following message format string will log the time in a human-readable " "format, the severity of the message, and the contents of the message, in " "that order::" msgstr "" -#: ../../howto/logging.rst:574 +#: ../../howto/logging.rst:575 msgid "" "Formatters use a user-configurable function to convert the creation time of " "a record to a tuple. By default, :func:`time.localtime` is used; to change " @@ -790,68 +790,68 @@ msgid "" "in the Formatter class (to ``time.gmtime`` for GMT display)." msgstr "" -#: ../../howto/logging.rst:584 +#: ../../howto/logging.rst:585 msgid "Configuring Logging" msgstr "" -#: ../../howto/logging.rst:588 +#: ../../howto/logging.rst:589 msgid "Programmers can configure logging in three ways:" msgstr "" -#: ../../howto/logging.rst:590 +#: ../../howto/logging.rst:591 msgid "" "Creating loggers, handlers, and formatters explicitly using Python code that " "calls the configuration methods listed above." msgstr "" -#: ../../howto/logging.rst:592 +#: ../../howto/logging.rst:593 msgid "" "Creating a logging config file and reading it using the :func:`fileConfig` " "function." msgstr "" -#: ../../howto/logging.rst:594 +#: ../../howto/logging.rst:595 msgid "" "Creating a dictionary of configuration information and passing it to the :" "func:`dictConfig` function." msgstr "" -#: ../../howto/logging.rst:597 +#: ../../howto/logging.rst:598 msgid "" "For the reference documentation on the last two options, see :ref:`logging-" "config-api`. The following example configures a very simple logger, a " "console handler, and a simple formatter using Python code::" msgstr "" -#: ../../howto/logging.rst:627 +#: ../../howto/logging.rst:628 msgid "" "Running this module from the command line produces the following output:" msgstr "" -#: ../../howto/logging.rst:638 +#: ../../howto/logging.rst:639 msgid "" "The following Python module creates a logger, handler, and formatter nearly " "identical to those in the example listed above, with the only difference " "being the names of the objects::" msgstr "" -#: ../../howto/logging.rst:657 +#: ../../howto/logging.rst:658 msgid "Here is the logging.conf file:" msgstr "" -#: ../../howto/logging.rst:689 +#: ../../howto/logging.rst:690 msgid "" "The output is nearly identical to that of the non-config-file-based example:" msgstr "" -#: ../../howto/logging.rst:700 +#: ../../howto/logging.rst:701 msgid "" "You can see that the config file approach has a few advantages over the " "Python code approach, mainly separation of configuration and code and the " "ability of noncoders to easily modify the logging properties." msgstr "" -#: ../../howto/logging.rst:704 +#: ../../howto/logging.rst:705 msgid "" "The :func:`fileConfig` function takes a default parameter, " "``disable_existing_loggers``, which defaults to ``True`` for reasons of " @@ -862,7 +862,7 @@ msgid "" "information, and specify ``False`` for this parameter if you wish." msgstr "" -#: ../../howto/logging.rst:712 +#: ../../howto/logging.rst:713 msgid "" "The dictionary passed to :func:`dictConfig` can also specify a Boolean value " "with key ``disable_existing_loggers``, which if not specified explicitly in " @@ -871,7 +871,7 @@ msgid "" "want - in which case, provide the key explicitly with a value of ``False``." msgstr "" -#: ../../howto/logging.rst:722 +#: ../../howto/logging.rst:723 msgid "" "Note that the class names referenced in config files need to be either " "relative to the logging module, or absolute values which can be resolved " @@ -882,7 +882,7 @@ msgid "" "path)." msgstr "" -#: ../../howto/logging.rst:730 +#: ../../howto/logging.rst:731 msgid "" "In Python 3.2, a new means of configuring logging has been introduced, using " "dictionaries to hold configuration information. This provides a superset of " @@ -897,23 +897,23 @@ msgid "" "a socket, or use whatever approach makes sense for your application." msgstr "" -#: ../../howto/logging.rst:742 +#: ../../howto/logging.rst:743 msgid "" "Here's an example of the same configuration as above, in YAML format for the " "new dictionary-based approach:" msgstr "" -#: ../../howto/logging.rst:766 +#: ../../howto/logging.rst:767 msgid "" "For more information about logging using a dictionary, see :ref:`logging-" "config-api`." msgstr "" -#: ../../howto/logging.rst:770 +#: ../../howto/logging.rst:771 msgid "What happens if no configuration is provided" msgstr "" -#: ../../howto/logging.rst:772 +#: ../../howto/logging.rst:773 msgid "" "If no logging configuration is provided, it is possible to have a situation " "where a logging event needs to be output, but no handlers can be found to " @@ -921,27 +921,27 @@ msgid "" "circumstances is dependent on the Python version." msgstr "" -#: ../../howto/logging.rst:777 +#: ../../howto/logging.rst:778 msgid "For versions of Python prior to 3.2, the behaviour is as follows:" msgstr "" -#: ../../howto/logging.rst:779 +#: ../../howto/logging.rst:780 msgid "" "If *logging.raiseExceptions* is ``False`` (production mode), the event is " "silently dropped." msgstr "" -#: ../../howto/logging.rst:782 +#: ../../howto/logging.rst:783 msgid "" "If *logging.raiseExceptions* is ``True`` (development mode), a message 'No " "handlers could be found for logger X.Y.Z' is printed once." msgstr "" -#: ../../howto/logging.rst:785 +#: ../../howto/logging.rst:786 msgid "In Python 3.2 and later, the behaviour is as follows:" msgstr "" -#: ../../howto/logging.rst:787 +#: ../../howto/logging.rst:788 msgid "" "The event is output using a 'handler of last resort', stored in ``logging." "lastResort``. This internal handler is not associated with any logger, and " @@ -953,17 +953,17 @@ msgid "" "severities will be output." msgstr "" -#: ../../howto/logging.rst:796 +#: ../../howto/logging.rst:797 msgid "" "To obtain the pre-3.2 behaviour, ``logging.lastResort`` can be set to " "``None``." msgstr "" -#: ../../howto/logging.rst:801 +#: ../../howto/logging.rst:802 msgid "Configuring Logging for a Library" msgstr "" -#: ../../howto/logging.rst:803 +#: ../../howto/logging.rst:804 msgid "" "When developing a library which uses logging, you should take care to " "document how the library uses logging - for example, the names of loggers " @@ -974,7 +974,7 @@ msgid "" "is regarded as the best default behaviour." msgstr "" -#: ../../howto/logging.rst:811 +#: ../../howto/logging.rst:812 msgid "" "If for some reason you *don't* want these messages printed in the absence of " "any logging configuration, you can attach a do-nothing handler to the top-" @@ -986,7 +986,7 @@ msgid "" "to those handlers, as normal." msgstr "" -#: ../../howto/logging.rst:820 +#: ../../howto/logging.rst:821 msgid "" "A do-nothing handler is included in the logging package: :class:`~logging." "NullHandler` (since Python 3.1). An instance of this handler could be added " @@ -997,14 +997,14 @@ msgid "" "etc. then the code::" msgstr "" -#: ../../howto/logging.rst:831 +#: ../../howto/logging.rst:832 msgid "" "should have the desired effect. If an organisation produces a number of " "libraries, then the logger name specified can be 'orgname.foo' rather than " "just 'foo'." msgstr "" -#: ../../howto/logging.rst:835 +#: ../../howto/logging.rst:836 msgid "" "It is strongly advised that you *do not log to the root logger* in your " "library. Instead, use a logger with a unique and easily identifiable name, " @@ -1014,7 +1014,7 @@ msgid "" "library as they wish." msgstr "" -#: ../../howto/logging.rst:842 +#: ../../howto/logging.rst:843 msgid "" "It is strongly advised that you *do not add any handlers other than* :class:" "`~logging.NullHandler` *to your library's loggers*. This is because the " @@ -1025,11 +1025,11 @@ msgid "" "carry out unit tests and deliver logs which suit their requirements." msgstr "" -#: ../../howto/logging.rst:853 +#: ../../howto/logging.rst:854 msgid "Logging Levels" msgstr "" -#: ../../howto/logging.rst:855 +#: ../../howto/logging.rst:856 msgid "" "The numeric values of logging levels are given in the following table. These " "are primarily of interest if you want to define your own levels, and need " @@ -1038,39 +1038,39 @@ msgid "" "value; the predefined name is lost." msgstr "" -#: ../../howto/logging.rst:862 +#: ../../howto/logging.rst:863 msgid "Numeric value" msgstr "" -#: ../../howto/logging.rst:864 +#: ../../howto/logging.rst:865 msgid "50" msgstr "50" -#: ../../howto/logging.rst:866 +#: ../../howto/logging.rst:867 msgid "40" msgstr "40" -#: ../../howto/logging.rst:868 +#: ../../howto/logging.rst:869 msgid "30" msgstr "30" -#: ../../howto/logging.rst:870 +#: ../../howto/logging.rst:871 msgid "20" msgstr "20" -#: ../../howto/logging.rst:872 +#: ../../howto/logging.rst:873 msgid "10" msgstr "10" -#: ../../howto/logging.rst:874 +#: ../../howto/logging.rst:875 msgid "``NOTSET``" msgstr "``NOTSET``" -#: ../../howto/logging.rst:874 +#: ../../howto/logging.rst:875 msgid "0" msgstr "0" -#: ../../howto/logging.rst:877 +#: ../../howto/logging.rst:878 msgid "" "Levels can also be associated with loggers, being set either by the " "developer or through loading a saved logging configuration. When a logging " @@ -1080,14 +1080,14 @@ msgid "" "basic mechanism controlling the verbosity of logging output." msgstr "" -#: ../../howto/logging.rst:884 +#: ../../howto/logging.rst:885 msgid "" "Logging messages are encoded as instances of the :class:`~logging.LogRecord` " "class. When a logger decides to actually log an event, a :class:`~logging." "LogRecord` instance is created from the logging message." msgstr "" -#: ../../howto/logging.rst:888 +#: ../../howto/logging.rst:889 msgid "" "Logging messages are subjected to a dispatch mechanism through the use of :" "dfn:`handlers`, which are instances of subclasses of the :class:`Handler` " @@ -1104,7 +1104,7 @@ msgid "" "at which point the passing to ancestor handlers stops)." msgstr "" -#: ../../howto/logging.rst:902 +#: ../../howto/logging.rst:903 msgid "" "Just as for loggers, handlers can have levels associated with them. A " "handler's level acts as a filter in the same way as a logger's level does. " @@ -1114,11 +1114,11 @@ msgid "" "`~Handler.emit`." msgstr "" -#: ../../howto/logging.rst:911 +#: ../../howto/logging.rst:912 msgid "Custom Levels" msgstr "" -#: ../../howto/logging.rst:913 +#: ../../howto/logging.rst:914 msgid "" "Defining your own levels is possible, but should not be necessary, as the " "existing levels have been chosen on the basis of practical experience. " @@ -1131,27 +1131,27 @@ msgid "" "given numeric value might mean different things for different libraries." msgstr "" -#: ../../howto/logging.rst:926 +#: ../../howto/logging.rst:927 msgid "Useful Handlers" msgstr "" -#: ../../howto/logging.rst:928 +#: ../../howto/logging.rst:929 msgid "" "In addition to the base :class:`Handler` class, many useful subclasses are " "provided:" msgstr "" -#: ../../howto/logging.rst:931 +#: ../../howto/logging.rst:932 msgid "" ":class:`StreamHandler` instances send messages to streams (file-like " "objects)." msgstr "" -#: ../../howto/logging.rst:934 +#: ../../howto/logging.rst:935 msgid ":class:`FileHandler` instances send messages to disk files." msgstr "" -#: ../../howto/logging.rst:936 +#: ../../howto/logging.rst:937 msgid "" ":class:`~handlers.BaseRotatingHandler` is the base class for handlers that " "rotate log files at a certain point. It is not meant to be instantiated " @@ -1159,61 +1159,61 @@ msgid "" "`~handlers.TimedRotatingFileHandler`." msgstr "" -#: ../../howto/logging.rst:941 +#: ../../howto/logging.rst:942 msgid "" ":class:`~handlers.RotatingFileHandler` instances send messages to disk " "files, with support for maximum log file sizes and log file rotation." msgstr "" -#: ../../howto/logging.rst:944 +#: ../../howto/logging.rst:945 msgid "" ":class:`~handlers.TimedRotatingFileHandler` instances send messages to disk " "files, rotating the log file at certain timed intervals." msgstr "" -#: ../../howto/logging.rst:947 +#: ../../howto/logging.rst:948 msgid "" ":class:`~handlers.SocketHandler` instances send messages to TCP/IP sockets. " "Since 3.4, Unix domain sockets are also supported." msgstr "" -#: ../../howto/logging.rst:950 +#: ../../howto/logging.rst:951 msgid "" ":class:`~handlers.DatagramHandler` instances send messages to UDP sockets. " "Since 3.4, Unix domain sockets are also supported." msgstr "" -#: ../../howto/logging.rst:953 +#: ../../howto/logging.rst:954 msgid "" ":class:`~handlers.SMTPHandler` instances send messages to a designated email " "address." msgstr "" -#: ../../howto/logging.rst:956 +#: ../../howto/logging.rst:957 msgid "" ":class:`~handlers.SysLogHandler` instances send messages to a Unix syslog " "daemon, possibly on a remote machine." msgstr "" -#: ../../howto/logging.rst:959 +#: ../../howto/logging.rst:960 msgid "" ":class:`~handlers.NTEventLogHandler` instances send messages to a Windows " "NT/2000/XP event log." msgstr "" -#: ../../howto/logging.rst:962 +#: ../../howto/logging.rst:963 msgid "" ":class:`~handlers.MemoryHandler` instances send messages to a buffer in " "memory, which is flushed whenever specific criteria are met." msgstr "" -#: ../../howto/logging.rst:965 +#: ../../howto/logging.rst:966 msgid "" ":class:`~handlers.HTTPHandler` instances send messages to an HTTP server " "using either ``GET`` or ``POST`` semantics." msgstr "" -#: ../../howto/logging.rst:968 +#: ../../howto/logging.rst:969 msgid "" ":class:`~handlers.WatchedFileHandler` instances watch the file they are " "logging to. If the file changes, it is closed and reopened using the file " @@ -1221,13 +1221,13 @@ msgid "" "support the underlying mechanism used." msgstr "" -#: ../../howto/logging.rst:973 +#: ../../howto/logging.rst:974 msgid "" ":class:`~handlers.QueueHandler` instances send messages to a queue, such as " "those implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" -#: ../../howto/logging.rst:976 +#: ../../howto/logging.rst:977 msgid "" ":class:`NullHandler` instances do nothing with error messages. They are used " "by library developers who want to use logging, but want to avoid the 'No " @@ -1236,15 +1236,15 @@ msgid "" "more information." msgstr "" -#: ../../howto/logging.rst:982 +#: ../../howto/logging.rst:983 msgid "The :class:`NullHandler` class." msgstr "" -#: ../../howto/logging.rst:985 +#: ../../howto/logging.rst:986 msgid "The :class:`~handlers.QueueHandler` class." msgstr "" -#: ../../howto/logging.rst:988 +#: ../../howto/logging.rst:989 msgid "" "The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` " "classes are defined in the core logging package. The other handlers are " @@ -1252,14 +1252,14 @@ msgid "" "module, :mod:`logging.config`, for configuration functionality.)" msgstr "" -#: ../../howto/logging.rst:993 +#: ../../howto/logging.rst:994 msgid "" "Logged messages are formatted for presentation through instances of the :" "class:`Formatter` class. They are initialized with a format string suitable " "for use with the % operator and a dictionary." msgstr "" -#: ../../howto/logging.rst:997 +#: ../../howto/logging.rst:998 msgid "" "For formatting multiple messages in a batch, instances of :class:`~handlers." "BufferingFormatter` can be used. In addition to the format string (which is " @@ -1267,7 +1267,7 @@ msgid "" "trailer format strings." msgstr "" -#: ../../howto/logging.rst:1002 +#: ../../howto/logging.rst:1003 msgid "" "When filtering based on logger level and/or handler level is not enough, " "instances of :class:`Filter` can be added to both :class:`Logger` and :class:" @@ -1277,18 +1277,18 @@ msgid "" "value, the message is not processed further." msgstr "" -#: ../../howto/logging.rst:1009 +#: ../../howto/logging.rst:1010 msgid "" "The basic :class:`Filter` functionality allows filtering by specific logger " "name. If this feature is used, messages sent to the named logger and its " "children are allowed through the filter, and all others dropped." msgstr "" -#: ../../howto/logging.rst:1017 +#: ../../howto/logging.rst:1018 msgid "Exceptions raised during logging" msgstr "" -#: ../../howto/logging.rst:1019 +#: ../../howto/logging.rst:1020 msgid "" "The logging package is designed to swallow exceptions which occur while " "logging in production. This is so that errors which occur while handling " @@ -1296,7 +1296,7 @@ msgid "" "errors - do not cause the application using logging to terminate prematurely." msgstr "" -#: ../../howto/logging.rst:1024 +#: ../../howto/logging.rst:1025 msgid "" ":class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never " "swallowed. Other exceptions which occur during the :meth:`~Handler.emit` " @@ -1304,7 +1304,7 @@ msgid "" "handleError` method." msgstr "" -#: ../../howto/logging.rst:1029 +#: ../../howto/logging.rst:1030 msgid "" "The default implementation of :meth:`~Handler.handleError` in :class:" "`Handler` checks to see if a module-level variable, :data:`raiseExceptions`, " @@ -1312,7 +1312,7 @@ msgid "" "the exception is swallowed." msgstr "" -#: ../../howto/logging.rst:1034 +#: ../../howto/logging.rst:1035 msgid "" "The default value of :data:`raiseExceptions` is ``True``. This is because " "during development, you typically want to be notified of any exceptions that " @@ -1320,11 +1320,11 @@ msgid "" "production usage." msgstr "" -#: ../../howto/logging.rst:1044 +#: ../../howto/logging.rst:1045 msgid "Using arbitrary objects as messages" msgstr "" -#: ../../howto/logging.rst:1046 +#: ../../howto/logging.rst:1047 msgid "" "In the preceding sections and examples, it has been assumed that the message " "passed when logging the event is a string. However, this is not the only " @@ -1336,11 +1336,11 @@ msgid "" "the wire." msgstr "" -#: ../../howto/logging.rst:1057 +#: ../../howto/logging.rst:1058 msgid "Optimization" msgstr "" -#: ../../howto/logging.rst:1059 +#: ../../howto/logging.rst:1060 msgid "" "Formatting of message arguments is deferred until it cannot be avoided. " "However, computing the arguments passed to the logging method can also be " @@ -1351,13 +1351,13 @@ msgid "" "code like this::" msgstr "" -#: ../../howto/logging.rst:1071 +#: ../../howto/logging.rst:1072 msgid "" "so that if the logger's threshold is set above ``DEBUG``, the calls to :func:" "`expensive_func1` and :func:`expensive_func2` are never made." msgstr "" -#: ../../howto/logging.rst:1074 +#: ../../howto/logging.rst:1075 msgid "" "In some cases, :meth:`~Logger.isEnabledFor` can itself be more expensive " "than you'd like (e.g. for deeply nested loggers where an explicit level is " @@ -1369,7 +1369,7 @@ msgid "" "while the application is running (which is not all that common)." msgstr "" -#: ../../howto/logging.rst:1083 +#: ../../howto/logging.rst:1084 msgid "" "There are other optimizations which can be made for specific applications " "which need more precise control over what logging information is collected. " @@ -1377,82 +1377,82 @@ msgid "" "you don't need:" msgstr "" -#: ../../howto/logging.rst:1089 +#: ../../howto/logging.rst:1090 msgid "What you don't want to collect" msgstr "" -#: ../../howto/logging.rst:1089 +#: ../../howto/logging.rst:1090 msgid "How to avoid collecting it" msgstr "" -#: ../../howto/logging.rst:1091 +#: ../../howto/logging.rst:1092 msgid "Information about where calls were made from." msgstr "" -#: ../../howto/logging.rst:1091 +#: ../../howto/logging.rst:1092 msgid "" "Set ``logging._srcfile`` to ``None``. This avoids calling :func:`sys." "_getframe`, which may help to speed up your code in environments like PyPy " "(which can't speed up code that uses :func:`sys._getframe`)." msgstr "" -#: ../../howto/logging.rst:1097 +#: ../../howto/logging.rst:1098 msgid "Threading information." msgstr "" -#: ../../howto/logging.rst:1097 +#: ../../howto/logging.rst:1098 msgid "Set ``logging.logThreads`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1099 +#: ../../howto/logging.rst:1100 msgid "Current process ID (:func:`os.getpid`)" msgstr "" -#: ../../howto/logging.rst:1099 +#: ../../howto/logging.rst:1100 msgid "Set ``logging.logProcesses`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1101 +#: ../../howto/logging.rst:1102 msgid "" "Current process name when using ``multiprocessing`` to manage multiple " "processes." msgstr "" -#: ../../howto/logging.rst:1101 +#: ../../howto/logging.rst:1102 msgid "Set ``logging.logMultiprocessing`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1105 +#: ../../howto/logging.rst:1106 msgid "" "Also note that the core logging module only includes the basic handlers. If " "you don't import :mod:`logging.handlers` and :mod:`logging.config`, they " "won't take up any memory." msgstr "" -#: ../../howto/logging.rst:1112 +#: ../../howto/logging.rst:1113 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging.rst:1112 +#: ../../howto/logging.rst:1113 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging.rst:1115 +#: ../../howto/logging.rst:1116 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging.rst:1115 +#: ../../howto/logging.rst:1116 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging.rst:1118 +#: ../../howto/logging.rst:1119 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging.rst:1118 +#: ../../howto/logging.rst:1119 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging.rst:1120 +#: ../../howto/logging.rst:1121 msgid ":ref:`A logging cookbook `" msgstr "" diff --git a/library/hashlib.po b/library/hashlib.po index 64c54e7963..cb935f138b 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-05-11 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -542,42 +542,42 @@ msgstr "" msgid "Explanation of tree mode parameters." msgstr "" -#: ../../library/hashlib.rst:440 +#: ../../library/hashlib.rst:441 msgid "" "See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." msgstr "" -#: ../../library/hashlib.rst:446 +#: ../../library/hashlib.rst:447 msgid "Constants" msgstr "常數" -#: ../../library/hashlib.rst:451 +#: ../../library/hashlib.rst:452 msgid "Salt length (maximum length accepted by constructors)." msgstr "" -#: ../../library/hashlib.rst:457 +#: ../../library/hashlib.rst:458 msgid "" "Personalization string length (maximum length accepted by constructors)." msgstr "" -#: ../../library/hashlib.rst:463 +#: ../../library/hashlib.rst:464 msgid "Maximum key size." msgstr "" -#: ../../library/hashlib.rst:469 +#: ../../library/hashlib.rst:470 msgid "Maximum digest size that the hash function can output." msgstr "" -#: ../../library/hashlib.rst:473 +#: ../../library/hashlib.rst:474 msgid "Examples" msgstr "範例" -#: ../../library/hashlib.rst:476 +#: ../../library/hashlib.rst:477 msgid "Simple hashing" msgstr "" -#: ../../library/hashlib.rst:478 +#: ../../library/hashlib.rst:479 msgid "" "To calculate hash of some data, you should first construct a hash object by " "calling the appropriate constructor function (:func:`blake2b` or :func:" @@ -586,41 +586,41 @@ msgid "" "`digest` (or :meth:`hexdigest` for hex-encoded string)." msgstr "" -#: ../../library/hashlib.rst:491 +#: ../../library/hashlib.rst:492 msgid "" "As a shortcut, you can pass the first chunk of data to update directly to " "the constructor as the positional argument:" msgstr "" -#: ../../library/hashlib.rst:498 +#: ../../library/hashlib.rst:499 msgid "" "You can call :meth:`hash.update` as many times as you need to iteratively " "update the hash:" msgstr "" -#: ../../library/hashlib.rst:511 +#: ../../library/hashlib.rst:512 msgid "Using different digest sizes" msgstr "" -#: ../../library/hashlib.rst:513 +#: ../../library/hashlib.rst:514 msgid "" "BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to " "32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without " "changing the size of output, we can tell BLAKE2b to produce 20-byte digests:" msgstr "" -#: ../../library/hashlib.rst:527 +#: ../../library/hashlib.rst:528 msgid "" "Hash objects with different digest sizes have completely different outputs " "(shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s " "produce different outputs even if the output length is the same:" msgstr "" -#: ../../library/hashlib.rst:543 +#: ../../library/hashlib.rst:544 msgid "Keyed hashing" msgstr "" -#: ../../library/hashlib.rst:545 +#: ../../library/hashlib.rst:546 msgid "" "Keyed hashing can be used for authentication as a faster and simpler " "replacement for `Hash-based message authentication code `_)" msgstr "" -#: ../../library/hashlib.rst:629 +#: ../../library/hashlib.rst:630 msgid "" "In BLAKE2 the salt is processed as a one-time input to the hash function " "during initialization, rather than as an input to each compression function." msgstr "" -#: ../../library/hashlib.rst:634 +#: ../../library/hashlib.rst:635 msgid "" "*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose " "cryptographic hash function, such as SHA-256, is not suitable for hashing " @@ -698,18 +698,18 @@ msgid "" "information." msgstr "" -#: ../../library/hashlib.rst:657 +#: ../../library/hashlib.rst:658 msgid "Personalization" msgstr "" -#: ../../library/hashlib.rst:659 +#: ../../library/hashlib.rst:660 msgid "" "Sometimes it is useful to force hash function to produce different digests " "for the same input for different purposes. Quoting the authors of the Skein " "hash function:" msgstr "" -#: ../../library/hashlib.rst:663 +#: ../../library/hashlib.rst:664 msgid "" "We recommend that all application designers seriously consider doing this; " "we have seen many protocols where a hash that is computed in one part of the " @@ -719,41 +719,41 @@ msgid "" "hash function used in the protocol summarily stops this type of attack." msgstr "" -#: ../../library/hashlib.rst:670 +#: ../../library/hashlib.rst:671 msgid "" "(`The Skein Hash Function Family `_, p. 21)" msgstr "" -#: ../../library/hashlib.rst:674 +#: ../../library/hashlib.rst:675 msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" msgstr "" -#: ../../library/hashlib.rst:688 +#: ../../library/hashlib.rst:689 msgid "" "Personalization together with the keyed mode can also be used to derive " "different keys from a single one." msgstr "" -#: ../../library/hashlib.rst:702 +#: ../../library/hashlib.rst:703 msgid "Tree mode" msgstr "" -#: ../../library/hashlib.rst:704 +#: ../../library/hashlib.rst:705 msgid "Here's an example of hashing a minimal tree with two leaf nodes::" msgstr "" -#: ../../library/hashlib.rst:710 +#: ../../library/hashlib.rst:711 msgid "" "This example uses 64-byte internal digests, and returns the 32-byte final " "digest::" msgstr "" -#: ../../library/hashlib.rst:740 +#: ../../library/hashlib.rst:741 msgid "Credits" msgstr "" -#: ../../library/hashlib.rst:742 +#: ../../library/hashlib.rst:743 msgid "" "BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko " "Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ " @@ -761,80 +761,80 @@ msgid "" "*Raphael C.-W. Phan*." msgstr "" -#: ../../library/hashlib.rst:747 +#: ../../library/hashlib.rst:748 msgid "" "It uses core algorithm from ChaCha_ cipher designed by *Daniel J. " "Bernstein*." msgstr "" -#: ../../library/hashlib.rst:749 +#: ../../library/hashlib.rst:750 msgid "" "The stdlib implementation is based on pyblake2_ module. It was written by " "*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The " "documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*." msgstr "" -#: ../../library/hashlib.rst:753 +#: ../../library/hashlib.rst:754 msgid "The C code was partly rewritten for Python by *Christian Heimes*." msgstr "" -#: ../../library/hashlib.rst:755 +#: ../../library/hashlib.rst:756 msgid "" "The following public domain dedication applies for both C hash function " "implementation, extension code, and this documentation:" msgstr "" -#: ../../library/hashlib.rst:758 +#: ../../library/hashlib.rst:759 msgid "" "To the extent possible under law, the author(s) have dedicated all copyright " "and related and neighboring rights to this software to the public domain " "worldwide. This software is distributed without any warranty." msgstr "" -#: ../../library/hashlib.rst:762 +#: ../../library/hashlib.rst:763 msgid "" "You should have received a copy of the CC0 Public Domain Dedication along " "with this software. If not, see https://creativecommons.org/publicdomain/" "zero/1.0/." msgstr "" -#: ../../library/hashlib.rst:766 +#: ../../library/hashlib.rst:767 msgid "" "The following people have helped with development or contributed their " "changes to the project and the public domain according to the Creative " "Commons Public Domain Dedication 1.0 Universal:" msgstr "" -#: ../../library/hashlib.rst:770 +#: ../../library/hashlib.rst:771 msgid "*Alexandr Sokolovskiy*" msgstr "" -#: ../../library/hashlib.rst:785 +#: ../../library/hashlib.rst:786 msgid "Module :mod:`hmac`" msgstr ":mod:`hmac` 模組" -#: ../../library/hashlib.rst:785 +#: ../../library/hashlib.rst:786 msgid "A module to generate message authentication codes using hashes." msgstr "" -#: ../../library/hashlib.rst:788 +#: ../../library/hashlib.rst:789 msgid "Module :mod:`base64`" msgstr ":mod:`base64` 模組" -#: ../../library/hashlib.rst:788 +#: ../../library/hashlib.rst:789 msgid "Another way to encode binary hashes for non-binary environments." msgstr "" -#: ../../library/hashlib.rst:791 +#: ../../library/hashlib.rst:792 #, fuzzy msgid "https://www.blake2.net" msgstr "https://blake2.net" -#: ../../library/hashlib.rst:791 +#: ../../library/hashlib.rst:792 msgid "Official BLAKE2 website." msgstr "BLAKE2 官方網站。" -#: ../../library/hashlib.rst:794 +#: ../../library/hashlib.rst:795 msgid "" "https://csrc.nist.gov/csrc/media/publications/fips/180/2/archive/2002-08-01/" "documents/fips180-2.pdf" @@ -842,11 +842,11 @@ msgstr "" "https://csrc.nist.gov/csrc/media/publications/fips/180/2/archive/2002-08-01/" "documents/fips180-2.pdf" -#: ../../library/hashlib.rst:794 +#: ../../library/hashlib.rst:795 msgid "The FIPS 180-2 publication on Secure Hash Algorithms." msgstr "" -#: ../../library/hashlib.rst:798 +#: ../../library/hashlib.rst:799 msgid "" "https://en.wikipedia.org/wiki/" "Cryptographic_hash_function#Cryptographic_hash_algorithms" @@ -854,26 +854,26 @@ msgstr "" "https://en.wikipedia.org/wiki/" "Cryptographic_hash_function#Cryptographic_hash_algorithms" -#: ../../library/hashlib.rst:797 +#: ../../library/hashlib.rst:798 msgid "" "Wikipedia article with information on which algorithms have known issues and " "what that means regarding their use." msgstr "" -#: ../../library/hashlib.rst:801 +#: ../../library/hashlib.rst:802 msgid "https://www.ietf.org/rfc/rfc8018.txt" msgstr "https://www.ietf.org/rfc/rfc8018.txt" -#: ../../library/hashlib.rst:801 +#: ../../library/hashlib.rst:802 msgid "PKCS #5: Password-Based Cryptography Specification Version 2.1" msgstr "" -#: ../../library/hashlib.rst:803 +#: ../../library/hashlib.rst:804 msgid "" "https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" msgstr "" -#: ../../library/hashlib.rst:804 +#: ../../library/hashlib.rst:805 msgid "NIST Recommendation for Password-Based Key Derivation." msgstr "" diff --git a/library/pathlib.po b/library/pathlib.po index c683d0c190..2aad5e07f4 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-05-11 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,7 +35,7 @@ msgid "" "inherit from pure paths but also provide I/O operations." msgstr "" -#: ../../library/pathlib.rst:25 +#: ../../library/pathlib.rst:26 msgid "" "If you've never used this module before or just aren't sure which class is " "right for your task, :class:`Path` is most likely what you need. It " @@ -43,170 +43,170 @@ msgid "" "code is running on." msgstr "" -#: ../../library/pathlib.rst:29 +#: ../../library/pathlib.rst:30 msgid "Pure paths are useful in some special cases; for example:" msgstr "" -#: ../../library/pathlib.rst:31 +#: ../../library/pathlib.rst:32 msgid "" "If you want to manipulate Windows paths on a Unix machine (or vice versa). " "You cannot instantiate a :class:`WindowsPath` when running on Unix, but you " "can instantiate :class:`PureWindowsPath`." msgstr "" -#: ../../library/pathlib.rst:34 +#: ../../library/pathlib.rst:35 msgid "" "You want to make sure that your code only manipulates paths without actually " "accessing the OS. In this case, instantiating one of the pure classes may be " "useful since those simply don't have any OS-accessing operations." msgstr "" -#: ../../library/pathlib.rst:39 +#: ../../library/pathlib.rst:40 msgid ":pep:`428`: The pathlib module -- object-oriented filesystem paths." msgstr "" -#: ../../library/pathlib.rst:42 +#: ../../library/pathlib.rst:43 msgid "" "For low-level path manipulation on strings, you can also use the :mod:`os." "path` module." msgstr "" -#: ../../library/pathlib.rst:47 +#: ../../library/pathlib.rst:48 msgid "Basic use" msgstr "" -#: ../../library/pathlib.rst:49 +#: ../../library/pathlib.rst:50 msgid "Importing the main class::" msgstr "" -#: ../../library/pathlib.rst:53 +#: ../../library/pathlib.rst:54 msgid "Listing subdirectories::" msgstr "" -#: ../../library/pathlib.rst:60 +#: ../../library/pathlib.rst:61 msgid "Listing Python source files in this directory tree::" msgstr "" -#: ../../library/pathlib.rst:67 +#: ../../library/pathlib.rst:68 msgid "Navigating inside a directory tree::" msgstr "" -#: ../../library/pathlib.rst:76 +#: ../../library/pathlib.rst:77 msgid "Querying path properties::" msgstr "" -#: ../../library/pathlib.rst:83 +#: ../../library/pathlib.rst:84 msgid "Opening a file::" msgstr "" -#: ../../library/pathlib.rst:93 +#: ../../library/pathlib.rst:94 msgid "Pure paths" msgstr "" -#: ../../library/pathlib.rst:95 +#: ../../library/pathlib.rst:96 msgid "" "Pure path objects provide path-handling operations which don't actually " "access a filesystem. There are three ways to access these classes, which we " "also call *flavours*:" msgstr "" -#: ../../library/pathlib.rst:101 +#: ../../library/pathlib.rst:102 msgid "" "A generic class that represents the system's path flavour (instantiating it " "creates either a :class:`PurePosixPath` or a :class:`PureWindowsPath`)::" msgstr "" -#: ../../library/pathlib.rst:107 +#: ../../library/pathlib.rst:108 msgid "" "Each element of *pathsegments* can be either a string representing a path " "segment, an object implementing the :class:`os.PathLike` interface which " "returns a string, or another path object::" msgstr "" -#: ../../library/pathlib.rst:116 +#: ../../library/pathlib.rst:117 msgid "When *pathsegments* is empty, the current directory is assumed::" msgstr "" -#: ../../library/pathlib.rst:121 +#: ../../library/pathlib.rst:122 msgid "" "If a segment is an absolute path, all previous segments are ignored (like :" "func:`os.path.join`)::" msgstr "" -#: ../../library/pathlib.rst:129 +#: ../../library/pathlib.rst:130 msgid "" "On Windows, the drive is not reset when a rooted relative path segment (e." "g., ``r'\\foo'``) is encountered::" msgstr "" -#: ../../library/pathlib.rst:135 +#: ../../library/pathlib.rst:136 msgid "" "Spurious slashes and single dots are collapsed, but double dots (``'..'``) " "and leading double slashes (``'//'``) are not, since this would change the " "meaning of a path for various reasons (e.g. symbolic links, UNC paths)::" msgstr "" -#: ../../library/pathlib.rst:148 +#: ../../library/pathlib.rst:149 msgid "" "(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent to " "``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to " "another directory)" msgstr "" -#: ../../library/pathlib.rst:152 +#: ../../library/pathlib.rst:153 msgid "" "Pure path objects implement the :class:`os.PathLike` interface, allowing " "them to be used anywhere the interface is accepted." msgstr "" -#: ../../library/pathlib.rst:155 +#: ../../library/pathlib.rst:156 msgid "Added support for the :class:`os.PathLike` interface." msgstr "" -#: ../../library/pathlib.rst:160 +#: ../../library/pathlib.rst:161 msgid "" "A subclass of :class:`PurePath`, this path flavour represents non-Windows " "filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:166 ../../library/pathlib.rst:178 -#: ../../library/pathlib.rst:671 ../../library/pathlib.rst:681 -#: ../../library/pathlib.rst:691 +#: ../../library/pathlib.rst:167 ../../library/pathlib.rst:179 +#: ../../library/pathlib.rst:672 ../../library/pathlib.rst:682 +#: ../../library/pathlib.rst:692 msgid "*pathsegments* is specified similarly to :class:`PurePath`." msgstr "" -#: ../../library/pathlib.rst:170 +#: ../../library/pathlib.rst:171 msgid "" "A subclass of :class:`PurePath`, this path flavour represents Windows " "filesystem paths, including `UNC paths`_::" msgstr "" -#: ../../library/pathlib.rst:182 +#: ../../library/pathlib.rst:183 msgid "" "Regardless of the system you're running on, you can instantiate all of these " "classes, since they don't provide any operation that does system calls." msgstr "" -#: ../../library/pathlib.rst:187 +#: ../../library/pathlib.rst:188 msgid "General properties" msgstr "" -#: ../../library/pathlib.rst:189 +#: ../../library/pathlib.rst:190 msgid "" "Paths are immutable and :term:`hashable`. Paths of a same flavour are " "comparable and orderable. These properties respect the flavour's case-" "folding semantics::" msgstr "" -#: ../../library/pathlib.rst:202 +#: ../../library/pathlib.rst:203 msgid "Paths of a different flavour compare unequal and cannot be ordered::" msgstr "" -#: ../../library/pathlib.rst:213 +#: ../../library/pathlib.rst:214 msgid "Operators" msgstr "" -#: ../../library/pathlib.rst:215 +#: ../../library/pathlib.rst:216 msgid "" "The slash operator helps create child paths, like :func:`os.path.join`. If " "the argument is an absolute path, the previous path is ignored. On Windows, " @@ -214,291 +214,291 @@ msgid "" "``r'\\foo'``)::" msgstr "" -#: ../../library/pathlib.rst:233 +#: ../../library/pathlib.rst:234 msgid "" "A path object can be used anywhere an object implementing :class:`os." "PathLike` is accepted::" msgstr "" -#: ../../library/pathlib.rst:241 +#: ../../library/pathlib.rst:242 msgid "" "The string representation of a path is the raw filesystem path itself (in " "native form, e.g. with backslashes under Windows), which you can pass to any " "function taking a file path as a string::" msgstr "" -#: ../../library/pathlib.rst:252 +#: ../../library/pathlib.rst:253 msgid "" "Similarly, calling :class:`bytes` on a path gives the raw filesystem path as " "a bytes object, as encoded by :func:`os.fsencode`::" msgstr "" -#: ../../library/pathlib.rst:259 +#: ../../library/pathlib.rst:260 msgid "" "Calling :class:`bytes` is only recommended under Unix. Under Windows, the " "unicode form is the canonical representation of filesystem paths." msgstr "" -#: ../../library/pathlib.rst:264 +#: ../../library/pathlib.rst:265 msgid "Accessing individual parts" msgstr "" -#: ../../library/pathlib.rst:266 +#: ../../library/pathlib.rst:267 msgid "" "To access the individual \"parts\" (components) of a path, use the following " "property:" msgstr "" -#: ../../library/pathlib.rst:271 +#: ../../library/pathlib.rst:272 msgid "A tuple giving access to the path's various components::" msgstr "" -#: ../../library/pathlib.rst:281 +#: ../../library/pathlib.rst:282 msgid "(note how the drive and local root are regrouped in a single part)" msgstr "" -#: ../../library/pathlib.rst:285 +#: ../../library/pathlib.rst:286 msgid "Methods and properties" msgstr "" -#: ../../library/pathlib.rst:291 +#: ../../library/pathlib.rst:292 msgid "Pure paths provide the following methods and properties:" msgstr "" -#: ../../library/pathlib.rst:295 +#: ../../library/pathlib.rst:296 msgid "A string representing the drive letter or name, if any::" msgstr "" -#: ../../library/pathlib.rst:304 +#: ../../library/pathlib.rst:305 msgid "UNC shares are also considered drives::" msgstr "" -#: ../../library/pathlib.rst:311 +#: ../../library/pathlib.rst:312 msgid "A string representing the (local or global) root, if any::" msgstr "" -#: ../../library/pathlib.rst:320 +#: ../../library/pathlib.rst:321 msgid "UNC shares always have a root::" msgstr "" -#: ../../library/pathlib.rst:325 +#: ../../library/pathlib.rst:326 msgid "" "If the path starts with more than two successive slashes, :class:`~pathlib." "PurePosixPath` collapses them::" msgstr "" -#: ../../library/pathlib.rst:337 +#: ../../library/pathlib.rst:338 msgid "" "This behavior conforms to *The Open Group Base Specifications Issue 6*, " "paragraph `4.11 Pathname Resolution `_:" msgstr "" -#: ../../library/pathlib.rst:341 +#: ../../library/pathlib.rst:342 msgid "" "*\"A pathname that begins with two successive slashes may be interpreted in " "an implementation-defined manner, although more than two leading slashes " "shall be treated as a single slash.\"*" msgstr "" -#: ../../library/pathlib.rst:347 +#: ../../library/pathlib.rst:348 msgid "The concatenation of the drive and root::" msgstr "" -#: ../../library/pathlib.rst:361 +#: ../../library/pathlib.rst:362 msgid "" "An immutable sequence providing access to the logical ancestors of the path::" msgstr "" -#: ../../library/pathlib.rst:372 +#: ../../library/pathlib.rst:373 msgid "" "The parents sequence now supports :term:`slices ` and negative index " "values." msgstr "" -#: ../../library/pathlib.rst:377 +#: ../../library/pathlib.rst:378 msgid "The logical parent of the path::" msgstr "" -#: ../../library/pathlib.rst:383 +#: ../../library/pathlib.rst:384 msgid "You cannot go past an anchor, or empty path::" msgstr "" -#: ../../library/pathlib.rst:393 +#: ../../library/pathlib.rst:394 msgid "This is a purely lexical operation, hence the following behaviour::" msgstr "" -#: ../../library/pathlib.rst:399 +#: ../../library/pathlib.rst:400 msgid "" "If you want to walk an arbitrary filesystem path upwards, it is recommended " "to first call :meth:`Path.resolve` so as to resolve symlinks and eliminate " "``\"..\"`` components." msgstr "" -#: ../../library/pathlib.rst:406 +#: ../../library/pathlib.rst:407 msgid "" "A string representing the final path component, excluding the drive and " "root, if any::" msgstr "" -#: ../../library/pathlib.rst:412 +#: ../../library/pathlib.rst:413 msgid "UNC drive names are not considered::" msgstr "" -#: ../../library/pathlib.rst:422 +#: ../../library/pathlib.rst:423 msgid "The file extension of the final component, if any::" msgstr "" -#: ../../library/pathlib.rst:434 +#: ../../library/pathlib.rst:435 msgid "A list of the path's file extensions::" msgstr "" -#: ../../library/pathlib.rst:446 +#: ../../library/pathlib.rst:447 msgid "The final path component, without its suffix::" msgstr "" -#: ../../library/pathlib.rst:458 +#: ../../library/pathlib.rst:459 msgid "" "Return a string representation of the path with forward slashes (``/``)::" msgstr "" -#: ../../library/pathlib.rst:469 +#: ../../library/pathlib.rst:470 msgid "" "Represent the path as a ``file`` URI. :exc:`ValueError` is raised if the " "path isn't absolute." msgstr "" -#: ../../library/pathlib.rst:482 +#: ../../library/pathlib.rst:483 msgid "" "Return whether the path is absolute or not. A path is considered absolute " "if it has both a root and (if the flavour allows) a drive::" msgstr "" -#: ../../library/pathlib.rst:502 +#: ../../library/pathlib.rst:503 msgid "Return whether or not this path is relative to the *other* path." msgstr "" -#: ../../library/pathlib.rst:515 +#: ../../library/pathlib.rst:516 msgid "" "With :class:`PureWindowsPath`, return ``True`` if the path is considered " "reserved under Windows, ``False`` otherwise. With :class:`PurePosixPath`, " "``False`` is always returned." msgstr "" -#: ../../library/pathlib.rst:524 +#: ../../library/pathlib.rst:525 msgid "" "File system calls on reserved paths can fail mysteriously or have unintended " "effects." msgstr "" -#: ../../library/pathlib.rst:530 +#: ../../library/pathlib.rst:531 msgid "" "Calling this method is equivalent to combining the path with each of the " "*other* arguments in turn::" msgstr "" -#: ../../library/pathlib.rst:545 +#: ../../library/pathlib.rst:546 msgid "" "Match this path against the provided glob-style pattern. Return ``True`` if " "matching is successful, ``False`` otherwise." msgstr "" -#: ../../library/pathlib.rst:548 +#: ../../library/pathlib.rst:549 msgid "" "If *pattern* is relative, the path can be either relative or absolute, and " "matching is done from the right::" msgstr "" -#: ../../library/pathlib.rst:558 +#: ../../library/pathlib.rst:559 msgid "" "If *pattern* is absolute, the path must be absolute, and the whole path must " "match::" msgstr "" -#: ../../library/pathlib.rst:566 +#: ../../library/pathlib.rst:567 msgid "As with other methods, case-sensitivity follows platform defaults::" msgstr "" -#: ../../library/pathlib.rst:576 +#: ../../library/pathlib.rst:577 msgid "" "Compute a version of this path relative to the path represented by *other*. " "If it's impossible, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:591 +#: ../../library/pathlib.rst:592 msgid "" "NOTE: This function is part of :class:`PurePath` and works with strings. It " "does not check or access the underlying file structure." msgstr "" -#: ../../library/pathlib.rst:596 +#: ../../library/pathlib.rst:597 msgid "" "Return a new path with the :attr:`name` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:613 +#: ../../library/pathlib.rst:614 msgid "" "Return a new path with the :attr:`stem` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:637 +#: ../../library/pathlib.rst:638 msgid "" "Return a new path with the :attr:`suffix` changed. If the original path " "doesn't have a suffix, the new *suffix* is appended instead. If the " "*suffix* is an empty string, the original suffix is removed::" msgstr "" -#: ../../library/pathlib.rst:656 +#: ../../library/pathlib.rst:657 msgid "Concrete paths" msgstr "" -#: ../../library/pathlib.rst:658 +#: ../../library/pathlib.rst:659 msgid "" "Concrete paths are subclasses of the pure path classes. In addition to " "operations provided by the latter, they also provide methods to do system " "calls on path objects. There are three ways to instantiate concrete paths:" msgstr "" -#: ../../library/pathlib.rst:664 +#: ../../library/pathlib.rst:665 msgid "" "A subclass of :class:`PurePath`, this class represents concrete paths of the " "system's path flavour (instantiating it creates either a :class:`PosixPath` " "or a :class:`WindowsPath`)::" msgstr "" -#: ../../library/pathlib.rst:675 +#: ../../library/pathlib.rst:676 msgid "" "A subclass of :class:`Path` and :class:`PurePosixPath`, this class " "represents concrete non-Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:685 +#: ../../library/pathlib.rst:686 msgid "" "A subclass of :class:`Path` and :class:`PureWindowsPath`, this class " "represents concrete Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:693 +#: ../../library/pathlib.rst:694 msgid "" "You can only instantiate the class flavour that corresponds to your system " "(allowing system calls on non-compatible path flavours could lead to bugs or " "failures in your application)::" msgstr "" -#: ../../library/pathlib.rst:713 +#: ../../library/pathlib.rst:714 msgid "Methods" msgstr "" -#: ../../library/pathlib.rst:715 +#: ../../library/pathlib.rst:716 msgid "" "Concrete paths provide the following methods in addition to pure paths " "methods. Many of these methods can raise an :exc:`OSError` if a system call " "fails (for example because the path doesn't exist)." msgstr "" -#: ../../library/pathlib.rst:721 +#: ../../library/pathlib.rst:722 msgid "" ":meth:`~Path.exists()`, :meth:`~Path.is_dir()`, :meth:`~Path.is_file()`, :" "meth:`~Path.is_mount()`, :meth:`~Path.is_symlink()`, :meth:`~Path." @@ -508,122 +508,122 @@ msgid "" "the OS level." msgstr "" -#: ../../library/pathlib.rst:731 +#: ../../library/pathlib.rst:732 msgid "" "Return a new path object representing the current directory (as returned by :" "func:`os.getcwd`)::" msgstr "" -#: ../../library/pathlib.rst:740 +#: ../../library/pathlib.rst:741 msgid "" "Return a new path object representing the user's home directory (as returned " "by :func:`os.path.expanduser` with ``~`` construct). If the home directory " "can't be resolved, :exc:`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:754 +#: ../../library/pathlib.rst:755 msgid "" "Return a :class:`os.stat_result` object containing information about this " "path, like :func:`os.stat`. The result is looked up at each call to this " "method." msgstr "" -#: ../../library/pathlib.rst:757 +#: ../../library/pathlib.rst:758 msgid "" "This method normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :meth:`~Path.lstat`." msgstr "" -#: ../../library/pathlib.rst:768 ../../library/pathlib.rst:788 +#: ../../library/pathlib.rst:769 ../../library/pathlib.rst:789 msgid "The *follow_symlinks* parameter was added." msgstr "新增 *follow_symlinks* 參數。" -#: ../../library/pathlib.rst:773 +#: ../../library/pathlib.rst:774 msgid "Change the file mode and permissions, like :func:`os.chmod`." msgstr "" -#: ../../library/pathlib.rst:775 +#: ../../library/pathlib.rst:776 msgid "" "This method normally follows symlinks. Some Unix flavours support changing " "permissions on the symlink itself; on these platforms you may add the " "argument ``follow_symlinks=False``, or use :meth:`~Path.lchmod`." msgstr "" -#: ../../library/pathlib.rst:793 +#: ../../library/pathlib.rst:794 msgid "Whether the path points to an existing file or directory::" msgstr "" -#: ../../library/pathlib.rst:805 +#: ../../library/pathlib.rst:806 msgid "" "If the path points to a symlink, :meth:`exists` returns whether the symlink " "*points to* an existing file or directory." msgstr "" -#: ../../library/pathlib.rst:811 +#: ../../library/pathlib.rst:812 msgid "" "Return a new path with expanded ``~`` and ``~user`` constructs, as returned " "by :meth:`os.path.expanduser`. If a home directory can't be resolved, :exc:" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:826 +#: ../../library/pathlib.rst:827 msgid "" "Glob the given relative *pattern* in the directory represented by this path, " "yielding all matching files (of any kind)::" msgstr "" -#: ../../library/pathlib.rst:834 +#: ../../library/pathlib.rst:835 msgid "" "Patterns are the same as for :mod:`fnmatch`, with the addition of \"``**``\" " "which means \"this directory and all subdirectories, recursively\". In " "other words, it enables recursive globbing::" msgstr "" -#: ../../library/pathlib.rst:846 +#: ../../library/pathlib.rst:847 msgid "" "Using the \"``**``\" pattern in large directory trees may consume an " "inordinate amount of time." msgstr "" -#: ../../library/pathlib.rst:849 +#: ../../library/pathlib.rst:850 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.glob`` with " "arguments ``self``, ``pattern``." msgstr "" -#: ../../library/pathlib.rst:851 ../../library/pathlib.rst:1146 +#: ../../library/pathlib.rst:852 ../../library/pathlib.rst:1147 msgid "" "Return only directories if *pattern* ends with a pathname components " "separator (:data:`~os.sep` or :data:`~os.altsep`)." msgstr "" -#: ../../library/pathlib.rst:857 +#: ../../library/pathlib.rst:858 msgid "" "Return the name of the group owning the file. :exc:`KeyError` is raised if " "the file's gid isn't found in the system database." msgstr "" -#: ../../library/pathlib.rst:863 +#: ../../library/pathlib.rst:864 msgid "" "Return ``True`` if the path points to a directory (or a symbolic link " "pointing to a directory), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:866 ../../library/pathlib.rst:875 -#: ../../library/pathlib.rst:904 ../../library/pathlib.rst:913 -#: ../../library/pathlib.rst:922 ../../library/pathlib.rst:931 +#: ../../library/pathlib.rst:867 ../../library/pathlib.rst:876 +#: ../../library/pathlib.rst:905 ../../library/pathlib.rst:914 +#: ../../library/pathlib.rst:923 ../../library/pathlib.rst:932 msgid "" "``False`` is also returned if the path doesn't exist or is a broken symlink; " "other errors (such as permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:872 +#: ../../library/pathlib.rst:873 msgid "" "Return ``True`` if the path points to a regular file (or a symbolic link " "pointing to a regular file), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:881 +#: ../../library/pathlib.rst:882 msgid "" "Return ``True`` if the path is a :dfn:`mount point`: a point in a file " "system where a different file system has been mounted. On POSIX, the " @@ -633,49 +633,49 @@ msgid "" "and POSIX variants. Not implemented on Windows." msgstr "" -#: ../../library/pathlib.rst:893 +#: ../../library/pathlib.rst:894 msgid "" "Return ``True`` if the path points to a symbolic link, ``False`` otherwise." msgstr "" -#: ../../library/pathlib.rst:895 +#: ../../library/pathlib.rst:896 msgid "" "``False`` is also returned if the path doesn't exist; other errors (such as " "permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:901 +#: ../../library/pathlib.rst:902 msgid "" "Return ``True`` if the path points to a Unix socket (or a symbolic link " "pointing to a Unix socket), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:910 +#: ../../library/pathlib.rst:911 msgid "" "Return ``True`` if the path points to a FIFO (or a symbolic link pointing to " "a FIFO), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:919 +#: ../../library/pathlib.rst:920 msgid "" "Return ``True`` if the path points to a block device (or a symbolic link " "pointing to a block device), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:928 +#: ../../library/pathlib.rst:929 msgid "" "Return ``True`` if the path points to a character device (or a symbolic link " "pointing to a character device), ``False`` if it points to another kind of " "file." msgstr "" -#: ../../library/pathlib.rst:937 +#: ../../library/pathlib.rst:938 msgid "" "When the path points to a directory, yield path objects of the directory " "contents::" msgstr "" -#: ../../library/pathlib.rst:951 +#: ../../library/pathlib.rst:952 msgid "" "The children are yielded in arbitrary order, and the special entries ``'.'`` " "and ``'..'`` are not included. If a file is removed from or added to the " @@ -683,88 +683,88 @@ msgid "" "be included is unspecified." msgstr "" -#: ../../library/pathlib.rst:958 +#: ../../library/pathlib.rst:959 msgid "" "Like :meth:`Path.chmod` but, if the path points to a symbolic link, the " "symbolic link's mode is changed rather than its target's." msgstr "" -#: ../../library/pathlib.rst:964 +#: ../../library/pathlib.rst:965 msgid "" "Like :meth:`Path.stat` but, if the path points to a symbolic link, return " "the symbolic link's information rather than its target's." msgstr "" -#: ../../library/pathlib.rst:970 +#: ../../library/pathlib.rst:971 msgid "" "Create a new directory at this given path. If *mode* is given, it is " "combined with the process' ``umask`` value to determine the file mode and " "access flags. If the path already exists, :exc:`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:975 +#: ../../library/pathlib.rst:976 msgid "" "If *parents* is true, any missing parents of this path are created as " "needed; they are created with the default permissions without taking *mode* " "into account (mimicking the POSIX ``mkdir -p`` command)." msgstr "" -#: ../../library/pathlib.rst:979 +#: ../../library/pathlib.rst:980 msgid "" "If *parents* is false (the default), a missing parent raises :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/pathlib.rst:982 +#: ../../library/pathlib.rst:983 msgid "" "If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if " "the target directory already exists." msgstr "" -#: ../../library/pathlib.rst:985 +#: ../../library/pathlib.rst:986 msgid "" "If *exist_ok* is true, :exc:`FileExistsError` exceptions will be ignored " "(same behavior as the POSIX ``mkdir -p`` command), but only if the last path " "component is not an existing non-directory file." msgstr "" -#: ../../library/pathlib.rst:989 +#: ../../library/pathlib.rst:990 msgid "The *exist_ok* parameter was added." msgstr "新增 *exist_ok* 參數。" -#: ../../library/pathlib.rst:995 +#: ../../library/pathlib.rst:996 msgid "" "Open the file pointed to by the path, like the built-in :func:`open` " "function does::" msgstr "" -#: ../../library/pathlib.rst:1007 +#: ../../library/pathlib.rst:1008 msgid "" "Return the name of the user owning the file. :exc:`KeyError` is raised if " "the file's uid isn't found in the system database." msgstr "" -#: ../../library/pathlib.rst:1013 +#: ../../library/pathlib.rst:1014 msgid "Return the binary contents of the pointed-to file as a bytes object::" msgstr "" -#: ../../library/pathlib.rst:1026 +#: ../../library/pathlib.rst:1027 msgid "Return the decoded contents of the pointed-to file as a string::" msgstr "" -#: ../../library/pathlib.rst:1034 +#: ../../library/pathlib.rst:1035 msgid "" "The file is opened and then closed. The optional parameters have the same " "meaning as in :func:`open`." msgstr "" -#: ../../library/pathlib.rst:1042 +#: ../../library/pathlib.rst:1043 msgid "" "Return the path to which the symbolic link points (as returned by :func:`os." "readlink`)::" msgstr "" -#: ../../library/pathlib.rst:1055 +#: ../../library/pathlib.rst:1056 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. On Unix, if *target* exists and is a file, " @@ -773,49 +773,49 @@ msgid "" "either a string or another path object::" msgstr "" -#: ../../library/pathlib.rst:1070 ../../library/pathlib.rst:1086 +#: ../../library/pathlib.rst:1071 ../../library/pathlib.rst:1087 msgid "" "The target path may be absolute or relative. Relative paths are interpreted " "relative to the current working directory, *not* the directory of the Path " "object." msgstr "" -#: ../../library/pathlib.rst:1074 +#: ../../library/pathlib.rst:1075 msgid "" "It is implemented in terms of :func:`os.rename` and gives the same " "guarantees." msgstr "" -#: ../../library/pathlib.rst:1076 ../../library/pathlib.rst:1090 +#: ../../library/pathlib.rst:1077 ../../library/pathlib.rst:1091 msgid "Added return value, return the new Path instance." msgstr "" -#: ../../library/pathlib.rst:1082 +#: ../../library/pathlib.rst:1083 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. If *target* points to an existing file or " "empty directory, it will be unconditionally replaced." msgstr "" -#: ../../library/pathlib.rst:1096 +#: ../../library/pathlib.rst:1097 msgid "" "Make the path absolute, without normalization or resolving symlinks. Returns " "a new path object::" msgstr "" -#: ../../library/pathlib.rst:1108 +#: ../../library/pathlib.rst:1109 msgid "" "Make the path absolute, resolving any symlinks. A new path object is " "returned::" msgstr "" -#: ../../library/pathlib.rst:1117 +#: ../../library/pathlib.rst:1118 msgid "" "\"``..``\" components are also eliminated (this is the only method to do " "so)::" msgstr "" -#: ../../library/pathlib.rst:1123 +#: ../../library/pathlib.rst:1124 msgid "" "If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError` " "is raised. If *strict* is ``False``, the path is resolved as far as " @@ -824,65 +824,65 @@ msgid "" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:1129 +#: ../../library/pathlib.rst:1130 msgid "The *strict* argument (pre-3.6 behavior is strict)." msgstr "" -#: ../../library/pathlib.rst:1134 +#: ../../library/pathlib.rst:1135 msgid "" "This is like calling :func:`Path.glob` with \"``**/``\" added in front of " "the given relative *pattern*::" msgstr "" -#: ../../library/pathlib.rst:1144 +#: ../../library/pathlib.rst:1145 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." msgstr "" -#: ../../library/pathlib.rst:1152 +#: ../../library/pathlib.rst:1153 msgid "Remove this directory. The directory must be empty." msgstr "" -#: ../../library/pathlib.rst:1157 +#: ../../library/pathlib.rst:1158 msgid "" "Return whether this path points to the same file as *other_path*, which can " "be either a Path object, or a string. The semantics are similar to :func:" "`os.path.samefile` and :func:`os.path.samestat`." msgstr "" -#: ../../library/pathlib.rst:1161 +#: ../../library/pathlib.rst:1162 msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." msgstr "" -#: ../../library/pathlib.rst:1178 +#: ../../library/pathlib.rst:1179 msgid "" "Make this path a symbolic link to *target*. Under Windows, " "*target_is_directory* must be true (default ``False``) if the link's target " "is a directory. Under POSIX, *target_is_directory*'s value is ignored." msgstr "" -#: ../../library/pathlib.rst:1194 +#: ../../library/pathlib.rst:1195 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." msgstr "" -#: ../../library/pathlib.rst:1199 +#: ../../library/pathlib.rst:1200 msgid "Make this path a hard link to the same file as *target*." msgstr "" -#: ../../library/pathlib.rst:1202 +#: ../../library/pathlib.rst:1203 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." msgstr "" -#: ../../library/pathlib.rst:1209 +#: ../../library/pathlib.rst:1210 msgid "Make *target* a hard link to this path." msgstr "" -#: ../../library/pathlib.rst:1213 +#: ../../library/pathlib.rst:1214 msgid "" "This function does not make this path a hard link to *target*, despite the " "implication of the function and argument names. The argument order (target, " @@ -890,14 +890,14 @@ msgid "" "hardlink_to`, but matches that of :func:`os.link`." msgstr "" -#: ../../library/pathlib.rst:1222 +#: ../../library/pathlib.rst:1223 msgid "" "This method is deprecated in favor of :meth:`Path.hardlink_to`, as the " "argument order of :meth:`Path.link_to` does not match that of :meth:`Path." "symlink_to`." msgstr "" -#: ../../library/pathlib.rst:1229 +#: ../../library/pathlib.rst:1230 msgid "" "Create a file at this given path. If *mode* is given, it is combined with " "the process' ``umask`` value to determine the file mode and access flags. " @@ -906,65 +906,65 @@ msgid "" "`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:1238 +#: ../../library/pathlib.rst:1239 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" -#: ../../library/pathlib.rst:1241 +#: ../../library/pathlib.rst:1242 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." msgstr "" -#: ../../library/pathlib.rst:1244 +#: ../../library/pathlib.rst:1245 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." msgstr "" -#: ../../library/pathlib.rst:1247 +#: ../../library/pathlib.rst:1248 msgid "The *missing_ok* parameter was added." msgstr "新增 *missing_ok* 參數。" -#: ../../library/pathlib.rst:1253 +#: ../../library/pathlib.rst:1254 msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1262 +#: ../../library/pathlib.rst:1263 msgid "An existing file of the same name is overwritten." msgstr "" -#: ../../library/pathlib.rst:1269 +#: ../../library/pathlib.rst:1270 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1278 +#: ../../library/pathlib.rst:1279 msgid "" "An existing file of the same name is overwritten. The optional parameters " "have the same meaning as in :func:`open`." msgstr "" -#: ../../library/pathlib.rst:1283 +#: ../../library/pathlib.rst:1284 msgid "The *newline* parameter was added." msgstr "新增 *newline* 參數。" -#: ../../library/pathlib.rst:1287 +#: ../../library/pathlib.rst:1288 msgid "Correspondence to tools in the :mod:`os` module" msgstr "" -#: ../../library/pathlib.rst:1289 +#: ../../library/pathlib.rst:1290 msgid "" "Below is a table mapping various :mod:`os` functions to their corresponding :" "class:`PurePath`/:class:`Path` equivalent." msgstr "" -#: ../../library/pathlib.rst:1294 +#: ../../library/pathlib.rst:1295 msgid "" "Not all pairs of functions/methods below are equivalent. Some of them, " "despite having some overlapping use-cases, have different semantics. They " @@ -972,237 +972,237 @@ msgid "" "relpath` and :meth:`PurePath.relative_to`." msgstr "" -#: ../../library/pathlib.rst:1300 +#: ../../library/pathlib.rst:1301 msgid ":mod:`os` and :mod:`os.path`" msgstr ":mod:`os` 和 :mod:`os.path`" -#: ../../library/pathlib.rst:1300 +#: ../../library/pathlib.rst:1301 msgid ":mod:`pathlib`" msgstr ":mod:`pathlib`" -#: ../../library/pathlib.rst:1302 +#: ../../library/pathlib.rst:1303 msgid ":func:`os.path.abspath`" msgstr ":func:`os.path.abspath`" -#: ../../library/pathlib.rst:1302 +#: ../../library/pathlib.rst:1303 msgid ":meth:`Path.absolute` [#]_" msgstr ":meth:`Path.absolute` [#]_" -#: ../../library/pathlib.rst:1303 +#: ../../library/pathlib.rst:1304 msgid ":func:`os.path.realpath`" msgstr ":func:`os.path.realpath`" -#: ../../library/pathlib.rst:1303 +#: ../../library/pathlib.rst:1304 msgid ":meth:`Path.resolve`" msgstr ":meth:`Path.resolve`" -#: ../../library/pathlib.rst:1304 +#: ../../library/pathlib.rst:1305 msgid ":func:`os.chmod`" msgstr ":func:`os.chmod`" -#: ../../library/pathlib.rst:1304 +#: ../../library/pathlib.rst:1305 msgid ":meth:`Path.chmod`" msgstr ":meth:`Path.chmod`" -#: ../../library/pathlib.rst:1305 +#: ../../library/pathlib.rst:1306 msgid ":func:`os.mkdir`" msgstr ":func:`os.mkdir`" -#: ../../library/pathlib.rst:1305 ../../library/pathlib.rst:1306 +#: ../../library/pathlib.rst:1306 ../../library/pathlib.rst:1307 msgid ":meth:`Path.mkdir`" msgstr ":meth:`Path.mkdir`" -#: ../../library/pathlib.rst:1306 +#: ../../library/pathlib.rst:1307 msgid ":func:`os.makedirs`" msgstr ":func:`os.makedirs`" -#: ../../library/pathlib.rst:1307 +#: ../../library/pathlib.rst:1308 msgid ":func:`os.rename`" msgstr ":func:`os.rename`" -#: ../../library/pathlib.rst:1307 +#: ../../library/pathlib.rst:1308 msgid ":meth:`Path.rename`" msgstr ":meth:`Path.rename`" -#: ../../library/pathlib.rst:1308 +#: ../../library/pathlib.rst:1309 msgid ":func:`os.replace`" msgstr ":func:`os.replace`" -#: ../../library/pathlib.rst:1308 +#: ../../library/pathlib.rst:1309 msgid ":meth:`Path.replace`" msgstr ":meth:`Path.replace`" -#: ../../library/pathlib.rst:1309 +#: ../../library/pathlib.rst:1310 msgid ":func:`os.rmdir`" msgstr ":func:`os.rmdir`" -#: ../../library/pathlib.rst:1309 +#: ../../library/pathlib.rst:1310 msgid ":meth:`Path.rmdir`" msgstr ":meth:`Path.rmdir`" -#: ../../library/pathlib.rst:1310 +#: ../../library/pathlib.rst:1311 msgid ":func:`os.remove`, :func:`os.unlink`" msgstr ":func:`os.remove`, :func:`os.unlink`" -#: ../../library/pathlib.rst:1310 +#: ../../library/pathlib.rst:1311 msgid ":meth:`Path.unlink`" msgstr ":meth:`Path.unlink`" -#: ../../library/pathlib.rst:1311 +#: ../../library/pathlib.rst:1312 msgid ":func:`os.getcwd`" msgstr ":func:`os.getcwd`" -#: ../../library/pathlib.rst:1311 +#: ../../library/pathlib.rst:1312 msgid ":func:`Path.cwd`" msgstr ":func:`Path.cwd`" -#: ../../library/pathlib.rst:1312 +#: ../../library/pathlib.rst:1313 msgid ":func:`os.path.exists`" msgstr ":func:`os.path.exists`" -#: ../../library/pathlib.rst:1312 +#: ../../library/pathlib.rst:1313 msgid ":meth:`Path.exists`" msgstr ":meth:`Path.exists`" -#: ../../library/pathlib.rst:1313 +#: ../../library/pathlib.rst:1314 msgid ":func:`os.path.expanduser`" msgstr ":func:`os.path.expanduser`" -#: ../../library/pathlib.rst:1313 +#: ../../library/pathlib.rst:1314 msgid ":meth:`Path.expanduser` and :meth:`Path.home`" msgstr ":meth:`Path.expanduser` 和 :meth:`Path.home`" -#: ../../library/pathlib.rst:1315 +#: ../../library/pathlib.rst:1316 msgid ":func:`os.listdir`" msgstr ":func:`os.listdir`" -#: ../../library/pathlib.rst:1315 +#: ../../library/pathlib.rst:1316 msgid ":meth:`Path.iterdir`" msgstr ":meth:`Path.iterdir`" -#: ../../library/pathlib.rst:1316 +#: ../../library/pathlib.rst:1317 msgid ":func:`os.path.isdir`" msgstr ":func:`os.path.isdir`" -#: ../../library/pathlib.rst:1316 +#: ../../library/pathlib.rst:1317 msgid ":meth:`Path.is_dir`" msgstr ":meth:`Path.is_dir`" -#: ../../library/pathlib.rst:1317 +#: ../../library/pathlib.rst:1318 msgid ":func:`os.path.isfile`" msgstr ":func:`os.path.isfile`" -#: ../../library/pathlib.rst:1317 +#: ../../library/pathlib.rst:1318 msgid ":meth:`Path.is_file`" msgstr ":meth:`Path.is_file`" -#: ../../library/pathlib.rst:1318 +#: ../../library/pathlib.rst:1319 msgid ":func:`os.path.islink`" msgstr ":func:`os.path.islink`" -#: ../../library/pathlib.rst:1318 +#: ../../library/pathlib.rst:1319 msgid ":meth:`Path.is_symlink`" msgstr ":meth:`Path.is_symlink`" -#: ../../library/pathlib.rst:1319 +#: ../../library/pathlib.rst:1320 msgid ":func:`os.link`" msgstr ":func:`os.link`" -#: ../../library/pathlib.rst:1319 +#: ../../library/pathlib.rst:1320 msgid ":meth:`Path.hardlink_to`" msgstr ":meth:`Path.hardlink_to`" -#: ../../library/pathlib.rst:1320 +#: ../../library/pathlib.rst:1321 msgid ":func:`os.symlink`" msgstr ":func:`os.symlink`" -#: ../../library/pathlib.rst:1320 +#: ../../library/pathlib.rst:1321 msgid ":meth:`Path.symlink_to`" msgstr ":meth:`Path.symlink_to`" -#: ../../library/pathlib.rst:1321 +#: ../../library/pathlib.rst:1322 msgid ":func:`os.readlink`" msgstr ":func:`os.readlink`" -#: ../../library/pathlib.rst:1321 +#: ../../library/pathlib.rst:1322 msgid ":meth:`Path.readlink`" msgstr ":meth:`Path.readlink`" -#: ../../library/pathlib.rst:1322 +#: ../../library/pathlib.rst:1323 msgid ":func:`os.path.relpath`" msgstr ":func:`os.path.relpath`" -#: ../../library/pathlib.rst:1322 +#: ../../library/pathlib.rst:1323 msgid ":meth:`PurePath.relative_to` [#]_" msgstr ":meth:`PurePath.relative_to` [#]_" -#: ../../library/pathlib.rst:1323 +#: ../../library/pathlib.rst:1324 msgid ":func:`os.stat`" msgstr ":func:`os.stat`" -#: ../../library/pathlib.rst:1323 +#: ../../library/pathlib.rst:1324 msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" msgstr ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" -#: ../../library/pathlib.rst:1326 +#: ../../library/pathlib.rst:1327 msgid ":func:`os.path.isabs`" msgstr ":func:`os.path.isabs`" -#: ../../library/pathlib.rst:1326 +#: ../../library/pathlib.rst:1327 msgid ":meth:`PurePath.is_absolute`" msgstr ":meth:`PurePath.is_absolute`" -#: ../../library/pathlib.rst:1327 +#: ../../library/pathlib.rst:1328 msgid ":func:`os.path.join`" msgstr ":func:`os.path.join`" -#: ../../library/pathlib.rst:1327 +#: ../../library/pathlib.rst:1328 msgid ":func:`PurePath.joinpath`" msgstr ":func:`PurePath.joinpath`" -#: ../../library/pathlib.rst:1328 +#: ../../library/pathlib.rst:1329 msgid ":func:`os.path.basename`" msgstr ":func:`os.path.basename`" -#: ../../library/pathlib.rst:1328 +#: ../../library/pathlib.rst:1329 msgid ":attr:`PurePath.name`" msgstr ":attr:`PurePath.name`" -#: ../../library/pathlib.rst:1329 +#: ../../library/pathlib.rst:1330 msgid ":func:`os.path.dirname`" msgstr ":func:`os.path.dirname`" -#: ../../library/pathlib.rst:1329 +#: ../../library/pathlib.rst:1330 msgid ":attr:`PurePath.parent`" msgstr ":attr:`PurePath.parent`" -#: ../../library/pathlib.rst:1330 +#: ../../library/pathlib.rst:1331 msgid ":func:`os.path.samefile`" msgstr ":func:`os.path.samefile`" -#: ../../library/pathlib.rst:1330 +#: ../../library/pathlib.rst:1331 msgid ":meth:`Path.samefile`" msgstr ":meth:`Path.samefile`" -#: ../../library/pathlib.rst:1331 +#: ../../library/pathlib.rst:1332 msgid ":func:`os.path.splitext`" msgstr ":func:`os.path.splitext`" -#: ../../library/pathlib.rst:1331 +#: ../../library/pathlib.rst:1332 msgid ":attr:`PurePath.stem` and :attr:`PurePath.suffix`" msgstr ":attr:`PurePath.stem` 和 :attr:`PurePath.suffix`" -#: ../../library/pathlib.rst:1336 +#: ../../library/pathlib.rst:1337 msgid "Footnotes" msgstr "註解" -#: ../../library/pathlib.rst:1337 +#: ../../library/pathlib.rst:1338 msgid "" ":func:`os.path.abspath` normalizes the resulting path, which may change its " "meaning in the presence of symlinks, while :meth:`Path.absolute` does not." msgstr "" -#: ../../library/pathlib.rst:1338 +#: ../../library/pathlib.rst:1339 msgid "" ":meth:`PurePath.relative_to` requires ``self`` to be the subpath of the " "argument, but :func:`os.path.relpath` does not." diff --git a/library/typing.po b/library/typing.po index a680947e3e..9411352942 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-10 00:29+0000\n" +"POT-Creation-Date: 2023-05-11 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -351,7 +351,7 @@ msgid "" msgstr "" #: ../../library/typing.rst:229 ../../library/typing.rst:1171 -#: ../../library/typing.rst:2819 +#: ../../library/typing.rst:2832 msgid "For example::" msgstr "" "舉例來說:\n" @@ -2690,26 +2690,31 @@ msgid "" "unchanged." msgstr "" -#: ../../library/typing.rst:2796 -msgid "Provide basic introspection for generic types and special typing forms." +#: ../../library/typing.rst:2795 +msgid "" +"Get the unsubscripted version of a type: for a typing object of the form " +"``X[Y, Z, ...]`` return ``X``. If ``X`` is a generic alias for a builtin or :" +"mod:`collections` class, it gets normalized to the original class. If ``X`` " +"is an instance of :class:`ParamSpecArgs` or :class:`ParamSpecKwargs`, return " +"the underlying :class:`ParamSpec`. Return ``None`` for unsupported objects. " +"Examples::" msgstr "" -#: ../../library/typing.rst:2798 +#: ../../library/typing.rst:2814 msgid "" -"For a typing object of the form ``X[Y, Z, ...]`` these functions return " -"``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" -"`collections` class, it gets normalized to the original class. If ``X`` is a " -"union or :class:`Literal` contained in another generic type, the order of " -"``(Y, Z, ...)`` may be different from the order of the original arguments " -"``[Y, Z, ...]`` due to type caching. For unsupported objects return ``None`` " -"and ``()`` correspondingly. Examples::" +"Get type arguments with all substitutions performed: for a typing object of " +"the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``. If ``X`` is a union or :" +"class:`Literal` contained in another generic type, the order of ``(Y, " +"Z, ...)`` may be different from the order of the original arguments ``[Y, " +"Z, ...]`` due to type caching. Return ``()`` for unsupported objects. " +"Examples::" msgstr "" -#: ../../library/typing.rst:2817 +#: ../../library/typing.rst:2830 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2832 +#: ../../library/typing.rst:2845 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2717,24 +2722,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2838 +#: ../../library/typing.rst:2851 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2845 +#: ../../library/typing.rst:2858 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2849 +#: ../../library/typing.rst:2862 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:2871 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2742,7 +2747,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2878 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2750,11 +2755,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2874 +#: ../../library/typing.rst:2887 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:2876 +#: ../../library/typing.rst:2889 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2762,76 +2767,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:2881 +#: ../../library/typing.rst:2894 msgid "Feature" msgstr "" -#: ../../library/typing.rst:2881 +#: ../../library/typing.rst:2894 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:2881 +#: ../../library/typing.rst:2894 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:2881 +#: ../../library/typing.rst:2894 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2896 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2896 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2896 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2896 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:2886 +#: ../../library/typing.rst:2899 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:2886 ../../library/typing.rst:2889 +#: ../../library/typing.rst:2899 ../../library/typing.rst:2902 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:2886 ../../library/typing.rst:2891 +#: ../../library/typing.rst:2899 ../../library/typing.rst:2904 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:2886 +#: ../../library/typing.rst:2899 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2902 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2902 msgid "3.14" msgstr "" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2902 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:2891 +#: ../../library/typing.rst:2904 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2891 +#: ../../library/typing.rst:2904 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:2891 +#: ../../library/typing.rst:2904 msgid ":gh:`92332`" msgstr ":gh:`92332`" From 01b6a7d6bd0b693e09f96ba2492ce0d2763d01d1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 12 May 2023 00:31:43 +0000 Subject: [PATCH 084/130] sync with cpython 70550885 --- library/sqlite3.po | 233 +++++++++++++++++++++++---------------------- 1 file changed, 117 insertions(+), 116 deletions(-) diff --git a/library/sqlite3.po b/library/sqlite3.po index 2c82c93358..db8e02eaa8 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-05-12 00:29+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-" @@ -1215,8 +1215,8 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1246 ../../library/sqlite3.rst:1535 -#: ../../library/sqlite3.rst:1558 +#: ../../library/sqlite3.rst:1246 ../../library/sqlite3.rst:1538 +#: ../../library/sqlite3.rst:1561 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "" @@ -1435,10 +1435,11 @@ msgid "" "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " "for other statements, including :abbr:`CTE (Common Table Expression)` " "queries. It is only updated by the :meth:`execute` and :meth:`executemany` " -"methods." +"methods, after the statement has run to completion. This means that any " +"resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: ../../library/sqlite3.rst:1523 +#: ../../library/sqlite3.rst:1526 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1447,18 +1448,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1530 +#: ../../library/sqlite3.rst:1533 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." msgstr "" -#: ../../library/sqlite3.rst:1546 +#: ../../library/sqlite3.rst:1549 msgid "Row objects" msgstr "" -#: ../../library/sqlite3.rst:1550 +#: ../../library/sqlite3.rst:1553 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1466,28 +1467,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1555 +#: ../../library/sqlite3.rst:1558 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1562 +#: ../../library/sqlite3.rst:1565 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`." msgstr "" -#: ../../library/sqlite3.rst:1566 +#: ../../library/sqlite3.rst:1569 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:1573 +#: ../../library/sqlite3.rst:1576 msgid "Blob objects" msgstr "" -#: ../../library/sqlite3.rst:1579 +#: ../../library/sqlite3.rst:1582 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:" @@ -1495,24 +1496,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1584 +#: ../../library/sqlite3.rst:1587 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1614 +#: ../../library/sqlite3.rst:1617 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1616 +#: ../../library/sqlite3.rst:1619 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." msgstr "" -#: ../../library/sqlite3.rst:1622 +#: ../../library/sqlite3.rst:1625 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)` " @@ -1520,18 +1521,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1630 +#: ../../library/sqlite3.rst:1633 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`." msgstr "" -#: ../../library/sqlite3.rst:1636 +#: ../../library/sqlite3.rst:1639 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1640 +#: ../../library/sqlite3.rst:1643 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :data:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1539,26 +1540,26 @@ msgid "" "position) and :data:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1648 +#: ../../library/sqlite3.rst:1651 msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:1652 +#: ../../library/sqlite3.rst:1655 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1660 +#: ../../library/sqlite3.rst:1663 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1662 +#: ../../library/sqlite3.rst:1665 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1666 +#: ../../library/sqlite3.rst:1669 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1566,39 +1567,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1673 +#: ../../library/sqlite3.rst:1676 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1677 +#: ../../library/sqlite3.rst:1680 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1682 +#: ../../library/sqlite3.rst:1685 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1689 +#: ../../library/sqlite3.rst:1692 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1696 +#: ../../library/sqlite3.rst:1699 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1703 +#: ../../library/sqlite3.rst:1706 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1606,14 +1607,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1710 +#: ../../library/sqlite3.rst:1713 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1716 +#: ../../library/sqlite3.rst:1719 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1621,20 +1622,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1724 +#: ../../library/sqlite3.rst:1727 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1729 +#: ../../library/sqlite3.rst:1732 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1736 +#: ../../library/sqlite3.rst:1739 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 " @@ -1642,7 +1643,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1743 +#: ../../library/sqlite3.rst:1746 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1651,78 +1652,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1753 +#: ../../library/sqlite3.rst:1756 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1755 +#: ../../library/sqlite3.rst:1758 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1758 +#: ../../library/sqlite3.rst:1761 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1761 ../../library/sqlite3.rst:1778 +#: ../../library/sqlite3.rst:1764 ../../library/sqlite3.rst:1781 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1761 ../../library/sqlite3.rst:1778 +#: ../../library/sqlite3.rst:1764 ../../library/sqlite3.rst:1781 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1763 ../../library/sqlite3.rst:1780 +#: ../../library/sqlite3.rst:1766 ../../library/sqlite3.rst:1783 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1763 ../../library/sqlite3.rst:1780 +#: ../../library/sqlite3.rst:1766 ../../library/sqlite3.rst:1783 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1765 ../../library/sqlite3.rst:1782 +#: ../../library/sqlite3.rst:1768 ../../library/sqlite3.rst:1785 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1765 ../../library/sqlite3.rst:1782 +#: ../../library/sqlite3.rst:1768 ../../library/sqlite3.rst:1785 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1767 ../../library/sqlite3.rst:1784 +#: ../../library/sqlite3.rst:1770 ../../library/sqlite3.rst:1787 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1767 ../../library/sqlite3.rst:1784 +#: ../../library/sqlite3.rst:1770 ../../library/sqlite3.rst:1787 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1769 +#: ../../library/sqlite3.rst:1772 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1769 ../../library/sqlite3.rst:1786 +#: ../../library/sqlite3.rst:1772 ../../library/sqlite3.rst:1789 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1771 ../../library/sqlite3.rst:1789 +#: ../../library/sqlite3.rst:1774 ../../library/sqlite3.rst:1792 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1771 ../../library/sqlite3.rst:1789 +#: ../../library/sqlite3.rst:1774 ../../library/sqlite3.rst:1792 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1775 +#: ../../library/sqlite3.rst:1778 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1786 +#: ../../library/sqlite3.rst:1789 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1792 +#: ../../library/sqlite3.rst:1795 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1731,42 +1732,42 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1802 +#: ../../library/sqlite3.rst:1805 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1804 +#: ../../library/sqlite3.rst:1807 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1807 +#: ../../library/sqlite3.rst:1810 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1811 +#: ../../library/sqlite3.rst:1814 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1815 +#: ../../library/sqlite3.rst:1818 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1819 +#: ../../library/sqlite3.rst:1822 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1825 +#: ../../library/sqlite3.rst:1828 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1774,15 +1775,15 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1834 +#: ../../library/sqlite3.rst:1837 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:1839 +#: ../../library/sqlite3.rst:1842 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:1841 +#: ../../library/sqlite3.rst:1844 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1790,7 +1791,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:1854 +#: ../../library/sqlite3.rst:1857 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1798,7 +1799,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:1859 +#: ../../library/sqlite3.rst:1862 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -1809,24 +1810,24 @@ msgid "" "are ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1896 +#: ../../library/sqlite3.rst:1899 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:1903 +#: ../../library/sqlite3.rst:1906 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1905 +#: ../../library/sqlite3.rst:1908 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1909 +#: ../../library/sqlite3.rst:1912 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1836,11 +1837,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1921 +#: ../../library/sqlite3.rst:1924 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1923 +#: ../../library/sqlite3.rst:1926 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1850,84 +1851,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1954 +#: ../../library/sqlite3.rst:1957 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1956 +#: ../../library/sqlite3.rst:1959 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1986 +#: ../../library/sqlite3.rst:1989 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1988 +#: ../../library/sqlite3.rst:1991 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1993 +#: ../../library/sqlite3.rst:1996 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1996 +#: ../../library/sqlite3.rst:1999 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:2001 +#: ../../library/sqlite3.rst:2004 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2010 +#: ../../library/sqlite3.rst:2013 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:2014 +#: ../../library/sqlite3.rst:2017 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2015 +#: ../../library/sqlite3.rst:2018 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2016 +#: ../../library/sqlite3.rst:2019 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2020 +#: ../../library/sqlite3.rst:2023 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2071 +#: ../../library/sqlite3.rst:2074 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2073 +#: ../../library/sqlite3.rst:2076 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2135 +#: ../../library/sqlite3.rst:2138 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2137 +#: ../../library/sqlite3.rst:2140 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1939,11 +1940,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2178 +#: ../../library/sqlite3.rst:2181 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2180 +#: ../../library/sqlite3.rst:2183 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1953,58 +1954,58 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2189 +#: ../../library/sqlite3.rst:2192 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2194 +#: ../../library/sqlite3.rst:2197 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2227 +#: ../../library/sqlite3.rst:2230 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2229 +#: ../../library/sqlite3.rst:2232 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2231 +#: ../../library/sqlite3.rst:2234 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2240 +#: ../../library/sqlite3.rst:2243 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2250 +#: ../../library/sqlite3.rst:2253 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2264 +#: ../../library/sqlite3.rst:2267 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2273 +#: ../../library/sqlite3.rst:2276 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2275 +#: ../../library/sqlite3.rst:2278 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`." msgstr "" -#: ../../library/sqlite3.rst:2280 +#: ../../library/sqlite3.rst:2283 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -2012,7 +2013,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2285 +#: ../../library/sqlite3.rst:2288 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -2020,51 +2021,51 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2295 +#: ../../library/sqlite3.rst:2298 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2310 +#: ../../library/sqlite3.rst:2313 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2319 +#: ../../library/sqlite3.rst:2322 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2329 +#: ../../library/sqlite3.rst:2332 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2340 +#: ../../library/sqlite3.rst:2343 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2355 +#: ../../library/sqlite3.rst:2358 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`." msgstr "" -#: ../../library/sqlite3.rst:2363 +#: ../../library/sqlite3.rst:2366 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2368 +#: ../../library/sqlite3.rst:2371 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2370 +#: ../../library/sqlite3.rst:2373 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2373 +#: ../../library/sqlite3.rst:2376 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2078,7 +2079,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2386 +#: ../../library/sqlite3.rst:2389 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2088,14 +2089,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2394 +#: ../../library/sqlite3.rst:2397 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2398 +#: ../../library/sqlite3.rst:2401 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." From 6601cd9b5c10ba3a790782c65af0bcac895bd0aa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 14 May 2023 00:34:05 +0000 Subject: [PATCH 085/130] sync with cpython b87ccc38 --- library/functions.po | 713 ++++++++++++++++++++++--------------------- 1 file changed, 363 insertions(+), 350 deletions(-) diff --git a/library/functions.po b/library/functions.po index e8d766fccc..7f2770f3e7 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-05-14 00:32+0000\n" "PO-Revision-Date: 2023-01-04 14:53+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -482,8 +482,8 @@ msgid "" "ways." msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" -#: ../../library/functions.rst:140 ../../library/functions.rst:834 -#: ../../library/functions.rst:1151 +#: ../../library/functions.rst:140 ../../library/functions.rst:841 +#: ../../library/functions.rst:1158 msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" @@ -502,8 +502,8 @@ msgstr "" "(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " "``True`` 兩個實例(參見 :ref:`bltin-boolean-values`)。" -#: ../../library/functions.rst:154 ../../library/functions.rst:699 -#: ../../library/functions.rst:923 +#: ../../library/functions.rst:154 ../../library/functions.rst:706 +#: ../../library/functions.rst:930 msgid "*x* is now a positional-only parameter." msgstr "" @@ -522,11 +522,24 @@ msgstr "" #: ../../library/functions.rst:171 msgid "" +"By default, the behavior of :func:`breakpoint` can be changed with the :" +"envvar:`PYTHONBREAKPOINT` environment variable. See :func:`sys." +"breakpointhook` for usage details." +msgstr "" + +#: ../../library/functions.rst:175 +msgid "" +"Note that this is not guaranteed if :func:`sys.breakpointhook` has been " +"replaced." +msgstr "" + +#: ../../library/functions.rst:178 +msgid "" "Raises an :ref:`auditing event ` ``builtins.breakpoint`` with " "argument ``breakpointhook``." msgstr "" -#: ../../library/functions.rst:181 +#: ../../library/functions.rst:188 msgid "" "Return a new array of bytes. The :class:`bytearray` class is a mutable " "sequence of integers in the range 0 <= x < 256. It has most of the usual " @@ -538,13 +551,13 @@ msgstr "" "`typesseq-mutable` 中所述),同時也有 :class:`bytes` 型別大部分的 method,參" "見 :ref:`bytes-methods`。" -#: ../../library/functions.rst:186 +#: ../../library/functions.rst:193 msgid "" "The optional *source* parameter can be used to initialize the array in a few " "different ways:" msgstr "選擇性參數 *source* 可以被用來以不同的方式初始化陣列:" -#: ../../library/functions.rst:189 +#: ../../library/functions.rst:196 msgid "" "If it is a *string*, you must also give the *encoding* (and optionally, " "*errors*) parameters; :func:`bytearray` then converts the string to bytes " @@ -554,14 +567,14 @@ msgstr "" "*errors* );\\ :func:`bytearray` 會使用 :meth:`str.encode` method 來將 " "string 轉變成 bytes。" -#: ../../library/functions.rst:193 +#: ../../library/functions.rst:200 msgid "" "If it is an *integer*, the array will have that size and will be initialized " "with null bytes." msgstr "" "如果是一個 *integer*,陣列則會有該數值的長度,並以 null bytes 來當作初始值。" -#: ../../library/functions.rst:196 +#: ../../library/functions.rst:203 msgid "" "If it is an object conforming to the :ref:`buffer interface " "`, a read-only buffer of the object will be used to " @@ -570,7 +583,7 @@ msgstr "" "如果是一個符合 :ref:`buffer 介面 `\\ 的物件,該物件的唯讀 " "buffer 會被用來初始化 bytes 陣列。" -#: ../../library/functions.rst:199 +#: ../../library/functions.rst:206 msgid "" "If it is an *iterable*, it must be an iterable of integers in the range ``0 " "<= x < 256``, which are used as the initial contents of the array." @@ -578,15 +591,15 @@ msgstr "" "如果是一個 *iterable*,它的元素必須是範圍為 ``0 <= x < 256`` 的整數,並且會被" "用作陣列的初始值。" -#: ../../library/functions.rst:202 +#: ../../library/functions.rst:209 msgid "Without an argument, an array of size 0 is created." msgstr "如果沒有引數,則建立長度為 0 的陣列。" -#: ../../library/functions.rst:204 +#: ../../library/functions.rst:211 msgid "See also :ref:`binaryseq` and :ref:`typebytearray`." msgstr "可參考 :ref:`binaryseq` 和 :ref:`typebytearray`。" -#: ../../library/functions.rst:213 +#: ../../library/functions.rst:220 msgid "" "Return a new \"bytes\" object which is an immutable sequence of integers in " "the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :" @@ -597,20 +610,20 @@ msgstr "" "變序列。:class:`bytes` 是 :class:`bytearray` 的不可變版本 — 它的同樣具備不改" "變物件的 method,也有相同的索引和切片操作。" -#: ../../library/functions.rst:218 +#: ../../library/functions.rst:225 msgid "" "Accordingly, constructor arguments are interpreted as for :func:`bytearray`." msgstr "因此,建構函式的引數和 :func:`bytearray` 相同。" -#: ../../library/functions.rst:220 +#: ../../library/functions.rst:227 msgid "Bytes objects can also be created with literals, see :ref:`strings`." msgstr "Bytes 物件還可以用文字建立,參見 :ref:`strings`。" -#: ../../library/functions.rst:222 +#: ../../library/functions.rst:229 msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." msgstr "可參考 :ref:`binaryseq`、\\ :ref:`typebytes` 和 :ref:`bytes-methods`。" -#: ../../library/functions.rst:227 +#: ../../library/functions.rst:234 msgid "" "Return :const:`True` if the *object* argument appears callable, :const:" "`False` if not. If this returns ``True``, it is still possible that a call " @@ -623,13 +636,13 @@ msgstr "" "會失敗。注意 class 是可呼叫的(呼叫 class 會回傳一個新的實例);如果實例的 " "class 有定義 :meth:`__call__` method,則它是可呼叫的。" -#: ../../library/functions.rst:233 +#: ../../library/functions.rst:240 msgid "" "This function was first removed in Python 3.0 and then brought back in " "Python 3.2." msgstr "這個函式一開始在 Python 3.0 被移除,但在 Python 3.2 又被重新加入。" -#: ../../library/functions.rst:240 +#: ../../library/functions.rst:247 msgid "" "Return the string representing a character whose Unicode code point is the " "integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while " @@ -638,7 +651,7 @@ msgstr "" "回傳代表字元之 Unicode 編碼位置為整數 *i* 的字串。例如,``chr(97)`` 回傳字串 " "``'a'``,而 ``chr(8364)`` 回傳字串 ``'€'``。這是 :func:`ord` 的逆函式。" -#: ../../library/functions.rst:244 +#: ../../library/functions.rst:251 msgid "" "The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in " "base 16). :exc:`ValueError` will be raised if *i* is outside that range." @@ -646,11 +659,11 @@ msgstr "" "引數的有效範圍是 0 到 1,114,111(16 進制表示為 0x10FFFF)。如果 *i* 超過這個" "範圍,會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:250 +#: ../../library/functions.rst:257 msgid "Transform a method into a class method." msgstr "把一個 method 封裝成 class method(類別方法)。" -#: ../../library/functions.rst:252 +#: ../../library/functions.rst:259 msgid "" "A class method receives the class as an implicit first argument, just like " "an instance method receives the instance. To declare a class method, use " @@ -661,7 +674,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:260 +#: ../../library/functions.rst:267 msgid "" "The ``@classmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -669,7 +682,7 @@ msgstr "" "``@classmethod`` 語法是一個函式 :term:`decorator` — 參見 :ref:`function` 中關" "於函式定義的詳細介紹。" -#: ../../library/functions.rst:263 +#: ../../library/functions.rst:270 msgid "" "A class method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). The instance is ignored except for its " @@ -680,7 +693,7 @@ msgstr "" "叫。實例除了它的 class 資訊,其他都會被忽略。如果一個 class method 在 " "subclass 上呼叫,subclass 會作為第一個引數傳入。" -#: ../../library/functions.rst:268 +#: ../../library/functions.rst:275 msgid "" "Class methods are different than C++ or Java static methods. If you want " "those, see :func:`staticmethod` in this section. For more information on " @@ -690,26 +703,26 @@ msgstr "" "method,請看本節的 :func:`staticmethod`。關於 class method 的更多資訊,請參" "考 :ref:`types`。" -#: ../../library/functions.rst:272 +#: ../../library/functions.rst:279 msgid "" "Class methods can now wrap other :term:`descriptors ` such as :" "func:`property`." msgstr "" -#: ../../library/functions.rst:276 +#: ../../library/functions.rst:283 msgid "" "Class methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``) and " "have a new ``__wrapped__`` attribute." msgstr "" -#: ../../library/functions.rst:281 +#: ../../library/functions.rst:288 msgid "" "Class methods can no longer wrap other :term:`descriptors ` such " "as :func:`property`." msgstr "" -#: ../../library/functions.rst:288 +#: ../../library/functions.rst:295 msgid "" "Compile the *source* into a code or AST object. Code objects can be " "executed by :func:`exec` or :func:`eval`. *source* can either be a normal " @@ -720,7 +733,7 @@ msgstr "" "`eval` 執行。*source* 可以是一般的字串、bytes 字串、或者 AST 物件。參見 :mod:" "`ast` module(模組)的文件瞭解如何使用 AST 物件。" -#: ../../library/functions.rst:293 +#: ../../library/functions.rst:300 msgid "" "The *filename* argument should give the file from which the code was read; " "pass some recognizable value if it wasn't read from a file (``''`` " @@ -729,7 +742,7 @@ msgstr "" "*filename* 引數必須是程式碼的檔名;如果程式碼不是從檔案中讀取,可以傳入一些可" "辨識的值(經常會使用 ``''`` 來替代)。" -#: ../../library/functions.rst:297 +#: ../../library/functions.rst:304 msgid "" "The *mode* argument specifies what kind of code must be compiled; it can be " "``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if " @@ -742,7 +755,7 @@ msgstr "" "式,可以是 ``'single'``(在最後一種情況下,如果運算式執行結果不是 ``None`` 則" "會被印出來)。" -#: ../../library/functions.rst:303 +#: ../../library/functions.rst:310 msgid "" "The optional arguments *flags* and *dont_inherit* control which :ref:" "`compiler options ` should be activated and which :ref:" @@ -756,7 +769,7 @@ msgid "" "in the surrounding code are ignored." msgstr "" -#: ../../library/functions.rst:314 +#: ../../library/functions.rst:321 msgid "" "Compiler options and future statements are specified by bits which can be " "bitwise ORed together to specify multiple options. The bitfield required to " @@ -771,7 +784,7 @@ msgstr "" "compiler_flag` 屬性來獲得。\\ :ref:`編譯器旗標 `\\ 可以" "在 :mod:`ast` module 中搜尋有 ``PyCF_`` 前綴的名稱。" -#: ../../library/functions.rst:322 +#: ../../library/functions.rst:329 msgid "" "The argument *optimize* specifies the optimization level of the compiler; " "the default value of ``-1`` selects the optimization level of the " @@ -784,7 +797,7 @@ msgstr "" "``__debug__`` 為真值)、\\ ``1``\\ (assert 被刪除,\\ ``__debug__`` 為假值)" "或 ``2``\\ (文件字串也被刪除)。" -#: ../../library/functions.rst:328 +#: ../../library/functions.rst:335 msgid "" "This function raises :exc:`SyntaxError` if the compiled source is invalid, " "and :exc:`ValueError` if the source contains null bytes." @@ -792,26 +805,26 @@ msgstr "" "如果編譯的原始碼無效,此函式會觸發 :exc:`SyntaxError`,如果原始碼包含 null " "bytes,則會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:331 +#: ../../library/functions.rst:338 msgid "" "If you want to parse Python code into its AST representation, see :func:`ast." "parse`." msgstr "如果您想解析 Python 程式碼為 AST 運算式,請參閱 :func:`ast.parse`。" -#: ../../library/functions.rst:334 +#: ../../library/functions.rst:341 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source``, ``filename``." msgstr "" -#: ../../library/functions.rst:336 +#: ../../library/functions.rst:343 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source`` and ``filename``. This event may also be raised by implicit " "compilation." msgstr "" -#: ../../library/functions.rst:342 +#: ../../library/functions.rst:349 msgid "" "When compiling a string with multi-line code in ``'single'`` or ``'eval'`` " "mode, input must be terminated by at least one newline character. This is " @@ -821,7 +834,7 @@ msgstr "" "在 ``'single'`` 或 ``'eval'`` 模式編譯多行程式碼時,輸入必須以至少一個換行符" "結尾。這使 :mod:`code` module 更容易檢測陳述式的完整性。" -#: ../../library/functions.rst:349 +#: ../../library/functions.rst:356 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string when compiling to an AST object due to stack depth " @@ -830,7 +843,7 @@ msgstr "" "如果編譯足夠大或者足夠複雜的字串成 AST 物件時,Python 直譯器會因為 Python " "AST 編譯器的 stack 深度限制而崩潰。" -#: ../../library/functions.rst:353 +#: ../../library/functions.rst:360 msgid "" "Allowed use of Windows and Mac newlines. Also, input in ``'exec'`` mode " "does not have to end in a newline anymore. Added the *optimize* parameter." @@ -838,20 +851,20 @@ msgstr "" "允許使用 Windows 和 Mac 的換行符號。在 ``'exec'`` 模式不需要以換行符號結尾。" "增加了 *optimize* 參數。" -#: ../../library/functions.rst:357 +#: ../../library/functions.rst:364 msgid "" "Previously, :exc:`TypeError` was raised when null bytes were encountered in " "*source*." msgstr "" "在之前的版本,*source* 中包含 null bytes 會觸發 :exc:`TypeError` 異常。" -#: ../../library/functions.rst:361 +#: ../../library/functions.rst:368 msgid "" "``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable " "support for top-level ``await``, ``async for``, and ``async with``." msgstr "" -#: ../../library/functions.rst:369 +#: ../../library/functions.rst:376 msgid "" "Return a complex number with the value *real* + *imag*\\*1j or convert a " "string or number to a complex number. If the first parameter is a string, " @@ -868,7 +881,7 @@ msgstr "" "預設值為零,建構函式會像 :class:`int` 和 :class:`float` 一樣進行數值轉換。如" "果兩個引數都省略,則回傳 ``0j``。" -#: ../../library/functions.rst:378 +#: ../../library/functions.rst:385 msgid "" "For a general Python object ``x``, ``complex(x)`` delegates to ``x." "__complex__()``. If ``__complex__()`` is not defined then it falls back to :" @@ -876,7 +889,7 @@ msgid "" "meth:`__index__`." msgstr "" -#: ../../library/functions.rst:385 +#: ../../library/functions.rst:392 msgid "" "When converting from a string, the string must not contain whitespace around " "the central ``+`` or ``-`` operator. For example, ``complex('1+2j')`` is " @@ -886,22 +899,22 @@ msgstr "" "``complex('1+2j')`` 是有效的,但 ``complex('1 + 2j')`` 會觸發 :exc:" "`ValueError`。" -#: ../../library/functions.rst:390 +#: ../../library/functions.rst:397 msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複數型別在 :ref:`typesnumeric` 中有相關描述。" -#: ../../library/functions.rst:392 ../../library/functions.rst:696 -#: ../../library/functions.rst:920 +#: ../../library/functions.rst:399 ../../library/functions.rst:703 +#: ../../library/functions.rst:927 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "可以使用底線將程式碼文字中的數字進行分組。" -#: ../../library/functions.rst:395 +#: ../../library/functions.rst:402 msgid "" "Falls back to :meth:`__index__` if :meth:`__complex__` and :meth:`__float__` " "are not defined." msgstr "" -#: ../../library/functions.rst:402 +#: ../../library/functions.rst:409 msgid "" "This is a relative of :func:`setattr`. The arguments are an object and a " "string. The string must be the name of one of the object's attributes. The " @@ -914,7 +927,7 @@ msgstr "" "'foobar')`` 等價於 ``del x.foobar``。*name* 不必是個 Python 識別符 " "(identifier)(請見 :func:`setattr`)。" -#: ../../library/functions.rst:415 +#: ../../library/functions.rst:422 msgid "" "Create a new dictionary. The :class:`dict` object is the dictionary class. " "See :class:`dict` and :ref:`typesmapping` for documentation about this class." @@ -922,7 +935,7 @@ msgstr "" "建立一個新的 dictionary(字典)。\\ :class:`dict` 物件是一個 dictionary " "class。參見 :class:`dict` 和 :ref:`typesmapping` 來瞭解這個 class。" -#: ../../library/functions.rst:418 +#: ../../library/functions.rst:425 msgid "" "For other containers see the built-in :class:`list`, :class:`set`, and :" "class:`tuple` classes, as well as the :mod:`collections` module." @@ -930,7 +943,7 @@ msgstr "" "其他容器型別,請參見內建的 :class:`list`、:class:`set` 和 :class:`tuple` " "class,以及 :mod:`collections` module。" -#: ../../library/functions.rst:425 +#: ../../library/functions.rst:432 msgid "" "Without arguments, return the list of names in the current local scope. " "With an argument, attempt to return a list of valid attributes for that " @@ -939,7 +952,7 @@ msgstr "" "如果沒有引數,則回傳當前本地作用域中的名稱列表。如果有引數,它會嘗試回傳該物" "件的有效屬性列表。" -#: ../../library/functions.rst:428 +#: ../../library/functions.rst:435 msgid "" "If the object has a method named :meth:`__dir__`, this method will be called " "and must return the list of attributes. This allows objects that implement a " @@ -950,7 +963,7 @@ msgstr "" "須回傳一個屬性列表。這允許實現自定義 :func:`__getattr__` 或 :func:" "`__getattribute__` 函式的物件能夠自定義 :func:`dir` 來報告它們的屬性。" -#: ../../library/functions.rst:433 +#: ../../library/functions.rst:440 msgid "" "If the object does not provide :meth:`__dir__`, the function tries its best " "to gather information from the object's :attr:`~object.__dict__` attribute, " @@ -962,7 +975,7 @@ msgstr "" "__dict__` 屬性和型別物件收集資訊。結果列表並不總是完整的,如果物件有自定義 :" "func:`__getattr__`,那結果可能不準確。" -#: ../../library/functions.rst:438 +#: ../../library/functions.rst:445 msgid "" "The default :func:`dir` mechanism behaves differently with different types " "of objects, as it attempts to produce the most relevant, rather than " @@ -971,13 +984,13 @@ msgstr "" "預設的 :func:`dir` 機制對不同型別的物件有不同行為,它會試圖回傳最相關而非最完" "整的資訊:" -#: ../../library/functions.rst:442 +#: ../../library/functions.rst:449 msgid "" "If the object is a module object, the list contains the names of the " "module's attributes." msgstr "如果物件是 module 物件,則列表包含 module 的屬性名稱。" -#: ../../library/functions.rst:445 +#: ../../library/functions.rst:452 msgid "" "If the object is a type or class object, the list contains the names of its " "attributes, and recursively of the attributes of its bases." @@ -985,7 +998,7 @@ msgstr "" "如果物件是型別或 class 物件,則列表包含它們的屬性名稱,並且遞迴查詢其基礎的所" "有屬性。" -#: ../../library/functions.rst:448 +#: ../../library/functions.rst:455 msgid "" "Otherwise, the list contains the object's attributes' names, the names of " "its class's attributes, and recursively of the attributes of its class's " @@ -994,11 +1007,11 @@ msgstr "" "否則,包含物件的屬性名稱列表、它的 class 屬性名稱,並且遞迴查詢它的 class 的" "所有基礎 class 的屬性。" -#: ../../library/functions.rst:452 +#: ../../library/functions.rst:459 msgid "The resulting list is sorted alphabetically. For example:" msgstr "回傳的列表按字母表排序,例如:" -#: ../../library/functions.rst:471 +#: ../../library/functions.rst:478 msgid "" "Because :func:`dir` is supplied primarily as a convenience for use at an " "interactive prompt, it tries to supply an interesting set of names more than " @@ -1011,7 +1024,7 @@ msgstr "" "版本之間改變。例如,當引數是一個 class 時,metaclass 的屬性不包含在結果列表" "中。" -#: ../../library/functions.rst:481 +#: ../../library/functions.rst:488 msgid "" "Take two (non-complex) numbers as arguments and return a pair of numbers " "consisting of their quotient and remainder when using integer division. " @@ -1029,7 +1042,7 @@ msgstr "" "等,如果 ``a % b`` 非零,則它的符號和 *b* 一樣,且 ``0 <= abs(a % b) < " "abs(b)``。" -#: ../../library/functions.rst:493 +#: ../../library/functions.rst:500 msgid "" "Return an enumerate object. *iterable* must be a sequence, an :term:" "`iterator`, or some other object which supports iteration. The :meth:" @@ -1042,14 +1055,14 @@ msgstr "" "meth:`~iterator.__next__` method 回傳一個 tuple(元組),裡面包含一個計數值" "(從 *start* 開始,預設為 0)和通過疊代 *iterable* 獲得的值。" -#: ../../library/functions.rst:505 +#: ../../library/functions.rst:512 msgid "Equivalent to::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/functions.rst:517 +#: ../../library/functions.rst:524 msgid "" "The arguments are a string and optional globals and locals. If provided, " "*globals* must be a dictionary. If provided, *locals* can be any mapping " @@ -1058,7 +1071,7 @@ msgstr "" "引數是一個字串,以及選擇性的 globals 和 locals。如果有提供選擇性引數," "*globals* 必須是一個 dictionary。*locals* 可以是任何映射 (mapping) 物件。" -#: ../../library/functions.rst:521 +#: ../../library/functions.rst:528 msgid "" "The *expression* argument is parsed and evaluated as a Python expression " "(technically speaking, a condition list) using the *globals* and *locals* " @@ -1084,13 +1097,13 @@ msgstr "" "呼叫的環境中執行運算式。請注意,*eval()* 在封閉環境中無法存取\\ :term:`巢狀" "域 ` (non-locals)。" -#: ../../library/functions.rst:536 +#: ../../library/functions.rst:543 msgid "" "The return value is the result of the evaluated expression. Syntax errors " "are reported as exceptions. Example:" msgstr "" -#: ../../library/functions.rst:543 +#: ../../library/functions.rst:550 msgid "" "This function can also be used to execute arbitrary code objects (such as " "those created by :func:`compile`). In this case, pass a code object instead " @@ -1101,7 +1114,7 @@ msgstr "" "情況下,傳入的引數是程式碼物件而不是字串。如果編譯該物件時的 *mode* 引數是 " "``'exec'``,那麼 :func:`eval` 回傳值為 ``None``。" -#: ../../library/functions.rst:548 +#: ../../library/functions.rst:555 msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " "function. The :func:`globals` and :func:`locals` functions return the " @@ -1112,13 +1125,13 @@ msgstr "" "`locals` 函式分別回傳當前的全域性和局部性 dictionary,它們對於將引數傳遞給 :" "func:`eval` 或 :func:`exec` 可能會方便許多。" -#: ../../library/functions.rst:553 +#: ../../library/functions.rst:560 msgid "" "If the given source is a string, then leading and trailing spaces and tabs " "are stripped." msgstr "" -#: ../../library/functions.rst:556 +#: ../../library/functions.rst:563 msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " "with expressions containing only literals." @@ -1126,19 +1139,19 @@ msgstr "" "另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的運算式字" "串。" -#: ../../library/functions.rst:559 ../../library/functions.rst:600 +#: ../../library/functions.rst:566 ../../library/functions.rst:607 msgid "" "Raises an :ref:`auditing event ` ``exec`` with argument " "``code_object``." msgstr "" -#: ../../library/functions.rst:561 ../../library/functions.rst:602 +#: ../../library/functions.rst:568 ../../library/functions.rst:609 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." msgstr "" -#: ../../library/functions.rst:568 +#: ../../library/functions.rst:575 msgid "" "This function supports dynamic execution of Python code. *object* must be " "either a string or a code object. If it is a string, the string is parsed " @@ -1158,7 +1171,7 @@ msgstr "" "`yield` 和 :keyword:`return` 陳述式也不能在函式之外使用。該函式回傳值是 " "``None``。" -#: ../../library/functions.rst:579 +#: ../../library/functions.rst:586 msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " "current scope. If only *globals* is provided, it must be a dictionary (and " @@ -1177,7 +1190,7 @@ msgstr "" "地變數是相同的 dictionary。如果 exec 有兩個不同的 *globals* 和 *locals* 物" "件,程式碼就像嵌入在 class 定義中一樣執行。" -#: ../../library/functions.rst:589 +#: ../../library/functions.rst:596 msgid "" "If the *globals* dictionary does not contain a value for the key " "``__builtins__``, a reference to the dictionary of the built-in module :mod:" @@ -1190,7 +1203,7 @@ msgstr "" "func:`exec` 之前,可以通過將自己的 ``__builtins__`` dictionary 插入到 " "*globals* 中來控制可以使用哪些內建程式碼。" -#: ../../library/functions.rst:595 +#: ../../library/functions.rst:602 msgid "" "The *closure* argument specifies a closure--a tuple of cellvars. It's only " "valid when the *object* is a code object containing free variables. The " @@ -1198,7 +1211,7 @@ msgid "" "referenced by the code object." msgstr "" -#: ../../library/functions.rst:607 +#: ../../library/functions.rst:614 msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " "global and local dictionary, respectively, which may be useful to pass " @@ -1207,7 +1220,7 @@ msgstr "" "內建 :func:`globals` 和 :func:`locals` 函式各自回傳當前的全域性和本地 " "dictionary,因此可以將它們傳遞給 :func:`exec` 的第二個和第三個引數。" -#: ../../library/functions.rst:613 +#: ../../library/functions.rst:620 msgid "" "The default *locals* act as described for function :func:`locals` below: " "modifications to the default *locals* dictionary should not be attempted. " @@ -1218,11 +1231,11 @@ msgstr "" "預設的 *locals* dictionary。如果您想在 :func:`exec` 函式回傳時知道程式碼對 " "*locals* 的變動,請明確地傳遞 *locals* dictionary 。" -#: ../../library/functions.rst:618 +#: ../../library/functions.rst:625 msgid "Added the *closure* parameter." msgstr "增加了 *closure* 參數。" -#: ../../library/functions.rst:624 +#: ../../library/functions.rst:631 #, fuzzy msgid "" "Construct an iterator from those elements of *iterable* for which *function* " @@ -1235,7 +1248,7 @@ msgstr "" "*function* 是 ``None``,則會假設它是一個恆等函數,即 *iterable* 中所有假值元" "素會被移除。" -#: ../../library/functions.rst:630 +#: ../../library/functions.rst:637 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1246,7 +1259,7 @@ msgstr "" "是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" "function 是 ``None`` 的時候為 ``(item for item in iterable if item)``。" -#: ../../library/functions.rst:635 +#: ../../library/functions.rst:642 #, fuzzy msgid "" "See :func:`itertools.filterfalse` for the complementary function that " @@ -1255,11 +1268,11 @@ msgstr "" "請參閱 :func:`itertools.filterfalse`,只有 *function* 回傳 false 時才選取 " "*iterable* 中元素的互補函數。" -#: ../../library/functions.rst:645 +#: ../../library/functions.rst:652 msgid "Return a floating point number constructed from a number or string *x*." msgstr "回傳從數字或字串 *x* 生成的浮點數。" -#: ../../library/functions.rst:647 +#: ../../library/functions.rst:654 msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " @@ -1274,7 +1287,7 @@ msgstr "" "數也可以是 NaN(非數字)或正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法中 ``floatvalue`` 的生成規則:" -#: ../../library/functions.rst:665 +#: ../../library/functions.rst:672 msgid "" "Here ``digit`` is a Unicode decimal digit (character in the Unicode general " "category ``Nd``). Case is not significant, so, for example, \"inf\", " @@ -1285,7 +1298,7 @@ msgstr "" "大小寫都可以,例如,\"inf\"、\"Inf\"、\"INFINITY\"、\"iNfINity\" 都可以表示正" "無窮大。" -#: ../../library/functions.rst:670 +#: ../../library/functions.rst:677 msgid "" "Otherwise, if the argument is an integer or a floating point number, a " "floating point number with the same value (within Python's floating point " @@ -1295,7 +1308,7 @@ msgstr "" "否則,如果引數是整數或浮點數,則回傳具有相同值(在 Python 浮點精度範圍內)的" "浮點數。如果引數在 Python 浮點精度範圍外,則會觸發 :exc:`OverflowError`。" -#: ../../library/functions.rst:675 +#: ../../library/functions.rst:682 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If ``__float__()`` is not defined then it falls back to :" @@ -1304,26 +1317,26 @@ msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 指派給 ``x.__float__()``。如果未定" "義 ``__float__()`` 則使用 :meth:`__index__`。" -#: ../../library/functions.rst:679 +#: ../../library/functions.rst:686 msgid "If no argument is given, ``0.0`` is returned." msgstr "如果沒有引數,則回傳 ``0.0``。" -#: ../../library/functions.rst:681 +#: ../../library/functions.rst:688 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:694 +#: ../../library/functions.rst:701 msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點數型別。" -#: ../../library/functions.rst:702 +#: ../../library/functions.rst:709 msgid "Falls back to :meth:`__index__` if :meth:`__float__` is not defined." msgstr "" -#: ../../library/functions.rst:712 +#: ../../library/functions.rst:719 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1334,7 +1347,7 @@ msgstr "" "取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" -#: ../../library/functions.rst:717 +#: ../../library/functions.rst:724 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1342,7 +1355,7 @@ msgstr "" "預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value) ` 的效" "果相同。" -#: ../../library/functions.rst:720 +#: ../../library/functions.rst:727 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1356,7 +1369,7 @@ msgstr "" "字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空,或是 " "*format_spec* 或回傳值不是字串,則會觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:727 +#: ../../library/functions.rst:734 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1364,7 +1377,7 @@ msgstr "" "當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會觸發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:736 +#: ../../library/functions.rst:743 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1374,7 +1387,7 @@ msgstr "" "素。\\ ``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" "`frozenset` 和 :ref:`types-set`。" -#: ../../library/functions.rst:740 +#: ../../library/functions.rst:747 msgid "" "For other containers see the built-in :class:`set`, :class:`list`, :class:" "`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." @@ -1382,7 +1395,7 @@ msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "class,以及 :mod:`collections` module 來了解其它的容器。" -#: ../../library/functions.rst:748 +#: ../../library/functions.rst:755 msgid "" "Return the value of the named attribute of *object*. *name* must be a " "string. If the string is the name of one of the object's attributes, the " @@ -1397,7 +1410,7 @@ msgstr "" "`AttributeError`。*name* 不必是個 Python 識別符 (identifier)(請見 :func:" "`setattr`)。" -#: ../../library/functions.rst:757 +#: ../../library/functions.rst:764 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1405,7 +1418,7 @@ msgid "" "`getattr`." msgstr "" -#: ../../library/functions.rst:765 +#: ../../library/functions.rst:772 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1414,7 +1427,7 @@ msgstr "" "回傳代表當前 module 命名空間的 dictionary。對於在函式中的程式碼來說,這在定義" "函式時設定且不論該函式是在何處呼叫都會保持相同。" -#: ../../library/functions.rst:772 +#: ../../library/functions.rst:779 msgid "" "The arguments are an object and a string. The result is ``True`` if the " "string is the name of one of the object's attributes, ``False`` if not. " @@ -1425,7 +1438,7 @@ msgstr "" "則回傳 ``False``。(此功能是通過呼叫 ``getattr(object, name)`` 看是否有 :exc:" "`AttributeError` 來實現的。)" -#: ../../library/functions.rst:780 +#: ../../library/functions.rst:787 msgid "" "Return the hash value of the object (if it has one). Hash values are " "integers. They are used to quickly compare dictionary keys during a " @@ -1436,7 +1449,7 @@ msgstr "" "時用來快速比較 dictionary 的鍵。相同大小的數字數值有相同的雜湊值(即使它們型" "別不同,如 1 和 1.0)。" -#: ../../library/functions.rst:787 +#: ../../library/functions.rst:794 msgid "" "For objects with custom :meth:`__hash__` methods, note that :func:`hash` " "truncates the return value based on the bit width of the host machine. See :" @@ -1445,7 +1458,7 @@ msgstr "" "請注意,如果物件實現了自己的 :meth:`__hash__` method,:func:`hash` 根據執行機" "器的位元長度來擷取回傳值。另請參閱 :meth:`__hash__`。" -#: ../../library/functions.rst:794 +#: ../../library/functions.rst:801 msgid "" "Invoke the built-in help system. (This function is intended for interactive " "use.) If no argument is given, the interactive help system starts on the " @@ -1459,7 +1472,7 @@ msgstr "" "鍵字或文件主題中搜索該字串,並在控制台上列印幫助資訊。如果引數是其他任意物" "件,則會生成該物件的幫助頁。" -#: ../../library/functions.rst:801 +#: ../../library/functions.rst:808 msgid "" "Note that if a slash(/) appears in the parameter list of a function when " "invoking :func:`help`, it means that the parameters prior to the slash are " @@ -1467,12 +1480,12 @@ msgid "" "parameters `." msgstr "" -#: ../../library/functions.rst:806 +#: ../../library/functions.rst:813 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "該函式透過 :mod:`site` module 加入到內建命名空間。" -#: ../../library/functions.rst:808 +#: ../../library/functions.rst:815 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1480,7 +1493,7 @@ msgstr "" "變更至 :mod:`pydoc` 和 :mod:`inspect` 使得可呼叫物件的簽名信息 (signature) 更" "加全面和一致。" -#: ../../library/functions.rst:815 +#: ../../library/functions.rst:822 msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " "\"0x\". If *x* is not a Python :class:`int` object, it has to define an :" @@ -1490,7 +1503,7 @@ msgstr "" "class:`int` 物件,則必須定義一個 :meth:`__index__` method 並且回傳一個整數。" "舉例來說:" -#: ../../library/functions.rst:824 +#: ../../library/functions.rst:831 msgid "" "If you want to convert an integer number to an uppercase or lower " "hexadecimal string with prefix or not, you can use either of the following " @@ -1499,20 +1512,20 @@ msgstr "" "如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無 \"0x\" 前綴,則可" "以使用如下方法:" -#: ../../library/functions.rst:836 +#: ../../library/functions.rst:843 msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." msgstr "另請參閱 :func:`int` 將十六進位制字串轉換為以 16 為基數的整數。" -#: ../../library/functions.rst:841 +#: ../../library/functions.rst:848 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." msgstr "" "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" -#: ../../library/functions.rst:847 +#: ../../library/functions.rst:854 msgid "" "Return the \"identity\" of an object. This is an integer which is " "guaranteed to be unique and constant for this object during its lifetime. " @@ -1522,17 +1535,17 @@ msgstr "" "回傳物件的 \"標識值\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" "的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" -#: ../../library/functions.rst:852 +#: ../../library/functions.rst:859 msgid "This is the address of the object in memory." msgstr "" -#: ../../library/functions.rst:854 +#: ../../library/functions.rst:861 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" -#: ../../library/functions.rst:860 +#: ../../library/functions.rst:867 msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " @@ -1545,7 +1558,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:870 +#: ../../library/functions.rst:877 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1553,31 +1566,31 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:873 +#: ../../library/functions.rst:880 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt``." msgstr "" -#: ../../library/functions.rst:875 +#: ../../library/functions.rst:882 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" msgstr "" -#: ../../library/functions.rst:878 +#: ../../library/functions.rst:885 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "argument ``result``." msgstr "" -#: ../../library/functions.rst:880 +#: ../../library/functions.rst:887 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." msgstr "" -#: ../../library/functions.rst:887 +#: ../../library/functions.rst:894 msgid "" "Return an integer object constructed from a number or string *x*, or return " "``0`` if no arguments are given. If *x* defines :meth:`__int__`, ``int(x)`` " @@ -1590,7 +1603,7 @@ msgstr "" "了 :meth:`__index__` 則回傳 ``x.__index__()``。如果 *x* 定義了 :meth:" "`__trunc__` 則回傳 ``x.__trunc__()``。對於浮點數則向零舍入。" -#: ../../library/functions.rst:894 +#: ../../library/functions.rst:901 msgid "" "If *x* is not a number or if *base* is given, then *x* must be a string, :" "class:`bytes`, or :class:`bytearray` instance representing an integer in " @@ -1603,7 +1616,7 @@ msgstr "" "前可以有 ``+`` 或 ``-``\\ (中間沒有空格)、可有個前導的零、也可被空格包圍、" "或在數字間有單一底線。" -#: ../../library/functions.rst:900 +#: ../../library/functions.rst:907 msgid "" "A base-n integer string contains digits, each representing a value from 0 to " "n-1. The values 0--9 can be represented by any Unicode decimal digit. The " @@ -1625,11 +1638,11 @@ msgstr "" "進制中的一個,所以 ``int('010', 0)`` 是非法的,但 ``int('010')`` 和 " "``int('010', 8)`` 是有效的。" -#: ../../library/functions.rst:911 +#: ../../library/functions.rst:918 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整數型別定義請參閱 :ref:`typesnumeric`。" -#: ../../library/functions.rst:913 +#: ../../library/functions.rst:920 msgid "" "If *base* is not an instance of :class:`int` and the *base* object has a :" "meth:`base.__index__ ` method, that method is called to " @@ -1641,15 +1654,15 @@ msgstr "" "使用 :meth:`base.__int__ ` 而不是 :meth:`base.__index__ " "`。" -#: ../../library/functions.rst:926 +#: ../../library/functions.rst:933 msgid "Falls back to :meth:`__index__` if :meth:`__int__` is not defined." msgstr "" -#: ../../library/functions.rst:929 +#: ../../library/functions.rst:936 msgid "The delegation to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../library/functions.rst:932 +#: ../../library/functions.rst:939 msgid "" ":class:`int` string inputs and string representations can be limited to help " "avoid denial of service attacks. A :exc:`ValueError` is raised when the " @@ -1659,7 +1672,7 @@ msgid "" "documentation." msgstr "" -#: ../../library/functions.rst:942 +#: ../../library/functions.rst:949 msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " "argument, or of a (direct, indirect, or :term:`virtual `) of *classinfo*. A class is considered a " @@ -1699,7 +1712,7 @@ msgstr "" "*class* 是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會" "觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:974 +#: ../../library/functions.rst:981 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1722,18 +1735,18 @@ msgstr "" "帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸發 :exc:" "`StopIteration`,否則回傳呼叫結果。" -#: ../../library/functions.rst:987 +#: ../../library/functions.rst:994 msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:989 +#: ../../library/functions.rst:996 msgid "" "One useful application of the second form of :func:`iter` is to build a " "block-reader. For example, reading fixed-width blocks from a binary database " "file until the end of file is reached::" msgstr "" -#: ../../library/functions.rst:1001 +#: ../../library/functions.rst:1008 msgid "" "Return the length (the number of items) of an object. The argument may be a " "sequence (such as a string, bytes, tuple, list, or range) or a collection " @@ -1742,13 +1755,13 @@ msgstr "" "回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " "range)或集合(如 dictionary、set 或 frozen set)。" -#: ../../library/functions.rst:1007 +#: ../../library/functions.rst:1014 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." msgstr "" -#: ../../library/functions.rst:1016 +#: ../../library/functions.rst:1023 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -1756,7 +1769,7 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:1022 +#: ../../library/functions.rst:1029 msgid "" "Update and return a dictionary representing the current local symbol table. " "Free variables are returned by :func:`locals` when it is called in function " @@ -1767,7 +1780,7 @@ msgstr "" "叫 :func:`locals` 時會回傳自由變數。請注意,在 module 階層中,\\ :func:" "`locals` 和 :func:`globals` 是相同的 dictionary。" -#: ../../library/functions.rst:1028 +#: ../../library/functions.rst:1035 msgid "" "The contents of this dictionary should not be modified; changes may not " "affect the values of local and free variables used by the interpreter." @@ -1775,7 +1788,7 @@ msgstr "" "此 dictionary 的內容不應該被更動;更改可能不會影響直譯器使用的本地變數或自由" "變數的值。" -#: ../../library/functions.rst:1033 +#: ../../library/functions.rst:1040 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -1790,13 +1803,13 @@ msgstr "" "iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經是 tuple 的引數,請參" "閱 :func:`itertools.starmap`\\。" -#: ../../library/functions.rst:1045 +#: ../../library/functions.rst:1052 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "回傳 iterable 中最大的元素,或者回傳兩個及以上引數中最大的。" -#: ../../library/functions.rst:1048 +#: ../../library/functions.rst:1055 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " @@ -1805,7 +1818,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" "會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" -#: ../../library/functions.rst:1053 ../../library/functions.rst:1091 +#: ../../library/functions.rst:1060 ../../library/functions.rst:1098 msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " "a one-argument ordering function like that used for :meth:`list.sort`. The " @@ -1817,7 +1830,7 @@ msgstr "" "式,如同 :meth:`list.sort` 使用方式。*default* 引數是當 iterable 為空時回傳的" "值。如果 iterable 為空,並且沒有提供 *default*,則會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:1059 +#: ../../library/functions.rst:1066 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1828,15 +1841,15 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1064 ../../library/functions.rst:1102 +#: ../../library/functions.rst:1071 ../../library/functions.rst:1109 msgid "The *default* keyword-only argument." msgstr "*default* 僅限關鍵字引數。" -#: ../../library/functions.rst:1067 ../../library/functions.rst:1105 +#: ../../library/functions.rst:1074 ../../library/functions.rst:1112 msgid "The *key* can be ``None``." msgstr "" -#: ../../library/functions.rst:1075 +#: ../../library/functions.rst:1082 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -1844,13 +1857,13 @@ msgstr "" "回傳由給定的引數建立之 \"memory view\" 物件。有關詳細資訊,請參閱 :ref:" "`typememoryview`。" -#: ../../library/functions.rst:1083 +#: ../../library/functions.rst:1090 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "回傳 iterable 中最小的元素,或者回傳兩個及以上引數中最小的。" -#: ../../library/functions.rst:1086 +#: ../../library/functions.rst:1093 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " @@ -1859,7 +1872,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" "被回傳。如果提供了兩個或以上的位置引數,則回傳最小的位置引數。" -#: ../../library/functions.rst:1097 +#: ../../library/functions.rst:1104 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1870,7 +1883,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1112 +#: ../../library/functions.rst:1119 msgid "" "Retrieve the next item from the :term:`iterator` by calling its :meth:" "`~iterator.__next__` method. If *default* is given, it is returned if the " @@ -1880,7 +1893,7 @@ msgstr "" "素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則觸發 :" "exc:`StopIteration`。" -#: ../../library/functions.rst:1119 +#: ../../library/functions.rst:1126 msgid "" "Return a new featureless object. :class:`object` is a base for all classes. " "It has methods that are common to all instances of Python classes. This " @@ -1889,7 +1902,7 @@ msgstr "" "回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " "Python class 實例的通用 method。這個函式不接受任何引數。" -#: ../../library/functions.rst:1125 +#: ../../library/functions.rst:1132 msgid "" ":class:`object` does *not* have a :attr:`~object.__dict__`, so you can't " "assign arbitrary attributes to an instance of the :class:`object` class." @@ -1897,7 +1910,7 @@ msgstr "" "由於 :class:`object` *沒有* :attr:`~object.__dict__`,因此無法將任意屬性賦" "給 :class:`object` class 的實例。" -#: ../../library/functions.rst:1131 +#: ../../library/functions.rst:1138 msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " @@ -1908,7 +1921,7 @@ msgstr "" "Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:1141 +#: ../../library/functions.rst:1148 msgid "" "If you want to convert an integer number to an octal string either with the " "prefix \"0o\" or not, you can use either of the following ways." @@ -1916,7 +1929,7 @@ msgstr "" "如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" "法。" -#: ../../library/functions.rst:1158 +#: ../../library/functions.rst:1165 msgid "" "Open *file* and return a corresponding :term:`file object`. If the file " "cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more " @@ -1925,7 +1938,7 @@ msgstr "" "開啟 *file* 並回傳對應的 :term:`file object`。如果該檔案不能開啟,則觸發 :" "exc:`OSError`。關於使用此函式的更多方法請參閱\\ :ref:`tut-files`。" -#: ../../library/functions.rst:1162 +#: ../../library/functions.rst:1169 msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " @@ -1938,7 +1951,7 @@ msgstr "" "果有提供檔案描述器,它會隨著回傳的 I/O 物件關閉而關閉,除非 *closefd* 被設為 " "``False``。)" -#: ../../library/functions.rst:1168 +#: ../../library/functions.rst:1175 msgid "" "*mode* is an optional string that specifies the mode in which the file is " "opened. It defaults to ``'r'`` which means open for reading in text mode. " @@ -1959,71 +1972,71 @@ msgstr "" "getencoding()` 來獲取當前的本地編碼。(要讀取和寫入原始 bytes,請使用二進位制" "模式且不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1185 +#: ../../library/functions.rst:1192 msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1185 +#: ../../library/functions.rst:1192 msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1187 +#: ../../library/functions.rst:1194 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1187 +#: ../../library/functions.rst:1194 msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1188 +#: ../../library/functions.rst:1195 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1188 +#: ../../library/functions.rst:1195 msgid "open for writing, truncating the file first" msgstr "" -#: ../../library/functions.rst:1189 +#: ../../library/functions.rst:1196 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1189 +#: ../../library/functions.rst:1196 msgid "open for exclusive creation, failing if the file already exists" msgstr "唯一性創建,如果文件已存在則會失敗" -#: ../../library/functions.rst:1190 +#: ../../library/functions.rst:1197 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1190 +#: ../../library/functions.rst:1197 msgid "open for writing, appending to the end of file if it exists" msgstr "寫入,如果文件存在則在末尾追加寫入內容" -#: ../../library/functions.rst:1191 +#: ../../library/functions.rst:1198 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1191 ../../library/functions.rst:1335 +#: ../../library/functions.rst:1198 ../../library/functions.rst:1342 msgid "binary mode" msgstr "二進制模式" -#: ../../library/functions.rst:1192 +#: ../../library/functions.rst:1199 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1192 +#: ../../library/functions.rst:1199 msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1193 +#: ../../library/functions.rst:1200 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1193 +#: ../../library/functions.rst:1200 msgid "open for updating (reading and writing)" msgstr "更新(讀取並寫入)" -#: ../../library/functions.rst:1196 +#: ../../library/functions.rst:1203 msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " @@ -2032,7 +2045,7 @@ msgstr "" "預設的模式是 ``'r'``\\ (開啟並讀取文字,同 ``'rt'``)。對於二進位制寫入," "``'w+b'`` 模式開啟並把檔案內容變成 0 bytes,``'r+b'`` 則不會捨棄原始內容。" -#: ../../library/functions.rst:1200 +#: ../../library/functions.rst:1207 msgid "" "As mentioned in the :ref:`io-overview`, Python distinguishes between binary " "and text I/O. Files opened in binary mode (including ``'b'`` in the *mode* " @@ -2043,14 +2056,14 @@ msgid "" "specified *encoding* if given." msgstr "" -#: ../../library/functions.rst:1210 +#: ../../library/functions.rst:1217 msgid "" "Python doesn't depend on the underlying operating system's notion of text " "files; all the processing is done by Python itself, and is therefore " "platform-independent." msgstr "" -#: ../../library/functions.rst:1214 +#: ../../library/functions.rst:1221 msgid "" "*buffering* is an optional integer used to set the buffering policy. Pass 0 " "to switch buffering off (only allowed in binary mode), 1 to select line " @@ -2063,7 +2076,7 @@ msgid "" "given, the default buffering policy works as follows:" msgstr "" -#: ../../library/functions.rst:1224 +#: ../../library/functions.rst:1231 msgid "" "Binary files are buffered in fixed-size chunks; the size of the buffer is " "chosen using a heuristic trying to determine the underlying device's \"block " @@ -2071,14 +2084,14 @@ msgid "" "the buffer will typically be 4096 or 8192 bytes long." msgstr "" -#: ../../library/functions.rst:1229 +#: ../../library/functions.rst:1236 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " "described above for binary files." msgstr "" -#: ../../library/functions.rst:1233 +#: ../../library/functions.rst:1240 msgid "" "*encoding* is the name of the encoding used to decode or encode the file. " "This should only be used in text mode. The default encoding is platform " @@ -2087,7 +2100,7 @@ msgid "" "the list of supported encodings." msgstr "" -#: ../../library/functions.rst:1239 +#: ../../library/functions.rst:1246 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " @@ -2096,25 +2109,25 @@ msgid "" "register_error` is also valid. The standard names include:" msgstr "" -#: ../../library/functions.rst:1247 +#: ../../library/functions.rst:1254 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." msgstr "" -#: ../../library/functions.rst:1251 +#: ../../library/functions.rst:1258 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "" -#: ../../library/functions.rst:1254 +#: ../../library/functions.rst:1261 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" -#: ../../library/functions.rst:1257 +#: ../../library/functions.rst:1264 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2123,33 +2136,33 @@ msgid "" "an unknown encoding." msgstr "" -#: ../../library/functions.rst:1264 +#: ../../library/functions.rst:1271 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " "character reference ``&#nnn;``." msgstr "" -#: ../../library/functions.rst:1268 +#: ../../library/functions.rst:1275 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." msgstr "" -#: ../../library/functions.rst:1271 +#: ../../library/functions.rst:1278 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." msgstr "" -#: ../../library/functions.rst:1279 +#: ../../library/functions.rst:1286 msgid "" "*newline* determines how to parse newline characters from the stream. It can " "be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " "follows:" msgstr "" -#: ../../library/functions.rst:1283 +#: ../../library/functions.rst:1290 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2160,7 +2173,7 @@ msgid "" "given string, and the line ending is returned to the caller untranslated." msgstr "" -#: ../../library/functions.rst:1291 +#: ../../library/functions.rst:1298 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2169,7 +2182,7 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/functions.rst:1297 +#: ../../library/functions.rst:1304 msgid "" "If *closefd* is ``False`` and a file descriptor rather than a filename was " "given, the underlying file descriptor will be kept open when the file is " @@ -2177,7 +2190,7 @@ msgid "" "otherwise, an error will be raised." msgstr "" -#: ../../library/functions.rst:1302 +#: ../../library/functions.rst:1309 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -2186,11 +2199,11 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/functions.rst:1308 +#: ../../library/functions.rst:1315 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1310 +#: ../../library/functions.rst:1317 msgid "" "The following example uses the :ref:`dir_fd ` parameter of the :func:" "`os.open` function to open a file relative to a given directory::" @@ -2200,7 +2213,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:1323 +#: ../../library/functions.rst:1330 msgid "" "The type of :term:`file object` returned by the :func:`open` function " "depends on the mode. When :func:`open` is used to open a file in a text " @@ -2215,7 +2228,7 @@ msgid "" "FileIO`, is returned." msgstr "" -#: ../../library/functions.rst:1344 +#: ../../library/functions.rst:1351 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2225,31 +2238,31 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1355 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " "``mode``, ``flags``." msgstr "" -#: ../../library/functions.rst:1350 +#: ../../library/functions.rst:1357 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "" -#: ../../library/functions.rst:1355 +#: ../../library/functions.rst:1362 msgid "The *opener* parameter was added." msgstr "增加了 *opener* 參數。" -#: ../../library/functions.rst:1356 +#: ../../library/functions.rst:1363 msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1364 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去觸發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1358 +#: ../../library/functions.rst:1365 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2257,11 +2270,11 @@ msgstr "" "如果檔案已存在但使用了唯一性建立模式 (\\ ``'x'``\\ ),現在會觸發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1363 +#: ../../library/functions.rst:1370 msgid "The file is now non-inheritable." msgstr "檔案在當前版本開始禁止繼承。" -#: ../../library/functions.rst:1367 +#: ../../library/functions.rst:1374 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" @@ -2270,15 +2283,15 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程序沒有觸發例外,此函式現在會重試系統呼叫,而" "不是觸發 :exc:`InterruptedError`\\ (原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1370 +#: ../../library/functions.rst:1377 msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" -#: ../../library/functions.rst:1374 +#: ../../library/functions.rst:1381 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對實現了 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1375 +#: ../../library/functions.rst:1382 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2286,11 +2299,11 @@ msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1378 +#: ../../library/functions.rst:1385 msgid "The ``'U'`` mode has been removed." msgstr "``'U'`` 模式被移除。" -#: ../../library/functions.rst:1383 +#: ../../library/functions.rst:1390 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2301,7 +2314,7 @@ msgstr "" "``ord('a')`` 回傳整數 ``97``、\\ ``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1391 +#: ../../library/functions.rst:1398 msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " @@ -2312,7 +2325,7 @@ msgstr "" "*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" -#: ../../library/functions.rst:1396 +#: ../../library/functions.rst:1403 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " @@ -2325,7 +2338,7 @@ msgid "" "close to ``3j``." msgstr "" -#: ../../library/functions.rst:1406 +#: ../../library/functions.rst:1413 msgid "" "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " "also be of integer type and *mod* must be nonzero. If *mod* is present and " @@ -2334,29 +2347,29 @@ msgid "" "*base* modulo *mod*." msgstr "" -#: ../../library/functions.rst:1412 +#: ../../library/functions.rst:1419 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" -#: ../../library/functions.rst:1419 +#: ../../library/functions.rst:1426 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." msgstr "" -#: ../../library/functions.rst:1424 +#: ../../library/functions.rst:1431 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" -#: ../../library/functions.rst:1431 +#: ../../library/functions.rst:1438 msgid "" "Print *objects* to the text stream *file*, separated by *sep* and followed " "by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as " "keyword arguments." msgstr "" -#: ../../library/functions.rst:1435 +#: ../../library/functions.rst:1442 msgid "" "All non-keyword arguments are converted to strings like :func:`str` does and " "written to the stream, separated by *sep* and followed by *end*. Both *sep* " @@ -2365,7 +2378,7 @@ msgid "" "*end*." msgstr "" -#: ../../library/functions.rst:1441 +#: ../../library/functions.rst:1448 msgid "" "The *file* argument must be an object with a ``write(string)`` method; if it " "is not present or ``None``, :data:`sys.stdout` will be used. Since printed " @@ -2373,38 +2386,38 @@ msgid "" "binary mode file objects. For these, use ``file.write(...)`` instead." msgstr "" -#: ../../library/functions.rst:1446 +#: ../../library/functions.rst:1453 msgid "" "Output buffering is usually determined by *file*. However, if *flush* is " "true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1450 +#: ../../library/functions.rst:1457 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1456 +#: ../../library/functions.rst:1463 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1458 +#: ../../library/functions.rst:1465 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " "attribute value. And *doc* creates a docstring for the attribute." msgstr "" -#: ../../library/functions.rst:1462 +#: ../../library/functions.rst:1469 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1479 +#: ../../library/functions.rst:1486 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter, and ``del c.x`` the deleter." msgstr "" -#: ../../library/functions.rst:1482 +#: ../../library/functions.rst:1489 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -2412,14 +2425,14 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1502 msgid "" "The ``@property`` decorator turns the :meth:`voltage` method into a " "\"getter\" for a read-only attribute with the same name, and it sets the " "docstring for *voltage* to \"Get the current voltage.\"" msgstr "" -#: ../../library/functions.rst:1499 +#: ../../library/functions.rst:1506 msgid "" "A property object has :attr:`~property.getter`, :attr:`~property.setter`, " "and :attr:`~property.deleter` methods usable as decorators that create a " @@ -2427,30 +2440,30 @@ msgid "" "decorated function. This is best explained with an example::" msgstr "" -#: ../../library/functions.rst:1521 +#: ../../library/functions.rst:1528 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " "case.)" msgstr "" -#: ../../library/functions.rst:1525 +#: ../../library/functions.rst:1532 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1528 +#: ../../library/functions.rst:1535 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1537 +#: ../../library/functions.rst:1544 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1543 +#: ../../library/functions.rst:1550 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -2463,7 +2476,7 @@ msgid "" "`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1556 +#: ../../library/functions.rst:1563 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" @@ -2471,14 +2484,14 @@ msgid "" "starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1564 +#: ../../library/functions.rst:1571 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " "input." msgstr "" -#: ../../library/functions.rst:1568 +#: ../../library/functions.rst:1575 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -2489,13 +2502,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1577 +#: ../../library/functions.rst:1584 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1582 +#: ../../library/functions.rst:1589 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -2504,21 +2517,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1594 +#: ../../library/functions.rst:1601 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" "set` for documentation about this class." msgstr "" -#: ../../library/functions.rst:1598 +#: ../../library/functions.rst:1605 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " "module." msgstr "" -#: ../../library/functions.rst:1605 +#: ../../library/functions.rst:1612 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string, and an arbitrary value. The string may name an existing attribute " @@ -2527,7 +2540,7 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1611 +#: ../../library/functions.rst:1618 msgid "" "*name* need not be a Python identifier as defined in :ref:`identifiers` " "unless the object chooses to enforce that, for example in a custom :meth:" @@ -2536,14 +2549,14 @@ msgid "" "notation, but is accessible through :func:`getattr` etc.." msgstr "" -#: ../../library/functions.rst:1619 +#: ../../library/functions.rst:1626 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " "with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" -#: ../../library/functions.rst:1628 +#: ../../library/functions.rst:1635 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -2556,35 +2569,35 @@ msgid "" "func:`itertools.islice` for an alternate version that returns an iterator." msgstr "" -#: ../../library/functions.rst:1641 +#: ../../library/functions.rst:1648 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1643 +#: ../../library/functions.rst:1650 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1645 +#: ../../library/functions.rst:1652 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -#: ../../library/functions.rst:1649 +#: ../../library/functions.rst:1656 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/functions.rst:1652 +#: ../../library/functions.rst:1659 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1655 +#: ../../library/functions.rst:1662 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -2592,7 +2605,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1660 +#: ../../library/functions.rst:1667 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2604,22 +2617,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1669 +#: ../../library/functions.rst:1676 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1673 +#: ../../library/functions.rst:1680 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1675 +#: ../../library/functions.rst:1682 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1682 +#: ../../library/functions.rst:1689 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -2627,21 +2640,21 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1685 +#: ../../library/functions.rst:1692 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, they can be called as regular " "functions (such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1689 +#: ../../library/functions.rst:1696 msgid "" "Static methods in Python are similar to those found in Java or C++. Also, " "see :func:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" -#: ../../library/functions.rst:1693 +#: ../../library/functions.rst:1700 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -2650,36 +2663,36 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1705 +#: ../../library/functions.rst:1712 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1707 +#: ../../library/functions.rst:1714 msgid "" "Static methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``), have a " "new ``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" -#: ../../library/functions.rst:1722 +#: ../../library/functions.rst:1729 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1724 +#: ../../library/functions.rst:1731 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1730 +#: ../../library/functions.rst:1737 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -#: ../../library/functions.rst:1734 +#: ../../library/functions.rst:1741 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." @@ -2688,31 +2701,31 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1740 +#: ../../library/functions.rst:1747 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1746 +#: ../../library/functions.rst:1753 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " "been overridden in a class." msgstr "" -#: ../../library/functions.rst:1750 +#: ../../library/functions.rst:1757 msgid "" "The *object_or_type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." msgstr "" -#: ../../library/functions.rst:1754 +#: ../../library/functions.rst:1761 msgid "" "For example, if :attr:`~class.__mro__` of *object_or_type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" -#: ../../library/functions.rst:1758 +#: ../../library/functions.rst:1765 msgid "" "The :attr:`~class.__mro__` attribute of the *object_or_type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2720,7 +2733,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1763 +#: ../../library/functions.rst:1770 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -2728,7 +2741,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1768 +#: ../../library/functions.rst:1775 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -2736,7 +2749,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1773 +#: ../../library/functions.rst:1780 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -2749,18 +2762,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1783 +#: ../../library/functions.rst:1790 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1790 +#: ../../library/functions.rst:1797 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " "` in a parent or sibling class." msgstr "" -#: ../../library/functions.rst:1794 +#: ../../library/functions.rst:1801 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2770,7 +2783,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1801 +#: ../../library/functions.rst:1808 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -2780,33 +2793,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1808 +#: ../../library/functions.rst:1815 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1818 +#: ../../library/functions.rst:1825 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1827 +#: ../../library/functions.rst:1834 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." "__class__ `." msgstr "" -#: ../../library/functions.rst:1831 +#: ../../library/functions.rst:1838 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." msgstr "" -#: ../../library/functions.rst:1835 +#: ../../library/functions.rst:1842 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -2819,11 +2832,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1850 +#: ../../library/functions.rst:1857 msgid "See also :ref:`bltin-type-objects`." msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:1852 +#: ../../library/functions.rst:1859 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2831,23 +2844,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1857 +#: ../../library/functions.rst:1864 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:1859 +#: ../../library/functions.rst:1866 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../library/functions.rst:1866 +#: ../../library/functions.rst:1873 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/functions.rst:1869 +#: ../../library/functions.rst:1876 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2855,54 +2868,54 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1874 +#: ../../library/functions.rst:1881 msgid "" "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " "locals dictionary is only useful for reads since updates to the locals " "dictionary are ignored." msgstr "" -#: ../../library/functions.rst:1878 +#: ../../library/functions.rst:1885 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " "defines the :attr:`~object.__slots__` attribute)." msgstr "" -#: ../../library/functions.rst:1884 +#: ../../library/functions.rst:1891 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:1887 +#: ../../library/functions.rst:1894 msgid "Example::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:1896 +#: ../../library/functions.rst:1903 msgid "" "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " "tuple contains the *i*-th element from each of the argument iterables." msgstr "" -#: ../../library/functions.rst:1899 +#: ../../library/functions.rst:1906 msgid "" "Another way to think of :func:`zip` is that it turns rows into columns, and " "columns into rows. This is similar to `transposing a matrix `_." msgstr "" -#: ../../library/functions.rst:1903 +#: ../../library/functions.rst:1910 msgid "" ":func:`zip` is lazy: The elements won't be processed until the iterable is " "iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" "`list`." msgstr "" -#: ../../library/functions.rst:1907 +#: ../../library/functions.rst:1914 msgid "" "One thing to consider is that the iterables passed to :func:`zip` could have " "different lengths; sometimes by design, and sometimes because of a bug in " @@ -2910,51 +2923,51 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:1912 +#: ../../library/functions.rst:1919 msgid "" "By default, :func:`zip` stops when the shortest iterable is exhausted. It " "will ignore the remaining items in the longer iterables, cutting off the " "result to the length of the shortest iterable::" msgstr "" -#: ../../library/functions.rst:1919 +#: ../../library/functions.rst:1926 msgid "" ":func:`zip` is often used in cases where the iterables are assumed to be of " "equal length. In such cases, it's recommended to use the ``strict=True`` " "option. Its output is the same as regular :func:`zip`::" msgstr "" -#: ../../library/functions.rst:1926 +#: ../../library/functions.rst:1933 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -#: ../../library/functions.rst:1944 +#: ../../library/functions.rst:1951 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " "bug in another part of the program." msgstr "" -#: ../../library/functions.rst:1948 +#: ../../library/functions.rst:1955 msgid "" "Shorter iterables can be padded with a constant value to make all the " "iterables have the same length. This is done by :func:`itertools." "zip_longest`." msgstr "" -#: ../../library/functions.rst:1952 +#: ../../library/functions.rst:1959 msgid "" "Edge cases: With a single iterable argument, :func:`zip` returns an iterator " "of 1-tuples. With no arguments, it returns an empty iterator." msgstr "" -#: ../../library/functions.rst:1955 +#: ../../library/functions.rst:1962 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:1957 +#: ../../library/functions.rst:1964 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -2963,23 +2976,23 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1963 +#: ../../library/functions.rst:1970 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1974 +#: ../../library/functions.rst:1981 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:1986 +#: ../../library/functions.rst:1993 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1989 +#: ../../library/functions.rst:1996 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -2991,7 +3004,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1998 +#: ../../library/functions.rst:2005 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3001,7 +3014,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2005 +#: ../../library/functions.rst:2012 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3010,7 +3023,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:2011 +#: ../../library/functions.rst:2018 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -3018,58 +3031,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:2016 +#: ../../library/functions.rst:2023 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:2021 +#: ../../library/functions.rst:2028 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:2025 +#: ../../library/functions.rst:2032 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2028 +#: ../../library/functions.rst:2035 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:2035 +#: ../../library/functions.rst:2042 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " "respective names." msgstr "" -#: ../../library/functions.rst:2039 +#: ../../library/functions.rst:2046 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2042 +#: ../../library/functions.rst:2049 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:2046 +#: ../../library/functions.rst:2053 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -#: ../../library/functions.rst:2051 +#: ../../library/functions.rst:2058 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2052 +#: ../../library/functions.rst:2059 msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " @@ -3082,113 +3095,113 @@ msgstr "" msgid "Boolean" msgstr "" -#: ../../library/functions.rst:152 ../../library/functions.rst:1825 +#: ../../library/functions.rst:152 ../../library/functions.rst:1832 msgid "type" msgstr "" -#: ../../library/functions.rst:564 +#: ../../library/functions.rst:571 #, fuzzy msgid "built-in function" msgstr "內建函式" -#: ../../library/functions.rst:564 +#: ../../library/functions.rst:571 msgid "exec" msgstr "" -#: ../../library/functions.rst:641 +#: ../../library/functions.rst:648 msgid "NaN" msgstr "" -#: ../../library/functions.rst:641 +#: ../../library/functions.rst:648 msgid "Infinity" msgstr "" -#: ../../library/functions.rst:706 +#: ../../library/functions.rst:713 msgid "__format__" msgstr "" -#: ../../library/functions.rst:706 ../../library/functions.rst:1714 +#: ../../library/functions.rst:713 ../../library/functions.rst:1721 msgid "string" msgstr "" -#: ../../library/functions.rst:706 +#: ../../library/functions.rst:713 #, fuzzy msgid "format() (built-in function)" msgstr "內建函式" -#: ../../library/functions.rst:1153 +#: ../../library/functions.rst:1160 msgid "file object" msgstr "" -#: ../../library/functions.rst:1153 ../../library/functions.rst:1274 +#: ../../library/functions.rst:1160 ../../library/functions.rst:1281 #, fuzzy msgid "open() built-in function" msgstr "內建函式" -#: ../../library/functions.rst:1181 +#: ../../library/functions.rst:1188 msgid "file" msgstr "" -#: ../../library/functions.rst:1181 +#: ../../library/functions.rst:1188 msgid "modes" msgstr "" -#: ../../library/functions.rst:1274 +#: ../../library/functions.rst:1281 msgid "universal newlines" msgstr "" -#: ../../library/functions.rst:1335 +#: ../../library/functions.rst:1342 msgid "line-buffered I/O" msgstr "" -#: ../../library/functions.rst:1335 +#: ../../library/functions.rst:1342 msgid "unbuffered I/O" msgstr "" -#: ../../library/functions.rst:1335 +#: ../../library/functions.rst:1342 msgid "buffer size, I/O" msgstr "" -#: ../../library/functions.rst:1335 +#: ../../library/functions.rst:1342 msgid "I/O control" msgstr "" -#: ../../library/functions.rst:1335 +#: ../../library/functions.rst:1342 msgid "buffering" msgstr "" -#: ../../library/functions.rst:1335 +#: ../../library/functions.rst:1342 #, fuzzy msgid "text mode" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1335 ../../library/functions.rst:1980 +#: ../../library/functions.rst:1342 ../../library/functions.rst:1987 msgid "module" msgstr "" -#: ../../library/functions.rst:1335 +#: ../../library/functions.rst:1342 msgid "sys" msgstr "" -#: ../../library/functions.rst:1714 +#: ../../library/functions.rst:1721 #, fuzzy msgid "str() (built-in function)" msgstr "內建函式" -#: ../../library/functions.rst:1825 +#: ../../library/functions.rst:1832 #, fuzzy msgid "object" msgstr ":func:`object`" -#: ../../library/functions.rst:1980 +#: ../../library/functions.rst:1987 msgid "statement" msgstr "" -#: ../../library/functions.rst:1980 +#: ../../library/functions.rst:1987 msgid "import" msgstr "" -#: ../../library/functions.rst:1980 +#: ../../library/functions.rst:1987 msgid "builtins" msgstr "" From 29775ccc71af171387fe6d8228b0dd237a492b6c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 15 May 2023 00:33:01 +0000 Subject: [PATCH 086/130] sync with cpython 1afc0a95 --- library/random.po | 87 +++---- library/typing.po | 574 +++++++++++++++++++++++----------------------- 2 files changed, 334 insertions(+), 327 deletions(-) diff --git a/library/random.po b/library/random.po index c8295612e6..eda5bbb325 100644 --- a/library/random.po +++ b/library/random.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-17 00:32+0000\n" +"POT-Creation-Date: 2023-05-15 00:31+0000\n" "PO-Revision-Date: 2023-01-23 22:47+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -531,29 +531,29 @@ msgstr "" #: ../../library/random.rst:313 msgid "" -"Gamma distribution. (*Not* the gamma function!) Conditions on the " -"parameters are ``alpha > 0`` and ``beta > 0``." +"Gamma distribution. (*Not* the gamma function!) The shape and scale " +"parameters, *alpha* and *beta*, must have positive values. (Calling " +"conventions vary and some sources define 'beta' as the inverse of the scale)." msgstr "" -"Gamma(伽瑪)分佈。(*不是* Gamma 函式!)參數的條件為 ``alpha > 0`` 和 " -"``beta > 0``。" -#: ../../library/random.rst:316 +#: ../../library/random.rst:318 msgid "The probability distribution function is::" msgstr "" "Probability distribution function(機率密度函式)是:\n" "\n" "::" -#: ../../library/random.rst:325 +#: ../../library/random.rst:327 +#, fuzzy msgid "" -"Normal distribution, also called the Gaussian distribution. *mu* is the " +"Normal distribution, also called the Gaussian distribution. *mu* is the " "mean, and *sigma* is the standard deviation. This is slightly faster than " "the :func:`normalvariate` function defined below." msgstr "" "常態分佈,也稱為高斯分佈。*mu* 是平均數,*sigma* 是標準差。這比下面定義的 :" "func:`normalvariate` 函式快一點。" -#: ../../library/random.rst:329 +#: ../../library/random.rst:332 msgid "" "Multithreading note: When two threads call this function simultaneously, it " "is possible that they will receive the same return value. This can be " @@ -565,11 +565,11 @@ msgstr "" "可以透過三種方式避免。1)讓每個執行緒使用隨機數產生器的不同實例。2)在所有呼" "叫周圍加鎖。3)使用較慢但執行緒安全的 :func:`normalvariate` 函式代替。" -#: ../../library/random.rst:336 ../../library/random.rst:352 +#: ../../library/random.rst:339 ../../library/random.rst:355 msgid "*mu* and *sigma* now have default arguments." msgstr "" -#: ../../library/random.rst:342 +#: ../../library/random.rst:345 msgid "" "Log normal distribution. If you take the natural logarithm of this " "distribution, you'll get a normal distribution with mean *mu* and standard " @@ -579,13 +579,13 @@ msgstr "" "對數常態分佈。如果你取此分佈的自然對數,你將獲得一個具有平均數 *mu* 和標準差 " "*sigma* 的常態分佈。*mu* 可以為任何值,並且 *sigma* 必須大於零。" -#: ../../library/random.rst:350 +#: ../../library/random.rst:353 msgid "" "Normal distribution. *mu* is the mean, and *sigma* is the standard " "deviation." msgstr "常態分佈。*mu* 是平均數,*sigma* 是標準差。" -#: ../../library/random.rst:358 +#: ../../library/random.rst:361 msgid "" "*mu* is the mean angle, expressed in radians between 0 and 2\\*\\ *pi*, and " "*kappa* is the concentration parameter, which must be greater than or equal " @@ -596,28 +596,28 @@ msgstr "" "大於或等於零。如果 *kappa* 等於零,則此分佈在 0 到 2\\*\\ *pi* 的範圍內將減小" "為均勻的隨機角度。" -#: ../../library/random.rst:366 +#: ../../library/random.rst:369 msgid "Pareto distribution. *alpha* is the shape parameter." msgstr "Pareto distribution(柏拉圖分佈)。*alpha* 是形狀參數。" -#: ../../library/random.rst:371 +#: ../../library/random.rst:374 msgid "" "Weibull distribution. *alpha* is the scale parameter and *beta* is the " "shape parameter." msgstr "" "Weibull distribution(韋伯分佈)。*alpha* 是比例參數,*beta* 是形狀參數。" -#: ../../library/random.rst:376 +#: ../../library/random.rst:379 msgid "Alternative Generator" msgstr "替代產生器" -#: ../../library/random.rst:380 +#: ../../library/random.rst:383 msgid "" "Class that implements the default pseudo-random number generator used by " "the :mod:`random` module." msgstr "實現 :mod:`random` 模組使用的預設偽隨機數產生器的 class。" -#: ../../library/random.rst:383 +#: ../../library/random.rst:386 msgid "" "In the future, the *seed* must be one of the following types: :class:" "`NoneType`, :class:`int`, :class:`float`, :class:`str`, :class:`bytes`, or :" @@ -626,7 +626,7 @@ msgstr "" "將來,*seed* 必須是以下類型之一:\\ :class:`NoneType`、\\ :class:`int`、\\ :" "class:`float`、\\ :class:`str`、\\ :class:`bytes`、\\ :class:`bytearray`。" -#: ../../library/random.rst:390 +#: ../../library/random.rst:393 msgid "" "Class that uses the :func:`os.urandom` function for generating random " "numbers from sources provided by the operating system. Not available on all " @@ -640,11 +640,11 @@ msgstr "" "有效果且被忽略。如果呼叫 :meth:`getstate` 和 :meth:`setstate` 方法會引發 :" "exc:`NotImplementedError`。" -#: ../../library/random.rst:399 +#: ../../library/random.rst:402 msgid "Notes on Reproducibility" msgstr "關於 Reproducibility(復現性)的注意事項" -#: ../../library/random.rst:401 +#: ../../library/random.rst:404 msgid "" "Sometimes it is useful to be able to reproduce the sequences given by a " "pseudo-random number generator. By re-using a seed value, the same sequence " @@ -654,7 +654,7 @@ msgstr "" "有時,能夠重現偽隨機數產生器給出的序列很有用。只要多執行緒未運行,透過重複使" "用種子值,同一序列就應該可以被復現。" -#: ../../library/random.rst:405 +#: ../../library/random.rst:408 msgid "" "Most of the random module's algorithms and seeding functions are subject to " "change across Python versions, but two aspects are guaranteed not to change:" @@ -662,13 +662,13 @@ msgstr "" "大多數隨機 module 的演算法和 seed 設定函式在 Python 版本中可能會發生變化,但" "可以保證兩個方面不會改變:" -#: ../../library/random.rst:408 +#: ../../library/random.rst:411 msgid "" "If a new seeding method is added, then a backward compatible seeder will be " "offered." msgstr "如果增加了新的 seed 設定函式,則將提供向後相容的播種器 (seeder)。" -#: ../../library/random.rst:411 +#: ../../library/random.rst:414 msgid "" "The generator's :meth:`~Random.random` method will continue to produce the " "same sequence when the compatible seeder is given the same seed." @@ -676,25 +676,25 @@ msgstr "" "當相容的播種器被賦予相同的種子時,產生器的 :meth:`~Random.random` 方法將持續" "產生相同的序列。" -#: ../../library/random.rst:417 +#: ../../library/random.rst:420 msgid "Examples" msgstr "範例" -#: ../../library/random.rst:419 +#: ../../library/random.rst:422 msgid "Basic examples::" msgstr "" "基礎範例:\n" "\n" "::" -#: ../../library/random.rst:447 +#: ../../library/random.rst:450 msgid "Simulations::" msgstr "" "模擬:\n" "\n" "::" -#: ../../library/random.rst:475 +#: ../../library/random.rst:478 msgid "" "Example of `statistical bootstrapping `_ using resampling with replacement to estimate " @@ -706,7 +706,7 @@ msgstr "" "\n" "::" -#: ../../library/random.rst:488 +#: ../../library/random.rst:491 msgid "" "Example of a `resampling permutation test `_ to determine the statistical " @@ -720,7 +720,7 @@ msgstr "" "\n" "::" -#: ../../library/random.rst:515 +#: ../../library/random.rst:518 msgid "" "Simulation of arrival times and service deliveries for a multiserver queue::" msgstr "" @@ -728,7 +728,7 @@ msgstr "" "\n" "::" -#: ../../library/random.rst:544 +#: ../../library/random.rst:547 msgid "" "`Statistics for Hackers `_ a " "video tutorial by `Jake Vanderplas `_ 製作的教" "學影片,僅使用幾個基本概念(包括模擬、取樣、洗牌、交叉驗證)進行統計分析。" -#: ../../library/random.rst:550 +#: ../../library/random.rst:553 msgid "" "`Economics Simulation `_ a simulation of a marketplace by `Peter Norvig `_ a tutorial by `Peter " @@ -765,17 +765,17 @@ msgstr "" "html>`_ 的教學課程,涵蓋了機率理論的基礎知識與如何模擬以及使用 Python 執行數" "據分析。" -#: ../../library/random.rst:565 +#: ../../library/random.rst:568 msgid "Recipes" msgstr "使用方案" -#: ../../library/random.rst:567 +#: ../../library/random.rst:570 msgid "" "These recipes show how to efficiently make random selections from the " "combinatoric iterators in the :mod:`itertools` module:" msgstr "" -#: ../../library/random.rst:599 +#: ../../library/random.rst:602 msgid "" "The default :func:`.random` returns multiples of 2⁻⁵³ in the range *0.0 ≤ x " "< 1.0*. All such numbers are evenly spaced and are exactly representable as " @@ -787,7 +787,7 @@ msgstr "" "均勻分佈的,並且可以完全表示為 Python float。但是,該間隔中的許多其他可表示" "的 float 不是可能的選擇。 例如 ``0.05954861408025609`` 不是 2⁻⁵³ 的整數倍。" -#: ../../library/random.rst:605 +#: ../../library/random.rst:608 msgid "" "The following recipe takes a different approach. All floats in the interval " "are possible selections. The mantissa comes from a uniform distribution of " @@ -799,7 +799,7 @@ msgstr "" "數 < 2⁵³* 範圍內的整數均勻分佈。指數來自幾何分佈,其中小於 *-53* 的指數的出現" "頻率是下一個較大指數的一半。" -#: ../../library/random.rst:627 +#: ../../library/random.rst:630 msgid "" "All :ref:`real valued distributions ` in the " "class will use the new method::" @@ -809,7 +809,7 @@ msgstr "" "\n" "::" -#: ../../library/random.rst:636 +#: ../../library/random.rst:639 msgid "" "The recipe is conceptually equivalent to an algorithm that chooses from all " "the multiples of 2⁻¹⁰⁷⁴ in the range *0.0 ≤ x < 1.0*. All such numbers are " @@ -822,7 +822,7 @@ msgstr "" "示的 Python float。(2⁻¹⁰⁷⁴ 是最小為正的非正規化 float,等於 ``math." "ulp(0.0)``)" -#: ../../library/random.rst:645 +#: ../../library/random.rst:648 msgid "" "`Generating Pseudo-random Floating-Point Values `_ a paper by Allen B. Downey describing " @@ -833,6 +833,13 @@ msgstr "" "pdf>`_ Allen B. Downey 的一篇論文描述了產生比通常由 :func:`.random` 產生的 " "float 更 fine-grained(細粒的)的方法。" +#~ msgid "" +#~ "Gamma distribution. (*Not* the gamma function!) Conditions on the " +#~ "parameters are ``alpha > 0`` and ``beta > 0``." +#~ msgstr "" +#~ "Gamma(伽瑪)分佈。(*不是* Gamma 函式!)參數的條件為 ``alpha > 0`` 和 " +#~ "``beta > 0``。" + #~ msgid "" #~ "The optional argument *random* is a 0-argument function returning a " #~ "random float in [0.0, 1.0); by default, this is the function :func:`." diff --git a/library/typing.po b/library/typing.po index 9411352942..da0a362d4a 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-11 00:29+0000\n" +"POT-Creation-Date: 2023-05-15 00:31+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,8 +37,8 @@ msgstr "" msgid "" "This module provides runtime support for type hints. The most fundamental " "support consists of the types :data:`Any`, :data:`Union`, :data:`Callable`, :" -"class:`TypeVar`, and :class:`Generic`. For a full specification, please see :" -"pep:`484`. For a simplified introduction to type hints, see :pep:`483`." +"class:`TypeVar`, and :class:`Generic`. For a specification, please see :pep:" +"`484`. For a simplified introduction to type hints, see :pep:`483`." msgstr "" #: ../../library/typing.rst:26 @@ -351,7 +351,7 @@ msgid "" msgstr "" #: ../../library/typing.rst:229 ../../library/typing.rst:1171 -#: ../../library/typing.rst:2832 +#: ../../library/typing.rst:2834 msgid "For example::" msgstr "" "舉例來說:\n" @@ -627,9 +627,10 @@ msgstr "" #: ../../library/typing.rst:589 msgid "" -"The deprecated types will be removed from the :mod:`typing` module in the " -"first Python version released 5 years after the release of Python 3.9.0. See " -"details in :pep:`585`—*Type Hinting Generics In Standard Collections*." +"The deprecated types will be removed from the :mod:`typing` module no sooner " +"than the first Python version released 5 years after the release of Python " +"3.9.0. See details in :pep:`585`—*Type Hinting Generics In Standard " +"Collections*." msgstr "" #: ../../library/typing.rst:595 @@ -671,7 +672,7 @@ msgid "" "``LiteralString``-typed objects is also acceptable as a ``LiteralString``." msgstr "" -#: ../../library/typing.rst:622 ../../library/typing.rst:2461 +#: ../../library/typing.rst:622 ../../library/typing.rst:2463 msgid "Example::" msgstr "" "舉例來說:\n" @@ -937,7 +938,7 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:919 ../../library/typing.rst:1507 +#: ../../library/typing.rst:919 ../../library/typing.rst:1509 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." @@ -1038,7 +1039,7 @@ msgid "" "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1038 ../../library/typing.rst:2702 +#: ../../library/typing.rst:1038 ../../library/typing.rst:2704 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1244,8 +1245,8 @@ msgstr "" msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1239 ../../library/typing.rst:1436 -#: ../../library/typing.rst:1629 +#: ../../library/typing.rst:1239 ../../library/typing.rst:1438 +#: ../../library/typing.rst:1631 msgid "Usage::" msgstr "" "用法:\n" @@ -1279,32 +1280,32 @@ msgid "" "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1289 +#: ../../library/typing.rst:1291 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1300 +#: ../../library/typing.rst:1302 msgid "" "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, :" "func:`isinstance` and :func:`issubclass` should not be used with types." msgstr "" -#: ../../library/typing.rst:1303 +#: ../../library/typing.rst:1305 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " "details. By default, type variables are invariant." msgstr "" -#: ../../library/typing.rst:1309 +#: ../../library/typing.rst:1311 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1312 +#: ../../library/typing.rst:1314 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1312,7 +1313,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1340 +#: ../../library/typing.rst:1342 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1322,36 +1323,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1348 +#: ../../library/typing.rst:1350 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1355 +#: ../../library/typing.rst:1357 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1364 +#: ../../library/typing.rst:1366 msgid "" "Type variable tuples can be happily combined with normal type variables::" msgstr "" -#: ../../library/typing.rst:1377 +#: ../../library/typing.rst:1379 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1384 +#: ../../library/typing.rst:1386 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1394 +#: ../../library/typing.rst:1396 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1360,11 +1361,11 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1401 +#: ../../library/typing.rst:1403 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1407 +#: ../../library/typing.rst:1409 msgid "" "A typing operator that conceptually marks an object as having been unpacked. " "For example, using the unpack operator ``*`` on a :class:`type variable " @@ -1372,20 +1373,20 @@ msgid "" "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1417 +#: ../../library/typing.rst:1419 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context of " "types. You might see ``Unpack`` being used explicitly in older versions of " "Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1433 +#: ../../library/typing.rst:1435 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1440 +#: ../../library/typing.rst:1442 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1395,7 +1396,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1447 +#: ../../library/typing.rst:1449 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1403,27 +1404,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1471 +#: ../../library/typing.rst:1473 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1475 +#: ../../library/typing.rst:1477 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1477 +#: ../../library/typing.rst:1479 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1484 +#: ../../library/typing.rst:1486 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1436,7 +1437,7 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1494 +#: ../../library/typing.rst:1496 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1445,17 +1446,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1503 +#: ../../library/typing.rst:1505 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1509 +#: ../../library/typing.rst:1511 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1514 +#: ../../library/typing.rst:1516 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1463,36 +1464,36 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1519 +#: ../../library/typing.rst:1521 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``::" msgstr "" -#: ../../library/typing.rst:1531 +#: ../../library/typing.rst:1533 msgid "" -"``AnyStr`` is a :class:`constrained type variable ` defined as " -"``AnyStr = TypeVar('AnyStr', str, bytes)``." +"``AnyStr`` is a :ref:`constrained type variable ` defined as ``AnyStr = TypeVar('AnyStr', str, bytes)``." msgstr "" -#: ../../library/typing.rst:1534 +#: ../../library/typing.rst:1536 msgid "" "It is meant to be used for functions that may accept any kind of string " "without allowing different kinds of strings to mix. For example::" msgstr "" -#: ../../library/typing.rst:1546 +#: ../../library/typing.rst:1548 msgid "" "Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1552 +#: ../../library/typing.rst:1554 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1564 +#: ../../library/typing.rst:1566 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1500,15 +1501,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1569 +#: ../../library/typing.rst:1571 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1579 +#: ../../library/typing.rst:1581 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1583 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1517,7 +1518,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1601 +#: ../../library/typing.rst:1603 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1528,7 +1529,7 @@ msgid "" "SSLObject`." msgstr "" -#: ../../library/typing.rst:1612 +#: ../../library/typing.rst:1614 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1536,38 +1537,38 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1621 +#: ../../library/typing.rst:1623 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1623 +#: ../../library/typing.rst:1625 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1627 +#: ../../library/typing.rst:1629 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1635 +#: ../../library/typing.rst:1637 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1639 +#: ../../library/typing.rst:1641 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1648 +#: ../../library/typing.rst:1650 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1650 +#: ../../library/typing.rst:1652 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1576,60 +1577,60 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1656 +#: ../../library/typing.rst:1658 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1666 +#: ../../library/typing.rst:1668 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1674 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1676 +#: ../../library/typing.rst:1678 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1679 +#: ../../library/typing.rst:1681 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1682 +#: ../../library/typing.rst:1684 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1686 +#: ../../library/typing.rst:1688 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1690 +#: ../../library/typing.rst:1692 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1695 +#: ../../library/typing.rst:1697 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1705 +#: ../../library/typing.rst:1707 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1710 +#: ../../library/typing.rst:1712 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1713 +#: ../../library/typing.rst:1715 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1637,53 +1638,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1729 +#: ../../library/typing.rst:1731 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1733 +#: ../../library/typing.rst:1735 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1737 +#: ../../library/typing.rst:1739 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1744 +#: ../../library/typing.rst:1746 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1745 +#: ../../library/typing.rst:1747 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1757 +#: ../../library/typing.rst:1759 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1768 +#: ../../library/typing.rst:1770 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1771 +#: ../../library/typing.rst:1773 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1781 +#: ../../library/typing.rst:1783 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1691,61 +1692,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1786 +#: ../../library/typing.rst:1788 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:1803 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1808 +#: ../../library/typing.rst:1810 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1816 +#: ../../library/typing.rst:1818 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:1834 +#: ../../library/typing.rst:1836 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:1840 +#: ../../library/typing.rst:1842 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:1846 +#: ../../library/typing.rst:1848 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example::" msgstr "" -#: ../../library/typing.rst:1866 +#: ../../library/typing.rst:1868 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:1869 +#: ../../library/typing.rst:1871 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:1872 +#: ../../library/typing.rst:1874 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1754,162 +1755,162 @@ msgid "" "``TypedDict`` with a different value for ``total``::" msgstr "" -#: ../../library/typing.rst:1893 +#: ../../library/typing.rst:1895 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1897 +#: ../../library/typing.rst:1899 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:1901 +#: ../../library/typing.rst:1903 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:1905 +#: ../../library/typing.rst:1907 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1908 +#: ../../library/typing.rst:1910 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1912 +#: ../../library/typing.rst:1914 msgid "" "A generic version of :class:`dict`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Mapping`." msgstr "" -#: ../../library/typing.rst:1916 +#: ../../library/typing.rst:1918 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1921 +#: ../../library/typing.rst:1923 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1927 +#: ../../library/typing.rst:1929 msgid "" "Generic version of :class:`list`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:1932 +#: ../../library/typing.rst:1934 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1942 +#: ../../library/typing.rst:1944 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1948 +#: ../../library/typing.rst:1950 msgid "" "A generic version of :class:`builtins.set `. Useful for annotating " "return types. To annotate arguments it is preferred to use an abstract " "collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:1952 +#: ../../library/typing.rst:1954 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1958 +#: ../../library/typing.rst:1960 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1960 +#: ../../library/typing.rst:1962 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1965 +#: ../../library/typing.rst:1967 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1968 +#: ../../library/typing.rst:1970 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1972 +#: ../../library/typing.rst:1974 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1976 +#: ../../library/typing.rst:1978 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1982 +#: ../../library/typing.rst:1984 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:1986 +#: ../../library/typing.rst:1988 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1992 +#: ../../library/typing.rst:1994 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:1997 +#: ../../library/typing.rst:1999 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2003 +#: ../../library/typing.rst:2005 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2008 +#: ../../library/typing.rst:2010 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2014 +#: ../../library/typing.rst:2016 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2019 +#: ../../library/typing.rst:2021 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2024 +#: ../../library/typing.rst:2026 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2030 +#: ../../library/typing.rst:2032 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2037 +#: ../../library/typing.rst:2039 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2042 +#: ../../library/typing.rst:2044 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1917,440 +1918,439 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2052 +#: ../../library/typing.rst:2054 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2053 +#: ../../library/typing.rst:2055 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2059 +#: ../../library/typing.rst:2061 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:2063 +#: ../../library/typing.rst:2065 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2071 +#: ../../library/typing.rst:2073 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " -"planned, but users are encouraged to use :class:`str` instead of ``Text`` " -"wherever possible." +"planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2078 +#: ../../library/typing.rst:2080 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2081 +#: ../../library/typing.rst:2083 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2085 +#: ../../library/typing.rst:2087 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2087 +#: ../../library/typing.rst:2089 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2093 +#: ../../library/typing.rst:2095 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2097 +#: ../../library/typing.rst:2099 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2101 +#: ../../library/typing.rst:2103 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:2105 +#: ../../library/typing.rst:2107 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2111 +#: ../../library/typing.rst:2113 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2113 +#: ../../library/typing.rst:2115 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2119 +#: ../../library/typing.rst:2121 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2121 +#: ../../library/typing.rst:2123 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2127 +#: ../../library/typing.rst:2129 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2129 +#: ../../library/typing.rst:2131 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2135 +#: ../../library/typing.rst:2137 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:2141 +#: ../../library/typing.rst:2143 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2147 +#: ../../library/typing.rst:2149 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2151 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2157 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2157 +#: ../../library/typing.rst:2159 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2164 +#: ../../library/typing.rst:2166 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2166 +#: ../../library/typing.rst:2168 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2173 +#: ../../library/typing.rst:2175 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2175 +#: ../../library/typing.rst:2177 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2181 +#: ../../library/typing.rst:2183 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2183 +#: ../../library/typing.rst:2185 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2189 +#: ../../library/typing.rst:2191 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2191 +#: ../../library/typing.rst:2193 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2196 +#: ../../library/typing.rst:2198 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2200 +#: ../../library/typing.rst:2202 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2202 +#: ../../library/typing.rst:2204 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2208 +#: ../../library/typing.rst:2210 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2210 +#: ../../library/typing.rst:2212 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2216 +#: ../../library/typing.rst:2218 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2225 +#: ../../library/typing.rst:2227 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2229 +#: ../../library/typing.rst:2231 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2237 +#: ../../library/typing.rst:2239 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2245 +#: ../../library/typing.rst:2247 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2251 +#: ../../library/typing.rst:2253 msgid "An alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2255 +#: ../../library/typing.rst:2257 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2257 +#: ../../library/typing.rst:2259 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2263 +#: ../../library/typing.rst:2265 msgid "An alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2266 +#: ../../library/typing.rst:2268 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2270 +#: ../../library/typing.rst:2272 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:2282 +#: ../../library/typing.rst:2284 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2288 +#: ../../library/typing.rst:2290 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2297 +#: ../../library/typing.rst:2299 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2301 +#: ../../library/typing.rst:2303 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2309 +#: ../../library/typing.rst:2311 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2319 +#: ../../library/typing.rst:2321 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2326 +#: ../../library/typing.rst:2328 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2330 +#: ../../library/typing.rst:2332 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2336 +#: ../../library/typing.rst:2338 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2340 +#: ../../library/typing.rst:2342 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2346 +#: ../../library/typing.rst:2348 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2350 +#: ../../library/typing.rst:2352 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2356 +#: ../../library/typing.rst:2358 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2360 +#: ../../library/typing.rst:2362 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2365 +#: ../../library/typing.rst:2367 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2372 +#: ../../library/typing.rst:2374 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2377 +#: ../../library/typing.rst:2379 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2383 +#: ../../library/typing.rst:2385 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2385 +#: ../../library/typing.rst:2387 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2389 +#: ../../library/typing.rst:2391 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2394 +#: ../../library/typing.rst:2396 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2398 +#: ../../library/typing.rst:2400 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2402 +#: ../../library/typing.rst:2404 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2406 +#: ../../library/typing.rst:2408 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2412 +#: ../../library/typing.rst:2414 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2416 +#: ../../library/typing.rst:2418 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2420 +#: ../../library/typing.rst:2422 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2424 +#: ../../library/typing.rst:2426 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2426 +#: ../../library/typing.rst:2428 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2433 +#: ../../library/typing.rst:2435 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2435 +#: ../../library/typing.rst:2437 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2438 +#: ../../library/typing.rst:2440 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2445 +#: ../../library/typing.rst:2447 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2459 +#: ../../library/typing.rst:2461 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2472 +#: ../../library/typing.rst:2474 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " @@ -2363,53 +2363,53 @@ msgid "" "bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2484 +#: ../../library/typing.rst:2486 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2487 +#: ../../library/typing.rst:2489 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2495 +#: ../../library/typing.rst:2497 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2497 +#: ../../library/typing.rst:2499 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2503 +#: ../../library/typing.rst:2505 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2506 +#: ../../library/typing.rst:2508 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2511 +#: ../../library/typing.rst:2513 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2516 +#: ../../library/typing.rst:2518 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2526 +#: ../../library/typing.rst:2528 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -2418,19 +2418,19 @@ msgid "" "`dataclasses.dataclass`-like behaviors." msgstr "" -#: ../../library/typing.rst:2532 +#: ../../library/typing.rst:2534 msgid "Example usage with a decorator function::" msgstr "" -#: ../../library/typing.rst:2546 +#: ../../library/typing.rst:2548 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2555 +#: ../../library/typing.rst:2557 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2566 +#: ../../library/typing.rst:2568 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*. *func* is the function object for the implementation of the " @@ -2576,25 +2576,25 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2668 +#: ../../library/typing.rst:2670 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2676 +#: ../../library/typing.rst:2678 msgid "" "Clear all registered overloads in the internal registry. This can be used to " "reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2684 +#: ../../library/typing.rst:2686 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2707 +#: ../../library/typing.rst:2709 msgid "" "The decorator will now set the ``__final__`` attribute to ``True`` on the " "decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2604,59 +2604,59 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2718 +#: ../../library/typing.rst:2720 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2720 +#: ../../library/typing.rst:2722 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods and classes defined in that class (but not to " "methods defined in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2724 +#: ../../library/typing.rst:2726 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2728 +#: ../../library/typing.rst:2730 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2730 +#: ../../library/typing.rst:2732 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2735 +#: ../../library/typing.rst:2737 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2737 +#: ../../library/typing.rst:2739 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2748 +#: ../../library/typing.rst:2750 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2752 +#: ../../library/typing.rst:2754 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2756 +#: ../../library/typing.rst:2758 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2759 +#: ../../library/typing.rst:2761 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2665,32 +2665,32 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2765 +#: ../../library/typing.rst:2767 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2780 +#: ../../library/typing.rst:2782 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2785 +#: ../../library/typing.rst:2787 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2788 +#: ../../library/typing.rst:2790 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2795 +#: ../../library/typing.rst:2797 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``. If ``X`` is a generic alias for a builtin or :" @@ -2700,7 +2700,7 @@ msgid "" "Examples::" msgstr "" -#: ../../library/typing.rst:2814 +#: ../../library/typing.rst:2816 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``. If ``X`` is a union or :" @@ -2710,11 +2710,11 @@ msgid "" "Examples::" msgstr "" -#: ../../library/typing.rst:2830 +#: ../../library/typing.rst:2832 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2845 +#: ../../library/typing.rst:2847 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2722,24 +2722,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2851 +#: ../../library/typing.rst:2853 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:2860 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:2864 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2871 +#: ../../library/typing.rst:2873 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2747,7 +2747,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2878 +#: ../../library/typing.rst:2880 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2755,11 +2755,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2887 +#: ../../library/typing.rst:2889 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2891 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2767,76 +2767,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2896 msgid "Feature" msgstr "" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2896 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2896 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2896 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:2896 +#: ../../library/typing.rst:2898 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:2896 +#: ../../library/typing.rst:2898 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:2896 +#: ../../library/typing.rst:2898 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:2896 +#: ../../library/typing.rst:2898 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:2899 +#: ../../library/typing.rst:2901 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:2899 ../../library/typing.rst:2902 +#: ../../library/typing.rst:2901 ../../library/typing.rst:2904 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:2899 ../../library/typing.rst:2904 +#: ../../library/typing.rst:2901 ../../library/typing.rst:2906 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:2899 +#: ../../library/typing.rst:2901 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:2902 +#: ../../library/typing.rst:2904 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2902 +#: ../../library/typing.rst:2904 msgid "3.14" msgstr "" -#: ../../library/typing.rst:2902 +#: ../../library/typing.rst:2904 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2906 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2906 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2906 msgid ":gh:`92332`" msgstr ":gh:`92332`" From ad06b14a44f6657d3e52732dc10b257a7bc9beb5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 16 May 2023 00:32:09 +0000 Subject: [PATCH 087/130] sync with cpython a712c5f4 --- library/atexit.po | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/library/atexit.po b/library/atexit.po index b671e9e96b..9a111f482d 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-05-16 00:30+0000\n" "PO-Revision-Date: 2016-01-31 07:13+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,11 +41,17 @@ msgstr "" #: ../../library/atexit.rst:23 msgid "" +"**Note:** The effect of registering or unregistering functions from within a " +"cleanup function is undefined." +msgstr "" + +#: ../../library/atexit.rst:26 +msgid "" "When used with C-API subinterpreters, registered functions are local to the " "interpreter they were registered in." msgstr "" -#: ../../library/atexit.rst:29 +#: ../../library/atexit.rst:32 msgid "" "Register *func* as a function to be executed at termination. Any optional " "arguments that are to be passed to *func* must be passed as arguments to :" @@ -53,7 +59,7 @@ msgid "" "more than once." msgstr "" -#: ../../library/atexit.rst:34 +#: ../../library/atexit.rst:37 msgid "" "At normal program termination (for instance, if :func:`sys.exit` is called " "or the main module's execution completes), all functions registered are " @@ -62,7 +68,7 @@ msgid "" "be cleaned up later." msgstr "" -#: ../../library/atexit.rst:40 +#: ../../library/atexit.rst:43 msgid "" "If an exception is raised during execution of the exit handlers, a traceback " "is printed (unless :exc:`SystemExit` is raised) and the exception " @@ -70,13 +76,13 @@ msgid "" "last exception to be raised is re-raised." msgstr "" -#: ../../library/atexit.rst:45 +#: ../../library/atexit.rst:48 msgid "" "This function returns *func*, which makes it possible to use it as a " "decorator." msgstr "" -#: ../../library/atexit.rst:51 +#: ../../library/atexit.rst:54 msgid "" "Remove *func* from the list of functions to be run at interpreter shutdown. :" "func:`unregister` silently does nothing if *func* was not previously " @@ -86,21 +92,21 @@ msgid "" "references do not need to have matching identities." msgstr "" -#: ../../library/atexit.rst:62 +#: ../../library/atexit.rst:65 msgid "Module :mod:`readline`" msgstr ":mod:`readline` 模組" -#: ../../library/atexit.rst:62 +#: ../../library/atexit.rst:65 msgid "" "Useful example of :mod:`atexit` to read and write :mod:`readline` history " "files." msgstr "" -#: ../../library/atexit.rst:69 +#: ../../library/atexit.rst:72 msgid ":mod:`atexit` Example" msgstr ":mod:`atexit` 範例" -#: ../../library/atexit.rst:71 +#: ../../library/atexit.rst:74 msgid "" "The following simple example demonstrates how a module can initialize a " "counter from a file when it is imported and save the counter's updated value " @@ -108,16 +114,16 @@ msgid "" "making an explicit call into this module at termination. ::" msgstr "" -#: ../../library/atexit.rst:94 +#: ../../library/atexit.rst:97 msgid "" "Positional and keyword arguments may also be passed to :func:`register` to " "be passed along to the registered function when it is called::" msgstr "" -#: ../../library/atexit.rst:106 +#: ../../library/atexit.rst:109 msgid "Usage as a :term:`decorator`::" msgstr "" -#: ../../library/atexit.rst:114 +#: ../../library/atexit.rst:117 msgid "This only works with functions that can be called without arguments." msgstr "" From 9a51f3704dc730dd463a0cb0ec9a09c8cc716831 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 17 May 2023 00:35:44 +0000 Subject: [PATCH 088/130] sync with cpython dece9c06 --- library/logging.config.po | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/library/logging.config.po b/library/logging.config.po index ebf183ceee..9b0c3ecd53 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-28 00:32+0000\n" +"POT-Creation-Date: 2023-05-17 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -160,32 +160,11 @@ msgstr "" #: ../../library/logging.config.rst:105 msgid "" -"If specified as ``False``, loggers which " -"exist when this call is made are left " -"enabled. The default is ``True`` because " -"this enables old behaviour in " -"a backward-compatible way. This behaviour is " -"to disable any existing non-root loggers " -"unless they or their ancestors are " -"explicitly named in the logging " -"configuration. :param encoding: The encoding used to open file when *fname* " -"is filename." -msgstr "" - -#: ../../library/logging.config.rst:112 -msgid "If specified as ``False``, loggers which" -msgstr "" - -#: ../../library/logging.config.rst:106 -msgid "" -"exist when this call is made are left enabled. The default is ``True`` " -"because this enables old behaviour in a backward-compatible way. This " -"behaviour is to disable any existing non-root loggers unless they or their " -"ancestors are explicitly named in the logging configuration." -msgstr "" - -#: ../../library/logging.config.rst:0 -msgid "param encoding" +"If specified as ``False``, loggers which exist when this call is made are " +"left enabled. The default is ``True`` because this enables old behaviour in " +"a backward-compatible way. This behaviour is to disable any existing non-" +"root loggers unless they or their ancestors are explicitly named in the " +"logging configuration." msgstr "" #: ../../library/logging.config.rst:114 From 5b1723c8a940f3abd9277e6b51dd2a7428d4a4a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 18 May 2023 00:32:48 +0000 Subject: [PATCH 089/130] sync with cpython a8fc8b7e --- library/urllib.parse.po | 351 +++++++++++++++++++++++----------------- 1 file changed, 205 insertions(+), 146 deletions(-) diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 5a597e613b..3710df73b1 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-05-18 00:30+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -101,74 +101,74 @@ msgid "" "accessed by index or as named attributes, which are:" msgstr "" -#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:293 -#: ../../library/urllib.parse.rst:397 +#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:297 +#: ../../library/urllib.parse.rst:410 msgid "Attribute" msgstr "屬性" -#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:293 -#: ../../library/urllib.parse.rst:397 +#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:297 +#: ../../library/urllib.parse.rst:410 msgid "Index" msgstr "" -#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:293 -#: ../../library/urllib.parse.rst:397 +#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:297 +#: ../../library/urllib.parse.rst:410 msgid "Value" msgstr "" -#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:293 -#: ../../library/urllib.parse.rst:397 +#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:297 +#: ../../library/urllib.parse.rst:410 msgid "Value if not present" msgstr "" -#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:295 +#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:299 msgid ":attr:`scheme`" msgstr ":attr:`scheme`" -#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:295 -#: ../../library/urllib.parse.rst:399 +#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:299 +#: ../../library/urllib.parse.rst:412 msgid "0" msgstr "0" -#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:295 +#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:299 msgid "URL scheme specifier" msgstr "" -#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:295 +#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:299 msgid "*scheme* parameter" msgstr "" -#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:297 +#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:301 msgid ":attr:`netloc`" msgstr ":attr:`netloc`" -#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:297 -#: ../../library/urllib.parse.rst:401 +#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:301 +#: ../../library/urllib.parse.rst:414 msgid "1" msgstr "1" -#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:297 +#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:301 msgid "Network location part" msgstr "" #: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:114 #: ../../library/urllib.parse.rst:116 ../../library/urllib.parse.rst:119 -#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:297 -#: ../../library/urllib.parse.rst:299 ../../library/urllib.parse.rst:301 -#: ../../library/urllib.parse.rst:303 ../../library/urllib.parse.rst:399 -#: ../../library/urllib.parse.rst:401 +#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:301 +#: ../../library/urllib.parse.rst:303 ../../library/urllib.parse.rst:305 +#: ../../library/urllib.parse.rst:307 ../../library/urllib.parse.rst:412 +#: ../../library/urllib.parse.rst:414 msgid "empty string" msgstr "" -#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:299 +#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:303 msgid ":attr:`path`" msgstr ":attr:`path`" -#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:299 +#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:303 msgid "2" msgstr "2" -#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:299 +#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:303 msgid "Hierarchical path" msgstr "" @@ -176,7 +176,7 @@ msgstr "" msgid ":attr:`params`" msgstr ":attr:`params`" -#: ../../library/urllib.parse.rst:116 ../../library/urllib.parse.rst:301 +#: ../../library/urllib.parse.rst:116 ../../library/urllib.parse.rst:305 msgid "3" msgstr "3" @@ -184,20 +184,20 @@ msgstr "3" msgid "Parameters for last path element" msgstr "" -#: ../../library/urllib.parse.rst:119 ../../library/urllib.parse.rst:301 +#: ../../library/urllib.parse.rst:119 ../../library/urllib.parse.rst:305 msgid ":attr:`query`" msgstr ":attr:`query`" -#: ../../library/urllib.parse.rst:119 ../../library/urllib.parse.rst:303 +#: ../../library/urllib.parse.rst:119 ../../library/urllib.parse.rst:307 msgid "4" msgstr "4" -#: ../../library/urllib.parse.rst:119 ../../library/urllib.parse.rst:301 +#: ../../library/urllib.parse.rst:119 ../../library/urllib.parse.rst:305 msgid "Query component" msgstr "" -#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:303 -#: ../../library/urllib.parse.rst:401 +#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:307 +#: ../../library/urllib.parse.rst:414 msgid ":attr:`fragment`" msgstr ":attr:`fragment`" @@ -205,64 +205,64 @@ msgstr ":attr:`fragment`" msgid "5" msgstr "5" -#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:303 -#: ../../library/urllib.parse.rst:401 +#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:307 +#: ../../library/urllib.parse.rst:414 msgid "Fragment identifier" msgstr "" -#: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:305 +#: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:309 msgid ":attr:`username`" msgstr ":attr:`username`" -#: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:305 +#: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:309 msgid "User name" msgstr "" #: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:125 #: ../../library/urllib.parse.rst:127 ../../library/urllib.parse.rst:129 -#: ../../library/urllib.parse.rst:305 ../../library/urllib.parse.rst:307 #: ../../library/urllib.parse.rst:309 ../../library/urllib.parse.rst:311 +#: ../../library/urllib.parse.rst:313 ../../library/urllib.parse.rst:315 msgid ":const:`None`" msgstr ":const:`None`" -#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:307 +#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:311 msgid ":attr:`password`" msgstr ":attr:`password`" -#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:307 +#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:311 msgid "Password" msgstr "" -#: ../../library/urllib.parse.rst:127 ../../library/urllib.parse.rst:309 +#: ../../library/urllib.parse.rst:127 ../../library/urllib.parse.rst:313 msgid ":attr:`hostname`" msgstr ":attr:`hostname`" -#: ../../library/urllib.parse.rst:127 ../../library/urllib.parse.rst:309 +#: ../../library/urllib.parse.rst:127 ../../library/urllib.parse.rst:313 msgid "Host name (lower case)" msgstr "" -#: ../../library/urllib.parse.rst:129 ../../library/urllib.parse.rst:311 +#: ../../library/urllib.parse.rst:129 ../../library/urllib.parse.rst:315 msgid ":attr:`port`" msgstr ":attr:`port`" -#: ../../library/urllib.parse.rst:129 ../../library/urllib.parse.rst:311 +#: ../../library/urllib.parse.rst:129 ../../library/urllib.parse.rst:315 msgid "Port number as integer, if present" msgstr "" -#: ../../library/urllib.parse.rst:133 ../../library/urllib.parse.rst:315 +#: ../../library/urllib.parse.rst:133 ../../library/urllib.parse.rst:319 msgid "" "Reading the :attr:`port` attribute will raise a :exc:`ValueError` if an " "invalid port is specified in the URL. See section :ref:`urlparse-result-" "object` for more information on the result object." msgstr "" -#: ../../library/urllib.parse.rst:137 ../../library/urllib.parse.rst:319 +#: ../../library/urllib.parse.rst:137 ../../library/urllib.parse.rst:323 msgid "" "Unmatched square brackets in the :attr:`netloc` attribute will raise a :exc:" "`ValueError`." msgstr "" -#: ../../library/urllib.parse.rst:140 ../../library/urllib.parse.rst:322 +#: ../../library/urllib.parse.rst:140 ../../library/urllib.parse.rst:326 msgid "" "Characters in the :attr:`netloc` attribute that decompose under NFKC " "normalization (as used by the IDNA encoding) into any of ``/``, ``?``, " @@ -278,30 +278,36 @@ msgid "" "object replacing specified fields with new values." msgstr "" -#: ../../library/urllib.parse.rst:163 +#: ../../library/urllib.parse.rst:164 +msgid "" +":func:`urlparse` does not perform validation. See :ref:`URL parsing " +"security ` for details." +msgstr "" + +#: ../../library/urllib.parse.rst:167 msgid "Added IPv6 URL parsing capabilities." msgstr "" -#: ../../library/urllib.parse.rst:166 +#: ../../library/urllib.parse.rst:170 msgid "" "The fragment is now parsed for all URL schemes (unless *allow_fragment* is " "false), in accordance with :rfc:`3986`. Previously, an allowlist of schemes " "that support fragments existed." msgstr "" -#: ../../library/urllib.parse.rst:171 ../../library/urllib.parse.rst:330 +#: ../../library/urllib.parse.rst:175 ../../library/urllib.parse.rst:340 msgid "" "Out-of-range port numbers now raise :exc:`ValueError`, instead of returning :" "const:`None`." msgstr "" -#: ../../library/urllib.parse.rst:175 ../../library/urllib.parse.rst:334 +#: ../../library/urllib.parse.rst:179 ../../library/urllib.parse.rst:344 msgid "" "Characters that affect netloc parsing under NFKC normalization will now " "raise :exc:`ValueError`." msgstr "" -#: ../../library/urllib.parse.rst:182 +#: ../../library/urllib.parse.rst:186 msgid "" "Parse a query string given as a string argument (data of type :mimetype:" "`application/x-www-form-urlencoded`). Data are returned as a dictionary. " @@ -309,7 +315,7 @@ msgid "" "lists of values for each name." msgstr "" -#: ../../library/urllib.parse.rst:187 ../../library/urllib.parse.rst:232 +#: ../../library/urllib.parse.rst:191 ../../library/urllib.parse.rst:236 msgid "" "The optional argument *keep_blank_values* is a flag indicating whether blank " "values in percent-encoded queries should be treated as blank strings. A true " @@ -318,48 +324,48 @@ msgid "" "treated as if they were not included." msgstr "" -#: ../../library/urllib.parse.rst:193 ../../library/urllib.parse.rst:238 +#: ../../library/urllib.parse.rst:197 ../../library/urllib.parse.rst:242 msgid "" "The optional argument *strict_parsing* is a flag indicating what to do with " "parsing errors. If false (the default), errors are silently ignored. If " "true, errors raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/urllib.parse.rst:197 ../../library/urllib.parse.rst:242 +#: ../../library/urllib.parse.rst:201 ../../library/urllib.parse.rst:246 msgid "" "The optional *encoding* and *errors* parameters specify how to decode " "percent-encoded sequences into Unicode characters, as accepted by the :meth:" "`bytes.decode` method." msgstr "" -#: ../../library/urllib.parse.rst:201 ../../library/urllib.parse.rst:246 +#: ../../library/urllib.parse.rst:205 ../../library/urllib.parse.rst:250 msgid "" "The optional argument *max_num_fields* is the maximum number of fields to " "read. If set, then throws a :exc:`ValueError` if there are more than " "*max_num_fields* fields read." msgstr "" -#: ../../library/urllib.parse.rst:205 ../../library/urllib.parse.rst:250 +#: ../../library/urllib.parse.rst:209 ../../library/urllib.parse.rst:254 msgid "" "The optional argument *separator* is the symbol to use for separating the " "query arguments. It defaults to ``&``." msgstr "" -#: ../../library/urllib.parse.rst:208 +#: ../../library/urllib.parse.rst:212 msgid "" "Use the :func:`urllib.parse.urlencode` function (with the ``doseq`` " "parameter set to ``True``) to convert such dictionaries into query strings." msgstr "" -#: ../../library/urllib.parse.rst:213 ../../library/urllib.parse.rst:256 +#: ../../library/urllib.parse.rst:217 ../../library/urllib.parse.rst:260 msgid "Add *encoding* and *errors* parameters." msgstr "" -#: ../../library/urllib.parse.rst:216 ../../library/urllib.parse.rst:259 +#: ../../library/urllib.parse.rst:220 ../../library/urllib.parse.rst:263 msgid "Added *max_num_fields* parameter." msgstr "新增 *max_num_fields* 參數。" -#: ../../library/urllib.parse.rst:219 ../../library/urllib.parse.rst:262 +#: ../../library/urllib.parse.rst:223 ../../library/urllib.parse.rst:266 msgid "" "Added *separator* parameter with the default value of ``&``. Python versions " "earlier than Python 3.10 allowed using both ``;`` and ``&`` as query " @@ -367,20 +373,20 @@ msgid "" "key, with ``&`` as the default separator." msgstr "" -#: ../../library/urllib.parse.rst:228 +#: ../../library/urllib.parse.rst:232 msgid "" "Parse a query string given as a string argument (data of type :mimetype:" "`application/x-www-form-urlencoded`). Data are returned as a list of name, " "value pairs." msgstr "" -#: ../../library/urllib.parse.rst:253 +#: ../../library/urllib.parse.rst:257 msgid "" "Use the :func:`urllib.parse.urlencode` function to convert such lists of " "pairs into query strings." msgstr "" -#: ../../library/urllib.parse.rst:271 +#: ../../library/urllib.parse.rst:275 msgid "" "Construct a URL from a tuple as returned by ``urlparse()``. The *parts* " "argument can be any six-item iterable. This may result in a slightly " @@ -389,7 +395,7 @@ msgid "" "states that these are equivalent)." msgstr "" -#: ../../library/urllib.parse.rst:280 +#: ../../library/urllib.parse.rst:284 msgid "" "This is similar to :func:`urlparse`, but does not split the params from the " "URL. This should generally be used instead of :func:`urlparse` if the more " @@ -399,23 +405,35 @@ msgid "" "returns a 5-item :term:`named tuple`::" msgstr "" -#: ../../library/urllib.parse.rst:289 ../../library/urllib.parse.rst:393 +#: ../../library/urllib.parse.rst:293 ../../library/urllib.parse.rst:406 msgid "" "The return value is a :term:`named tuple`, its items can be accessed by " "index or as named attributes:" msgstr "" -#: ../../library/urllib.parse.rst:327 +#: ../../library/urllib.parse.rst:331 msgid "" -"Following the `WHATWG spec`_ that updates RFC 3986, ASCII newline ``\\n``, " -"``\\r`` and tab ``\\t`` characters are stripped from the URL." +"Following some of the `WHATWG spec`_ that updates RFC 3986, leading C0 " +"control and space characters are stripped from the URL. ``\\n``, ``\\r`` and " +"tab ``\\t`` characters are removed from the URL at any position." msgstr "" -#: ../../library/urllib.parse.rst:338 +#: ../../library/urllib.parse.rst:337 +msgid "" +":func:`urlsplit` does not perform validation. See :ref:`URL parsing " +"security ` for details." +msgstr "" + +#: ../../library/urllib.parse.rst:348 msgid "ASCII newline and tab characters are stripped from the URL." msgstr "" -#: ../../library/urllib.parse.rst:345 +#: ../../library/urllib.parse.rst:351 +msgid "" +"Leading WHATWG C0 control and space characters are stripped from the URL." +msgstr "" + +#: ../../library/urllib.parse.rst:358 msgid "" "Combine the elements of a tuple as returned by :func:`urlsplit` into a " "complete URL as a string. The *parts* argument can be any five-item " @@ -424,7 +442,7 @@ msgid "" "a ? with an empty query; the RFC states that these are equivalent)." msgstr "" -#: ../../library/urllib.parse.rst:354 +#: ../../library/urllib.parse.rst:367 msgid "" "Construct a full (\"absolute\") URL by combining a \"base URL\" (*base*) " "with another URL (*url*). Informally, this uses components of the base URL, " @@ -432,30 +450,30 @@ msgid "" "path, to provide missing components in the relative URL. For example:" msgstr "" -#: ../../library/urllib.parse.rst:363 +#: ../../library/urllib.parse.rst:376 msgid "" "The *allow_fragments* argument has the same meaning and default as for :func:" "`urlparse`." msgstr "" -#: ../../library/urllib.parse.rst:368 +#: ../../library/urllib.parse.rst:381 msgid "" "If *url* is an absolute URL (that is, it starts with ``//`` or ``scheme://" "``), the *url*'s hostname and/or scheme will be present in the result. For " "example:" msgstr "" -#: ../../library/urllib.parse.rst:377 +#: ../../library/urllib.parse.rst:390 msgid "" "If you do not want that behavior, preprocess the *url* with :func:`urlsplit` " "and :func:`urlunsplit`, removing possible *scheme* and *netloc* parts." msgstr "" -#: ../../library/urllib.parse.rst:383 +#: ../../library/urllib.parse.rst:396 msgid "Behavior updated to match the semantics defined in :rfc:`3986`." msgstr "" -#: ../../library/urllib.parse.rst:388 +#: ../../library/urllib.parse.rst:401 msgid "" "If *url* contains a fragment identifier, return a modified version of *url* " "with no fragment identifier, and the fragment identifier as a separate " @@ -463,25 +481,25 @@ msgid "" "unmodified and an empty string." msgstr "" -#: ../../library/urllib.parse.rst:399 +#: ../../library/urllib.parse.rst:412 msgid ":attr:`url`" msgstr ":attr:`url`" -#: ../../library/urllib.parse.rst:399 +#: ../../library/urllib.parse.rst:412 msgid "URL with no fragment" msgstr "" -#: ../../library/urllib.parse.rst:404 +#: ../../library/urllib.parse.rst:417 msgid "" "See section :ref:`urlparse-result-object` for more information on the result " "object." msgstr "" -#: ../../library/urllib.parse.rst:407 +#: ../../library/urllib.parse.rst:420 msgid "Result is a structured object rather than a simple 2-tuple." msgstr "" -#: ../../library/urllib.parse.rst:412 +#: ../../library/urllib.parse.rst:425 msgid "" "Extract the url from a wrapped URL (that is, a string formatted as ````, ````, ``URL:scheme://host/path`` " @@ -489,11 +507,52 @@ msgid "" "without changes." msgstr "" -#: ../../library/urllib.parse.rst:420 +#: ../../library/urllib.parse.rst:433 +msgid "URL parsing security" +msgstr "" + +#: ../../library/urllib.parse.rst:435 +msgid "" +"The :func:`urlsplit` and :func:`urlparse` APIs do not perform **validation** " +"of inputs. They may not raise errors on inputs that other applications " +"consider invalid. They may also succeed on some inputs that might not be " +"considered URLs elsewhere. Their purpose is for practical functionality " +"rather than purity." +msgstr "" + +#: ../../library/urllib.parse.rst:441 +msgid "" +"Instead of raising an exception on unusual input, they may instead return " +"some component parts as empty strings. Or components may contain more than " +"perhaps they should." +msgstr "" + +#: ../../library/urllib.parse.rst:445 +msgid "" +"We recommend that users of these APIs where the values may be used anywhere " +"with security implications code defensively. Do some verification within " +"your code before trusting a returned component part. Does that ``scheme`` " +"make sense? Is that a sensible ``path``? Is there anything strange about " +"that ``hostname``? etc." +msgstr "" + +#: ../../library/urllib.parse.rst:451 +msgid "" +"What constitutes a URL is not universally well defined. Different " +"applications have different needs and desired constraints. For instance the " +"living `WHATWG spec`_ describes what user facing web clients such as a web " +"browser require. While :rfc:`3986` is more general. These functions " +"incorporate some aspects of both, but cannot be claimed compliant with " +"either. The APIs and existing user code with expectations on specific " +"behaviors predate both standards leading us to be very cautious about making " +"API behavior changes." +msgstr "" + +#: ../../library/urllib.parse.rst:462 msgid "Parsing ASCII Encoded Bytes" msgstr "" -#: ../../library/urllib.parse.rst:422 +#: ../../library/urllib.parse.rst:464 msgid "" "The URL parsing functions were originally designed to operate on character " "strings only. In practice, it is useful to be able to manipulate properly " @@ -502,14 +561,14 @@ msgid "" "`bytearray` objects in addition to :class:`str` objects." msgstr "" -#: ../../library/urllib.parse.rst:428 +#: ../../library/urllib.parse.rst:470 msgid "" "If :class:`str` data is passed in, the result will also contain only :class:" "`str` data. If :class:`bytes` or :class:`bytearray` data is passed in, the " "result will contain only :class:`bytes` data." msgstr "" -#: ../../library/urllib.parse.rst:432 +#: ../../library/urllib.parse.rst:474 msgid "" "Attempting to mix :class:`str` data with :class:`bytes` or :class:" "`bytearray` in a single function call will result in a :exc:`TypeError` " @@ -517,7 +576,7 @@ msgid "" "trigger :exc:`UnicodeDecodeError`." msgstr "" -#: ../../library/urllib.parse.rst:437 +#: ../../library/urllib.parse.rst:479 msgid "" "To support easier conversion of result objects between :class:`str` and :" "class:`bytes`, all return values from URL parsing functions provide either " @@ -530,14 +589,14 @@ msgid "" "`str` data (for :meth:`decode` methods)." msgstr "" -#: ../../library/urllib.parse.rst:448 +#: ../../library/urllib.parse.rst:490 msgid "" "Applications that need to operate on potentially improperly quoted URLs that " "may contain non-ASCII data will need to do their own decoding from bytes to " "characters before invoking the URL parsing methods." msgstr "" -#: ../../library/urllib.parse.rst:452 +#: ../../library/urllib.parse.rst:494 msgid "" "The behaviour described in this section applies only to the URL parsing " "functions. The URL quoting functions use their own rules when producing or " @@ -545,15 +604,15 @@ msgid "" "URL quoting functions." msgstr "" -#: ../../library/urllib.parse.rst:457 +#: ../../library/urllib.parse.rst:499 msgid "URL parsing functions now accept ASCII encoded byte sequences" msgstr "" -#: ../../library/urllib.parse.rst:464 +#: ../../library/urllib.parse.rst:506 msgid "Structured Parse Results" msgstr "" -#: ../../library/urllib.parse.rst:466 +#: ../../library/urllib.parse.rst:508 msgid "" "The result objects from the :func:`urlparse`, :func:`urlsplit` and :func:" "`urldefrag` functions are subclasses of the :class:`tuple` type. These " @@ -562,7 +621,7 @@ msgid "" "section, as well as an additional method:" msgstr "" -#: ../../library/urllib.parse.rst:474 +#: ../../library/urllib.parse.rst:516 msgid "" "Return the re-combined version of the original URL as a string. This may " "differ from the original URL in that the scheme may be normalized to lower " @@ -570,72 +629,72 @@ msgid "" "queries, and fragment identifiers will be removed." msgstr "" -#: ../../library/urllib.parse.rst:479 +#: ../../library/urllib.parse.rst:521 msgid "" "For :func:`urldefrag` results, only empty fragment identifiers will be " "removed. For :func:`urlsplit` and :func:`urlparse` results, all noted " "changes will be made to the URL returned by this method." msgstr "" -#: ../../library/urllib.parse.rst:483 +#: ../../library/urllib.parse.rst:525 msgid "" "The result of this method remains unchanged if passed back through the " "original parsing function:" msgstr "" -#: ../../library/urllib.parse.rst:496 +#: ../../library/urllib.parse.rst:538 msgid "" "The following classes provide the implementations of the structured parse " "results when operating on :class:`str` objects:" msgstr "" -#: ../../library/urllib.parse.rst:501 +#: ../../library/urllib.parse.rst:543 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`DefragResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:509 +#: ../../library/urllib.parse.rst:551 msgid "" "Concrete class for :func:`urlparse` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`ParseResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:515 +#: ../../library/urllib.parse.rst:557 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`SplitResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:520 +#: ../../library/urllib.parse.rst:562 msgid "" "The following classes provide the implementations of the parse results when " "operating on :class:`bytes` or :class:`bytearray` objects:" msgstr "" -#: ../../library/urllib.parse.rst:525 +#: ../../library/urllib.parse.rst:567 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`DefragResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:533 +#: ../../library/urllib.parse.rst:575 msgid "" "Concrete class for :func:`urlparse` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`ParseResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:541 +#: ../../library/urllib.parse.rst:583 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`SplitResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:549 +#: ../../library/urllib.parse.rst:591 msgid "URL Quoting" msgstr "" -#: ../../library/urllib.parse.rst:551 +#: ../../library/urllib.parse.rst:593 msgid "" "The URL quoting functions focus on taking program data and making it safe " "for use as URL components by quoting special characters and appropriately " @@ -644,7 +703,7 @@ msgid "" "isn't already covered by the URL parsing functions above." msgstr "" -#: ../../library/urllib.parse.rst:559 +#: ../../library/urllib.parse.rst:601 msgid "" "Replace special characters in *string* using the ``%xx`` escape. Letters, " "digits, and the characters ``'_.-~'`` are never quoted. By default, this " @@ -653,18 +712,18 @@ msgid "" "quoted --- its default value is ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:565 ../../library/urllib.parse.rst:611 -#: ../../library/urllib.parse.rst:640 +#: ../../library/urllib.parse.rst:607 ../../library/urllib.parse.rst:653 +#: ../../library/urllib.parse.rst:682 msgid "*string* may be either a :class:`str` or a :class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:567 +#: ../../library/urllib.parse.rst:609 msgid "" "Moved from :rfc:`2396` to :rfc:`3986` for quoting URL strings. \"~\" is now " "included in the set of unreserved characters." msgstr "" -#: ../../library/urllib.parse.rst:571 +#: ../../library/urllib.parse.rst:613 msgid "" "The optional *encoding* and *errors* parameters specify how to deal with non-" "ASCII characters, as accepted by the :meth:`str.encode` method. *encoding* " @@ -674,17 +733,17 @@ msgid "" "`TypeError` is raised." msgstr "" -#: ../../library/urllib.parse.rst:579 +#: ../../library/urllib.parse.rst:621 msgid "" "Note that ``quote(string, safe, encoding, errors)`` is equivalent to " "``quote_from_bytes(string.encode(encoding, errors), safe)``." msgstr "" -#: ../../library/urllib.parse.rst:582 +#: ../../library/urllib.parse.rst:624 msgid "Example: ``quote('/El Niño/')`` yields ``'/El%20Ni%C3%B1o/'``." msgstr "" -#: ../../library/urllib.parse.rst:587 +#: ../../library/urllib.parse.rst:629 msgid "" "Like :func:`quote`, but also replace spaces with plus signs, as required for " "quoting HTML form values when building up a query string to go into a URL. " @@ -692,21 +751,21 @@ msgid "" "*safe*. It also does not have *safe* default to ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:592 +#: ../../library/urllib.parse.rst:634 msgid "Example: ``quote_plus('/El Niño/')`` yields ``'%2FEl+Ni%C3%B1o%2F'``." msgstr "" -#: ../../library/urllib.parse.rst:597 +#: ../../library/urllib.parse.rst:639 msgid "" "Like :func:`quote`, but accepts a :class:`bytes` object rather than a :class:" "`str`, and does not perform string-to-bytes encoding." msgstr "" -#: ../../library/urllib.parse.rst:600 +#: ../../library/urllib.parse.rst:642 msgid "Example: ``quote_from_bytes(b'a&\\xef')`` yields ``'a%26%EF'``." msgstr "" -#: ../../library/urllib.parse.rst:606 +#: ../../library/urllib.parse.rst:648 msgid "" "Replace ``%xx`` escapes with their single-character equivalent. The optional " "*encoding* and *errors* parameters specify how to decode percent-encoded " @@ -714,52 +773,52 @@ msgid "" "method." msgstr "" -#: ../../library/urllib.parse.rst:613 +#: ../../library/urllib.parse.rst:655 msgid "" "*encoding* defaults to ``'utf-8'``. *errors* defaults to ``'replace'``, " "meaning invalid sequences are replaced by a placeholder character." msgstr "" -#: ../../library/urllib.parse.rst:617 +#: ../../library/urllib.parse.rst:659 msgid "Example: ``unquote('/El%20Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:619 +#: ../../library/urllib.parse.rst:661 msgid "" "*string* parameter supports bytes and str objects (previously only str)." msgstr "" -#: ../../library/urllib.parse.rst:627 +#: ../../library/urllib.parse.rst:669 msgid "" "Like :func:`unquote`, but also replace plus signs with spaces, as required " "for unquoting HTML form values." msgstr "" -#: ../../library/urllib.parse.rst:630 +#: ../../library/urllib.parse.rst:672 msgid "*string* must be a :class:`str`." msgstr "" -#: ../../library/urllib.parse.rst:632 +#: ../../library/urllib.parse.rst:674 msgid "Example: ``unquote_plus('/El+Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:637 +#: ../../library/urllib.parse.rst:679 msgid "" "Replace ``%xx`` escapes with their single-octet equivalent, and return a :" "class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:642 +#: ../../library/urllib.parse.rst:684 msgid "" "If it is a :class:`str`, unescaped non-ASCII characters in *string* are " "encoded into UTF-8 bytes." msgstr "" -#: ../../library/urllib.parse.rst:645 +#: ../../library/urllib.parse.rst:687 msgid "Example: ``unquote_to_bytes('a%26%EF')`` yields ``b'a&\\xef'``." msgstr "" -#: ../../library/urllib.parse.rst:651 +#: ../../library/urllib.parse.rst:693 msgid "" "Convert a mapping object or a sequence of two-element tuples, which may " "contain :class:`str` or :class:`bytes` objects, to a percent-encoded ASCII " @@ -768,7 +827,7 @@ msgid "" "be encoded to bytes, otherwise it would result in a :exc:`TypeError`." msgstr "" -#: ../../library/urllib.parse.rst:658 +#: ../../library/urllib.parse.rst:700 msgid "" "The resulting string is a series of ``key=value`` pairs separated by ``'&'`` " "characters, where both *key* and *value* are quoted using the *quote_via* " @@ -781,7 +840,7 @@ msgid "" "``quote`` and specify a value for *safe*." msgstr "" -#: ../../library/urllib.parse.rst:668 +#: ../../library/urllib.parse.rst:710 msgid "" "When a sequence of two-element tuples is used as the *query* argument, the " "first element of each tuple is a key and the second is a value. The value " @@ -792,49 +851,49 @@ msgid "" "order of parameter tuples in the sequence." msgstr "" -#: ../../library/urllib.parse.rst:676 +#: ../../library/urllib.parse.rst:718 msgid "" "The *safe*, *encoding*, and *errors* parameters are passed down to " "*quote_via* (the *encoding* and *errors* parameters are only passed when a " "query element is a :class:`str`)." msgstr "" -#: ../../library/urllib.parse.rst:680 +#: ../../library/urllib.parse.rst:722 msgid "" "To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are " "provided in this module to parse query strings into Python data structures." msgstr "" -#: ../../library/urllib.parse.rst:683 +#: ../../library/urllib.parse.rst:725 msgid "" "Refer to :ref:`urllib examples ` to find out how the :func:" "`urllib.parse.urlencode` method can be used for generating the query string " "of a URL or data for a POST request." msgstr "" -#: ../../library/urllib.parse.rst:687 +#: ../../library/urllib.parse.rst:729 msgid "*query* supports bytes and string objects." msgstr "" -#: ../../library/urllib.parse.rst:690 +#: ../../library/urllib.parse.rst:732 msgid "*quote_via* parameter." msgstr "" -#: ../../library/urllib.parse.rst:698 +#: ../../library/urllib.parse.rst:740 msgid "`WHATWG`_ - URL Living standard" msgstr "" -#: ../../library/urllib.parse.rst:697 +#: ../../library/urllib.parse.rst:739 msgid "" "Working Group for the URL Standard that defines URLs, domains, IP addresses, " "the application/x-www-form-urlencoded format, and their API." msgstr "" -#: ../../library/urllib.parse.rst:704 +#: ../../library/urllib.parse.rst:746 msgid ":rfc:`3986` - Uniform Resource Identifiers" msgstr "" -#: ../../library/urllib.parse.rst:701 +#: ../../library/urllib.parse.rst:743 msgid "" "This is the current standard (STD66). Any changes to urllib.parse module " "should conform to this. Certain deviations could be observed, which are " @@ -842,48 +901,48 @@ msgid "" "requirements as commonly observed in major browsers." msgstr "" -#: ../../library/urllib.parse.rst:707 +#: ../../library/urllib.parse.rst:749 msgid ":rfc:`2732` - Format for Literal IPv6 Addresses in URL's." msgstr "" -#: ../../library/urllib.parse.rst:707 +#: ../../library/urllib.parse.rst:749 msgid "This specifies the parsing requirements of IPv6 URLs." msgstr "" -#: ../../library/urllib.parse.rst:711 +#: ../../library/urllib.parse.rst:753 msgid ":rfc:`2396` - Uniform Resource Identifiers (URI): Generic Syntax" msgstr "" -#: ../../library/urllib.parse.rst:710 +#: ../../library/urllib.parse.rst:752 msgid "" "Document describing the generic syntactic requirements for both Uniform " "Resource Names (URNs) and Uniform Resource Locators (URLs)." msgstr "" -#: ../../library/urllib.parse.rst:714 +#: ../../library/urllib.parse.rst:756 msgid ":rfc:`2368` - The mailto URL scheme." msgstr "" -#: ../../library/urllib.parse.rst:714 +#: ../../library/urllib.parse.rst:756 msgid "Parsing requirements for mailto URL schemes." msgstr "" -#: ../../library/urllib.parse.rst:719 +#: ../../library/urllib.parse.rst:761 msgid ":rfc:`1808` - Relative Uniform Resource Locators" msgstr "" -#: ../../library/urllib.parse.rst:717 +#: ../../library/urllib.parse.rst:759 msgid "" "This Request For Comments includes the rules for joining an absolute and a " "relative URL, including a fair number of \"Abnormal Examples\" which govern " "the treatment of border cases." msgstr "" -#: ../../library/urllib.parse.rst:721 +#: ../../library/urllib.parse.rst:763 msgid ":rfc:`1738` - Uniform Resource Locators (URL)" msgstr "" -#: ../../library/urllib.parse.rst:722 +#: ../../library/urllib.parse.rst:764 msgid "This specifies the formal syntax and semantics of absolute URLs." msgstr "" From d6e1811fddf63a46a02abdff19b1a0b9d04dad9b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 20 May 2023 00:30:59 +0000 Subject: [PATCH 090/130] sync with cpython 2801b3f8 --- library/enum.po | 164 ++++++++++++++++++++++++------------------------ 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/library/enum.po b/library/enum.po index 228e5dcc46..965e0324f7 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-14 00:29+0000\n" +"POT-Creation-Date: 2023-05-20 00:28+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-" @@ -542,20 +542,20 @@ msgid "" "enumeration status." msgstr "" -#: ../../library/enum.rst:422 +#: ../../library/enum.rst:423 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr "" -#: ../../library/enum.rst:425 +#: ../../library/enum.rst:426 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " "already :meth:`!int.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:432 +#: ../../library/enum.rst:433 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -563,7 +563,7 @@ msgid "" "the enumeration." msgstr "" -#: ../../library/enum.rst:438 +#: ../../library/enum.rst:439 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -571,285 +571,285 @@ msgid "" "``str(StrEnum.member)``." msgstr "" -#: ../../library/enum.rst:445 +#: ../../library/enum.rst:446 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr "" -#: ../../library/enum.rst:450 +#: ../../library/enum.rst:451 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " "likewise :meth:`!str.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:458 +#: ../../library/enum.rst:459 msgid "" "*Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), " "``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are " "members of the enumeration." msgstr "" -#: ../../library/enum.rst:464 +#: ../../library/enum.rst:465 msgid "Returns *True* if value is in self::" msgstr "" -#: ../../library/enum.rst:484 +#: ../../library/enum.rst:485 msgid "Returns all contained non-alias members::" msgstr "" -#: ../../library/enum.rst:493 +#: ../../library/enum.rst:494 msgid "Aliases are no longer returned during iteration." msgstr "" -#: ../../library/enum.rst:497 +#: ../../library/enum.rst:498 msgid "Returns number of members in flag::" msgstr "" -#: ../../library/enum.rst:506 +#: ../../library/enum.rst:507 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "" -#: ../../library/enum.rst:518 +#: ../../library/enum.rst:519 msgid "Returns current flag binary or'ed with other::" msgstr "" -#: ../../library/enum.rst:525 +#: ../../library/enum.rst:526 msgid "Returns current flag binary and'ed with other::" msgstr "" -#: ../../library/enum.rst:534 +#: ../../library/enum.rst:535 msgid "Returns current flag binary xor'ed with other::" msgstr "" -#: ../../library/enum.rst:543 +#: ../../library/enum.rst:544 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "" -#: ../../library/enum.rst:554 +#: ../../library/enum.rst:555 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." msgstr "" -#: ../../library/enum.rst:559 +#: ../../library/enum.rst:560 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:562 +#: ../../library/enum.rst:563 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "" -#: ../../library/enum.rst:570 +#: ../../library/enum.rst:571 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." msgstr "" -#: ../../library/enum.rst:583 +#: ../../library/enum.rst:584 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "" -#: ../../library/enum.rst:589 +#: ../../library/enum.rst:590 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "" -#: ../../library/enum.rst:591 +#: ../../library/enum.rst:592 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "" -#: ../../library/enum.rst:592 +#: ../../library/enum.rst:593 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "" -#: ../../library/enum.rst:594 +#: ../../library/enum.rst:595 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "" -#: ../../library/enum.rst:601 +#: ../../library/enum.rst:602 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:606 +#: ../../library/enum.rst:607 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " "was already :meth:`!int.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:610 +#: ../../library/enum.rst:611 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " "matches the existing :class:`Flag` behavior." msgstr "" -#: ../../library/enum.rst:616 +#: ../../library/enum.rst:617 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" msgstr "" -#: ../../library/enum.rst:619 +#: ../../library/enum.rst:620 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:620 +#: ../../library/enum.rst:621 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "" -#: ../../library/enum.rst:622 +#: ../../library/enum.rst:623 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" "default :meth:`str() `." msgstr "" -#: ../../library/enum.rst:631 +#: ../../library/enum.rst:632 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." msgstr "" -#: ../../library/enum.rst:636 +#: ../../library/enum.rst:637 msgid "Ensure that each value has only one name::" msgstr "" -#: ../../library/enum.rst:652 +#: ../../library/enum.rst:653 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "" -#: ../../library/enum.rst:667 +#: ../../library/enum.rst:668 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" msgstr "" -#: ../../library/enum.rst:684 +#: ../../library/enum.rst:685 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "" -#: ../../library/enum.rst:690 +#: ../../library/enum.rst:691 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "" -#: ../../library/enum.rst:695 +#: ../../library/enum.rst:696 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "" -#: ../../library/enum.rst:712 +#: ../../library/enum.rst:713 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "" -#: ../../library/enum.rst:725 +#: ../../library/enum.rst:726 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "" -#: ../../library/enum.rst:737 +#: ../../library/enum.rst:738 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" msgstr "" -#: ../../library/enum.rst:753 +#: ../../library/enum.rst:754 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../library/enum.rst:755 +#: ../../library/enum.rst:756 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:758 +#: ../../library/enum.rst:759 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " "appropriately. Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:764 +#: ../../library/enum.rst:765 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../library/enum.rst:766 +#: ../../library/enum.rst:767 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../library/enum.rst:767 +#: ../../library/enum.rst:768 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../library/enum.rst:769 +#: ../../library/enum.rst:770 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../library/enum.rst:771 +#: ../../library/enum.rst:772 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../library/enum.rst:774 +#: ../../library/enum.rst:775 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:776 +#: ../../library/enum.rst:777 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "" -#: ../../library/enum.rst:781 +#: ../../library/enum.rst:782 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../library/enum.rst:784 +#: ../../library/enum.rst:785 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../library/enum.rst:787 +#: ../../library/enum.rst:788 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:788 +#: ../../library/enum.rst:789 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:793 +#: ../../library/enum.rst:794 msgid "Utilities and Decorators" msgstr "" -#: ../../library/enum.rst:797 +#: ../../library/enum.rst:798 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -860,58 +860,58 @@ msgid "" "manually specified values." msgstr "" -#: ../../library/enum.rst:805 +#: ../../library/enum.rst:806 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: ../../library/enum.rst:807 +#: ../../library/enum.rst:808 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: ../../library/enum.rst:808 +#: ../../library/enum.rst:809 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" -#: ../../library/enum.rst:809 +#: ../../library/enum.rst:810 msgid "used to create the ``SECOND`` enum member;" msgstr "" -#: ../../library/enum.rst:810 +#: ../../library/enum.rst:811 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:815 +#: ../../library/enum.rst:816 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "" -#: ../../library/enum.rst:818 +#: ../../library/enum.rst:819 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:821 +#: ../../library/enum.rst:822 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:827 +#: ../../library/enum.rst:828 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:831 +#: ../../library/enum.rst:832 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -919,29 +919,29 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:840 +#: ../../library/enum.rst:841 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:858 +#: ../../library/enum.rst:859 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:866 +#: ../../library/enum.rst:867 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:872 +#: ../../library/enum.rst:873 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:878 +#: ../../library/enum.rst:879 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -949,41 +949,41 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:888 +#: ../../library/enum.rst:889 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:895 +#: ../../library/enum.rst:896 msgid "Notes" msgstr "" -#: ../../library/enum.rst:897 +#: ../../library/enum.rst:898 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:899 +#: ../../library/enum.rst:900 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:902 +#: ../../library/enum.rst:903 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:904 +#: ../../library/enum.rst:905 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:907 +#: ../../library/enum.rst:908 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:914 +#: ../../library/enum.rst:915 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" From 1035d54c881eeaf092ae306e5a5fd9f357421391 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 21 May 2023 00:35:23 +0000 Subject: [PATCH 091/130] sync with cpython 2e457bc2 --- library/gc.po | 104 ++++++++++++++++++++++++++------------------------ 1 file changed, 55 insertions(+), 49 deletions(-) diff --git a/library/gc.po b/library/gc.po index 4cb7f8fc8b..f74628d17b 100644 --- a/library/gc.po +++ b/library/gc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-21 00:33+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,65 +68,71 @@ msgid "" "implementation, in particular :class:`float`." msgstr "" -#: ../../library/gc.rst:56 +#: ../../library/gc.rst:53 +msgid "" +"The effect of calling ``gc.collect()`` while the interpreter is already " +"performing a collection is undefined." +msgstr "" + +#: ../../library/gc.rst:59 msgid "" "Set the garbage collection debugging flags. Debugging information will be " "written to ``sys.stderr``. See below for a list of debugging flags which " "can be combined using bit operations to control debugging." msgstr "" -#: ../../library/gc.rst:63 +#: ../../library/gc.rst:66 msgid "Return the debugging flags currently set." msgstr "" -#: ../../library/gc.rst:68 +#: ../../library/gc.rst:71 msgid "" "Returns a list of all objects tracked by the collector, excluding the list " "returned. If *generation* is not None, return only the objects tracked by " "the collector that are in that generation." msgstr "" -#: ../../library/gc.rst:72 +#: ../../library/gc.rst:75 msgid "New *generation* parameter." msgstr "" -#: ../../library/gc.rst:75 +#: ../../library/gc.rst:78 msgid "" "Raises an :ref:`auditing event ` ``gc.get_objects`` with argument " "``generation``." msgstr "" -#: ../../library/gc.rst:79 +#: ../../library/gc.rst:82 msgid "" "Return a list of three per-generation dictionaries containing collection " "statistics since interpreter start. The number of keys may change in the " "future, but currently each dictionary will contain the following items:" msgstr "" -#: ../../library/gc.rst:84 +#: ../../library/gc.rst:87 msgid "``collections`` is the number of times this generation was collected;" msgstr "" -#: ../../library/gc.rst:86 +#: ../../library/gc.rst:89 msgid "" "``collected`` is the total number of objects collected inside this " "generation;" msgstr "" -#: ../../library/gc.rst:89 +#: ../../library/gc.rst:92 msgid "" "``uncollectable`` is the total number of objects which were found to be " "uncollectable (and were therefore moved to the :data:`garbage` list) inside " "this generation." msgstr "" -#: ../../library/gc.rst:98 +#: ../../library/gc.rst:101 msgid "" "Set the garbage collection thresholds (the collection frequency). Setting " "*threshold0* to zero disables collection." msgstr "" -#: ../../library/gc.rst:101 +#: ../../library/gc.rst:104 msgid "" "The GC classifies objects into three generations depending on how many " "collection sweeps they have survived. New objects are placed in the " @@ -145,19 +151,19 @@ msgid "" "information." msgstr "" -#: ../../library/gc.rst:118 +#: ../../library/gc.rst:121 msgid "" "Return the current collection counts as a tuple of ``(count0, count1, " "count2)``." msgstr "" -#: ../../library/gc.rst:124 +#: ../../library/gc.rst:127 msgid "" "Return the current collection thresholds as a tuple of ``(threshold0, " "threshold1, threshold2)``." msgstr "" -#: ../../library/gc.rst:130 +#: ../../library/gc.rst:133 msgid "" "Return the list of objects that directly refer to any of objs. This function " "will only locate those containers which support garbage collection; " @@ -165,7 +171,7 @@ msgid "" "collection will not be found." msgstr "" -#: ../../library/gc.rst:135 +#: ../../library/gc.rst:138 msgid "" "Note that objects which have already been dereferenced, but which live in " "cycles and have not yet been collected by the garbage collector can be " @@ -173,7 +179,7 @@ msgid "" "call :func:`collect` before calling :func:`get_referrers`." msgstr "" -#: ../../library/gc.rst:141 +#: ../../library/gc.rst:144 msgid "" "Care must be taken when using objects returned by :func:`get_referrers` " "because some of them could still be under construction and hence in a " @@ -181,13 +187,13 @@ msgid "" "other than debugging." msgstr "" -#: ../../library/gc.rst:146 +#: ../../library/gc.rst:149 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referrers`` with " "argument ``objs``." msgstr "" -#: ../../library/gc.rst:151 +#: ../../library/gc.rst:154 msgid "" "Return a list of objects directly referred to by any of the arguments. The " "referents returned are those objects visited by the arguments' C-level :c:" @@ -199,13 +205,13 @@ msgid "" "object may or may not appear in the result list." msgstr "" -#: ../../library/gc.rst:159 +#: ../../library/gc.rst:162 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referents`` with " "argument ``objs``." msgstr "" -#: ../../library/gc.rst:163 +#: ../../library/gc.rst:166 msgid "" "Returns ``True`` if the object is currently tracked by the garbage " "collector, ``False`` otherwise. As a general rule, instances of atomic " @@ -215,19 +221,19 @@ msgid "" "instances (e.g. dicts containing only atomic keys and values)::" msgstr "" -#: ../../library/gc.rst:188 +#: ../../library/gc.rst:191 msgid "" "Returns ``True`` if the given object has been finalized by the garbage " "collector, ``False`` otherwise. ::" msgstr "" -#: ../../library/gc.rst:209 +#: ../../library/gc.rst:212 msgid "" "Freeze all the objects tracked by the garbage collector; move them to a " "permanent generation and ignore them in all the future collections." msgstr "" -#: ../../library/gc.rst:212 +#: ../../library/gc.rst:215 msgid "" "If a process will ``fork()`` without ``exec()``, avoiding unnecessary copy-" "on-write in child processes will maximize memory sharing and reduce overall " @@ -239,23 +245,23 @@ msgid "" "``gc.enable()`` early in child processes." msgstr "" -#: ../../library/gc.rst:226 +#: ../../library/gc.rst:229 msgid "" "Unfreeze the objects in the permanent generation, put them back into the " "oldest generation." msgstr "" -#: ../../library/gc.rst:234 +#: ../../library/gc.rst:237 msgid "Return the number of objects in the permanent generation." msgstr "" -#: ../../library/gc.rst:239 +#: ../../library/gc.rst:242 msgid "" "The following variables are provided for read-only access (you can mutate " "the values but should not rebind them):" msgstr "" -#: ../../library/gc.rst:244 +#: ../../library/gc.rst:247 msgid "" "A list of objects which the collector found to be unreachable but could not " "be freed (uncollectable objects). Starting with Python 3.4, this list " @@ -263,13 +269,13 @@ msgid "" "types with a non-``NULL`` ``tp_del`` slot." msgstr "" -#: ../../library/gc.rst:249 +#: ../../library/gc.rst:252 msgid "" "If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added " "to this list rather than freed." msgstr "" -#: ../../library/gc.rst:252 +#: ../../library/gc.rst:255 msgid "" "If this list is non-empty at :term:`interpreter shutdown`, a :exc:" "`ResourceWarning` is emitted, which is silent by default. If :const:" @@ -277,105 +283,105 @@ msgid "" "printed." msgstr "" -#: ../../library/gc.rst:258 +#: ../../library/gc.rst:261 msgid "" "Following :pep:`442`, objects with a :meth:`__del__` method don't end up in :" "attr:`gc.garbage` anymore." msgstr "" -#: ../../library/gc.rst:264 +#: ../../library/gc.rst:267 msgid "" "A list of callbacks that will be invoked by the garbage collector before and " "after collection. The callbacks will be called with two arguments, *phase* " "and *info*." msgstr "" -#: ../../library/gc.rst:268 +#: ../../library/gc.rst:271 msgid "*phase* can be one of two values:" msgstr "" -#: ../../library/gc.rst:270 +#: ../../library/gc.rst:273 msgid "\"start\": The garbage collection is about to start." msgstr "" -#: ../../library/gc.rst:272 +#: ../../library/gc.rst:275 msgid "\"stop\": The garbage collection has finished." msgstr "" -#: ../../library/gc.rst:274 +#: ../../library/gc.rst:277 msgid "" "*info* is a dict providing more information for the callback. The following " "keys are currently defined:" msgstr "" -#: ../../library/gc.rst:277 +#: ../../library/gc.rst:280 msgid "\"generation\": The oldest generation being collected." msgstr "" -#: ../../library/gc.rst:279 +#: ../../library/gc.rst:282 msgid "" "\"collected\": When *phase* is \"stop\", the number of objects successfully " "collected." msgstr "" -#: ../../library/gc.rst:282 +#: ../../library/gc.rst:285 msgid "" "\"uncollectable\": When *phase* is \"stop\", the number of objects that " "could not be collected and were put in :data:`garbage`." msgstr "" -#: ../../library/gc.rst:285 +#: ../../library/gc.rst:288 msgid "" "Applications can add their own callbacks to this list. The primary use " "cases are:" msgstr "" -#: ../../library/gc.rst:288 +#: ../../library/gc.rst:291 msgid "" "Gathering statistics about garbage collection, such as how often various " "generations are collected, and how long the collection takes." msgstr "" -#: ../../library/gc.rst:292 +#: ../../library/gc.rst:295 msgid "" "Allowing applications to identify and clear their own uncollectable types " "when they appear in :data:`garbage`." msgstr "" -#: ../../library/gc.rst:298 +#: ../../library/gc.rst:301 msgid "The following constants are provided for use with :func:`set_debug`:" msgstr "" -#: ../../library/gc.rst:303 +#: ../../library/gc.rst:306 msgid "" "Print statistics during collection. This information can be useful when " "tuning the collection frequency." msgstr "" -#: ../../library/gc.rst:309 +#: ../../library/gc.rst:312 msgid "Print information on collectable objects found." msgstr "" -#: ../../library/gc.rst:314 +#: ../../library/gc.rst:317 msgid "" "Print information of uncollectable objects found (objects which are not " "reachable but cannot be freed by the collector). These objects will be " "added to the ``garbage`` list." msgstr "" -#: ../../library/gc.rst:318 +#: ../../library/gc.rst:321 msgid "" "Also print the contents of the :data:`garbage` list at :term:`interpreter " "shutdown`, if it isn't empty." msgstr "" -#: ../../library/gc.rst:324 +#: ../../library/gc.rst:327 msgid "" "When set, all unreachable objects found will be appended to *garbage* rather " "than being freed. This can be useful for debugging a leaking program." msgstr "" -#: ../../library/gc.rst:330 +#: ../../library/gc.rst:333 msgid "" "The debugging flags necessary for the collector to print information about a " "leaking program (equal to ``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | " From ea7dc05d5bf9902a1d9fb6996e34c4ccc07a93f2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 22 May 2023 00:33:54 +0000 Subject: [PATCH 092/130] sync with cpython d691de1d --- library/logging.config.po | 234 +++++----- library/operator.po | 5 +- library/typing.po | 897 +++++++++++++++++++------------------- 3 files changed, 575 insertions(+), 561 deletions(-) diff --git a/library/logging.config.po b/library/logging.config.po index 9b0c3ecd53..2c116d8444 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-17 00:33+0000\n" +"POT-Creation-Date: 2023-05-22 00:31+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -137,11 +137,17 @@ msgid "" "chosen configuration)." msgstr "" +#: ../../library/logging.config.rst:90 +msgid "" +"It will raise :exc:`FileNotFoundError` if the file doesn't exist and :exc:" +"`RuntimeError` if the file is invalid or empty." +msgstr "" + #: ../../library/logging.config.rst:0 msgid "Parameters" msgstr "參數" -#: ../../library/logging.config.rst:90 +#: ../../library/logging.config.rst:94 msgid "" "A filename, or a file-like object, or an instance derived from :class:" "`~configparser.RawConfigParser`. If a ``RawConfigParser``-derived instance " @@ -153,12 +159,12 @@ msgid "" "passed to :meth:`~configparser.ConfigParser.read`." msgstr "" -#: ../../library/logging.config.rst:102 +#: ../../library/logging.config.rst:106 msgid "" "Defaults to be passed to the ConfigParser can be specified in this argument." msgstr "" -#: ../../library/logging.config.rst:105 +#: ../../library/logging.config.rst:109 msgid "" "If specified as ``False``, loggers which exist when this call is made are " "left enabled. The default is ``True`` because this enables old behaviour in " @@ -167,34 +173,40 @@ msgid "" "logging configuration." msgstr "" -#: ../../library/logging.config.rst:114 +#: ../../library/logging.config.rst:118 msgid "The encoding used to open file when *fname* is filename." msgstr "" -#: ../../library/logging.config.rst:116 +#: ../../library/logging.config.rst:120 msgid "" "An instance of a subclass of :class:`~configparser.RawConfigParser` is now " "accepted as a value for ``fname``. This facilitates:" msgstr "" -#: ../../library/logging.config.rst:120 +#: ../../library/logging.config.rst:124 msgid "" "Use of a configuration file where logging configuration is just part of the " "overall application configuration." msgstr "" -#: ../../library/logging.config.rst:122 +#: ../../library/logging.config.rst:126 msgid "" "Use of a configuration read from a file, and then modified by the using " "application (e.g. based on command-line parameters or other aspects of the " "runtime environment) before being passed to ``fileConfig``." msgstr "" -#: ../../library/logging.config.rst:126 +#: ../../library/logging.config.rst:130 msgid "The *encoding* parameter is added." msgstr "" -#: ../../library/logging.config.rst:131 +#: ../../library/logging.config.rst:133 +msgid "" +"An exception will be thrown if the provided file doesn't exist or is invalid " +"or empty." +msgstr "" + +#: ../../library/logging.config.rst:139 msgid "" "Starts up a socket server on the specified port, and listens for new " "configurations. If no port is specified, the module's default :const:" @@ -206,7 +218,7 @@ msgid "" "func:`stopListening`." msgstr "" -#: ../../library/logging.config.rst:140 +#: ../../library/logging.config.rst:148 msgid "" "The ``verify`` argument, if specified, should be a callable which should " "verify whether bytes received across the socket are valid and should be " @@ -220,14 +232,14 @@ msgid "" "(perhaps if decryption were performed)." msgstr "" -#: ../../library/logging.config.rst:151 +#: ../../library/logging.config.rst:159 msgid "" "To send a configuration to the socket, read in the configuration file and " "send it to the socket as a sequence of bytes preceded by a four-byte length " "string packed in binary using ``struct.pack('>L', n)``." msgstr "" -#: ../../library/logging.config.rst:159 +#: ../../library/logging.config.rst:167 msgid "" "Because portions of the configuration are passed through :func:`eval`, use " "of this function may open its users to a security risk. While the function " @@ -245,11 +257,11 @@ msgid "" "from being applied." msgstr "" -#: ../../library/logging.config.rst:175 +#: ../../library/logging.config.rst:183 msgid "The ``verify`` argument was added." msgstr "新增 ``verify`` 引數。" -#: ../../library/logging.config.rst:180 +#: ../../library/logging.config.rst:188 msgid "" "If you want to send configurations to the listener which don't disable " "existing loggers, you will need to use a JSON format for the configuration, " @@ -258,18 +270,18 @@ msgid "" "you send." msgstr "" -#: ../../library/logging.config.rst:189 +#: ../../library/logging.config.rst:197 msgid "" "Stops the listening server which was created with a call to :func:`listen`. " "This is typically called before calling :meth:`join` on the return value " "from :func:`listen`." msgstr "" -#: ../../library/logging.config.rst:195 +#: ../../library/logging.config.rst:203 msgid "Security considerations" msgstr "" -#: ../../library/logging.config.rst:197 +#: ../../library/logging.config.rst:205 msgid "" "The logging configuration functionality tries to offer convenience, and in " "part this is done by offering the ability to convert text in configuration " @@ -282,11 +294,11 @@ msgid "" "bad can happen if you load them, before actually loading them." msgstr "" -#: ../../library/logging.config.rst:211 +#: ../../library/logging.config.rst:219 msgid "Configuration dictionary schema" msgstr "" -#: ../../library/logging.config.rst:213 +#: ../../library/logging.config.rst:221 msgid "" "Describing a logging configuration requires listing the various objects to " "create and the connections between them; for example, you may create a " @@ -299,23 +311,23 @@ msgid "" "connections` below." msgstr "" -#: ../../library/logging.config.rst:225 +#: ../../library/logging.config.rst:233 msgid "Dictionary Schema Details" msgstr "" -#: ../../library/logging.config.rst:227 +#: ../../library/logging.config.rst:235 msgid "" "The dictionary passed to :func:`dictConfig` must contain the following keys:" msgstr "" -#: ../../library/logging.config.rst:230 +#: ../../library/logging.config.rst:238 msgid "" "*version* - to be set to an integer value representing the schema version. " "The only valid value at present is 1, but having this key allows the schema " "to evolve while still preserving backwards compatibility." msgstr "" -#: ../../library/logging.config.rst:235 +#: ../../library/logging.config.rst:243 msgid "" "All other keys are optional, but if present they will be interpreted as " "described below. In all cases below where a 'configuring dict' is " @@ -325,37 +337,37 @@ msgid "" "otherwise, the context is used to determine what to instantiate." msgstr "" -#: ../../library/logging.config.rst:244 +#: ../../library/logging.config.rst:252 msgid "" "*formatters* - the corresponding value will be a dict in which each key is a " "formatter id and each value is a dict describing how to configure the " "corresponding :class:`~logging.Formatter` instance." msgstr "" -#: ../../library/logging.config.rst:248 +#: ../../library/logging.config.rst:256 msgid "" "The configuring dict is searched for the following optional keys which " "correspond to the arguments passed to create a :class:`~logging.Formatter` " "object:" msgstr "" -#: ../../library/logging.config.rst:252 +#: ../../library/logging.config.rst:260 msgid "``format``" msgstr "``format``" -#: ../../library/logging.config.rst:253 +#: ../../library/logging.config.rst:261 msgid "``datefmt``" msgstr "``datefmt``" -#: ../../library/logging.config.rst:254 +#: ../../library/logging.config.rst:262 msgid "``style``" msgstr "``style``" -#: ../../library/logging.config.rst:255 +#: ../../library/logging.config.rst:263 msgid "``validate`` (since version >=3.8)" msgstr "" -#: ../../library/logging.config.rst:257 +#: ../../library/logging.config.rst:265 msgid "" "An optional ``class`` key indicates the name of the formatter's class (as a " "dotted module and class name). The instantiation arguments are as for :" @@ -366,60 +378,60 @@ msgid "" "configuration keys, you should use :ref:`logging-config-dict-userdef`." msgstr "" -#: ../../library/logging.config.rst:266 +#: ../../library/logging.config.rst:274 msgid "" "*filters* - the corresponding value will be a dict in which each key is a " "filter id and each value is a dict describing how to configure the " "corresponding Filter instance." msgstr "" -#: ../../library/logging.config.rst:270 +#: ../../library/logging.config.rst:278 msgid "" "The configuring dict is searched for the key ``name`` (defaulting to the " "empty string) and this is used to construct a :class:`logging.Filter` " "instance." msgstr "" -#: ../../library/logging.config.rst:274 +#: ../../library/logging.config.rst:282 msgid "" "*handlers* - the corresponding value will be a dict in which each key is a " "handler id and each value is a dict describing how to configure the " "corresponding Handler instance." msgstr "" -#: ../../library/logging.config.rst:278 ../../library/logging.config.rst:323 +#: ../../library/logging.config.rst:286 ../../library/logging.config.rst:331 msgid "The configuring dict is searched for the following keys:" msgstr "" -#: ../../library/logging.config.rst:280 +#: ../../library/logging.config.rst:288 msgid "" "``class`` (mandatory). This is the fully qualified name of the handler " "class." msgstr "" -#: ../../library/logging.config.rst:283 +#: ../../library/logging.config.rst:291 msgid "``level`` (optional). The level of the handler." msgstr "" -#: ../../library/logging.config.rst:285 +#: ../../library/logging.config.rst:293 msgid "``formatter`` (optional). The id of the formatter for this handler." msgstr "" -#: ../../library/logging.config.rst:288 +#: ../../library/logging.config.rst:296 msgid "``filters`` (optional). A list of ids of the filters for this handler." msgstr "" -#: ../../library/logging.config.rst:291 ../../library/logging.config.rst:332 +#: ../../library/logging.config.rst:299 ../../library/logging.config.rst:340 msgid "``filters`` can take filter instances in addition to ids." msgstr "" -#: ../../library/logging.config.rst:294 +#: ../../library/logging.config.rst:302 msgid "" "All *other* keys are passed through as keyword arguments to the handler's " "constructor. For example, given the snippet:" msgstr "" -#: ../../library/logging.config.rst:313 +#: ../../library/logging.config.rst:321 msgid "" "the handler with id ``console`` is instantiated as a :class:`logging." "StreamHandler`, using ``sys.stdout`` as the underlying stream. The handler " @@ -428,44 +440,44 @@ msgid "" "maxBytes=1024, backupCount=3``." msgstr "" -#: ../../library/logging.config.rst:319 +#: ../../library/logging.config.rst:327 msgid "" "*loggers* - the corresponding value will be a dict in which each key is a " "logger name and each value is a dict describing how to configure the " "corresponding Logger instance." msgstr "" -#: ../../library/logging.config.rst:325 +#: ../../library/logging.config.rst:333 msgid "``level`` (optional). The level of the logger." msgstr "" -#: ../../library/logging.config.rst:327 +#: ../../library/logging.config.rst:335 msgid "``propagate`` (optional). The propagation setting of the logger." msgstr "" -#: ../../library/logging.config.rst:329 +#: ../../library/logging.config.rst:337 msgid "``filters`` (optional). A list of ids of the filters for this logger." msgstr "" -#: ../../library/logging.config.rst:335 +#: ../../library/logging.config.rst:343 msgid "" "``handlers`` (optional). A list of ids of the handlers for this logger." msgstr "" -#: ../../library/logging.config.rst:338 +#: ../../library/logging.config.rst:346 msgid "" "The specified loggers will be configured according to the level, " "propagation, filters and handlers specified." msgstr "" -#: ../../library/logging.config.rst:341 +#: ../../library/logging.config.rst:349 msgid "" "*root* - this will be the configuration for the root logger. Processing of " "the configuration will be as for any logger, except that the ``propagate`` " "setting will not be applicable." msgstr "" -#: ../../library/logging.config.rst:345 +#: ../../library/logging.config.rst:353 msgid "" "*incremental* - whether the configuration is to be interpreted as " "incremental to the existing configuration. This value defaults to " @@ -474,13 +486,13 @@ msgid "" "`fileConfig` API." msgstr "" -#: ../../library/logging.config.rst:351 +#: ../../library/logging.config.rst:359 msgid "" "If the specified value is ``True``, the configuration is processed as " "described in the section on :ref:`logging-config-dict-incremental`." msgstr "" -#: ../../library/logging.config.rst:354 +#: ../../library/logging.config.rst:362 msgid "" "*disable_existing_loggers* - whether any existing non-root loggers are to be " "disabled. This setting mirrors the parameter of the same name in :func:" @@ -488,11 +500,11 @@ msgid "" "ignored if *incremental* is ``True``." msgstr "" -#: ../../library/logging.config.rst:362 +#: ../../library/logging.config.rst:370 msgid "Incremental Configuration" msgstr "" -#: ../../library/logging.config.rst:364 +#: ../../library/logging.config.rst:372 msgid "" "It is difficult to provide complete flexibility for incremental " "configuration. For example, because objects such as filters and formatters " @@ -500,7 +512,7 @@ msgid "" "to such anonymous objects when augmenting a configuration." msgstr "" -#: ../../library/logging.config.rst:370 +#: ../../library/logging.config.rst:378 msgid "" "Furthermore, there is not a compelling case for arbitrarily altering the " "object graph of loggers, handlers, filters, formatters at run-time, once a " @@ -511,7 +523,7 @@ msgid "" "worth the complexity it adds to the implementation." msgstr "" -#: ../../library/logging.config.rst:379 +#: ../../library/logging.config.rst:387 msgid "" "Thus, when the ``incremental`` key of a configuration dict is present and is " "``True``, the system will completely ignore any ``formatters`` and " @@ -520,7 +532,7 @@ msgid "" "``loggers`` and ``root`` entries." msgstr "" -#: ../../library/logging.config.rst:385 +#: ../../library/logging.config.rst:393 msgid "" "Using a value in the configuration dict lets configurations to be sent over " "the wire as pickled dicts to a socket listener. Thus, the logging verbosity " @@ -528,11 +540,11 @@ msgid "" "and restart the application." msgstr "" -#: ../../library/logging.config.rst:393 +#: ../../library/logging.config.rst:401 msgid "Object connections" msgstr "" -#: ../../library/logging.config.rst:395 +#: ../../library/logging.config.rst:403 msgid "" "The schema describes a set of logging objects - loggers, handlers, " "formatters, filters - which are connected to each other in an object graph. " @@ -548,17 +560,17 @@ msgid "" "source and the destination object with that id." msgstr "" -#: ../../library/logging.config.rst:409 +#: ../../library/logging.config.rst:417 msgid "So, for example, consider the following YAML snippet:" msgstr "" -#: ../../library/logging.config.rst:430 +#: ../../library/logging.config.rst:438 msgid "" "(Note: YAML used here because it's a little more readable than the " "equivalent Python source form for the dictionary.)" msgstr "" -#: ../../library/logging.config.rst:433 +#: ../../library/logging.config.rst:441 msgid "" "The ids for loggers are the logger names which would be used " "programmatically to obtain a reference to those loggers, e.g. ``foo.bar." @@ -569,7 +581,7 @@ msgid "" "configuration call is complete." msgstr "" -#: ../../library/logging.config.rst:441 +#: ../../library/logging.config.rst:449 msgid "" "The above snippet indicates that logger named ``foo.bar.baz`` should have " "two handlers attached to it, which are described by the handler ids ``h1`` " @@ -577,11 +589,11 @@ msgid "" "the formatter for ``h2`` is that described by id ``precise``." msgstr "" -#: ../../library/logging.config.rst:451 +#: ../../library/logging.config.rst:459 msgid "User-defined objects" msgstr "" -#: ../../library/logging.config.rst:453 +#: ../../library/logging.config.rst:461 msgid "" "The schema supports user-defined objects for handlers, filters and " "formatters. (Loggers do not need to have different types for different " @@ -589,7 +601,7 @@ msgid "" "defined logger classes.)" msgstr "" -#: ../../library/logging.config.rst:458 +#: ../../library/logging.config.rst:466 msgid "" "Objects to be configured are described by dictionaries which detail their " "configuration. In some places, the logging system will be able to infer " @@ -602,7 +614,7 @@ msgid "" "made available under the special key ``'()'``. Here's a concrete example:" msgstr "" -#: ../../library/logging.config.rst:484 +#: ../../library/logging.config.rst:492 msgid "" "The above YAML snippet defines three formatters. The first, with id " "``brief``, is a standard :class:`logging.Formatter` instance with the " @@ -613,14 +625,14 @@ msgid "" "configuration sub-dictionaries::" msgstr "" -#: ../../library/logging.config.rst:496 +#: ../../library/logging.config.rst:504 msgid "and::" msgstr "" "和:\n" "\n" "::" -#: ../../library/logging.config.rst:503 +#: ../../library/logging.config.rst:511 msgid "" "respectively, and as these dictionaries do not contain the special key " "``'()'``, the instantiation is inferred from the context: as a result, " @@ -629,7 +641,7 @@ msgid "" "is::" msgstr "" -#: ../../library/logging.config.rst:516 +#: ../../library/logging.config.rst:524 msgid "" "and this contains the special key ``'()'``, which means that user-defined " "instantiation is wanted. In this case, the specified factory callable will " @@ -641,7 +653,7 @@ msgid "" "assumed to be returned by the call::" msgstr "" -#: ../../library/logging.config.rst:528 +#: ../../library/logging.config.rst:536 msgid "" "The values for keys such as ``bar``, ``spam`` and ``answer`` in the above " "example should not be configuration dictionaries or references such as " @@ -649,7 +661,7 @@ msgid "" "configuration machinery, but passed to the callable as-is." msgstr "" -#: ../../library/logging.config.rst:533 +#: ../../library/logging.config.rst:541 msgid "" "The key ``'()'`` has been used as the special key because it is not a valid " "keyword parameter name, and so will not clash with the names of the keyword " @@ -657,13 +669,13 @@ msgid "" "corresponding value is a callable." msgstr "" -#: ../../library/logging.config.rst:538 +#: ../../library/logging.config.rst:546 msgid "" "The ``filters`` member of ``handlers`` and ``loggers`` can take filter " "instances in addition to ids." msgstr "" -#: ../../library/logging.config.rst:542 +#: ../../library/logging.config.rst:550 msgid "" "You can also specify a special key ``'.'`` whose value is a dictionary is a " "mapping of attribute names to values. If found, the specified attributes " @@ -671,13 +683,13 @@ msgid "" "following configuration::" msgstr "" -#: ../../library/logging.config.rst:558 +#: ../../library/logging.config.rst:566 msgid "" "the returned formatter will have attribute ``foo`` set to ``'bar'`` and " "attribute ``baz`` set to ``'bozz'``." msgstr "" -#: ../../library/logging.config.rst:561 +#: ../../library/logging.config.rst:569 msgid "" "The values for attributes such as ``foo`` and ``baz`` in the above example " "should not be configuration dictionaries or references such as ``cfg://foo`` " @@ -685,11 +697,11 @@ msgid "" "machinery, but set as attribute values as-is." msgstr "" -#: ../../library/logging.config.rst:570 +#: ../../library/logging.config.rst:578 msgid "Handler configuration order" msgstr "" -#: ../../library/logging.config.rst:572 +#: ../../library/logging.config.rst:580 msgid "" "Handlers are configured in alphabetical order of their keys, and a " "configured handler replaces the configuration dictionary in (a working copy " @@ -710,11 +722,11 @@ msgid "" "dictionary." msgstr "" -#: ../../library/logging.config.rst:593 +#: ../../library/logging.config.rst:601 msgid "Access to external objects" msgstr "" -#: ../../library/logging.config.rst:595 +#: ../../library/logging.config.rst:603 msgid "" "There are times where a configuration needs to refer to objects external to " "the configuration, for example ``sys.stderr``. If the configuration dict is " @@ -729,7 +741,7 @@ msgid "" "import mechanisms." msgstr "" -#: ../../library/logging.config.rst:608 +#: ../../library/logging.config.rst:616 msgid "" "The handling of such prefixes is done in a way analogous to protocol " "handling: there is a generic mechanism to look for prefixes which match the " @@ -739,11 +751,11 @@ msgid "" "prefix is not recognised, then the string value will be left as-is." msgstr "" -#: ../../library/logging.config.rst:620 +#: ../../library/logging.config.rst:628 msgid "Access to internal objects" msgstr "" -#: ../../library/logging.config.rst:622 +#: ../../library/logging.config.rst:630 msgid "" "As well as external objects, there is sometimes also a need to refer to " "objects in the configuration. This will be done implicitly by the " @@ -754,7 +766,7 @@ msgid "" "and resolve to the appropriate destination object." msgstr "" -#: ../../library/logging.config.rst:630 +#: ../../library/logging.config.rst:638 msgid "" "However, a more generic mechanism is needed for user-defined objects which " "are not known to the :mod:`logging` module. For example, consider :class:" @@ -768,7 +780,7 @@ msgid "" "resolution system allows the user to specify:" msgstr "" -#: ../../library/logging.config.rst:652 +#: ../../library/logging.config.rst:660 msgid "" "The literal string ``'cfg://handlers.file'`` will be resolved in an " "analogous way to strings with the ``ext://`` prefix, but looking in the " @@ -777,7 +789,7 @@ msgid "" "format``. Thus, given the following snippet:" msgstr "" -#: ../../library/logging.config.rst:670 +#: ../../library/logging.config.rst:678 msgid "" "in the configuration, the string ``'cfg://handlers'`` would resolve to the " "dict with key ``handlers``, the string ``'cfg://handlers.email`` would " @@ -793,7 +805,7 @@ msgid "" "to the string value if needed." msgstr "" -#: ../../library/logging.config.rst:684 +#: ../../library/logging.config.rst:692 msgid "" "Given a string ``cfg://handlers.myhandler.mykey.123``, this will resolve to " "``config_dict['handlers']['myhandler']['mykey']['123']``. If the string is " @@ -803,11 +815,11 @@ msgid "" "['mykey']['123']`` if that fails." msgstr "" -#: ../../library/logging.config.rst:696 +#: ../../library/logging.config.rst:704 msgid "Import resolution and custom importers" msgstr "" -#: ../../library/logging.config.rst:698 +#: ../../library/logging.config.rst:706 msgid "" "Import resolution, by default, uses the builtin :func:`__import__` function " "to do its importing. You may want to replace this with your own importing " @@ -819,17 +831,17 @@ msgid "" "instance level, you need to wrap it with :func:`staticmethod`. For example::" msgstr "" -#: ../../library/logging.config.rst:713 +#: ../../library/logging.config.rst:721 msgid "" "You don't need to wrap with :func:`staticmethod` if you're setting the " "import callable on a configurator *instance*." msgstr "" -#: ../../library/logging.config.rst:720 +#: ../../library/logging.config.rst:728 msgid "Configuration file format" msgstr "" -#: ../../library/logging.config.rst:722 +#: ../../library/logging.config.rst:730 msgid "" "The configuration file format understood by :func:`fileConfig` is based on :" "mod:`configparser` functionality. The file must contain sections called " @@ -846,7 +858,7 @@ msgid "" "specified in a section called ``[logger_root]``." msgstr "" -#: ../../library/logging.config.rst:737 +#: ../../library/logging.config.rst:745 msgid "" "The :func:`fileConfig` API is older than the :func:`dictConfig` API and does " "not provide functionality to cover certain aspects of logging. For example, " @@ -859,17 +871,17 @@ msgid "" "when it's convenient to do so." msgstr "" -#: ../../library/logging.config.rst:747 +#: ../../library/logging.config.rst:755 msgid "Examples of these sections in the file are given below." msgstr "" -#: ../../library/logging.config.rst:760 +#: ../../library/logging.config.rst:768 msgid "" "The root logger must specify a level and a list of handlers. An example of a " "root logger section is given below." msgstr "" -#: ../../library/logging.config.rst:769 +#: ../../library/logging.config.rst:777 msgid "" "The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` " "or ``NOTSET``. For the root logger only, ``NOTSET`` means that all messages " @@ -877,7 +889,7 @@ msgid "" "of the ``logging`` package's namespace." msgstr "" -#: ../../library/logging.config.rst:774 +#: ../../library/logging.config.rst:782 msgid "" "The ``handlers`` entry is a comma-separated list of handler names, which " "must appear in the ``[handlers]`` section. These names must appear in the " @@ -885,13 +897,13 @@ msgid "" "file." msgstr "" -#: ../../library/logging.config.rst:779 +#: ../../library/logging.config.rst:787 msgid "" "For loggers other than the root logger, some additional information is " "required. This is illustrated by the following example." msgstr "" -#: ../../library/logging.config.rst:790 +#: ../../library/logging.config.rst:798 msgid "" "The ``level`` and ``handlers`` entries are interpreted as for the root " "logger, except that if a non-root logger's level is specified as ``NOTSET``, " @@ -904,20 +916,20 @@ msgid "" "application to get the logger." msgstr "" -#: ../../library/logging.config.rst:799 +#: ../../library/logging.config.rst:807 msgid "" "Sections which specify handler configuration are exemplified by the " "following." msgstr "" -#: ../../library/logging.config.rst:809 +#: ../../library/logging.config.rst:817 msgid "" "The ``class`` entry indicates the handler's class (as determined by :func:" "`eval` in the ``logging`` package's namespace). The ``level`` is interpreted " "as for loggers, and ``NOTSET`` is taken to mean 'log everything'." msgstr "" -#: ../../library/logging.config.rst:813 +#: ../../library/logging.config.rst:821 msgid "" "The ``formatter`` entry indicates the key name of the formatter for this " "handler. If blank, a default formatter (``logging._defaultFormatter``) is " @@ -925,7 +937,7 @@ msgid "" "and have a corresponding section in the configuration file." msgstr "" -#: ../../library/logging.config.rst:818 +#: ../../library/logging.config.rst:826 msgid "" "The ``args`` entry, when :ref:`evaluated ` in the context of the " "``logging`` package's namespace, is the list of arguments to the constructor " @@ -934,7 +946,7 @@ msgid "" "provided, it defaults to ``()``." msgstr "" -#: ../../library/logging.config.rst:824 +#: ../../library/logging.config.rst:832 msgid "" "The optional ``kwargs`` entry, when :ref:`evaluated ` in the " "context of the ``logging`` package's namespace, is the keyword argument dict " @@ -942,19 +954,19 @@ msgid "" "``{}``." msgstr "" -#: ../../library/logging.config.rst:881 +#: ../../library/logging.config.rst:889 msgid "" "Sections which specify formatter configuration are typified by the following." msgstr "" -#: ../../library/logging.config.rst:892 +#: ../../library/logging.config.rst:900 msgid "" "The arguments for the formatter configuration are the same as the keys in " "the dictionary schema :ref:`formatters section `." msgstr "" -#: ../../library/logging.config.rst:898 +#: ../../library/logging.config.rst:906 msgid "" "Due to the use of :func:`eval` as described above, there are potential " "security risks which result from using the :func:`listen` to send and " @@ -963,18 +975,18 @@ msgid "" "`listen` documentation for more information." msgstr "" -#: ../../library/logging.config.rst:907 +#: ../../library/logging.config.rst:915 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.config.rst:907 +#: ../../library/logging.config.rst:915 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.config.rst:909 +#: ../../library/logging.config.rst:917 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../library/logging.config.rst:910 +#: ../../library/logging.config.rst:918 msgid "Useful handlers included with the logging module." msgstr "" diff --git a/library/operator.po b/library/operator.po index 9e459c858b..a65e02ca9a 100644 --- a/library/operator.po +++ b/library/operator.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:32+0000\n" +"POT-Creation-Date: 2023-05-22 00:31+0000\n" "PO-Revision-Date: 2021-12-09 23:32+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -231,8 +231,9 @@ msgid "Set the value of *a* at index *b* to *c*." msgstr "將 *a* 中索引為 *b* 的值設為 *c*。" #: ../../library/operator.rst:247 +#, fuzzy msgid "" -"Return an estimated length for the object *o*. First try to return its " +"Return an estimated length for the object *obj*. First try to return its " "actual length, then an estimate using :meth:`object.__length_hint__`, and " "finally return the default value." msgstr "" diff --git a/library/typing.po b/library/typing.po index da0a362d4a..4b279e69c6 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-15 00:31+0000\n" +"POT-Creation-Date: 2023-05-22 00:31+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -350,8 +350,8 @@ msgid "" "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:229 ../../library/typing.rst:1171 -#: ../../library/typing.rst:2834 +#: ../../library/typing.rst:229 ../../library/typing.rst:1186 +#: ../../library/typing.rst:2837 msgid "For example::" msgstr "" "舉例來說:\n" @@ -365,7 +365,7 @@ msgid "" "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:248 ../../library/typing.rst:850 +#: ../../library/typing.rst:248 ../../library/typing.rst:865 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -376,7 +376,7 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:256 ../../library/typing.rst:862 +#: ../../library/typing.rst:256 ../../library/typing.rst:877 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -666,53 +666,65 @@ msgstr "" #: ../../library/typing.rst:616 msgid "" +"``AnyStr`` is a :ref:`constrained type variable ` defined as ``AnyStr = TypeVar('AnyStr', str, bytes)``." +msgstr "" + +#: ../../library/typing.rst:619 +msgid "" +"It is meant to be used for functions that may accept any kind of string " +"without allowing different kinds of strings to mix. For example::" +msgstr "" + +#: ../../library/typing.rst:631 +msgid "" "Special type that includes only literal strings. A string literal is " "compatible with ``LiteralString``, as is another ``LiteralString``, but an " "object typed as just ``str`` is not. A string created by composing " "``LiteralString``-typed objects is also acceptable as a ``LiteralString``." msgstr "" -#: ../../library/typing.rst:622 ../../library/typing.rst:2463 +#: ../../library/typing.rst:637 ../../library/typing.rst:2466 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:636 +#: ../../library/typing.rst:651 msgid "" "This is useful for sensitive APIs where arbitrary user-generated strings " "could generate problems. For example, the two cases above that generate type " "checker errors could be vulnerable to an SQL injection attack." msgstr "" -#: ../../library/typing.rst:641 +#: ../../library/typing.rst:656 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:647 +#: ../../library/typing.rst:662 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:650 +#: ../../library/typing.rst:665 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:670 +#: ../../library/typing.rst:685 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:675 +#: ../../library/typing.rst:690 msgid "Special type indicating that a function never returns. For example::" msgstr "" -#: ../../library/typing.rst:683 +#: ../../library/typing.rst:698 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -720,150 +732,150 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:694 +#: ../../library/typing.rst:709 msgid "Special type to represent the current enclosed class. For example::" msgstr "" -#: ../../library/typing.rst:705 +#: ../../library/typing.rst:720 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:717 +#: ../../library/typing.rst:732 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:724 +#: ../../library/typing.rst:739 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:727 +#: ../../library/typing.rst:742 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:729 +#: ../../library/typing.rst:744 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:731 +#: ../../library/typing.rst:746 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:733 +#: ../../library/typing.rst:748 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:739 +#: ../../library/typing.rst:754 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `. For example::" msgstr "" -#: ../../library/typing.rst:746 +#: ../../library/typing.rst:761 msgid "See :pep:`613` for more details about explicit type aliases." msgstr "" -#: ../../library/typing.rst:751 +#: ../../library/typing.rst:766 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:753 +#: ../../library/typing.rst:768 msgid "" "These can be used as types in annotations using ``[]``, each having a unique " "syntax." msgstr "" -#: ../../library/typing.rst:757 +#: ../../library/typing.rst:772 msgid "" "Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the " "first item of type X and the second of type Y. The type of the empty tuple " "can be written as ``Tuple[()]``." msgstr "" -#: ../../library/typing.rst:761 +#: ../../library/typing.rst:776 msgid "" "Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " "variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " "float and a string." msgstr "" -#: ../../library/typing.rst:765 +#: ../../library/typing.rst:780 msgid "" "To specify a variable-length tuple of homogeneous type, use literal " "ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` is equivalent to " "``Tuple[Any, ...]``, and in turn to :class:`tuple`." msgstr "" -#: ../../library/typing.rst:769 +#: ../../library/typing.rst:784 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:775 +#: ../../library/typing.rst:790 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:777 +#: ../../library/typing.rst:792 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:779 +#: ../../library/typing.rst:794 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:781 +#: ../../library/typing.rst:796 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:785 +#: ../../library/typing.rst:800 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:789 +#: ../../library/typing.rst:804 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:793 +#: ../../library/typing.rst:808 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:797 +#: ../../library/typing.rst:812 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:799 +#: ../../library/typing.rst:814 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:801 +#: ../../library/typing.rst:816 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:804 +#: ../../library/typing.rst:819 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:810 +#: ../../library/typing.rst:825 msgid "Optional type." msgstr "" -#: ../../library/typing.rst:812 +#: ../../library/typing.rst:827 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:814 +#: ../../library/typing.rst:829 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -871,31 +883,31 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:822 +#: ../../library/typing.rst:837 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:829 +#: ../../library/typing.rst:844 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:850 msgid "Callable type; ``Callable[[int], str]`` is a function of (int) -> str." msgstr "" -#: ../../library/typing.rst:837 +#: ../../library/typing.rst:852 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " "types or an ellipsis; the return type must be a single type." msgstr "" -#: ../../library/typing.rst:842 +#: ../../library/typing.rst:857 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -905,19 +917,19 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:858 +#: ../../library/typing.rst:873 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:867 +#: ../../library/typing.rst:882 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:872 +#: ../../library/typing.rst:887 msgid "" "Used with :data:`Callable` and :class:`ParamSpec` to type annotate a higher " "order callable which adds, removes, or transforms parameters of another " @@ -927,7 +939,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:880 +#: ../../library/typing.rst:895 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -938,17 +950,17 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:919 ../../library/typing.rst:1509 +#: ../../library/typing.rst:934 ../../library/typing.rst:1526 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:921 +#: ../../library/typing.rst:936 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:926 +#: ../../library/typing.rst:941 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``Type[C]`` may accept values that are " @@ -956,11 +968,11 @@ msgid "" "``C``. For example::" msgstr "" -#: ../../library/typing.rst:935 +#: ../../library/typing.rst:950 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:947 +#: ../../library/typing.rst:962 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -970,39 +982,39 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:955 +#: ../../library/typing.rst:970 msgid "" "The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:961 +#: ../../library/typing.rst:976 msgid "" "``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " "``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:966 +#: ../../library/typing.rst:981 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:972 +#: ../../library/typing.rst:987 msgid "" "A type that can be used to indicate to type checkers that the corresponding " "variable or function parameter has a value equivalent to the provided " "literal (or one of several literals). For example::" msgstr "" -#: ../../library/typing.rst:986 +#: ../../library/typing.rst:1001 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:992 +#: ../../library/typing.rst:1007 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1010,22 +1022,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1000 +#: ../../library/typing.rst:1015 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1002 +#: ../../library/typing.rst:1017 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1010 +#: ../../library/typing.rst:1025 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1012 +#: ../../library/typing.rst:1027 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1033,29 +1045,29 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1026 +#: ../../library/typing.rst:1041 msgid "" "A special typing construct to indicate to type checkers that a name cannot " "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1038 ../../library/typing.rst:2704 +#: ../../library/typing.rst:1053 ../../library/typing.rst:2707 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1047 +#: ../../library/typing.rst:1062 msgid "" "Special typing constructs that mark individual keys of a :class:`TypedDict` " "as either required or non-required respectively." msgstr "" -#: ../../library/typing.rst:1050 +#: ../../library/typing.rst:1065 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1056 +#: ../../library/typing.rst:1071 msgid "" "A type, introduced in :pep:`593` (``Flexible function and variable " "annotations``), to decorate existing types with context-specific metadata " @@ -1072,7 +1084,7 @@ msgid "" "application." msgstr "" -#: ../../library/typing.rst:1070 +#: ../../library/typing.rst:1085 msgid "" "Ultimately, the responsibility of how to interpret the annotations (if at " "all) is the responsibility of the tool or library encountering the " @@ -1081,21 +1093,21 @@ msgid "" "using ``isinstance()``)." msgstr "" -#: ../../library/typing.rst:1076 +#: ../../library/typing.rst:1091 msgid "" "When a tool or a library does not support annotations or encounters an " "unknown annotation it should just ignore it and treat annotated type as the " "underlying type." msgstr "" -#: ../../library/typing.rst:1080 +#: ../../library/typing.rst:1095 msgid "" "It's up to the tool consuming the annotations to decide whether the client " "is allowed to have several annotations on one type and how to merge those " "annotations." msgstr "" -#: ../../library/typing.rst:1084 +#: ../../library/typing.rst:1099 msgid "" "Since the ``Annotated`` type allows you to put several annotations of the " "same (or different) type(s) on any node, the tools or libraries consuming " @@ -1103,59 +1115,59 @@ msgid "" "example, if you are doing value range analysis you might allow this::" msgstr "" -#: ../../library/typing.rst:1093 +#: ../../library/typing.rst:1108 msgid "" "Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " "the extra annotations at runtime." msgstr "" -#: ../../library/typing.rst:1096 +#: ../../library/typing.rst:1111 msgid "The details of the syntax:" msgstr "" -#: ../../library/typing.rst:1098 +#: ../../library/typing.rst:1113 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1100 +#: ../../library/typing.rst:1115 msgid "" "Multiple type annotations are supported (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1105 +#: ../../library/typing.rst:1120 msgid "" "``Annotated`` must be called with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1108 +#: ../../library/typing.rst:1123 msgid "" "The order of the annotations is preserved and matters for equality checks::" msgstr "" -#: ../../library/typing.rst:1115 +#: ../../library/typing.rst:1130 msgid "" "Nested ``Annotated`` types are flattened, with metadata ordered starting " "with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1122 +#: ../../library/typing.rst:1137 msgid "Duplicated annotations are not removed::" msgstr "" -#: ../../library/typing.rst:1128 +#: ../../library/typing.rst:1143 msgid "``Annotated`` can be used with nested and generic aliases::" msgstr "" -#: ../../library/typing.rst:1141 +#: ../../library/typing.rst:1156 msgid "" "Special typing form used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1145 +#: ../../library/typing.rst:1160 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1164,44 +1176,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1160 +#: ../../library/typing.rst:1175 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1164 +#: ../../library/typing.rst:1179 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1167 +#: ../../library/typing.rst:1182 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1168 +#: ../../library/typing.rst:1183 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1185 +#: ../../library/typing.rst:1200 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1189 +#: ../../library/typing.rst:1204 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1195 +#: ../../library/typing.rst:1210 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1210,50 +1222,66 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1201 +#: ../../library/typing.rst:1216 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1207 +#: ../../library/typing.rst:1223 +msgid "" +"A typing operator that conceptually marks an object as having been unpacked. " +"For example, using the unpack operator ``*`` on a :class:`type variable " +"tuple ` is equivalent to using ``Unpack`` to mark the type " +"variable tuple as having been unpacked::" +msgstr "" + +#: ../../library/typing.rst:1233 +msgid "" +"In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " +"of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " +"` types. You might see ``Unpack`` being used explicitly in older " +"versions of Python, where ``*`` couldn't be used in certain places::" +msgstr "" + +#: ../../library/typing.rst:1250 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1209 +#: ../../library/typing.rst:1252 msgid "" "These are not used in annotations. They are building blocks for creating " "generic types." msgstr "" -#: ../../library/typing.rst:1213 +#: ../../library/typing.rst:1256 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1215 +#: ../../library/typing.rst:1258 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1224 +#: ../../library/typing.rst:1267 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1237 +#: ../../library/typing.rst:1280 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1239 ../../library/typing.rst:1438 -#: ../../library/typing.rst:1631 +#: ../../library/typing.rst:1282 ../../library/typing.rst:1455 +#: ../../library/typing.rst:1557 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1245 +#: ../../library/typing.rst:1288 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1261,51 +1289,51 @@ msgid "" "types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1265 +#: ../../library/typing.rst:1308 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1268 +#: ../../library/typing.rst:1311 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1283 +#: ../../library/typing.rst:1326 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1291 +#: ../../library/typing.rst:1334 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1302 +#: ../../library/typing.rst:1345 msgid "" "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, :" "func:`isinstance` and :func:`issubclass` should not be used with types." msgstr "" -#: ../../library/typing.rst:1305 +#: ../../library/typing.rst:1348 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " "details. By default, type variables are invariant." msgstr "" -#: ../../library/typing.rst:1311 +#: ../../library/typing.rst:1354 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1314 +#: ../../library/typing.rst:1357 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1313,7 +1341,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1342 +#: ../../library/typing.rst:1385 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1323,36 +1351,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1350 +#: ../../library/typing.rst:1393 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1357 +#: ../../library/typing.rst:1400 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1366 +#: ../../library/typing.rst:1409 msgid "" "Type variable tuples can be happily combined with normal type variables::" msgstr "" -#: ../../library/typing.rst:1379 +#: ../../library/typing.rst:1422 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1386 +#: ../../library/typing.rst:1429 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1396 +#: ../../library/typing.rst:1439 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1361,32 +1389,17 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1403 +#: ../../library/typing.rst:1446 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1409 -msgid "" -"A typing operator that conceptually marks an object as having been unpacked. " -"For example, using the unpack operator ``*`` on a :class:`type variable " -"tuple ` is equivalent to using ``Unpack`` to mark the type " -"variable tuple as having been unpacked::" -msgstr "" - -#: ../../library/typing.rst:1419 -msgid "" -"In fact, ``Unpack`` can be used interchangeably with ``*`` in the context of " -"types. You might see ``Unpack`` being used explicitly in older versions of " -"Python, where ``*`` couldn't be used in certain places::" -msgstr "" - -#: ../../library/typing.rst:1435 +#: ../../library/typing.rst:1452 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1442 +#: ../../library/typing.rst:1459 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1396,7 +1409,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1449 +#: ../../library/typing.rst:1466 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1404,27 +1417,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1473 +#: ../../library/typing.rst:1490 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1477 +#: ../../library/typing.rst:1494 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1479 +#: ../../library/typing.rst:1496 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1486 +#: ../../library/typing.rst:1503 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1437,7 +1450,7 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1496 +#: ../../library/typing.rst:1513 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1446,17 +1459,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1505 +#: ../../library/typing.rst:1522 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1511 +#: ../../library/typing.rst:1528 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1516 +#: ../../library/typing.rst:1533 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1464,111 +1477,44 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1521 +#: ../../library/typing.rst:1538 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``::" msgstr "" -#: ../../library/typing.rst:1533 -msgid "" -"``AnyStr`` is a :ref:`constrained type variable ` defined as ``AnyStr = TypeVar('AnyStr', str, bytes)``." -msgstr "" - -#: ../../library/typing.rst:1536 -msgid "" -"It is meant to be used for functions that may accept any kind of string " -"without allowing different kinds of strings to mix. For example::" -msgstr "" - -#: ../../library/typing.rst:1548 -msgid "" -"Base class for protocol classes. Protocol classes are defined like this::" -msgstr "" - -#: ../../library/typing.rst:1554 -msgid "" -"Such classes are primarily used with static type checkers that recognize " -"structural subtyping (static duck-typing), for example::" -msgstr "" - -#: ../../library/typing.rst:1566 -msgid "" -"See :pep:`544` for more details. Protocol classes decorated with :func:" -"`runtime_checkable` (described later) act as simple-minded runtime protocols " -"that check only the presence of given attributes, ignoring their type " -"signatures." -msgstr "" - -#: ../../library/typing.rst:1571 -msgid "Protocol classes can be generic, for example::" -msgstr "" - -#: ../../library/typing.rst:1581 -msgid "Mark a protocol class as a runtime protocol." -msgstr "" - -#: ../../library/typing.rst:1583 -msgid "" -"Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " -"This raises :exc:`TypeError` when applied to a non-protocol class. This " -"allows a simple-minded structural check, very similar to \"one trick " -"ponies\" in :mod:`collections.abc` such as :class:`~collections.abc." -"Iterable`. For example::" -msgstr "" - -#: ../../library/typing.rst:1603 -msgid "" -":func:`!runtime_checkable` will check only the presence of the required " -"methods or attributes, not their type signatures or types. For example, :" -"class:`ssl.SSLObject` is a class, therefore it passes an :func:`issubclass` " -"check against :data:`Callable`. However, the ``ssl.SSLObject.__init__`` " -"method exists only to raise a :exc:`TypeError` with a more informative " -"message, therefore making it impossible to call (instantiate) :class:`ssl." -"SSLObject`." -msgstr "" - -#: ../../library/typing.rst:1614 -msgid "" -"An :func:`isinstance` check against a runtime-checkable protocol can be " -"surprisingly slow compared to an ``isinstance()`` check against a non-" -"protocol class. Consider using alternative idioms such as :func:`hasattr` " -"calls for structural checks in performance-sensitive code." -msgstr "" - -#: ../../library/typing.rst:1623 +#: ../../library/typing.rst:1549 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1625 +#: ../../library/typing.rst:1551 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1629 +#: ../../library/typing.rst:1555 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1637 +#: ../../library/typing.rst:1563 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1641 +#: ../../library/typing.rst:1567 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1650 +#: ../../library/typing.rst:1576 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1652 +#: ../../library/typing.rst:1578 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1577,60 +1523,115 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1658 +#: ../../library/typing.rst:1584 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1668 +#: ../../library/typing.rst:1594 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1674 +#: ../../library/typing.rst:1600 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1678 +#: ../../library/typing.rst:1604 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1681 +#: ../../library/typing.rst:1607 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1684 +#: ../../library/typing.rst:1610 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1688 +#: ../../library/typing.rst:1614 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1692 +#: ../../library/typing.rst:1618 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1697 +#: ../../library/typing.rst:1623 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1707 +#: ../../library/typing.rst:1633 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1712 +#: ../../library/typing.rst:1638 +msgid "" +"Base class for protocol classes. Protocol classes are defined like this::" +msgstr "" + +#: ../../library/typing.rst:1644 +msgid "" +"Such classes are primarily used with static type checkers that recognize " +"structural subtyping (static duck-typing), for example::" +msgstr "" + +#: ../../library/typing.rst:1656 +msgid "" +"See :pep:`544` for more details. Protocol classes decorated with :func:" +"`runtime_checkable` (described later) act as simple-minded runtime protocols " +"that check only the presence of given attributes, ignoring their type " +"signatures." +msgstr "" + +#: ../../library/typing.rst:1661 +msgid "Protocol classes can be generic, for example::" +msgstr "" + +#: ../../library/typing.rst:1671 +msgid "Mark a protocol class as a runtime protocol." +msgstr "" + +#: ../../library/typing.rst:1673 +msgid "" +"Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " +"This raises :exc:`TypeError` when applied to a non-protocol class. This " +"allows a simple-minded structural check, very similar to \"one trick " +"ponies\" in :mod:`collections.abc` such as :class:`~collections.abc." +"Iterable`. For example::" +msgstr "" + +#: ../../library/typing.rst:1693 +msgid "" +":func:`!runtime_checkable` will check only the presence of the required " +"methods or attributes, not their type signatures or types. For example, :" +"class:`ssl.SSLObject` is a class, therefore it passes an :func:`issubclass` " +"check against :data:`Callable`. However, the ``ssl.SSLObject.__init__`` " +"method exists only to raise a :exc:`TypeError` with a more informative " +"message, therefore making it impossible to call (instantiate) :class:`ssl." +"SSLObject`." +msgstr "" + +#: ../../library/typing.rst:1704 +msgid "" +"An :func:`isinstance` check against a runtime-checkable protocol can be " +"surprisingly slow compared to an ``isinstance()`` check against a non-" +"protocol class. Consider using alternative idioms such as :func:`hasattr` " +"calls for structural checks in performance-sensitive code." +msgstr "" + +#: ../../library/typing.rst:1715 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1715 +#: ../../library/typing.rst:1718 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1638,53 +1639,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1731 +#: ../../library/typing.rst:1734 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1735 +#: ../../library/typing.rst:1738 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1739 +#: ../../library/typing.rst:1742 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1746 +#: ../../library/typing.rst:1749 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1747 +#: ../../library/typing.rst:1750 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1759 +#: ../../library/typing.rst:1762 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1770 +#: ../../library/typing.rst:1773 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1773 +#: ../../library/typing.rst:1776 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1783 +#: ../../library/typing.rst:1786 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1692,61 +1693,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1788 +#: ../../library/typing.rst:1791 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:1803 +#: ../../library/typing.rst:1806 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1810 +#: ../../library/typing.rst:1813 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1818 +#: ../../library/typing.rst:1821 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:1836 +#: ../../library/typing.rst:1839 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:1842 +#: ../../library/typing.rst:1845 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:1848 +#: ../../library/typing.rst:1851 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example::" msgstr "" -#: ../../library/typing.rst:1868 +#: ../../library/typing.rst:1871 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:1874 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:1874 +#: ../../library/typing.rst:1877 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1755,162 +1756,162 @@ msgid "" "``TypedDict`` with a different value for ``total``::" msgstr "" -#: ../../library/typing.rst:1895 +#: ../../library/typing.rst:1898 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1899 +#: ../../library/typing.rst:1902 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:1903 +#: ../../library/typing.rst:1906 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:1907 +#: ../../library/typing.rst:1910 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1910 +#: ../../library/typing.rst:1913 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1914 +#: ../../library/typing.rst:1917 msgid "" "A generic version of :class:`dict`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Mapping`." msgstr "" -#: ../../library/typing.rst:1918 +#: ../../library/typing.rst:1921 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1923 +#: ../../library/typing.rst:1926 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1929 +#: ../../library/typing.rst:1932 msgid "" "Generic version of :class:`list`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:1934 +#: ../../library/typing.rst:1937 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1944 +#: ../../library/typing.rst:1947 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1950 +#: ../../library/typing.rst:1953 msgid "" "A generic version of :class:`builtins.set `. Useful for annotating " "return types. To annotate arguments it is preferred to use an abstract " "collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:1954 +#: ../../library/typing.rst:1957 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1960 +#: ../../library/typing.rst:1963 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1962 +#: ../../library/typing.rst:1965 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1967 +#: ../../library/typing.rst:1970 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1970 +#: ../../library/typing.rst:1973 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1974 +#: ../../library/typing.rst:1977 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1978 +#: ../../library/typing.rst:1981 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1984 +#: ../../library/typing.rst:1987 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:1988 +#: ../../library/typing.rst:1991 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1994 +#: ../../library/typing.rst:1997 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:1999 +#: ../../library/typing.rst:2002 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2005 +#: ../../library/typing.rst:2008 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2010 +#: ../../library/typing.rst:2013 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2016 +#: ../../library/typing.rst:2019 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2024 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2026 +#: ../../library/typing.rst:2029 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2032 +#: ../../library/typing.rst:2035 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2039 +#: ../../library/typing.rst:2042 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2044 +#: ../../library/typing.rst:2047 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1918,439 +1919,439 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2054 +#: ../../library/typing.rst:2057 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2055 +#: ../../library/typing.rst:2058 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2061 +#: ../../library/typing.rst:2064 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:2065 +#: ../../library/typing.rst:2068 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2073 +#: ../../library/typing.rst:2076 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2080 +#: ../../library/typing.rst:2083 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2083 +#: ../../library/typing.rst:2086 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2087 +#: ../../library/typing.rst:2090 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2089 +#: ../../library/typing.rst:2092 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2095 +#: ../../library/typing.rst:2098 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2099 +#: ../../library/typing.rst:2102 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2103 +#: ../../library/typing.rst:2106 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:2107 +#: ../../library/typing.rst:2110 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2113 +#: ../../library/typing.rst:2116 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2115 +#: ../../library/typing.rst:2118 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2121 +#: ../../library/typing.rst:2124 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2123 +#: ../../library/typing.rst:2126 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2129 +#: ../../library/typing.rst:2132 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2131 +#: ../../library/typing.rst:2134 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2137 +#: ../../library/typing.rst:2140 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:2143 +#: ../../library/typing.rst:2146 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2152 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2151 +#: ../../library/typing.rst:2154 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2157 +#: ../../library/typing.rst:2160 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2159 +#: ../../library/typing.rst:2162 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2166 +#: ../../library/typing.rst:2169 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2168 +#: ../../library/typing.rst:2171 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2175 +#: ../../library/typing.rst:2178 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2177 +#: ../../library/typing.rst:2180 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2183 +#: ../../library/typing.rst:2186 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2185 +#: ../../library/typing.rst:2188 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2191 +#: ../../library/typing.rst:2194 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2193 +#: ../../library/typing.rst:2196 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2198 +#: ../../library/typing.rst:2201 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2202 +#: ../../library/typing.rst:2205 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2204 +#: ../../library/typing.rst:2207 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2210 +#: ../../library/typing.rst:2213 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2212 +#: ../../library/typing.rst:2215 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2218 +#: ../../library/typing.rst:2221 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2227 +#: ../../library/typing.rst:2230 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2231 +#: ../../library/typing.rst:2234 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2239 +#: ../../library/typing.rst:2242 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2247 +#: ../../library/typing.rst:2250 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2253 +#: ../../library/typing.rst:2256 msgid "An alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2257 +#: ../../library/typing.rst:2260 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2259 +#: ../../library/typing.rst:2262 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2265 +#: ../../library/typing.rst:2268 msgid "An alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2268 +#: ../../library/typing.rst:2271 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2272 +#: ../../library/typing.rst:2275 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:2284 +#: ../../library/typing.rst:2287 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2290 +#: ../../library/typing.rst:2293 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2299 +#: ../../library/typing.rst:2302 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2303 +#: ../../library/typing.rst:2306 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2311 +#: ../../library/typing.rst:2314 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2321 +#: ../../library/typing.rst:2324 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2328 +#: ../../library/typing.rst:2331 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2332 +#: ../../library/typing.rst:2335 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2338 +#: ../../library/typing.rst:2341 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2342 +#: ../../library/typing.rst:2345 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2348 +#: ../../library/typing.rst:2351 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2352 +#: ../../library/typing.rst:2355 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2358 +#: ../../library/typing.rst:2361 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2362 +#: ../../library/typing.rst:2365 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2367 +#: ../../library/typing.rst:2370 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2374 +#: ../../library/typing.rst:2377 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2379 +#: ../../library/typing.rst:2382 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2385 +#: ../../library/typing.rst:2388 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2387 +#: ../../library/typing.rst:2390 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2391 +#: ../../library/typing.rst:2394 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2396 +#: ../../library/typing.rst:2399 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2400 +#: ../../library/typing.rst:2403 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2404 +#: ../../library/typing.rst:2407 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2408 +#: ../../library/typing.rst:2411 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2414 +#: ../../library/typing.rst:2417 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2418 +#: ../../library/typing.rst:2421 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2422 +#: ../../library/typing.rst:2425 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2426 +#: ../../library/typing.rst:2429 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2428 +#: ../../library/typing.rst:2431 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2435 +#: ../../library/typing.rst:2438 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2437 +#: ../../library/typing.rst:2440 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2440 +#: ../../library/typing.rst:2443 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2447 +#: ../../library/typing.rst:2450 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2461 +#: ../../library/typing.rst:2464 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2474 +#: ../../library/typing.rst:2477 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " @@ -2363,53 +2364,53 @@ msgid "" "bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2486 +#: ../../library/typing.rst:2489 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2489 +#: ../../library/typing.rst:2492 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2497 +#: ../../library/typing.rst:2500 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2499 +#: ../../library/typing.rst:2502 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2505 +#: ../../library/typing.rst:2508 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2508 +#: ../../library/typing.rst:2511 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2513 +#: ../../library/typing.rst:2516 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2518 +#: ../../library/typing.rst:2521 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2528 +#: ../../library/typing.rst:2531 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -2418,19 +2419,19 @@ msgid "" "`dataclasses.dataclass`-like behaviors." msgstr "" -#: ../../library/typing.rst:2534 +#: ../../library/typing.rst:2537 msgid "Example usage with a decorator function::" msgstr "" -#: ../../library/typing.rst:2548 +#: ../../library/typing.rst:2551 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2557 +#: ../../library/typing.rst:2560 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2568 +#: ../../library/typing.rst:2571 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*. *func* is the function object for the implementation of the " @@ -2576,25 +2577,25 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2670 +#: ../../library/typing.rst:2673 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2678 +#: ../../library/typing.rst:2681 msgid "" "Clear all registered overloads in the internal registry. This can be used to " "reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2686 +#: ../../library/typing.rst:2689 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2709 +#: ../../library/typing.rst:2712 msgid "" "The decorator will now set the ``__final__`` attribute to ``True`` on the " "decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2604,59 +2605,59 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2720 +#: ../../library/typing.rst:2723 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2722 +#: ../../library/typing.rst:2725 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods and classes defined in that class (but not to " "methods defined in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2726 +#: ../../library/typing.rst:2729 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2730 +#: ../../library/typing.rst:2733 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2732 +#: ../../library/typing.rst:2735 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2737 +#: ../../library/typing.rst:2740 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2739 +#: ../../library/typing.rst:2742 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2750 +#: ../../library/typing.rst:2753 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2754 +#: ../../library/typing.rst:2757 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2758 +#: ../../library/typing.rst:2761 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2761 +#: ../../library/typing.rst:2764 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2665,32 +2666,32 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2767 +#: ../../library/typing.rst:2770 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2782 +#: ../../library/typing.rst:2785 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2787 +#: ../../library/typing.rst:2790 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2790 +#: ../../library/typing.rst:2793 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2797 +#: ../../library/typing.rst:2800 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``. If ``X`` is a generic alias for a builtin or :" @@ -2700,7 +2701,7 @@ msgid "" "Examples::" msgstr "" -#: ../../library/typing.rst:2816 +#: ../../library/typing.rst:2819 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``. If ``X`` is a union or :" @@ -2710,11 +2711,11 @@ msgid "" "Examples::" msgstr "" -#: ../../library/typing.rst:2832 +#: ../../library/typing.rst:2835 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2850 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2722,24 +2723,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2853 +#: ../../library/typing.rst:2856 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2860 +#: ../../library/typing.rst:2863 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2864 +#: ../../library/typing.rst:2867 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2873 +#: ../../library/typing.rst:2876 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2747,7 +2748,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2880 +#: ../../library/typing.rst:2883 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2755,11 +2756,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2892 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:2891 +#: ../../library/typing.rst:2894 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2767,76 +2768,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:2896 +#: ../../library/typing.rst:2899 msgid "Feature" msgstr "" -#: ../../library/typing.rst:2896 +#: ../../library/typing.rst:2899 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:2896 +#: ../../library/typing.rst:2899 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:2896 +#: ../../library/typing.rst:2899 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:2898 +#: ../../library/typing.rst:2901 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:2898 +#: ../../library/typing.rst:2901 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:2898 +#: ../../library/typing.rst:2901 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:2898 +#: ../../library/typing.rst:2901 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:2901 +#: ../../library/typing.rst:2904 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:2901 ../../library/typing.rst:2904 +#: ../../library/typing.rst:2904 ../../library/typing.rst:2907 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:2901 ../../library/typing.rst:2906 +#: ../../library/typing.rst:2904 ../../library/typing.rst:2909 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:2901 +#: ../../library/typing.rst:2904 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2907 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2907 msgid "3.14" msgstr "" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2907 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:2906 +#: ../../library/typing.rst:2909 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2906 +#: ../../library/typing.rst:2909 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:2906 +#: ../../library/typing.rst:2909 msgid ":gh:`92332`" msgstr ":gh:`92332`" From fd7596cf5f2ad6750c33cccac671426948064933 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 23 May 2023 00:34:01 +0000 Subject: [PATCH 093/130] sync with cpython be20e9c6 --- howto/urllib2.po | 183 +++++++++++++++++++++++------------------------ 1 file changed, 91 insertions(+), 92 deletions(-) diff --git a/howto/urllib2.po b/howto/urllib2.po index 08fd413edd..f652d11866 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-05-23 00:31+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,27 +33,16 @@ msgid "`Michael Foord `_" msgstr "`Michael Foord `_" #: ../../howto/urllib2.rst:11 -msgid "" -"There is a French translation of an earlier revision of this HOWTO, " -"available at `urllib2 - Le Manuel manquant `_." -msgstr "" -"這份指南出自於早期版本的法文翻譯 `urllib2 - Le Manuel manquant `_\\ 。" - -#: ../../howto/urllib2.rst:18 msgid "Introduction" msgstr "簡介" -#: ../../howto/urllib2.rst:22 +#: ../../howto/urllib2.rst:15 msgid "" "You may also find useful the following article on fetching web resources " "with Python:" msgstr "以下這些與 Python 有關的文章說不定能幫到你::" -#: ../../howto/urllib2.rst:25 +#: ../../howto/urllib2.rst:18 msgid "" "`Basic Authentication `_" @@ -61,11 +50,11 @@ msgstr "" "`Basic Authentication `_" -#: ../../howto/urllib2.rst:27 +#: ../../howto/urllib2.rst:20 msgid "A tutorial on *Basic Authentication*, with examples in Python." msgstr "以 Python 為例的 *Basic Authentication* 教學。" -#: ../../howto/urllib2.rst:29 +#: ../../howto/urllib2.rst:22 msgid "" "**urllib.request** is a Python module for fetching URLs (Uniform Resource " "Locators). It offers a very simple interface, in the form of the *urlopen* " @@ -79,7 +68,7 @@ msgstr "" "也提供了較複雜的介面用於處理一些常見的狀況,例如:基本的 authentication、" "cookies、proxies 等等,這些都可以由 handler 或 opener 物件操作。" -#: ../../howto/urllib2.rst:36 +#: ../../howto/urllib2.rst:29 msgid "" "urllib.request supports fetching URLs for many \"URL schemes\" (identified " "by the string before the ``\":\"`` in URL - for example ``\"ftp\"`` is the " @@ -88,7 +77,7 @@ msgid "" "HTTP." msgstr "" -#: ../../howto/urllib2.rst:41 +#: ../../howto/urllib2.rst:34 msgid "" "For straightforward situations *urlopen* is very easy to use. But as soon as " "you encounter errors or non-trivial cases when opening HTTP URLs, you will " @@ -105,22 +94,22 @@ msgstr "" "HTTP 知識來幫助你使用 *urllib*。這份教學並非要取代 :mod:`urllib.request` 這份" "文件,你還是會需要它。" -#: ../../howto/urllib2.rst:51 +#: ../../howto/urllib2.rst:44 msgid "Fetching URLs" msgstr "從 URL 取得資源" -#: ../../howto/urllib2.rst:53 +#: ../../howto/urllib2.rst:46 msgid "The simplest way to use urllib.request is as follows::" msgstr "以下是使用 urllib.request 最簡單的方法::" -#: ../../howto/urllib2.rst:59 +#: ../../howto/urllib2.rst:52 msgid "" "If you wish to retrieve a resource via URL and store it in a temporary " "location, you can do so via the :func:`shutil.copyfileobj` and :func:" "`tempfile.NamedTemporaryFile` functions::" msgstr "" -#: ../../howto/urllib2.rst:74 +#: ../../howto/urllib2.rst:67 msgid "" "Many uses of urllib will be that simple (note that instead of an 'http:' URL " "we could have used a URL starting with 'ftp:', 'file:', etc.). However, " @@ -128,7 +117,7 @@ msgid "" "concentrating on HTTP." msgstr "" -#: ../../howto/urllib2.rst:79 +#: ../../howto/urllib2.rst:72 msgid "" "HTTP is based on requests and responses - the client makes requests and " "servers send responses. urllib.request mirrors this with a ``Request`` " @@ -139,13 +128,13 @@ msgid "" "for example call ``.read()`` on the response::" msgstr "" -#: ../../howto/urllib2.rst:93 +#: ../../howto/urllib2.rst:86 msgid "" "Note that urllib.request makes use of the same Request interface to handle " "all URL schemes. For example, you can make an FTP request like so::" msgstr "" -#: ../../howto/urllib2.rst:98 +#: ../../howto/urllib2.rst:91 msgid "" "In the case of HTTP, there are two extra things that Request objects allow " "you to do: First, you can pass data to be sent to the server. Second, you " @@ -154,11 +143,11 @@ msgid "" "\"headers\". Let's look at each of these in turn." msgstr "" -#: ../../howto/urllib2.rst:105 +#: ../../howto/urllib2.rst:98 msgid "Data" msgstr "" -#: ../../howto/urllib2.rst:107 +#: ../../howto/urllib2.rst:100 msgid "" "Sometimes you want to send data to a URL (often the URL will refer to a CGI " "(Common Gateway Interface) script or other web application). With HTTP, this " @@ -171,14 +160,14 @@ msgid "" "function from the :mod:`urllib.parse` library. ::" msgstr "" -#: ../../howto/urllib2.rst:131 +#: ../../howto/urllib2.rst:124 msgid "" "Note that other encodings are sometimes required (e.g. for file upload from " "HTML forms - see `HTML Specification, Form Submission `_ for more details)." msgstr "" -#: ../../howto/urllib2.rst:136 +#: ../../howto/urllib2.rst:129 msgid "" "If you do not pass the ``data`` argument, urllib uses a **GET** request. One " "way in which GET and POST requests differ is that POST requests often have " @@ -191,27 +180,27 @@ msgid "" "be passed in an HTTP GET request by encoding it in the URL itself." msgstr "" -#: ../../howto/urllib2.rst:146 +#: ../../howto/urllib2.rst:139 msgid "This is done as follows::" msgstr "" -#: ../../howto/urllib2.rst:161 +#: ../../howto/urllib2.rst:154 msgid "" "Notice that the full URL is created by adding a ``?`` to the URL, followed " "by the encoded values." msgstr "" -#: ../../howto/urllib2.rst:165 +#: ../../howto/urllib2.rst:158 msgid "Headers" msgstr "" -#: ../../howto/urllib2.rst:167 +#: ../../howto/urllib2.rst:160 msgid "" "We'll discuss here one particular HTTP header, to illustrate how to add " "headers to your HTTP request." msgstr "" -#: ../../howto/urllib2.rst:170 +#: ../../howto/urllib2.rst:163 msgid "" "Some websites [#]_ dislike being browsed by programs, or send different " "versions to different browsers [#]_. By default urllib identifies itself as " @@ -224,39 +213,39 @@ msgid "" "Explorer [#]_. ::" msgstr "" -#: ../../howto/urllib2.rst:197 +#: ../../howto/urllib2.rst:190 msgid "" "The response also has two useful methods. See the section on `info and " "geturl`_ which comes after we have a look at what happens when things go " "wrong." msgstr "" -#: ../../howto/urllib2.rst:202 +#: ../../howto/urllib2.rst:195 msgid "Handling Exceptions" msgstr "" -#: ../../howto/urllib2.rst:204 +#: ../../howto/urllib2.rst:197 msgid "" "*urlopen* raises :exc:`URLError` when it cannot handle a response (though as " "usual with Python APIs, built-in exceptions such as :exc:`ValueError`, :exc:" "`TypeError` etc. may also be raised)." msgstr "" -#: ../../howto/urllib2.rst:208 +#: ../../howto/urllib2.rst:201 msgid "" ":exc:`HTTPError` is the subclass of :exc:`URLError` raised in the specific " "case of HTTP URLs." msgstr "" -#: ../../howto/urllib2.rst:211 +#: ../../howto/urllib2.rst:204 msgid "The exception classes are exported from the :mod:`urllib.error` module." msgstr "" -#: ../../howto/urllib2.rst:214 +#: ../../howto/urllib2.rst:207 msgid "URLError" msgstr "URLError" -#: ../../howto/urllib2.rst:216 +#: ../../howto/urllib2.rst:209 msgid "" "Often, URLError is raised because there is no network connection (no route " "to the specified server), or the specified server doesn't exist. In this " @@ -264,15 +253,15 @@ msgid "" "containing an error code and a text error message." msgstr "" -#: ../../howto/urllib2.rst:221 +#: ../../howto/urllib2.rst:214 msgid "e.g. ::" msgstr "" -#: ../../howto/urllib2.rst:232 +#: ../../howto/urllib2.rst:225 msgid "HTTPError" msgstr "HTTPError" -#: ../../howto/urllib2.rst:234 +#: ../../howto/urllib2.rst:227 msgid "" "Every HTTP response from the server contains a numeric \"status code\". " "Sometimes the status code indicates that the server is unable to fulfil the " @@ -284,36 +273,36 @@ msgid "" "'401' (authentication required)." msgstr "" -#: ../../howto/urllib2.rst:242 +#: ../../howto/urllib2.rst:235 msgid "" "See section 10 of :rfc:`2616` for a reference on all the HTTP error codes." msgstr "" -#: ../../howto/urllib2.rst:244 +#: ../../howto/urllib2.rst:237 msgid "" "The :exc:`HTTPError` instance raised will have an integer 'code' attribute, " "which corresponds to the error sent by the server." msgstr "" -#: ../../howto/urllib2.rst:248 +#: ../../howto/urllib2.rst:241 msgid "Error Codes" msgstr "" -#: ../../howto/urllib2.rst:250 +#: ../../howto/urllib2.rst:243 msgid "" "Because the default handlers handle redirects (codes in the 300 range), and " "codes in the 100--299 range indicate success, you will usually only see " "error codes in the 400--599 range." msgstr "" -#: ../../howto/urllib2.rst:254 +#: ../../howto/urllib2.rst:247 msgid "" ":attr:`http.server.BaseHTTPRequestHandler.responses` is a useful dictionary " "of response codes in that shows all the response codes used by :rfc:`2616`. " "The dictionary is reproduced here for convenience ::" msgstr "" -#: ../../howto/urllib2.rst:326 +#: ../../howto/urllib2.rst:319 msgid "" "When an error is raised the server responds by returning an HTTP error code " "*and* an error page. You can use the :exc:`HTTPError` instance as a response " @@ -322,42 +311,42 @@ msgid "" "module::" msgstr "" -#: ../../howto/urllib2.rst:346 +#: ../../howto/urllib2.rst:339 msgid "Wrapping it Up" msgstr "" -#: ../../howto/urllib2.rst:348 +#: ../../howto/urllib2.rst:341 msgid "" "So if you want to be prepared for :exc:`HTTPError` *or* :exc:`URLError` " "there are two basic approaches. I prefer the second approach." msgstr "" -#: ../../howto/urllib2.rst:352 +#: ../../howto/urllib2.rst:345 msgid "Number 1" msgstr "" -#: ../../howto/urllib2.rst:374 +#: ../../howto/urllib2.rst:367 msgid "" "The ``except HTTPError`` *must* come first, otherwise ``except URLError`` " "will *also* catch an :exc:`HTTPError`." msgstr "" -#: ../../howto/urllib2.rst:378 +#: ../../howto/urllib2.rst:371 msgid "Number 2" msgstr "" -#: ../../howto/urllib2.rst:399 +#: ../../howto/urllib2.rst:392 msgid "info and geturl" msgstr "" -#: ../../howto/urllib2.rst:401 +#: ../../howto/urllib2.rst:394 msgid "" "The response returned by urlopen (or the :exc:`HTTPError` instance) has two " "useful methods :meth:`info` and :meth:`geturl` and is defined in the module :" "mod:`urllib.response`.." msgstr "" -#: ../../howto/urllib2.rst:405 +#: ../../howto/urllib2.rst:398 msgid "" "**geturl** - this returns the real URL of the page fetched. This is useful " "because ``urlopen`` (or the opener object used) may have followed a " @@ -365,14 +354,14 @@ msgid "" "requested." msgstr "" -#: ../../howto/urllib2.rst:409 +#: ../../howto/urllib2.rst:402 msgid "" "**info** - this returns a dictionary-like object that describes the page " "fetched, particularly the headers sent by the server. It is currently an :" "class:`http.client.HTTPMessage` instance." msgstr "" -#: ../../howto/urllib2.rst:413 +#: ../../howto/urllib2.rst:406 msgid "" "Typical headers include 'Content-length', 'Content-type', and so on. See the " "`Quick Reference to HTTP Headers `_ for a " @@ -380,11 +369,11 @@ msgid "" "use." msgstr "" -#: ../../howto/urllib2.rst:420 +#: ../../howto/urllib2.rst:413 msgid "Openers and Handlers" msgstr "" -#: ../../howto/urllib2.rst:422 +#: ../../howto/urllib2.rst:415 msgid "" "When you fetch a URL you use an opener (an instance of the perhaps " "confusingly named :class:`urllib.request.OpenerDirector`). Normally we have " @@ -395,20 +384,20 @@ msgid "" "HTTP redirections or HTTP cookies." msgstr "" -#: ../../howto/urllib2.rst:430 +#: ../../howto/urllib2.rst:423 msgid "" "You will want to create openers if you want to fetch URLs with specific " "handlers installed, for example to get an opener that handles cookies, or to " "get an opener that does not handle redirections." msgstr "" -#: ../../howto/urllib2.rst:434 +#: ../../howto/urllib2.rst:427 msgid "" "To create an opener, instantiate an ``OpenerDirector``, and then call ``." "add_handler(some_handler_instance)`` repeatedly." msgstr "" -#: ../../howto/urllib2.rst:437 +#: ../../howto/urllib2.rst:430 msgid "" "Alternatively, you can use ``build_opener``, which is a convenience function " "for creating opener objects with a single function call. ``build_opener`` " @@ -416,31 +405,31 @@ msgid "" "or override the default handlers." msgstr "" -#: ../../howto/urllib2.rst:442 +#: ../../howto/urllib2.rst:435 msgid "" "Other sorts of handlers you might want to can handle proxies, " "authentication, and other common but slightly specialised situations." msgstr "" -#: ../../howto/urllib2.rst:445 +#: ../../howto/urllib2.rst:438 msgid "" "``install_opener`` can be used to make an ``opener`` object the (global) " "default opener. This means that calls to ``urlopen`` will use the opener you " "have installed." msgstr "" -#: ../../howto/urllib2.rst:449 +#: ../../howto/urllib2.rst:442 msgid "" "Opener objects have an ``open`` method, which can be called directly to " "fetch urls in the same way as the ``urlopen`` function: there's no need to " "call ``install_opener``, except as a convenience." msgstr "" -#: ../../howto/urllib2.rst:455 +#: ../../howto/urllib2.rst:448 msgid "Basic Authentication" msgstr "" -#: ../../howto/urllib2.rst:457 +#: ../../howto/urllib2.rst:450 msgid "" "To illustrate creating and installing a handler we will use the " "``HTTPBasicAuthHandler``. For a more detailed discussion of this subject -- " @@ -449,7 +438,7 @@ msgid "" "www.voidspace.org.uk/python/articles/authentication.shtml>`__." msgstr "" -#: ../../howto/urllib2.rst:463 +#: ../../howto/urllib2.rst:456 msgid "" "When authentication is required, the server sends a header (as well as the " "401 error code) requesting authentication. This specifies the " @@ -457,11 +446,11 @@ msgid "" "Authenticate: SCHEME realm=\"REALM\"``." msgstr "" -#: ../../howto/urllib2.rst:468 +#: ../../howto/urllib2.rst:461 msgid "e.g." msgstr "" -#: ../../howto/urllib2.rst:475 +#: ../../howto/urllib2.rst:468 msgid "" "The client should then retry the request with the appropriate name and " "password for the realm included as a header in the request. This is 'basic " @@ -469,7 +458,7 @@ msgid "" "of ``HTTPBasicAuthHandler`` and an opener to use this handler." msgstr "" -#: ../../howto/urllib2.rst:480 +#: ../../howto/urllib2.rst:473 msgid "" "The ``HTTPBasicAuthHandler`` uses an object called a password manager to " "handle the mapping of URLs and realms to passwords and usernames. If you " @@ -482,13 +471,13 @@ msgid "" "by providing ``None`` as the realm argument to the ``add_password`` method." msgstr "" -#: ../../howto/urllib2.rst:490 +#: ../../howto/urllib2.rst:483 msgid "" "The top-level URL is the first URL that requires authentication. URLs " "\"deeper\" than the URL you pass to .add_password() will also match. ::" msgstr "" -#: ../../howto/urllib2.rst:515 +#: ../../howto/urllib2.rst:508 msgid "" "In the above example we only supplied our ``HTTPBasicAuthHandler`` to " "``build_opener``. By default openers have the handlers for normal situations " @@ -498,7 +487,7 @@ msgid "" "``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor``." msgstr "" -#: ../../howto/urllib2.rst:522 +#: ../../howto/urllib2.rst:515 msgid "" "``top_level_url`` is in fact *either* a full URL (including the 'http:' " "scheme component and the hostname and optionally the port number) e.g. " @@ -509,11 +498,11 @@ msgid "" "example ``\"joe:password@example.com\"`` is not correct." msgstr "" -#: ../../howto/urllib2.rst:532 +#: ../../howto/urllib2.rst:525 msgid "Proxies" msgstr "" -#: ../../howto/urllib2.rst:534 +#: ../../howto/urllib2.rst:527 msgid "" "**urllib** will auto-detect your proxy settings and use those. This is " "through the ``ProxyHandler``, which is part of the normal handler chain when " @@ -523,30 +512,30 @@ msgid "" "similar steps to setting up a `Basic Authentication`_ handler: ::" msgstr "" -#: ../../howto/urllib2.rst:547 +#: ../../howto/urllib2.rst:540 msgid "" "Currently ``urllib.request`` *does not* support fetching of ``https`` " "locations through a proxy. However, this can be enabled by extending urllib." "request as shown in the recipe [#]_." msgstr "" -#: ../../howto/urllib2.rst:553 +#: ../../howto/urllib2.rst:546 msgid "" "``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see " "the documentation on :func:`~urllib.request.getproxies`." msgstr "" -#: ../../howto/urllib2.rst:558 +#: ../../howto/urllib2.rst:551 msgid "Sockets and Layers" msgstr "" -#: ../../howto/urllib2.rst:560 +#: ../../howto/urllib2.rst:553 msgid "" "The Python support for fetching resources from the web is layered. urllib " "uses the :mod:`http.client` library, which in turn uses the socket library." msgstr "" -#: ../../howto/urllib2.rst:563 +#: ../../howto/urllib2.rst:556 msgid "" "As of Python 2.3 you can specify how long a socket should wait for a " "response before timing out. This can be useful in applications which have to " @@ -556,38 +545,38 @@ msgid "" "sockets using ::" msgstr "" -#: ../../howto/urllib2.rst:586 +#: ../../howto/urllib2.rst:579 msgid "Footnotes" msgstr "註解" -#: ../../howto/urllib2.rst:588 +#: ../../howto/urllib2.rst:581 msgid "This document was reviewed and revised by John Lee." msgstr "" -#: ../../howto/urllib2.rst:590 +#: ../../howto/urllib2.rst:583 msgid "Google for example." msgstr "" -#: ../../howto/urllib2.rst:591 +#: ../../howto/urllib2.rst:584 msgid "" "Browser sniffing is a very bad practice for website design - building sites " "using web standards is much more sensible. Unfortunately a lot of sites " "still send different versions to different browsers." msgstr "" -#: ../../howto/urllib2.rst:594 +#: ../../howto/urllib2.rst:587 msgid "" "The user agent for MSIE 6 is *'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT " "5.1; SV1; .NET CLR 1.1.4322)'*" msgstr "" -#: ../../howto/urllib2.rst:596 +#: ../../howto/urllib2.rst:589 msgid "" "For details of more HTTP request headers, see `Quick Reference to HTTP " "Headers`_." msgstr "" -#: ../../howto/urllib2.rst:598 +#: ../../howto/urllib2.rst:591 msgid "" "In my case I have to use a proxy to access the internet at work. If you " "attempt to fetch *localhost* URLs through this proxy it blocks them. IE is " @@ -595,8 +584,18 @@ msgid "" "with a localhost server, I have to prevent urllib from using the proxy." msgstr "" -#: ../../howto/urllib2.rst:603 +#: ../../howto/urllib2.rst:596 msgid "" "urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_." msgstr "" + +#~ msgid "" +#~ "There is a French translation of an earlier revision of this HOWTO, " +#~ "available at `urllib2 - Le Manuel manquant `_." +#~ msgstr "" +#~ "這份指南出自於早期版本的法文翻譯 `urllib2 - Le Manuel manquant `_\\ 。" From d5a5988ac8698fd0969ebb2b07566e53adafd163 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 25 May 2023 00:31:35 +0000 Subject: [PATCH 094/130] sync with cpython 3b3f2e10 --- library/typing.po | 470 ++++++++++++++++++++++++---------------------- 1 file changed, 241 insertions(+), 229 deletions(-) diff --git a/library/typing.po b/library/typing.po index 4b279e69c6..f56f936b7a 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-22 00:31+0000\n" +"POT-Creation-Date: 2023-05-25 00:29+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -351,7 +351,7 @@ msgid "" msgstr "" #: ../../library/typing.rst:229 ../../library/typing.rst:1186 -#: ../../library/typing.rst:2837 +#: ../../library/typing.rst:2849 msgid "For example::" msgstr "" "舉例來說:\n" @@ -684,7 +684,7 @@ msgid "" "``LiteralString``-typed objects is also acceptable as a ``LiteralString``." msgstr "" -#: ../../library/typing.rst:637 ../../library/typing.rst:2466 +#: ../../library/typing.rst:637 ../../library/typing.rst:2478 msgid "Example::" msgstr "" "舉例來說:\n" @@ -1051,7 +1051,7 @@ msgid "" "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1053 ../../library/typing.rst:2707 +#: ../../library/typing.rst:1053 ../../library/typing.rst:2719 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1567,21 +1567,33 @@ msgid "" msgstr "" #: ../../library/typing.rst:1633 +msgid "The module in which the new type is defined." +msgstr "" + +#: ../../library/typing.rst:1637 +msgid "The name of the new type." +msgstr "" + +#: ../../library/typing.rst:1641 +msgid "The type that the new type is based on." +msgstr "" + +#: ../../library/typing.rst:1645 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1638 +#: ../../library/typing.rst:1650 msgid "" "Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1644 +#: ../../library/typing.rst:1656 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1656 +#: ../../library/typing.rst:1668 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1589,15 +1601,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1661 +#: ../../library/typing.rst:1673 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1671 +#: ../../library/typing.rst:1683 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1673 +#: ../../library/typing.rst:1685 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1606,7 +1618,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1693 +#: ../../library/typing.rst:1705 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1617,7 +1629,7 @@ msgid "" "SSLObject`." msgstr "" -#: ../../library/typing.rst:1704 +#: ../../library/typing.rst:1716 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1625,13 +1637,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1715 +#: ../../library/typing.rst:1727 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1718 +#: ../../library/typing.rst:1730 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1639,53 +1651,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1734 +#: ../../library/typing.rst:1746 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1738 +#: ../../library/typing.rst:1750 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1742 +#: ../../library/typing.rst:1754 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1749 +#: ../../library/typing.rst:1761 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1750 +#: ../../library/typing.rst:1762 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1762 +#: ../../library/typing.rst:1774 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1773 +#: ../../library/typing.rst:1785 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1776 +#: ../../library/typing.rst:1788 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1786 +#: ../../library/typing.rst:1798 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1693,61 +1705,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1791 +#: ../../library/typing.rst:1803 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:1806 +#: ../../library/typing.rst:1818 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1813 +#: ../../library/typing.rst:1825 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1821 +#: ../../library/typing.rst:1833 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:1839 +#: ../../library/typing.rst:1851 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:1845 +#: ../../library/typing.rst:1857 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:1851 +#: ../../library/typing.rst:1863 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example::" msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:1883 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:1874 +#: ../../library/typing.rst:1886 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:1877 +#: ../../library/typing.rst:1889 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1756,162 +1768,162 @@ msgid "" "``TypedDict`` with a different value for ``total``::" msgstr "" -#: ../../library/typing.rst:1898 +#: ../../library/typing.rst:1910 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1902 +#: ../../library/typing.rst:1914 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:1906 +#: ../../library/typing.rst:1918 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:1910 +#: ../../library/typing.rst:1922 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1913 +#: ../../library/typing.rst:1925 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1917 +#: ../../library/typing.rst:1929 msgid "" "A generic version of :class:`dict`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Mapping`." msgstr "" -#: ../../library/typing.rst:1921 +#: ../../library/typing.rst:1933 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1926 +#: ../../library/typing.rst:1938 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1932 +#: ../../library/typing.rst:1944 msgid "" "Generic version of :class:`list`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:1937 +#: ../../library/typing.rst:1949 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1947 +#: ../../library/typing.rst:1959 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:1965 msgid "" "A generic version of :class:`builtins.set `. Useful for annotating " "return types. To annotate arguments it is preferred to use an abstract " "collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:1957 +#: ../../library/typing.rst:1969 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1963 +#: ../../library/typing.rst:1975 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1965 +#: ../../library/typing.rst:1977 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1970 +#: ../../library/typing.rst:1982 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1973 +#: ../../library/typing.rst:1985 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1977 +#: ../../library/typing.rst:1989 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1981 +#: ../../library/typing.rst:1993 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1987 +#: ../../library/typing.rst:1999 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:1991 +#: ../../library/typing.rst:2003 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1997 +#: ../../library/typing.rst:2009 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2002 +#: ../../library/typing.rst:2014 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2008 +#: ../../library/typing.rst:2020 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2013 +#: ../../library/typing.rst:2025 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2019 +#: ../../library/typing.rst:2031 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2024 +#: ../../library/typing.rst:2036 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2029 +#: ../../library/typing.rst:2041 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2035 +#: ../../library/typing.rst:2047 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2042 +#: ../../library/typing.rst:2054 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2047 +#: ../../library/typing.rst:2059 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1919,439 +1931,439 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2057 +#: ../../library/typing.rst:2069 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2058 +#: ../../library/typing.rst:2070 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2064 +#: ../../library/typing.rst:2076 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:2068 +#: ../../library/typing.rst:2080 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2076 +#: ../../library/typing.rst:2088 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2083 +#: ../../library/typing.rst:2095 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2086 +#: ../../library/typing.rst:2098 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2090 +#: ../../library/typing.rst:2102 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2092 +#: ../../library/typing.rst:2104 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2098 +#: ../../library/typing.rst:2110 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2102 +#: ../../library/typing.rst:2114 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2106 +#: ../../library/typing.rst:2118 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:2110 +#: ../../library/typing.rst:2122 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2116 +#: ../../library/typing.rst:2128 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2130 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2124 +#: ../../library/typing.rst:2136 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2126 +#: ../../library/typing.rst:2138 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2132 +#: ../../library/typing.rst:2144 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2134 +#: ../../library/typing.rst:2146 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2140 +#: ../../library/typing.rst:2152 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:2146 +#: ../../library/typing.rst:2158 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2152 +#: ../../library/typing.rst:2164 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2154 +#: ../../library/typing.rst:2166 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2160 +#: ../../library/typing.rst:2172 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2162 +#: ../../library/typing.rst:2174 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2169 +#: ../../library/typing.rst:2181 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2171 +#: ../../library/typing.rst:2183 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2178 +#: ../../library/typing.rst:2190 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2180 +#: ../../library/typing.rst:2192 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2186 +#: ../../library/typing.rst:2198 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2188 +#: ../../library/typing.rst:2200 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2194 +#: ../../library/typing.rst:2206 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2196 +#: ../../library/typing.rst:2208 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2201 +#: ../../library/typing.rst:2213 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2205 +#: ../../library/typing.rst:2217 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2219 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2213 +#: ../../library/typing.rst:2225 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2215 +#: ../../library/typing.rst:2227 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2221 +#: ../../library/typing.rst:2233 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2230 +#: ../../library/typing.rst:2242 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2234 +#: ../../library/typing.rst:2246 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2242 +#: ../../library/typing.rst:2254 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2250 +#: ../../library/typing.rst:2262 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2256 +#: ../../library/typing.rst:2268 msgid "An alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2260 +#: ../../library/typing.rst:2272 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2262 +#: ../../library/typing.rst:2274 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2268 +#: ../../library/typing.rst:2280 msgid "An alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2283 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2275 +#: ../../library/typing.rst:2287 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:2287 +#: ../../library/typing.rst:2299 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2293 +#: ../../library/typing.rst:2305 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2302 +#: ../../library/typing.rst:2314 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2306 +#: ../../library/typing.rst:2318 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2314 +#: ../../library/typing.rst:2326 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2324 +#: ../../library/typing.rst:2336 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2331 +#: ../../library/typing.rst:2343 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2335 +#: ../../library/typing.rst:2347 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2341 +#: ../../library/typing.rst:2353 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2345 +#: ../../library/typing.rst:2357 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2351 +#: ../../library/typing.rst:2363 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2355 +#: ../../library/typing.rst:2367 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2361 +#: ../../library/typing.rst:2373 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2365 +#: ../../library/typing.rst:2377 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2370 +#: ../../library/typing.rst:2382 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2377 +#: ../../library/typing.rst:2389 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2382 +#: ../../library/typing.rst:2394 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2388 +#: ../../library/typing.rst:2400 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2390 +#: ../../library/typing.rst:2402 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2394 +#: ../../library/typing.rst:2406 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2399 +#: ../../library/typing.rst:2411 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2403 +#: ../../library/typing.rst:2415 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2407 +#: ../../library/typing.rst:2419 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2411 +#: ../../library/typing.rst:2423 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2417 +#: ../../library/typing.rst:2429 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2421 +#: ../../library/typing.rst:2433 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2425 +#: ../../library/typing.rst:2437 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2429 +#: ../../library/typing.rst:2441 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2431 +#: ../../library/typing.rst:2443 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2438 +#: ../../library/typing.rst:2450 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2440 +#: ../../library/typing.rst:2452 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2443 +#: ../../library/typing.rst:2455 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2450 +#: ../../library/typing.rst:2462 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2464 +#: ../../library/typing.rst:2476 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2489 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " @@ -2364,53 +2376,53 @@ msgid "" "bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2489 +#: ../../library/typing.rst:2501 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2492 +#: ../../library/typing.rst:2504 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2500 +#: ../../library/typing.rst:2512 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2502 +#: ../../library/typing.rst:2514 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2508 +#: ../../library/typing.rst:2520 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2511 +#: ../../library/typing.rst:2523 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2516 +#: ../../library/typing.rst:2528 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2521 +#: ../../library/typing.rst:2533 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2531 +#: ../../library/typing.rst:2543 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -2419,19 +2431,19 @@ msgid "" "`dataclasses.dataclass`-like behaviors." msgstr "" -#: ../../library/typing.rst:2537 +#: ../../library/typing.rst:2549 msgid "Example usage with a decorator function::" msgstr "" -#: ../../library/typing.rst:2551 +#: ../../library/typing.rst:2563 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2560 +#: ../../library/typing.rst:2572 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2571 +#: ../../library/typing.rst:2583 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*. *func* is the function object for the implementation of the " @@ -2577,25 +2589,25 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2673 +#: ../../library/typing.rst:2685 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2681 +#: ../../library/typing.rst:2693 msgid "" "Clear all registered overloads in the internal registry. This can be used to " "reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2689 +#: ../../library/typing.rst:2701 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2712 +#: ../../library/typing.rst:2724 msgid "" "The decorator will now set the ``__final__`` attribute to ``True`` on the " "decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2605,59 +2617,59 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2723 +#: ../../library/typing.rst:2735 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2725 +#: ../../library/typing.rst:2737 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods and classes defined in that class (but not to " "methods defined in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2729 +#: ../../library/typing.rst:2741 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2733 +#: ../../library/typing.rst:2745 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2735 +#: ../../library/typing.rst:2747 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2740 +#: ../../library/typing.rst:2752 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2742 +#: ../../library/typing.rst:2754 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2753 +#: ../../library/typing.rst:2765 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2757 +#: ../../library/typing.rst:2769 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2761 +#: ../../library/typing.rst:2773 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2764 +#: ../../library/typing.rst:2776 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2666,32 +2678,32 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2770 +#: ../../library/typing.rst:2782 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2785 +#: ../../library/typing.rst:2797 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2790 +#: ../../library/typing.rst:2802 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2793 +#: ../../library/typing.rst:2805 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2800 +#: ../../library/typing.rst:2812 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``. If ``X`` is a generic alias for a builtin or :" @@ -2701,7 +2713,7 @@ msgid "" "Examples::" msgstr "" -#: ../../library/typing.rst:2819 +#: ../../library/typing.rst:2831 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``. If ``X`` is a union or :" @@ -2711,11 +2723,11 @@ msgid "" "Examples::" msgstr "" -#: ../../library/typing.rst:2835 +#: ../../library/typing.rst:2847 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2850 +#: ../../library/typing.rst:2862 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2723,24 +2735,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2856 +#: ../../library/typing.rst:2868 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2875 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2867 +#: ../../library/typing.rst:2879 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2876 +#: ../../library/typing.rst:2888 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2748,7 +2760,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2895 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2756,11 +2768,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2892 +#: ../../library/typing.rst:2904 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2906 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2768,76 +2780,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:2899 +#: ../../library/typing.rst:2911 msgid "Feature" msgstr "" -#: ../../library/typing.rst:2899 +#: ../../library/typing.rst:2911 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:2899 +#: ../../library/typing.rst:2911 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:2899 +#: ../../library/typing.rst:2911 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:2901 +#: ../../library/typing.rst:2913 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:2901 +#: ../../library/typing.rst:2913 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:2901 +#: ../../library/typing.rst:2913 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:2901 +#: ../../library/typing.rst:2913 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2916 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:2904 ../../library/typing.rst:2907 +#: ../../library/typing.rst:2916 ../../library/typing.rst:2919 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:2904 ../../library/typing.rst:2909 +#: ../../library/typing.rst:2916 ../../library/typing.rst:2921 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2916 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:2907 +#: ../../library/typing.rst:2919 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2907 +#: ../../library/typing.rst:2919 msgid "3.14" msgstr "" -#: ../../library/typing.rst:2907 +#: ../../library/typing.rst:2919 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:2909 +#: ../../library/typing.rst:2921 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2909 +#: ../../library/typing.rst:2921 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:2909 +#: ../../library/typing.rst:2921 msgid ":gh:`92332`" msgstr ":gh:`92332`" From 002b6e67f41490c9fd8b9773a20c3a3b3535c30b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 27 May 2023 00:34:22 +0000 Subject: [PATCH 095/130] sync with cpython a6326972 --- library/ast.po | 159 ++++++++++++++++++-------------------- tutorial/floatingpoint.po | 93 ++++++++++++---------- 2 files changed, 127 insertions(+), 125 deletions(-) diff --git a/library/ast.po b/library/ast.po index a5f073c74d..fb296d5d1b 100644 --- a/library/ast.po +++ b/library/ast.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-05-27 00:32+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-" @@ -365,7 +365,7 @@ msgstr "" #: ../../library/ast.rst:493 msgid "" "When creating a ``Call`` node, ``args`` and ``keywords`` are required, but " -"they can be empty lists. ``starargs`` and ``kwargs`` are optional." +"they can be empty lists." msgstr "" #: ../../library/ast.rst:517 @@ -862,45 +862,38 @@ msgstr "" #: ../../library/ast.rst:1830 msgid "" -"``starargs`` and ``kwargs`` are each a single node, as in a function call. " -"starargs will be expanded to join the list of base classes, and kwargs will " -"be passed to the metaclass." -msgstr "" - -#: ../../library/ast.rst:1833 -msgid "" "``body`` is a list of nodes representing the code within the class " "definition." msgstr "" -#: ../../library/ast.rst:1835 +#: ../../library/ast.rst:1832 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "" -#: ../../library/ast.rst:1864 +#: ../../library/ast.rst:1861 msgid "Async and await" msgstr "" -#: ../../library/ast.rst:1868 +#: ../../library/ast.rst:1865 msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." msgstr "" -#: ../../library/ast.rst:1874 +#: ../../library/ast.rst:1871 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:1907 +#: ../../library/ast.rst:1904 msgid "" "``async for`` loops and ``async with`` context managers. They have the same " "fields as :class:`For` and :class:`With`, respectively. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:1912 +#: ../../library/ast.rst:1909 msgid "" "When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" "class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." @@ -909,23 +902,23 @@ msgid "" "same value (e.g. :class:`ast.Add`)." msgstr "" -#: ../../library/ast.rst:1920 +#: ../../library/ast.rst:1917 msgid ":mod:`ast` Helpers" msgstr "" -#: ../../library/ast.rst:1922 +#: ../../library/ast.rst:1919 msgid "" "Apart from the node classes, the :mod:`ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" msgstr "" -#: ../../library/ast.rst:1927 +#: ../../library/ast.rst:1924 msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " "filename, mode, ast.PyCF_ONLY_AST)``." msgstr "" -#: ../../library/ast.rst:1930 +#: ../../library/ast.rst:1927 msgid "" "If ``type_comments=True`` is given, the parser is modified to check and " "return type comments as specified by :pep:`484` and :pep:`526`. This is " @@ -938,14 +931,14 @@ msgid "" "empty list)." msgstr "" -#: ../../library/ast.rst:1940 +#: ../../library/ast.rst:1937 msgid "" "In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " "correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> " "List[str]``." msgstr "" -#: ../../library/ast.rst:1944 +#: ../../library/ast.rst:1941 msgid "" "Also, setting ``feature_version`` to a tuple ``(major, minor)`` will attempt " "to parse using that Python version's grammar. Currently ``major`` must equal " @@ -954,12 +947,12 @@ msgid "" "version is ``(3, 4)``; the highest is ``sys.version_info[0:2]``." msgstr "" -#: ../../library/ast.rst:1951 +#: ../../library/ast.rst:1948 msgid "" "If source contains a null character ('\\0'), :exc:`ValueError` is raised." msgstr "" -#: ../../library/ast.rst:1954 +#: ../../library/ast.rst:1951 msgid "" "Note that successfully parsing source code into an AST object doesn't " "guarantee that the source code provided is valid Python code that can be " @@ -969,45 +962,45 @@ msgid "" "inside a function node)." msgstr "" -#: ../../library/ast.rst:1961 +#: ../../library/ast.rst:1958 msgid "" "In particular, :func:`ast.parse` won't do any scoping checks, which the " "compilation step does." msgstr "" -#: ../../library/ast.rst:1965 +#: ../../library/ast.rst:1962 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string due to stack depth limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:1969 +#: ../../library/ast.rst:1966 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" "新增 ``type_comments``\\ 、\\ ``mode='func_type'`` 與 " "``feature_version``\\ 。" -#: ../../library/ast.rst:1975 +#: ../../library/ast.rst:1972 msgid "" "Unparse an :class:`ast.AST` object and generate a string with code that " "would produce an equivalent :class:`ast.AST` object if parsed back with :" "func:`ast.parse`." msgstr "" -#: ../../library/ast.rst:1980 +#: ../../library/ast.rst:1977 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " "optimizations, such as constant tuples/frozensets)." msgstr "" -#: ../../library/ast.rst:1985 +#: ../../library/ast.rst:1982 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "" -#: ../../library/ast.rst:1993 +#: ../../library/ast.rst:1990 msgid "" "Evaluate an expression node or a string containing only a Python literal or " "container display. The string or node provided may only consist of the " @@ -1015,14 +1008,14 @@ msgid "" "dicts, sets, booleans, ``None`` and ``Ellipsis``." msgstr "" -#: ../../library/ast.rst:1998 +#: ../../library/ast.rst:1995 msgid "" "This can be used for evaluating strings containing Python values without the " "need to parse the values oneself. It is not capable of evaluating " "arbitrarily complex expressions, for example involving operators or indexing." msgstr "" -#: ../../library/ast.rst:2003 +#: ../../library/ast.rst:2000 msgid "" "This function had been documented as \"safe\" in the past without defining " "what that meant. That was misleading. This is specifically designed not to " @@ -1034,31 +1027,31 @@ msgid "" "untrusted data is thus not recommended." msgstr "" -#: ../../library/ast.rst:2013 +#: ../../library/ast.rst:2010 msgid "" "It is possible to crash the Python interpreter due to stack depth " "limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:2016 +#: ../../library/ast.rst:2013 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." msgstr "" -#: ../../library/ast.rst:2020 +#: ../../library/ast.rst:2017 msgid "Now allows bytes and set literals." msgstr "" -#: ../../library/ast.rst:2023 +#: ../../library/ast.rst:2020 msgid "Now supports creating empty sets with ``'set()'``." msgstr "" -#: ../../library/ast.rst:2026 +#: ../../library/ast.rst:2023 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "" -#: ../../library/ast.rst:2032 +#: ../../library/ast.rst:2029 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -1066,24 +1059,24 @@ msgid "" "clean up the docstring's indentation with :func:`inspect.cleandoc`." msgstr "" -#: ../../library/ast.rst:2038 +#: ../../library/ast.rst:2035 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "目前已支援 :class:`AsyncFunctionDef`\\ 。" -#: ../../library/ast.rst:2044 +#: ../../library/ast.rst:2041 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`lineno`, :attr:`end_lineno`, :attr:" "`col_offset`, or :attr:`end_col_offset`) is missing, return ``None``." msgstr "" -#: ../../library/ast.rst:2048 +#: ../../library/ast.rst:2045 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." msgstr "" -#: ../../library/ast.rst:2056 +#: ../../library/ast.rst:2053 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`lineno` and :attr:`col_offset` attributes for every node that supports " @@ -1092,77 +1085,77 @@ msgid "" "the values of the parent node. It works recursively starting at *node*." msgstr "" -#: ../../library/ast.rst:2065 +#: ../../library/ast.rst:2062 msgid "" "Increment the line number and end line number of each node in the tree " "starting at *node* by *n*. This is useful to \"move code\" to a different " "location in a file." msgstr "" -#: ../../library/ast.rst:2072 +#: ../../library/ast.rst:2069 msgid "" "Copy source location (:attr:`lineno`, :attr:`col_offset`, :attr:" "`end_lineno`, and :attr:`end_col_offset`) from *old_node* to *new_node* if " "possible, and return *new_node*." msgstr "" -#: ../../library/ast.rst:2079 +#: ../../library/ast.rst:2076 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." msgstr "" -#: ../../library/ast.rst:2085 +#: ../../library/ast.rst:2082 msgid "" "Yield all direct child nodes of *node*, that is, all fields that are nodes " "and all items of fields that are lists of nodes." msgstr "" -#: ../../library/ast.rst:2091 +#: ../../library/ast.rst:2088 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " "only want to modify nodes in place and don't care about the context." msgstr "" -#: ../../library/ast.rst:2098 +#: ../../library/ast.rst:2095 msgid "" "A node visitor base class that walks the abstract syntax tree and calls a " "visitor function for every node found. This function may return a value " "which is forwarded by the :meth:`visit` method." msgstr "" -#: ../../library/ast.rst:2102 +#: ../../library/ast.rst:2099 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "" -#: ../../library/ast.rst:2107 +#: ../../library/ast.rst:2104 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " "or :meth:`generic_visit` if that method doesn't exist." msgstr "" -#: ../../library/ast.rst:2113 +#: ../../library/ast.rst:2110 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "" -#: ../../library/ast.rst:2115 +#: ../../library/ast.rst:2112 msgid "" "Note that child nodes of nodes that have a custom visitor method won't be " "visited unless the visitor calls :meth:`generic_visit` or visits them itself." msgstr "" -#: ../../library/ast.rst:2119 +#: ../../library/ast.rst:2116 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" "`NodeTransformer`) that allows modifications." msgstr "" -#: ../../library/ast.rst:2125 +#: ../../library/ast.rst:2122 msgid "" "Methods :meth:`visit_Num`, :meth:`visit_Str`, :meth:`visit_Bytes`, :meth:" "`visit_NameConstant` and :meth:`visit_Ellipsis` are deprecated now and will " @@ -1170,13 +1163,13 @@ msgid "" "method to handle all constant nodes." msgstr "" -#: ../../library/ast.rst:2133 +#: ../../library/ast.rst:2130 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "" -#: ../../library/ast.rst:2136 +#: ../../library/ast.rst:2133 msgid "" "The :class:`NodeTransformer` will walk the AST and use the return value of " "the visitor methods to replace or remove the old node. If the return value " @@ -1185,27 +1178,27 @@ msgid "" "may be the original node in which case no replacement takes place." msgstr "" -#: ../../library/ast.rst:2142 +#: ../../library/ast.rst:2139 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" msgstr "" -#: ../../library/ast.rst:2154 +#: ../../library/ast.rst:2151 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " "either transform the child nodes yourself or call the :meth:`generic_visit` " "method for the node first." msgstr "" -#: ../../library/ast.rst:2158 +#: ../../library/ast.rst:2155 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " "just a single node." msgstr "" -#: ../../library/ast.rst:2162 +#: ../../library/ast.rst:2159 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:" @@ -1213,11 +1206,11 @@ msgid "" "tree to recalculate the location information::" msgstr "" -#: ../../library/ast.rst:2170 +#: ../../library/ast.rst:2167 msgid "Usually you use the transformer like this::" msgstr "" -#: ../../library/ast.rst:2177 +#: ../../library/ast.rst:2174 msgid "" "Return a formatted dump of the tree in *node*. This is mainly useful for " "debugging purposes. If *annotate_fields* is true (by default), the returned " @@ -1228,7 +1221,7 @@ msgid "" "true." msgstr "" -#: ../../library/ast.rst:2185 +#: ../../library/ast.rst:2182 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " "pretty-printed with that indent level. An indent level of 0, negative, or " @@ -1238,87 +1231,87 @@ msgid "" "string is used to indent each level." msgstr "" -#: ../../library/ast.rst:2192 +#: ../../library/ast.rst:2189 msgid "Added the *indent* option." msgstr "新增 *indent* 選項。" -#: ../../library/ast.rst:2199 +#: ../../library/ast.rst:2196 msgid "Compiler Flags" msgstr "" -#: ../../library/ast.rst:2201 +#: ../../library/ast.rst:2198 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" msgstr "" -#: ../../library/ast.rst:2206 +#: ../../library/ast.rst:2203 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." msgstr "" -#: ../../library/ast.rst:2213 +#: ../../library/ast.rst:2210 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "" -#: ../../library/ast.rst:2218 +#: ../../library/ast.rst:2215 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." msgstr "" -#: ../../library/ast.rst:2227 +#: ../../library/ast.rst:2224 msgid "Command-Line Usage" msgstr "" -#: ../../library/ast.rst:2231 +#: ../../library/ast.rst:2228 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr "" -#: ../../library/ast.rst:2238 +#: ../../library/ast.rst:2235 msgid "The following options are accepted:" msgstr "" -#: ../../library/ast.rst:2244 +#: ../../library/ast.rst:2241 msgid "Show the help message and exit." msgstr "" -#: ../../library/ast.rst:2249 +#: ../../library/ast.rst:2246 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "" -#: ../../library/ast.rst:2254 +#: ../../library/ast.rst:2251 msgid "Don't parse type comments." msgstr "" -#: ../../library/ast.rst:2258 +#: ../../library/ast.rst:2255 msgid "Include attributes such as line numbers and column offsets." msgstr "" -#: ../../library/ast.rst:2263 +#: ../../library/ast.rst:2260 msgid "Indentation of nodes in AST (number of spaces)." msgstr "" -#: ../../library/ast.rst:2265 +#: ../../library/ast.rst:2262 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." msgstr "" -#: ../../library/ast.rst:2271 +#: ../../library/ast.rst:2268 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." msgstr "" -#: ../../library/ast.rst:2274 +#: ../../library/ast.rst:2271 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -1326,21 +1319,21 @@ msgid "" "transformations." msgstr "" -#: ../../library/ast.rst:2279 +#: ../../library/ast.rst:2276 msgid "" "`leoAst.py `_ unifies the " "token-based and parse-tree-based views of python programs by inserting two-" "way links between tokens and ast nodes." msgstr "" -#: ../../library/ast.rst:2283 +#: ../../library/ast.rst:2280 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " "useful for building automated refactoring (codemod) applications and linters." msgstr "" -#: ../../library/ast.rst:2288 +#: ../../library/ast.rst:2285 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index 782d403e5d..7a7f996335 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-05-27 00:32+0000\n" "PO-Revision-Date: 2022-10-16 05:40+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -160,8 +160,8 @@ msgid "" "shortest of these and simply display ``0.1``." msgstr "" "歷史上,Python 的提示字元 (prompt) 與內建的 :func:`repr` 函式會選擇上段說明中" -"有 17 個有效位元的數:``0.10000000000000001``。從 Python 3.1 版開始," -"Python(在大部分的系統上)現在能選擇其中最短的數並簡單地顯示為 ``0.1``。" +"有 17 個有效位元的數:``0.10000000000000001``。從 Python 3.1 版開始,Python" +"(在大部分的系統上)現在能選擇其中最短的數並簡單地顯示為 ``0.1``。" #: ../../tutorial/floatingpoint.rst:87 msgid "" @@ -227,18 +227,22 @@ msgstr "" "::" #: ../../tutorial/floatingpoint.rst:128 +#, fuzzy msgid "" "Binary floating-point arithmetic holds many surprises like this. The " "problem with \"0.1\" is explained in precise detail below, in the " -"\"Representation Error\" section. See `The Perils of Floating Point " -"`_ for a more complete account of other " -"common surprises." +"\"Representation Error\" section. See `Examples of Floating Point Problems " +"`_ for " +"a pleasant summary of how binary floating-point works and the kinds of " +"problems commonly encountered in practice. Also see `The Perils of Floating " +"Point `_ for a more complete account of " +"other common surprises." msgstr "" "二進位浮點數架構擁有很多這樣的驚喜。底下的「表示法誤差」章節,詳細地解釋了" "「0.1」的問題。如果想要其他常見驚喜的更完整描述,可以參考 `The Perils of " "Floating Point(浮點數的風險) `_。" -#: ../../tutorial/floatingpoint.rst:133 +#: ../../tutorial/floatingpoint.rst:137 msgid "" "As that says near the end, \"there are no easy answers.\" Still, don't be " "unduly wary of floating-point! The errors in Python float operations are " @@ -254,7 +258,7 @@ msgstr "" "經相當足夠,但你需要記住,它並非十進位運算,且每一次 float 運算都可能會承受新" "的捨入誤差。" -#: ../../tutorial/floatingpoint.rst:140 +#: ../../tutorial/floatingpoint.rst:144 msgid "" "While pathological cases do exist, for most casual use of floating-point " "arithmetic you'll see the result you expect in the end if you simply round " @@ -267,7 +271,7 @@ msgstr "" "能滿足要求,而若想要更細緻的控制,可參閱\\ :ref:`formatstrings`\\ 中關於 :" "meth:`str.format` method(方法)的格式規範。" -#: ../../tutorial/floatingpoint.rst:146 +#: ../../tutorial/floatingpoint.rst:150 msgid "" "For use cases which require exact decimal representation, try using the :mod:" "`decimal` module which implements decimal arithmetic suitable for accounting " @@ -276,7 +280,7 @@ msgstr "" "對於需要精準十進位表示法的用例,可以試著用 :mod:`decimal` 模組,它可實作適用" "於會計應用程式與高精確度應用程式的十進位運算。" -#: ../../tutorial/floatingpoint.rst:150 +#: ../../tutorial/floatingpoint.rst:154 msgid "" "Another form of exact arithmetic is supported by the :mod:`fractions` module " "which implements arithmetic based on rational numbers (so the numbers like " @@ -285,9 +289,10 @@ msgstr "" "另一種支援精準運算的格式為 :mod:`fractions` 模組,該模組基於有理數來實作運算" "(因此可以精確表示像 1/3 這樣的數字)。" -#: ../../tutorial/floatingpoint.rst:154 +#: ../../tutorial/floatingpoint.rst:158 +#, fuzzy msgid "" -"If you are a heavy user of floating point operations you should take a look " +"If you are a heavy user of floating-point operations you should take a look " "at the NumPy package and many other packages for mathematical and " "statistical operations supplied by the SciPy project. See ." @@ -295,7 +300,7 @@ msgstr "" "如果你是浮點運算的重度使用者,你應該看一下 NumPy 套件,以及由 SciPy 專案提供" "的許多用於數學和統計學運算的其他套件。請參閱 。" -#: ../../tutorial/floatingpoint.rst:158 +#: ../../tutorial/floatingpoint.rst:162 msgid "" "Python provides tools that may help on those rare occasions when you really " "*do* want to know the exact value of a float. The :meth:`float." @@ -307,7 +312,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:167 +#: ../../tutorial/floatingpoint.rst:171 msgid "" "Since the ratio is exact, it can be used to losslessly recreate the original " "value::" @@ -316,7 +321,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:173 +#: ../../tutorial/floatingpoint.rst:177 msgid "" "The :meth:`float.hex` method expresses a float in hexadecimal (base 16), " "again giving the exact value stored by your computer::" @@ -326,7 +331,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:179 +#: ../../tutorial/floatingpoint.rst:183 msgid "" "This precise hexadecimal representation can be used to reconstruct the float " "value exactly::" @@ -335,7 +340,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:185 +#: ../../tutorial/floatingpoint.rst:189 msgid "" "Since the representation is exact, it is useful for reliably porting values " "across different versions of Python (platform independence) and exchanging " @@ -345,7 +350,7 @@ msgstr "" "由於該表示法是精準的,因此適用於在不同版本的 Python 之間可靠地傳送數值(獨立" "於系統平台),並與支援相同格式的其他語言(如 JAVA 和 C99)交換資料。" -#: ../../tutorial/floatingpoint.rst:189 +#: ../../tutorial/floatingpoint.rst:193 msgid "" "Another helpful tool is the :func:`math.fsum` function which helps mitigate " "loss-of-precision during summation. It tracks \"lost digits\" as values are " @@ -358,11 +363,11 @@ msgstr "" "以明顯改善總體準確度 (overall accuracy),使得誤差不至於累積到影響最終總計值的" "程度:" -#: ../../tutorial/floatingpoint.rst:203 +#: ../../tutorial/floatingpoint.rst:207 msgid "Representation Error" msgstr "表示法誤差 (Representation Error)" -#: ../../tutorial/floatingpoint.rst:205 +#: ../../tutorial/floatingpoint.rst:209 msgid "" "This section explains the \"0.1\" example in detail, and shows how you can " "perform an exact analysis of cases like this yourself. Basic familiarity " @@ -371,7 +376,7 @@ msgstr "" "本節將會詳細解釋「0.1」的例子,並說明你自己要如何對類似案例執行精準的分析。 " "以下假設你對二進位浮點表示法已有基本程度的熟悉。" -#: ../../tutorial/floatingpoint.rst:209 +#: ../../tutorial/floatingpoint.rst:213 msgid "" ":dfn:`Representation error` refers to the fact that some (most, actually) " "decimal fractions cannot be represented exactly as binary (base 2) " @@ -384,14 +389,16 @@ msgstr "" "Perl、C、C++、JAVA、Fortran 和其他許多)通常不會顯示你期望的精準十進位數字的" "主要原因。" -#: ../../tutorial/floatingpoint.rst:214 +#: ../../tutorial/floatingpoint.rst:218 +#, fuzzy msgid "" -"Why is that? 1/10 is not exactly representable as a binary fraction. Almost " -"all machines today (November 2000) use IEEE-754 floating point arithmetic, " -"and almost all platforms map Python floats to IEEE-754 \"double precision" -"\". 754 doubles contain 53 bits of precision, so on input the computer " -"strives to convert 0.1 to the closest fraction it can of the form *J*/2**\\ " -"*N* where *J* is an integer containing exactly 53 bits. Rewriting ::" +"Why is that? 1/10 is not exactly representable as a binary fraction. Since " +"at least 2000, almost all machines use IEEE 754 binary floating-point " +"arithmetic, and almost all platforms map Python floats to IEEE 754 binary64 " +"\"double precision\" values. IEEE 754 binary64 values contain 53 bits of " +"precision, so on input the computer strives to convert 0.1 to the closest " +"fraction it can of the form *J*/2**\\ *N* where *J* is an integer containing " +"exactly 53 bits. Rewriting ::" msgstr "" "為什麼呢?因為 1/10 無法精準地以一個二進位小數來表示。至今(2000 年 11 月)幾" "乎所有的計算機皆使用 IEEE-754 浮點數運算標準,並且幾乎所有的平台都以 " @@ -402,14 +409,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:223 +#: ../../tutorial/floatingpoint.rst:229 msgid "as ::" msgstr "" "重寫為:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:227 +#: ../../tutorial/floatingpoint.rst:233 msgid "" "and recalling that *J* has exactly 53 bits (is ``>= 2**52`` but ``< " "2**53``), the best value for *N* is 56::" @@ -419,7 +426,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:233 +#: ../../tutorial/floatingpoint.rst:239 msgid "" "That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits. " "The best possible value for *J* is then that quotient rounded::" @@ -429,7 +436,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:240 +#: ../../tutorial/floatingpoint.rst:246 msgid "" "Since the remainder is more than half of 10, the best approximation is " "obtained by rounding up::" @@ -438,16 +445,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:246 +#: ../../tutorial/floatingpoint.rst:252 +#, fuzzy msgid "" -"Therefore the best possible approximation to 1/10 in 754 double precision " -"is::" +"Therefore the best possible approximation to 1/10 in IEEE 754 double " +"precision is::" msgstr "" "所以,在 754 雙精度下,1/10 的最佳近似值是:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:250 +#: ../../tutorial/floatingpoint.rst:257 msgid "" "Dividing both the numerator and denominator by two reduces the fraction to::" msgstr "" @@ -455,7 +463,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:254 +#: ../../tutorial/floatingpoint.rst:261 msgid "" "Note that since we rounded up, this is actually a little bit larger than " "1/10; if we had not rounded up, the quotient would have been a little bit " @@ -464,17 +472,18 @@ msgstr "" "請注意,由於我們有進位,所以這實際上比 1/10 大了一點;如果我們沒有進位,商數" "將會有點小於 1/10。但在任何情況下都不可能是\\ *精準的* 1/10!" -#: ../../tutorial/floatingpoint.rst:258 +#: ../../tutorial/floatingpoint.rst:265 +#, fuzzy msgid "" "So the computer never \"sees\" 1/10: what it sees is the exact fraction " -"given above, the best 754 double approximation it can get::" +"given above, the best IEEE 754 double approximation it can get:" msgstr "" "所以電腦從來沒有「看到」1/10:它看到的是上述的精準分數,也就是它能得到的 754 " "double 最佳近似值:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:264 +#: ../../tutorial/floatingpoint.rst:271 msgid "" "If we multiply that fraction by 10\\*\\*55, we can see the value out to 55 " "decimal digits::" @@ -483,7 +492,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:270 +#: ../../tutorial/floatingpoint.rst:277 msgid "" "meaning that the exact number stored in the computer is equal to the decimal " "value 0.1000000000000000055511151231257827021181583404541015625. Instead of " @@ -496,7 +505,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:278 +#: ../../tutorial/floatingpoint.rst:285 msgid "" "The :mod:`fractions` and :mod:`decimal` modules make these calculations " "easy::" From 20acfffef3d1d5e934d022639432bbef9222a1a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 28 May 2023 00:35:01 +0000 Subject: [PATCH 096/130] sync with cpython d34e58a1 --- library/typing.po | 948 ++++++++++++++++++++++++---------------------- whatsnew/3.11.po | 588 ++++++++++++++-------------- 2 files changed, 787 insertions(+), 749 deletions(-) diff --git a/library/typing.po b/library/typing.po index f56f936b7a..c3512ff19a 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-25 00:29+0000\n" +"POT-Creation-Date: 2023-05-28 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -260,21 +260,27 @@ msgid "" "``type(None)``." msgstr "" -#: ../../library/typing.rst:142 +#: ../../library/typing.rst:139 +msgid "" +"Type aliases may be marked with :data:`TypeAlias` to make it explicit that " +"the statement is a type alias declaration, not a normal variable assignment::" +msgstr "" + +#: ../../library/typing.rst:149 msgid "NewType" msgstr "NewType" -#: ../../library/typing.rst:144 +#: ../../library/typing.rst:151 msgid "Use the :class:`NewType` helper to create distinct types::" msgstr "" -#: ../../library/typing.rst:151 +#: ../../library/typing.rst:158 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. This is useful in helping catch logical errors::" msgstr "" -#: ../../library/typing.rst:163 +#: ../../library/typing.rst:170 msgid "" "You may still perform all ``int`` operations on a variable of type " "``UserId``, but the result will always be of type ``int``. This lets you " @@ -282,7 +288,7 @@ msgid "" "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" -#: ../../library/typing.rst:171 +#: ../../library/typing.rst:178 msgid "" "Note that these checks are enforced only by the static type checker. At " "runtime, the statement ``Derived = NewType('Derived', Base)`` will make " @@ -291,31 +297,31 @@ msgid "" "class or introduce much overhead beyond that of a regular function call." msgstr "" -#: ../../library/typing.rst:177 +#: ../../library/typing.rst:184 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" -#: ../../library/typing.rst:180 +#: ../../library/typing.rst:187 msgid "It is invalid to create a subtype of ``Derived``::" msgstr "" -#: ../../library/typing.rst:189 +#: ../../library/typing.rst:196 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" -#: ../../library/typing.rst:197 +#: ../../library/typing.rst:204 msgid "and typechecking for ``ProUserId`` will work as expected." msgstr "" -#: ../../library/typing.rst:199 +#: ../../library/typing.rst:206 msgid "See :pep:`484` for more details." msgstr "更多細節請見 :pep:`484`\\ 。" -#: ../../library/typing.rst:203 +#: ../../library/typing.rst:210 msgid "" "Recall that the use of a type alias declares two types to be *equivalent* to " "one another. Doing ``Alias = Original`` will make the static type checker " @@ -323,7 +329,7 @@ msgid "" "This is useful when you want to simplify complex type signatures." msgstr "" -#: ../../library/typing.rst:208 +#: ../../library/typing.rst:215 msgid "" "In contrast, ``NewType`` declares one type to be a *subtype* of another. " "Doing ``Derived = NewType('Derived', Original)`` will make the static type " @@ -333,39 +339,39 @@ msgid "" "errors with minimal runtime cost." msgstr "" -#: ../../library/typing.rst:217 +#: ../../library/typing.rst:224 msgid "" "``NewType`` is now a class rather than a function. There is some additional " "runtime cost when calling ``NewType`` over a regular function. However, " "this cost will be reduced in 3.11.0." msgstr "" -#: ../../library/typing.rst:224 +#: ../../library/typing.rst:231 msgid "Callable" msgstr "" -#: ../../library/typing.rst:226 +#: ../../library/typing.rst:233 msgid "" "Frameworks expecting callback functions of specific signatures might be type " "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:229 ../../library/typing.rst:1186 -#: ../../library/typing.rst:2849 +#: ../../library/typing.rst:236 ../../library/typing.rst:1192 +#: ../../library/typing.rst:2889 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:244 +#: ../../library/typing.rst:251 msgid "" "It is possible to declare the return type of a callable without specifying " "the call signature by substituting a literal ellipsis for the list of " "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:248 ../../library/typing.rst:865 +#: ../../library/typing.rst:255 ../../library/typing.rst:871 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -376,97 +382,97 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:256 ../../library/typing.rst:877 +#: ../../library/typing.rst:263 ../../library/typing.rst:883 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:261 +#: ../../library/typing.rst:268 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:267 +#: ../../library/typing.rst:274 msgid "Generics" msgstr "" -#: ../../library/typing.rst:269 +#: ../../library/typing.rst:276 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, abstract base classes have been extended to " "support subscription to denote expected types for container elements." msgstr "" -#: ../../library/typing.rst:280 +#: ../../library/typing.rst:287 msgid "" "Generics can be parameterized by using a factory available in typing called :" "class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:296 +#: ../../library/typing.rst:303 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:298 +#: ../../library/typing.rst:305 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:324 +#: ../../library/typing.rst:331 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:328 +#: ../../library/typing.rst:335 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[T]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:337 +#: ../../library/typing.rst:344 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:349 +#: ../../library/typing.rst:356 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:360 +#: ../../library/typing.rst:367 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:370 +#: ../../library/typing.rst:377 msgid "" -"When inheriting from generic classes, some type variables could be fixed::" +"When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:380 +#: ../../library/typing.rst:387 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:382 +#: ../../library/typing.rst:389 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``::" msgstr "" -#: ../../library/typing.rst:390 -msgid "User defined generic type aliases are also supported. Examples::" +#: ../../library/typing.rst:397 +msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:407 +#: ../../library/typing.rst:414 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:410 +#: ../../library/typing.rst:417 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -476,7 +482,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:427 +#: ../../library/typing.rst:433 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -484,20 +490,20 @@ msgid "" "converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:439 +#: ../../library/typing.rst:445 msgid "" "Do note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:443 +#: ../../library/typing.rst:449 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:447 +#: ../../library/typing.rst:453 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -505,24 +511,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:454 +#: ../../library/typing.rst:460 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:456 +#: ../../library/typing.rst:462 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:460 +#: ../../library/typing.rst:466 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:478 +#: ../../library/typing.rst:484 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -531,19 +537,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:484 +#: ../../library/typing.rst:490 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:497 +#: ../../library/typing.rst:503 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:500 +#: ../../library/typing.rst:506 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -551,7 +557,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:505 +#: ../../library/typing.rst:511 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -559,24 +565,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:527 +#: ../../library/typing.rst:533 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:532 +#: ../../library/typing.rst:538 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:534 +#: ../../library/typing.rst:540 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:538 +#: ../../library/typing.rst:544 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -585,7 +591,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:551 +#: ../../library/typing.rst:557 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -594,22 +600,22 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:567 +#: ../../library/typing.rst:573 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:572 +#: ../../library/typing.rst:578 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:574 +#: ../../library/typing.rst:580 msgid "The module defines the following classes, functions and decorators." msgstr "" -#: ../../library/typing.rst:578 +#: ../../library/typing.rst:584 msgid "" "This module defines several types that are subclasses of pre-existing " "standard library classes which also extend :class:`Generic` to support type " @@ -617,7 +623,7 @@ msgid "" "corresponding pre-existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:584 +#: ../../library/typing.rst:590 msgid "" "The redundant types are deprecated as of Python 3.9 but no deprecation " "warnings will be issued by the interpreter. It is expected that type " @@ -625,7 +631,7 @@ msgid "" "Python 3.9 or newer." msgstr "" -#: ../../library/typing.rst:589 +#: ../../library/typing.rst:595 msgid "" "The deprecated types will be removed from the :mod:`typing` module no sooner " "than the first Python version released 5 years after the release of Python " @@ -633,50 +639,50 @@ msgid "" "Collections*." msgstr "" -#: ../../library/typing.rst:595 +#: ../../library/typing.rst:601 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:598 +#: ../../library/typing.rst:604 msgid "Special types" msgstr "" -#: ../../library/typing.rst:600 +#: ../../library/typing.rst:606 msgid "These can be used as types in annotations and do not support ``[]``." msgstr "" -#: ../../library/typing.rst:604 +#: ../../library/typing.rst:610 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:606 +#: ../../library/typing.rst:612 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:607 +#: ../../library/typing.rst:613 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:609 +#: ../../library/typing.rst:615 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:616 +#: ../../library/typing.rst:622 msgid "" "``AnyStr`` is a :ref:`constrained type variable ` defined as ``AnyStr = TypeVar('AnyStr', str, bytes)``." msgstr "" -#: ../../library/typing.rst:619 +#: ../../library/typing.rst:625 msgid "" "It is meant to be used for functions that may accept any kind of string " "without allowing different kinds of strings to mix. For example::" msgstr "" -#: ../../library/typing.rst:631 +#: ../../library/typing.rst:637 msgid "" "Special type that includes only literal strings. A string literal is " "compatible with ``LiteralString``, as is another ``LiteralString``, but an " @@ -684,47 +690,47 @@ msgid "" "``LiteralString``-typed objects is also acceptable as a ``LiteralString``." msgstr "" -#: ../../library/typing.rst:637 ../../library/typing.rst:2478 +#: ../../library/typing.rst:643 ../../library/typing.rst:2518 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:651 +#: ../../library/typing.rst:657 msgid "" "This is useful for sensitive APIs where arbitrary user-generated strings " "could generate problems. For example, the two cases above that generate type " "checker errors could be vulnerable to an SQL injection attack." msgstr "" -#: ../../library/typing.rst:656 +#: ../../library/typing.rst:662 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:662 +#: ../../library/typing.rst:668 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:665 +#: ../../library/typing.rst:671 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:685 +#: ../../library/typing.rst:691 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:690 +#: ../../library/typing.rst:696 msgid "Special type indicating that a function never returns. For example::" msgstr "" -#: ../../library/typing.rst:698 +#: ../../library/typing.rst:704 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -732,150 +738,150 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:709 +#: ../../library/typing.rst:715 msgid "Special type to represent the current enclosed class. For example::" msgstr "" -#: ../../library/typing.rst:720 +#: ../../library/typing.rst:726 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:732 +#: ../../library/typing.rst:738 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:739 +#: ../../library/typing.rst:745 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:742 +#: ../../library/typing.rst:748 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:744 +#: ../../library/typing.rst:750 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:746 +#: ../../library/typing.rst:752 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:748 +#: ../../library/typing.rst:754 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:754 +#: ../../library/typing.rst:760 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `. For example::" msgstr "" -#: ../../library/typing.rst:761 +#: ../../library/typing.rst:767 msgid "See :pep:`613` for more details about explicit type aliases." msgstr "" -#: ../../library/typing.rst:766 +#: ../../library/typing.rst:772 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:768 +#: ../../library/typing.rst:774 msgid "" "These can be used as types in annotations using ``[]``, each having a unique " "syntax." msgstr "" -#: ../../library/typing.rst:772 +#: ../../library/typing.rst:778 msgid "" "Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the " "first item of type X and the second of type Y. The type of the empty tuple " "can be written as ``Tuple[()]``." msgstr "" -#: ../../library/typing.rst:776 +#: ../../library/typing.rst:782 msgid "" "Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " "variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " "float and a string." msgstr "" -#: ../../library/typing.rst:780 +#: ../../library/typing.rst:786 msgid "" "To specify a variable-length tuple of homogeneous type, use literal " "ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` is equivalent to " "``Tuple[Any, ...]``, and in turn to :class:`tuple`." msgstr "" -#: ../../library/typing.rst:784 +#: ../../library/typing.rst:790 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:790 +#: ../../library/typing.rst:796 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:798 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:794 +#: ../../library/typing.rst:800 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:796 +#: ../../library/typing.rst:802 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:800 +#: ../../library/typing.rst:806 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:804 +#: ../../library/typing.rst:810 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:808 +#: ../../library/typing.rst:814 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:812 +#: ../../library/typing.rst:818 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:814 +#: ../../library/typing.rst:820 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:816 +#: ../../library/typing.rst:822 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:819 +#: ../../library/typing.rst:825 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:825 +#: ../../library/typing.rst:831 msgid "Optional type." msgstr "" -#: ../../library/typing.rst:827 +#: ../../library/typing.rst:833 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:829 +#: ../../library/typing.rst:835 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -883,31 +889,31 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:837 +#: ../../library/typing.rst:843 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:844 +#: ../../library/typing.rst:850 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:850 +#: ../../library/typing.rst:856 msgid "Callable type; ``Callable[[int], str]`` is a function of (int) -> str." msgstr "" -#: ../../library/typing.rst:852 +#: ../../library/typing.rst:858 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " "types or an ellipsis; the return type must be a single type." msgstr "" -#: ../../library/typing.rst:857 +#: ../../library/typing.rst:863 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -917,19 +923,19 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:873 +#: ../../library/typing.rst:879 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:882 +#: ../../library/typing.rst:888 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:887 +#: ../../library/typing.rst:893 msgid "" "Used with :data:`Callable` and :class:`ParamSpec` to type annotate a higher " "order callable which adds, removes, or transforms parameters of another " @@ -939,7 +945,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:895 +#: ../../library/typing.rst:901 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -950,17 +956,17 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:934 ../../library/typing.rst:1526 +#: ../../library/typing.rst:940 ../../library/typing.rst:1564 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:936 +#: ../../library/typing.rst:942 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:941 +#: ../../library/typing.rst:947 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``Type[C]`` may accept values that are " @@ -968,11 +974,11 @@ msgid "" "``C``. For example::" msgstr "" -#: ../../library/typing.rst:950 +#: ../../library/typing.rst:956 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:962 +#: ../../library/typing.rst:968 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -982,39 +988,39 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:970 +#: ../../library/typing.rst:976 msgid "" "The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:976 +#: ../../library/typing.rst:982 msgid "" "``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " "``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:981 +#: ../../library/typing.rst:987 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:987 +#: ../../library/typing.rst:993 msgid "" "A type that can be used to indicate to type checkers that the corresponding " "variable or function parameter has a value equivalent to the provided " "literal (or one of several literals). For example::" msgstr "" -#: ../../library/typing.rst:1001 +#: ../../library/typing.rst:1007 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:1007 +#: ../../library/typing.rst:1013 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1022,22 +1028,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1015 +#: ../../library/typing.rst:1021 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1017 +#: ../../library/typing.rst:1023 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1025 +#: ../../library/typing.rst:1031 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1027 +#: ../../library/typing.rst:1033 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1045,29 +1051,29 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1041 +#: ../../library/typing.rst:1047 msgid "" "A special typing construct to indicate to type checkers that a name cannot " "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1053 ../../library/typing.rst:2719 +#: ../../library/typing.rst:1059 ../../library/typing.rst:2759 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1062 +#: ../../library/typing.rst:1068 msgid "" "Special typing constructs that mark individual keys of a :class:`TypedDict` " "as either required or non-required respectively." msgstr "" -#: ../../library/typing.rst:1065 +#: ../../library/typing.rst:1071 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1071 +#: ../../library/typing.rst:1077 msgid "" "A type, introduced in :pep:`593` (``Flexible function and variable " "annotations``), to decorate existing types with context-specific metadata " @@ -1084,7 +1090,7 @@ msgid "" "application." msgstr "" -#: ../../library/typing.rst:1085 +#: ../../library/typing.rst:1091 msgid "" "Ultimately, the responsibility of how to interpret the annotations (if at " "all) is the responsibility of the tool or library encountering the " @@ -1093,21 +1099,21 @@ msgid "" "using ``isinstance()``)." msgstr "" -#: ../../library/typing.rst:1091 +#: ../../library/typing.rst:1097 msgid "" "When a tool or a library does not support annotations or encounters an " "unknown annotation it should just ignore it and treat annotated type as the " "underlying type." msgstr "" -#: ../../library/typing.rst:1095 +#: ../../library/typing.rst:1101 msgid "" "It's up to the tool consuming the annotations to decide whether the client " "is allowed to have several annotations on one type and how to merge those " "annotations." msgstr "" -#: ../../library/typing.rst:1099 +#: ../../library/typing.rst:1105 msgid "" "Since the ``Annotated`` type allows you to put several annotations of the " "same (or different) type(s) on any node, the tools or libraries consuming " @@ -1115,59 +1121,59 @@ msgid "" "example, if you are doing value range analysis you might allow this::" msgstr "" -#: ../../library/typing.rst:1108 +#: ../../library/typing.rst:1114 msgid "" "Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " "the extra annotations at runtime." msgstr "" -#: ../../library/typing.rst:1111 +#: ../../library/typing.rst:1117 msgid "The details of the syntax:" msgstr "" -#: ../../library/typing.rst:1113 +#: ../../library/typing.rst:1119 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1115 +#: ../../library/typing.rst:1121 msgid "" "Multiple type annotations are supported (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1120 +#: ../../library/typing.rst:1126 msgid "" "``Annotated`` must be called with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1123 +#: ../../library/typing.rst:1129 msgid "" "The order of the annotations is preserved and matters for equality checks::" msgstr "" -#: ../../library/typing.rst:1130 +#: ../../library/typing.rst:1136 msgid "" "Nested ``Annotated`` types are flattened, with metadata ordered starting " "with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1137 +#: ../../library/typing.rst:1143 msgid "Duplicated annotations are not removed::" msgstr "" -#: ../../library/typing.rst:1143 +#: ../../library/typing.rst:1149 msgid "``Annotated`` can be used with nested and generic aliases::" msgstr "" -#: ../../library/typing.rst:1156 +#: ../../library/typing.rst:1162 msgid "" "Special typing form used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1160 +#: ../../library/typing.rst:1166 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1176,44 +1182,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1175 +#: ../../library/typing.rst:1181 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1179 +#: ../../library/typing.rst:1185 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1182 +#: ../../library/typing.rst:1188 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1183 +#: ../../library/typing.rst:1189 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1200 +#: ../../library/typing.rst:1206 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1204 +#: ../../library/typing.rst:1210 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1210 +#: ../../library/typing.rst:1216 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1222,13 +1228,13 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1216 +#: ../../library/typing.rst:1222 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1223 +#: ../../library/typing.rst:1229 msgid "" "A typing operator that conceptually marks an object as having been unpacked. " "For example, using the unpack operator ``*`` on a :class:`type variable " @@ -1236,7 +1242,7 @@ msgid "" "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1233 +#: ../../library/typing.rst:1239 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1244,96 +1250,114 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1250 +#: ../../library/typing.rst:1256 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1252 +#: ../../library/typing.rst:1258 msgid "" -"These are not used in annotations. They are building blocks for creating " -"generic types." +"The following objects are not used directly in annotations. Instead, they " +"are building blocks for creating generic types." msgstr "" -#: ../../library/typing.rst:1256 +#: ../../library/typing.rst:1263 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1258 +#: ../../library/typing.rst:1265 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1267 +#: ../../library/typing.rst:1274 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1280 +#: ../../library/typing.rst:1287 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1282 ../../library/typing.rst:1455 -#: ../../library/typing.rst:1557 +#: ../../library/typing.rst:1289 ../../library/typing.rst:1385 +#: ../../library/typing.rst:1489 ../../library/typing.rst:1595 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1288 +#: ../../library/typing.rst:1295 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " -"function definitions. See :class:`Generic` for more information on generic " -"types. Generic functions work as follows::" +"function and type alias definitions. See :class:`Generic` for more " +"information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1308 +#: ../../library/typing.rst:1316 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1311 +#: ../../library/typing.rst:1319 +msgid "" +"Created type variables may be explicitly marked covariant or contravariant " +"by passing ``covariant=True`` or ``contravariant=True``. By default, type " +"variables are invariant. See :pep:`484` and :pep:`695` for more details." +msgstr "" + +#: ../../library/typing.rst:1324 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1326 +#: ../../library/typing.rst:1339 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1334 +#: ../../library/typing.rst:1347 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1345 -msgid "" -"At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, :" -"func:`isinstance` and :func:`issubclass` should not be used with types." +#: ../../library/typing.rst:1358 +msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1348 -msgid "" -"Type variables may be marked covariant or contravariant by passing " -"``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " -"details. By default, type variables are invariant." +#: ../../library/typing.rst:1362 +msgid "The name of the type variable." +msgstr "" + +#: ../../library/typing.rst:1366 +msgid "Whether the type var has been marked as covariant." +msgstr "" + +#: ../../library/typing.rst:1370 +msgid "Whether the type var has been marked as contravariant." +msgstr "" + +#: ../../library/typing.rst:1374 +msgid "The bound of the type variable, if any." +msgstr "" + +#: ../../library/typing.rst:1378 +msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1354 +#: ../../library/typing.rst:1382 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1357 +#: ../../library/typing.rst:1393 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1341,7 +1365,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1385 +#: ../../library/typing.rst:1415 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1351,36 +1375,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1393 +#: ../../library/typing.rst:1423 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1400 +#: ../../library/typing.rst:1430 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1409 +#: ../../library/typing.rst:1439 msgid "" "Type variable tuples can be happily combined with normal type variables::" msgstr "" -#: ../../library/typing.rst:1422 +#: ../../library/typing.rst:1452 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1429 +#: ../../library/typing.rst:1459 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1439 +#: ../../library/typing.rst:1469 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1389,17 +1413,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1446 +#: ../../library/typing.rst:1476 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1452 +#: ../../library/typing.rst:1480 +msgid "The name of the type variable tuple." +msgstr "" + +#: ../../library/typing.rst:1486 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1459 +#: ../../library/typing.rst:1493 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1409,7 +1437,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1466 +#: ../../library/typing.rst:1500 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1417,27 +1445,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1490 +#: ../../library/typing.rst:1524 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1494 +#: ../../library/typing.rst:1528 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1496 +#: ../../library/typing.rst:1530 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1503 +#: ../../library/typing.rst:1537 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1450,7 +1478,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1513 +#: ../../library/typing.rst:1549 +msgid "The name of the parameter specification." +msgstr "" + +#: ../../library/typing.rst:1551 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1459,17 +1491,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1522 +#: ../../library/typing.rst:1560 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1528 +#: ../../library/typing.rst:1566 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1533 +#: ../../library/typing.rst:1571 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1477,44 +1509,44 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1538 +#: ../../library/typing.rst:1576 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``::" msgstr "" -#: ../../library/typing.rst:1549 +#: ../../library/typing.rst:1587 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1551 +#: ../../library/typing.rst:1589 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1555 +#: ../../library/typing.rst:1593 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1563 +#: ../../library/typing.rst:1601 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1567 +#: ../../library/typing.rst:1605 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1576 +#: ../../library/typing.rst:1614 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1578 +#: ../../library/typing.rst:1616 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1523,77 +1555,77 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1584 +#: ../../library/typing.rst:1622 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1594 +#: ../../library/typing.rst:1632 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1600 +#: ../../library/typing.rst:1638 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1604 +#: ../../library/typing.rst:1642 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1607 +#: ../../library/typing.rst:1645 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1610 +#: ../../library/typing.rst:1648 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1614 +#: ../../library/typing.rst:1652 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1618 +#: ../../library/typing.rst:1656 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1623 +#: ../../library/typing.rst:1661 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1633 +#: ../../library/typing.rst:1671 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1637 +#: ../../library/typing.rst:1675 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1641 +#: ../../library/typing.rst:1679 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1645 +#: ../../library/typing.rst:1683 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1650 +#: ../../library/typing.rst:1688 msgid "" "Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1656 +#: ../../library/typing.rst:1694 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1668 +#: ../../library/typing.rst:1706 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1601,15 +1633,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1673 +#: ../../library/typing.rst:1711 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1683 +#: ../../library/typing.rst:1723 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1685 +#: ../../library/typing.rst:1725 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1618,7 +1650,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1705 +#: ../../library/typing.rst:1745 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1629,7 +1661,7 @@ msgid "" "SSLObject`." msgstr "" -#: ../../library/typing.rst:1716 +#: ../../library/typing.rst:1756 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1637,13 +1669,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1727 +#: ../../library/typing.rst:1767 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1730 +#: ../../library/typing.rst:1770 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1651,53 +1683,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1746 +#: ../../library/typing.rst:1786 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1750 +#: ../../library/typing.rst:1790 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1754 +#: ../../library/typing.rst:1794 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1761 +#: ../../library/typing.rst:1801 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1762 +#: ../../library/typing.rst:1802 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1774 +#: ../../library/typing.rst:1814 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1785 +#: ../../library/typing.rst:1825 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1788 +#: ../../library/typing.rst:1828 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1798 +#: ../../library/typing.rst:1838 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1705,61 +1737,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1803 +#: ../../library/typing.rst:1843 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:1818 +#: ../../library/typing.rst:1858 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1825 +#: ../../library/typing.rst:1865 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1833 +#: ../../library/typing.rst:1873 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:1851 +#: ../../library/typing.rst:1891 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:1857 +#: ../../library/typing.rst:1897 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:1863 +#: ../../library/typing.rst:1903 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example::" msgstr "" -#: ../../library/typing.rst:1883 +#: ../../library/typing.rst:1923 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:1886 +#: ../../library/typing.rst:1926 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:1889 +#: ../../library/typing.rst:1929 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1768,162 +1800,162 @@ msgid "" "``TypedDict`` with a different value for ``total``::" msgstr "" -#: ../../library/typing.rst:1910 +#: ../../library/typing.rst:1950 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1914 +#: ../../library/typing.rst:1954 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:1918 +#: ../../library/typing.rst:1958 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:1922 +#: ../../library/typing.rst:1962 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1925 +#: ../../library/typing.rst:1965 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1929 +#: ../../library/typing.rst:1969 msgid "" "A generic version of :class:`dict`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Mapping`." msgstr "" -#: ../../library/typing.rst:1933 +#: ../../library/typing.rst:1973 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1938 +#: ../../library/typing.rst:1978 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1944 +#: ../../library/typing.rst:1984 msgid "" "Generic version of :class:`list`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:1949 +#: ../../library/typing.rst:1989 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1959 +#: ../../library/typing.rst:1999 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1965 +#: ../../library/typing.rst:2005 msgid "" "A generic version of :class:`builtins.set `. Useful for annotating " "return types. To annotate arguments it is preferred to use an abstract " "collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:2009 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1975 +#: ../../library/typing.rst:2015 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1977 +#: ../../library/typing.rst:2017 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1982 +#: ../../library/typing.rst:2022 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1985 +#: ../../library/typing.rst:2025 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1989 +#: ../../library/typing.rst:2029 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1993 +#: ../../library/typing.rst:2033 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1999 +#: ../../library/typing.rst:2039 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2003 +#: ../../library/typing.rst:2043 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2009 +#: ../../library/typing.rst:2049 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2014 +#: ../../library/typing.rst:2054 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2020 +#: ../../library/typing.rst:2060 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2025 +#: ../../library/typing.rst:2065 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2031 +#: ../../library/typing.rst:2071 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2036 +#: ../../library/typing.rst:2076 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2041 +#: ../../library/typing.rst:2081 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2047 +#: ../../library/typing.rst:2087 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2054 +#: ../../library/typing.rst:2094 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2059 +#: ../../library/typing.rst:2099 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1931,439 +1963,439 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2069 +#: ../../library/typing.rst:2109 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2070 +#: ../../library/typing.rst:2110 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2076 +#: ../../library/typing.rst:2116 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:2080 +#: ../../library/typing.rst:2120 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2088 +#: ../../library/typing.rst:2128 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2095 +#: ../../library/typing.rst:2135 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2098 +#: ../../library/typing.rst:2138 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2102 +#: ../../library/typing.rst:2142 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2104 +#: ../../library/typing.rst:2144 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2110 +#: ../../library/typing.rst:2150 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2114 +#: ../../library/typing.rst:2154 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2158 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:2122 +#: ../../library/typing.rst:2162 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2128 +#: ../../library/typing.rst:2168 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2130 +#: ../../library/typing.rst:2170 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2136 +#: ../../library/typing.rst:2176 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2138 +#: ../../library/typing.rst:2178 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2144 +#: ../../library/typing.rst:2184 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2146 +#: ../../library/typing.rst:2186 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2152 +#: ../../library/typing.rst:2192 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:2158 +#: ../../library/typing.rst:2198 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2164 +#: ../../library/typing.rst:2204 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2166 +#: ../../library/typing.rst:2206 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2172 +#: ../../library/typing.rst:2212 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2174 +#: ../../library/typing.rst:2214 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2181 +#: ../../library/typing.rst:2221 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2183 +#: ../../library/typing.rst:2223 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2190 +#: ../../library/typing.rst:2230 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2192 +#: ../../library/typing.rst:2232 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2198 +#: ../../library/typing.rst:2238 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2200 +#: ../../library/typing.rst:2240 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2206 +#: ../../library/typing.rst:2246 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2208 +#: ../../library/typing.rst:2248 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2213 +#: ../../library/typing.rst:2253 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2217 +#: ../../library/typing.rst:2257 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2219 +#: ../../library/typing.rst:2259 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2225 +#: ../../library/typing.rst:2265 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2227 +#: ../../library/typing.rst:2267 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2233 +#: ../../library/typing.rst:2273 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2242 +#: ../../library/typing.rst:2282 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2246 +#: ../../library/typing.rst:2286 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2254 +#: ../../library/typing.rst:2294 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2262 +#: ../../library/typing.rst:2302 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2268 +#: ../../library/typing.rst:2308 msgid "An alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2272 +#: ../../library/typing.rst:2312 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2274 +#: ../../library/typing.rst:2314 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2280 +#: ../../library/typing.rst:2320 msgid "An alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2283 +#: ../../library/typing.rst:2323 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2287 +#: ../../library/typing.rst:2327 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:2299 +#: ../../library/typing.rst:2339 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2305 +#: ../../library/typing.rst:2345 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2314 +#: ../../library/typing.rst:2354 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2318 +#: ../../library/typing.rst:2358 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2326 +#: ../../library/typing.rst:2366 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2336 +#: ../../library/typing.rst:2376 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2343 +#: ../../library/typing.rst:2383 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2347 +#: ../../library/typing.rst:2387 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2353 +#: ../../library/typing.rst:2393 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2357 +#: ../../library/typing.rst:2397 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2363 +#: ../../library/typing.rst:2403 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2367 +#: ../../library/typing.rst:2407 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2373 +#: ../../library/typing.rst:2413 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2377 +#: ../../library/typing.rst:2417 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2382 +#: ../../library/typing.rst:2422 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2389 +#: ../../library/typing.rst:2429 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2394 +#: ../../library/typing.rst:2434 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2400 +#: ../../library/typing.rst:2440 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2402 +#: ../../library/typing.rst:2442 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2406 +#: ../../library/typing.rst:2446 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2411 +#: ../../library/typing.rst:2451 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2415 +#: ../../library/typing.rst:2455 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2419 +#: ../../library/typing.rst:2459 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2423 +#: ../../library/typing.rst:2463 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2429 +#: ../../library/typing.rst:2469 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2433 +#: ../../library/typing.rst:2473 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2437 +#: ../../library/typing.rst:2477 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2441 +#: ../../library/typing.rst:2481 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2443 +#: ../../library/typing.rst:2483 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2450 +#: ../../library/typing.rst:2490 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2452 +#: ../../library/typing.rst:2492 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2455 +#: ../../library/typing.rst:2495 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2462 +#: ../../library/typing.rst:2502 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2476 +#: ../../library/typing.rst:2516 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2489 +#: ../../library/typing.rst:2529 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " @@ -2376,53 +2408,53 @@ msgid "" "bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2501 +#: ../../library/typing.rst:2541 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2504 +#: ../../library/typing.rst:2544 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2512 +#: ../../library/typing.rst:2552 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2514 +#: ../../library/typing.rst:2554 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2520 +#: ../../library/typing.rst:2560 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2523 +#: ../../library/typing.rst:2563 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2528 +#: ../../library/typing.rst:2568 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2533 +#: ../../library/typing.rst:2573 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2543 +#: ../../library/typing.rst:2583 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -2431,19 +2463,19 @@ msgid "" "`dataclasses.dataclass`-like behaviors." msgstr "" -#: ../../library/typing.rst:2549 +#: ../../library/typing.rst:2589 msgid "Example usage with a decorator function::" msgstr "" -#: ../../library/typing.rst:2563 +#: ../../library/typing.rst:2603 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2612 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2583 +#: ../../library/typing.rst:2623 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*. *func* is the function object for the implementation of the " @@ -2589,25 +2621,25 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2685 +#: ../../library/typing.rst:2725 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2693 +#: ../../library/typing.rst:2733 msgid "" "Clear all registered overloads in the internal registry. This can be used to " "reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2701 +#: ../../library/typing.rst:2741 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2724 +#: ../../library/typing.rst:2764 msgid "" "The decorator will now set the ``__final__`` attribute to ``True`` on the " "decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2617,59 +2649,59 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2735 +#: ../../library/typing.rst:2775 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2737 +#: ../../library/typing.rst:2777 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods and classes defined in that class (but not to " "methods defined in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2741 +#: ../../library/typing.rst:2781 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2745 +#: ../../library/typing.rst:2785 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2747 +#: ../../library/typing.rst:2787 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2752 +#: ../../library/typing.rst:2792 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2754 +#: ../../library/typing.rst:2794 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2765 +#: ../../library/typing.rst:2805 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2769 +#: ../../library/typing.rst:2809 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2773 +#: ../../library/typing.rst:2813 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2776 +#: ../../library/typing.rst:2816 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2678,32 +2710,32 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2782 +#: ../../library/typing.rst:2822 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2797 +#: ../../library/typing.rst:2837 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2802 +#: ../../library/typing.rst:2842 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2805 +#: ../../library/typing.rst:2845 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2812 +#: ../../library/typing.rst:2852 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``. If ``X`` is a generic alias for a builtin or :" @@ -2713,7 +2745,7 @@ msgid "" "Examples::" msgstr "" -#: ../../library/typing.rst:2831 +#: ../../library/typing.rst:2871 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``. If ``X`` is a union or :" @@ -2723,11 +2755,11 @@ msgid "" "Examples::" msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2887 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:2902 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2735,24 +2767,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2908 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2875 +#: ../../library/typing.rst:2915 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2879 +#: ../../library/typing.rst:2919 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2888 +#: ../../library/typing.rst:2928 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2760,7 +2792,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2895 +#: ../../library/typing.rst:2935 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2768,11 +2800,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2944 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:2906 +#: ../../library/typing.rst:2946 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2780,76 +2812,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:2911 +#: ../../library/typing.rst:2951 msgid "Feature" msgstr "" -#: ../../library/typing.rst:2911 +#: ../../library/typing.rst:2951 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:2911 +#: ../../library/typing.rst:2951 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:2911 +#: ../../library/typing.rst:2951 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:2913 +#: ../../library/typing.rst:2953 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:2913 +#: ../../library/typing.rst:2953 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:2913 +#: ../../library/typing.rst:2953 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:2913 +#: ../../library/typing.rst:2953 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:2916 +#: ../../library/typing.rst:2956 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:2916 ../../library/typing.rst:2919 +#: ../../library/typing.rst:2956 ../../library/typing.rst:2959 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:2916 ../../library/typing.rst:2921 +#: ../../library/typing.rst:2956 ../../library/typing.rst:2961 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:2916 +#: ../../library/typing.rst:2956 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:2919 +#: ../../library/typing.rst:2959 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2919 +#: ../../library/typing.rst:2959 msgid "3.14" msgstr "" -#: ../../library/typing.rst:2919 +#: ../../library/typing.rst:2959 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:2921 +#: ../../library/typing.rst:2961 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2921 +#: ../../library/typing.rst:2961 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:2921 +#: ../../library/typing.rst:2961 msgid ":gh:`92332`" msgstr ":gh:`92332`" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index e4bb2883da..16c5dab4e0 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-05-28 00:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -152,7 +152,7 @@ msgid "" "pep670>`" msgstr "" -#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2191 +#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2195 msgid "New Features" msgstr "" @@ -2349,7 +2349,7 @@ msgid "" "POP_BLOCK`, :opcode:`!SETUP_FINALLY` and :opcode:`!YIELD_FROM`." msgstr "" -#: ../../whatsnew/3.11.rst:1691 ../../whatsnew/3.11.rst:2559 +#: ../../whatsnew/3.11.rst:1691 ../../whatsnew/3.11.rst:2563 msgid "Deprecated" msgstr "" @@ -2694,286 +2694,292 @@ msgstr ":meth:`unittest.TestLoader.getTestCaseNames`" msgid "(Contributed by Erlend E. Aasland in :issue:`5846`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1866 ../../whatsnew/3.11.rst:2587 +#: ../../whatsnew/3.11.rst:1861 +msgid "" +":meth:`~!unittest.TestProgram.usageExit` is marked deprecated, to be removed " +"in 3.13. (Contributed by Carlos Damázio in :gh:`67048`.)" +msgstr "" + +#: ../../whatsnew/3.11.rst:1870 ../../whatsnew/3.11.rst:2591 msgid "Pending Removal in Python 3.12" msgstr "" -#: ../../whatsnew/3.11.rst:1868 +#: ../../whatsnew/3.11.rst:1872 msgid "" "The following Python APIs have been deprecated in earlier Python releases, " "and will be removed in Python 3.12." msgstr "" -#: ../../whatsnew/3.11.rst:1871 +#: ../../whatsnew/3.11.rst:1875 msgid "" "C APIs pending removal are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:1874 +#: ../../whatsnew/3.11.rst:1878 msgid "The :mod:`asynchat` module" msgstr "" -#: ../../whatsnew/3.11.rst:1875 +#: ../../whatsnew/3.11.rst:1879 msgid "The :mod:`asyncore` module" msgstr "" -#: ../../whatsnew/3.11.rst:1876 +#: ../../whatsnew/3.11.rst:1880 msgid "The :ref:`entire distutils package `" msgstr "" -#: ../../whatsnew/3.11.rst:1877 +#: ../../whatsnew/3.11.rst:1881 msgid "The :mod:`imp` module" msgstr "" -#: ../../whatsnew/3.11.rst:1878 +#: ../../whatsnew/3.11.rst:1882 msgid "The :class:`typing.io ` namespace" msgstr "" -#: ../../whatsnew/3.11.rst:1879 +#: ../../whatsnew/3.11.rst:1883 msgid "The :class:`typing.re ` namespace" msgstr "" -#: ../../whatsnew/3.11.rst:1880 +#: ../../whatsnew/3.11.rst:1884 msgid ":func:`!cgi.log`" msgstr "" -#: ../../whatsnew/3.11.rst:1881 +#: ../../whatsnew/3.11.rst:1885 msgid ":func:`importlib.find_loader`" msgstr ":func:`importlib.find_loader`" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1886 msgid ":meth:`importlib.abc.Loader.module_repr`" msgstr ":meth:`importlib.abc.Loader.module_repr`" -#: ../../whatsnew/3.11.rst:1883 +#: ../../whatsnew/3.11.rst:1887 msgid ":meth:`importlib.abc.MetaPathFinder.find_module`" msgstr ":meth:`importlib.abc.MetaPathFinder.find_module`" -#: ../../whatsnew/3.11.rst:1884 +#: ../../whatsnew/3.11.rst:1888 msgid ":meth:`importlib.abc.PathEntryFinder.find_loader`" msgstr ":meth:`importlib.abc.PathEntryFinder.find_loader`" -#: ../../whatsnew/3.11.rst:1885 +#: ../../whatsnew/3.11.rst:1889 msgid ":meth:`importlib.abc.PathEntryFinder.find_module`" msgstr ":meth:`importlib.abc.PathEntryFinder.find_module`" -#: ../../whatsnew/3.11.rst:1886 +#: ../../whatsnew/3.11.rst:1890 msgid ":meth:`!importlib.machinery.BuiltinImporter.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1887 +#: ../../whatsnew/3.11.rst:1891 msgid ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" msgstr "" -#: ../../whatsnew/3.11.rst:1888 +#: ../../whatsnew/3.11.rst:1892 msgid ":meth:`!importlib.machinery.FileFinder.find_loader`" msgstr "" -#: ../../whatsnew/3.11.rst:1889 +#: ../../whatsnew/3.11.rst:1893 msgid ":meth:`!importlib.machinery.FileFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1890 +#: ../../whatsnew/3.11.rst:1894 msgid ":meth:`!importlib.machinery.FrozenImporter.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1891 +#: ../../whatsnew/3.11.rst:1895 msgid ":meth:`!importlib.machinery.FrozenLoader.module_repr`" msgstr "" -#: ../../whatsnew/3.11.rst:1892 +#: ../../whatsnew/3.11.rst:1896 msgid ":meth:`importlib.machinery.PathFinder.find_module`" msgstr ":meth:`importlib.machinery.PathFinder.find_module`" -#: ../../whatsnew/3.11.rst:1893 +#: ../../whatsnew/3.11.rst:1897 msgid ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1894 +#: ../../whatsnew/3.11.rst:1898 msgid ":func:`importlib.util.module_for_loader`" msgstr ":func:`importlib.util.module_for_loader`" -#: ../../whatsnew/3.11.rst:1895 +#: ../../whatsnew/3.11.rst:1899 msgid ":func:`!importlib.util.set_loader_wrapper`" msgstr "" -#: ../../whatsnew/3.11.rst:1896 +#: ../../whatsnew/3.11.rst:1900 msgid ":func:`!importlib.util.set_package_wrapper`" msgstr "" -#: ../../whatsnew/3.11.rst:1897 +#: ../../whatsnew/3.11.rst:1901 msgid ":class:`pkgutil.ImpImporter`" msgstr ":class:`pkgutil.ImpImporter`" -#: ../../whatsnew/3.11.rst:1898 +#: ../../whatsnew/3.11.rst:1902 msgid ":class:`pkgutil.ImpLoader`" msgstr ":class:`pkgutil.ImpLoader`" -#: ../../whatsnew/3.11.rst:1899 +#: ../../whatsnew/3.11.rst:1903 msgid ":meth:`pathlib.Path.link_to`" msgstr ":meth:`pathlib.Path.link_to`" -#: ../../whatsnew/3.11.rst:1900 +#: ../../whatsnew/3.11.rst:1904 msgid ":func:`!sqlite3.enable_shared_cache`" msgstr "" -#: ../../whatsnew/3.11.rst:1901 +#: ../../whatsnew/3.11.rst:1905 msgid ":func:`!sqlite3.OptimizedUnicode`" msgstr "" -#: ../../whatsnew/3.11.rst:1902 +#: ../../whatsnew/3.11.rst:1906 msgid ":envvar:`PYTHONTHREADDEBUG` environment variable" msgstr "" -#: ../../whatsnew/3.11.rst:1903 +#: ../../whatsnew/3.11.rst:1907 msgid "The following deprecated aliases in :mod:`unittest`:" msgstr "" -#: ../../whatsnew/3.11.rst:1906 +#: ../../whatsnew/3.11.rst:1910 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.11.rst:1906 +#: ../../whatsnew/3.11.rst:1910 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.11.rst:1906 +#: ../../whatsnew/3.11.rst:1910 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.11.rst:1908 +#: ../../whatsnew/3.11.rst:1912 msgid "``failUnless``" msgstr "" -#: ../../whatsnew/3.11.rst:1908 ../../whatsnew/3.11.rst:1915 +#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1919 msgid ":meth:`.assertTrue`" msgstr "" -#: ../../whatsnew/3.11.rst:1908 ../../whatsnew/3.11.rst:1909 -#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1911 #: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1913 -#: ../../whatsnew/3.11.rst:1914 +#: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1915 +#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1918 msgid "3.1" msgstr "" -#: ../../whatsnew/3.11.rst:1909 +#: ../../whatsnew/3.11.rst:1913 msgid "``failIf``" msgstr "" -#: ../../whatsnew/3.11.rst:1909 +#: ../../whatsnew/3.11.rst:1913 msgid ":meth:`.assertFalse`" msgstr "" -#: ../../whatsnew/3.11.rst:1910 +#: ../../whatsnew/3.11.rst:1914 msgid "``failUnlessEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1920 msgid ":meth:`.assertEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1911 +#: ../../whatsnew/3.11.rst:1915 msgid "``failIfEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1911 ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1915 ../../whatsnew/3.11.rst:1921 msgid ":meth:`.assertNotEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1912 +#: ../../whatsnew/3.11.rst:1916 msgid "``failUnlessAlmostEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1922 msgid ":meth:`.assertAlmostEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1913 +#: ../../whatsnew/3.11.rst:1917 msgid "``failIfAlmostEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1913 ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1917 ../../whatsnew/3.11.rst:1923 msgid ":meth:`.assertNotAlmostEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1914 +#: ../../whatsnew/3.11.rst:1918 msgid "``failUnlessRaises``" msgstr "" -#: ../../whatsnew/3.11.rst:1914 +#: ../../whatsnew/3.11.rst:1918 msgid ":meth:`.assertRaises`" msgstr "" -#: ../../whatsnew/3.11.rst:1915 +#: ../../whatsnew/3.11.rst:1919 msgid "``assert_``" msgstr "" -#: ../../whatsnew/3.11.rst:1915 ../../whatsnew/3.11.rst:1916 -#: ../../whatsnew/3.11.rst:1917 ../../whatsnew/3.11.rst:1918 #: ../../whatsnew/3.11.rst:1919 ../../whatsnew/3.11.rst:1920 -#: ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1921 ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1923 ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1925 msgid "3.2" msgstr "" -#: ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1920 msgid "``assertEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1921 msgid "``assertNotEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1922 msgid "``assertAlmostEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1923 msgid "``assertNotAlmostEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1924 msgid "``assertRegexpMatches``" msgstr "" -#: ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1924 msgid ":meth:`.assertRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1925 msgid "``assertRaisesRegexp``" msgstr "" -#: ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1925 msgid ":meth:`.assertRaisesRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1926 msgid "``assertNotRegexpMatches``" msgstr "" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1926 msgid ":meth:`.assertNotRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1926 msgid "3.5" msgstr "" -#: ../../whatsnew/3.11.rst:1929 ../../whatsnew/3.11.rst:2613 +#: ../../whatsnew/3.11.rst:1933 ../../whatsnew/3.11.rst:2617 msgid "Removed" msgstr "" -#: ../../whatsnew/3.11.rst:1931 +#: ../../whatsnew/3.11.rst:1935 msgid "This section lists Python APIs that have been removed in Python 3.11." msgstr "" -#: ../../whatsnew/3.11.rst:1933 +#: ../../whatsnew/3.11.rst:1937 msgid "" "Removed C APIs are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:1935 +#: ../../whatsnew/3.11.rst:1939 msgid "" "Removed the :func:`!@asyncio.coroutine` :term:`decorator` enabling legacy " "generator-based coroutines to be compatible with :keyword:`async` / :keyword:" @@ -2982,14 +2988,14 @@ msgid "" "instead. (Contributed by Illia Volochii in :issue:`43216`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1942 +#: ../../whatsnew/3.11.rst:1946 msgid "" "Removed :class:`!asyncio.coroutines.CoroWrapper` used for wrapping legacy " "generator-based coroutine objects in the debug mode. (Contributed by Illia " "Volochii in :issue:`43216`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1946 +#: ../../whatsnew/3.11.rst:1950 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is now " @@ -2998,44 +3004,44 @@ msgid "" "`45129`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1952 +#: ../../whatsnew/3.11.rst:1956 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" msgstr "" -#: ../../whatsnew/3.11.rst:1955 +#: ../../whatsnew/3.11.rst:1959 msgid ":func:`!binascii.a2b_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1956 +#: ../../whatsnew/3.11.rst:1960 msgid ":func:`!binascii.b2a_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1957 +#: ../../whatsnew/3.11.rst:1961 msgid ":func:`!binascii.rlecode_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1958 +#: ../../whatsnew/3.11.rst:1962 msgid ":func:`!binascii.rldecode_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1960 +#: ../../whatsnew/3.11.rst:1964 msgid "The :func:`binascii.crc_hqx` function remains available." msgstr "" -#: ../../whatsnew/3.11.rst:1962 +#: ../../whatsnew/3.11.rst:1966 msgid "(Contributed by Victor Stinner in :issue:`45085`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1964 +#: ../../whatsnew/3.11.rst:1968 msgid "" "Removed the :mod:`distutils` ``bdist_msi`` command deprecated in Python 3.9. " "Use ``bdist_wheel`` (wheel packages) instead. (Contributed by Hugo van " "Kemenade in :issue:`45124`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1968 +#: ../../whatsnew/3.11.rst:1972 msgid "" "Removed the :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." "DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." @@ -3043,7 +3049,7 @@ msgid "" "in :issue:`45132`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1973 +#: ../../whatsnew/3.11.rst:1977 msgid "" "Removed the deprecated :mod:`gettext` functions :func:`!lgettext`, :func:`!" "ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed the :" @@ -3054,62 +3060,62 @@ msgid "" "by Dong-hee Na and Serhiy Storchaka in :issue:`44235`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1983 +#: ../../whatsnew/3.11.rst:1987 msgid "Removed from the :mod:`inspect` module:" msgstr "" -#: ../../whatsnew/3.11.rst:1985 +#: ../../whatsnew/3.11.rst:1989 msgid "" "The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" "`inspect.signature` or :func:`inspect.getfullargspec` instead." msgstr "" -#: ../../whatsnew/3.11.rst:1988 +#: ../../whatsnew/3.11.rst:1992 msgid "" "The :func:`!formatargspec` function, deprecated since Python 3.5; use the :" "func:`inspect.signature` function or the :class:`inspect.Signature` object " "directly." msgstr "" -#: ../../whatsnew/3.11.rst:1992 +#: ../../whatsnew/3.11.rst:1996 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." msgstr "" -#: ../../whatsnew/3.11.rst:1997 +#: ../../whatsnew/3.11.rst:2001 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1999 +#: ../../whatsnew/3.11.rst:2003 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2004 +#: ../../whatsnew/3.11.rst:2008 msgid "" "Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " "Dong-hee Na in :issue:`35800`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2008 +#: ../../whatsnew/3.11.rst:2012 msgid "" "Removed the deprecated :meth:`!split` method of :class:`!_tkinter." "TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2011 +#: ../../whatsnew/3.11.rst:2015 msgid "" "Removed namespace package support from :mod:`unittest` discovery. It was " "introduced in Python 3.4 but has been broken since Python 3.7. (Contributed " "by Inada Naoki in :issue:`23882`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2015 +#: ../../whatsnew/3.11.rst:2019 msgid "" "Removed the undocumented private :meth:`!float.__set_format__()` method, " "previously known as :meth:`!float.__setformat__()` in Python 3.7. Its " @@ -3118,14 +3124,14 @@ msgid "" "in :issue:`46852`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2021 +#: ../../whatsnew/3.11.rst:2025 msgid "" "The :option:`!--experimental-isolated-subinterpreters` configure flag (and " "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " "been removed." msgstr "" -#: ../../whatsnew/3.11.rst:2025 +#: ../../whatsnew/3.11.rst:2029 msgid "" "`Pynche `_ --- The Pythonically Natural " "Color and Hue Editor --- has been moved out of ``Tools/scripts`` and is " @@ -3133,23 +3139,23 @@ msgid "" "main>`_ from the Python source tree." msgstr "" -#: ../../whatsnew/3.11.rst:2035 ../../whatsnew/3.11.rst:2257 +#: ../../whatsnew/3.11.rst:2039 ../../whatsnew/3.11.rst:2261 msgid "Porting to Python 3.11" msgstr "" -#: ../../whatsnew/3.11.rst:2037 +#: ../../whatsnew/3.11.rst:2041 msgid "" "This section lists previously described changes and other bugfixes in the " "Python API that may require changes to your Python code." msgstr "" -#: ../../whatsnew/3.11.rst:2040 +#: ../../whatsnew/3.11.rst:2044 msgid "" "Porting notes for the C API are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:2043 +#: ../../whatsnew/3.11.rst:2047 msgid "" ":func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput." "FileInput` no longer accept ``'U'`` (\"universal newline\") in the file " @@ -3160,7 +3166,7 @@ msgid "" "Stinner in :issue:`37330`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2052 +#: ../../whatsnew/3.11.rst:2056 msgid "" ":class:`ast.AST` node positions are now validated when provided to :func:" "`compile` and other related functions. If invalid positions are detected, a :" @@ -3168,14 +3174,14 @@ msgid "" "`93351`)" msgstr "" -#: ../../whatsnew/3.11.rst:2056 +#: ../../whatsnew/3.11.rst:2060 msgid "" "Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor` " "executors to :meth:`asyncio.loop.set_default_executor` following a " "deprecation in Python 3.8. (Contributed by Illia Volochii in :issue:`43234`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2061 +#: ../../whatsnew/3.11.rst:2065 msgid "" ":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:" "`calendar.LocaleHTMLCalendar` classes now use :func:`locale.getlocale`, " @@ -3183,14 +3189,14 @@ msgid "" "(Contributed by Victor Stinner in :issue:`46659`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2067 +#: ../../whatsnew/3.11.rst:2071 msgid "" "The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with " "the ``'UTF-8'`` encoding. (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ " "రెడ్డి తాటిపర్తి) in :issue:`41137`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2071 +#: ../../whatsnew/3.11.rst:2075 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 " @@ -3199,14 +3205,14 @@ msgid "" "`40465`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2077 +#: ../../whatsnew/3.11.rst:2081 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." msgstr "" -#: ../../whatsnew/3.11.rst:2081 +#: ../../whatsnew/3.11.rst:2085 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 " @@ -3214,7 +3220,7 @@ msgid "" "`47066`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2086 +#: ../../whatsnew/3.11.rst:2090 msgid "" "In the :mod:`re` module, several long-standing bugs where fixed that, in " "rare cases, could cause capture groups to get the wrong result. Therefore, " @@ -3222,11 +3228,11 @@ msgid "" "in :issue:`35859`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2095 +#: ../../whatsnew/3.11.rst:2099 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.11.rst:2097 +#: ../../whatsnew/3.11.rst:2101 msgid "" "CPython now has :pep:`11` :pep:`Tier 3 support <11#tier-3>` for cross " "compiling to the `WebAssembly `_ platforms " @@ -3241,11 +3247,11 @@ msgid "" "gh:`90473`; platforms promoted in :gh:`95085`)" msgstr "" -#: ../../whatsnew/3.11.rst:2111 +#: ../../whatsnew/3.11.rst:2115 msgid "Building CPython now requires:" msgstr "" -#: ../../whatsnew/3.11.rst:2113 +#: ../../whatsnew/3.11.rst:2117 msgid "" "A `C11 `_ compiler and standard library. " "`Optional C11 features `_ floating " "point numbers. (Contributed by Victor Stinner in :issue:`46917`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2124 +#: ../../whatsnew/3.11.rst:2128 msgid "" "The :c:macro:`!Py_NO_NAN` macro has been removed. Since CPython now requires " "IEEE 754 floats, NaN values are always available. (Contributed by Victor " "Stinner in :issue:`46656`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2128 +#: ../../whatsnew/3.11.rst:2132 msgid "" "The :mod:`tkinter` package now requires `Tcl/Tk `_ " "version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2132 +#: ../../whatsnew/3.11.rst:2136 msgid "" "Build dependencies, compiler flags, and linker flags for most stdlib " "extension modules are now detected by :program:`configure`. libffi, libnsl, " @@ -3285,13 +3291,13 @@ msgid "" "`45847`, :issue:`45747`, and :issue:`45763`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2142 +#: ../../whatsnew/3.11.rst:2146 msgid "" "libpython is no longer linked against libcrypt. (Contributed by Mike Gilbert " "in :issue:`45433`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2145 +#: ../../whatsnew/3.11.rst:2149 msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " @@ -3299,7 +3305,7 @@ msgid "" "`44340`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2150 +#: ../../whatsnew/3.11.rst:2154 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " "option :option:`!--without-freelists` can be used to disable all freelists " @@ -3307,7 +3313,7 @@ msgid "" "`45522`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2155 +#: ../../whatsnew/3.11.rst:2159 msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " @@ -3316,7 +3322,7 @@ msgid "" "`45570`, :issue:`45571`, and :issue:`43974`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2162 +#: ../../whatsnew/3.11.rst:2166 msgid "" "Use the environment variables :envvar:`!TCLTK_CFLAGS` and :envvar:`!" "TCLTK_LIBS` to manually specify the location of Tcl/Tk headers and " @@ -3324,7 +3330,7 @@ msgid "" "and :option:`!--with-tcltk-libs` have been removed." msgstr "" -#: ../../whatsnew/3.11.rst:2168 +#: ../../whatsnew/3.11.rst:2172 msgid "" "On RHEL 7 and CentOS 7 the development packages do not provide ``tcl.pc`` " "and ``tk.pc``; use ``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``. The " @@ -3332,7 +3338,7 @@ msgid "" "build Python with RHEL 7's and CentOS 7's Tcl/Tk and OpenSSL." msgstr "" -#: ../../whatsnew/3.11.rst:2173 +#: ../../whatsnew/3.11.rst:2177 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 " @@ -3344,23 +3350,23 @@ msgid "" "in :issue:`45569`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2186 +#: ../../whatsnew/3.11.rst:2190 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.11.rst:2193 +#: ../../whatsnew/3.11.rst:2197 msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2196 +#: ../../whatsnew/3.11.rst:2200 msgid "" "Add a new :c:func:`PyType_GetQualName` function to get type's qualified " "name. (Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2199 +#: ../../whatsnew/3.11.rst:2203 msgid "" "Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " @@ -3368,78 +3374,78 @@ msgid "" "`43760`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2204 +#: ../../whatsnew/3.11.rst:2208 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2208 +#: ../../whatsnew/3.11.rst:2212 msgid "" ":c:type:`Py_buffer` and APIs are now part of the limited API and the stable " "ABI:" msgstr "" -#: ../../whatsnew/3.11.rst:2211 +#: ../../whatsnew/3.11.rst:2215 msgid ":c:func:`PyObject_CheckBuffer`" msgstr ":c:func:`PyObject_CheckBuffer`" -#: ../../whatsnew/3.11.rst:2212 +#: ../../whatsnew/3.11.rst:2216 msgid ":c:func:`PyObject_GetBuffer`" msgstr ":c:func:`PyObject_GetBuffer`" -#: ../../whatsnew/3.11.rst:2213 +#: ../../whatsnew/3.11.rst:2217 msgid ":c:func:`PyBuffer_GetPointer`" msgstr ":c:func:`PyBuffer_GetPointer`" -#: ../../whatsnew/3.11.rst:2214 +#: ../../whatsnew/3.11.rst:2218 msgid ":c:func:`PyBuffer_SizeFromFormat`" msgstr ":c:func:`PyBuffer_SizeFromFormat`" -#: ../../whatsnew/3.11.rst:2215 +#: ../../whatsnew/3.11.rst:2219 msgid ":c:func:`PyBuffer_ToContiguous`" msgstr ":c:func:`PyBuffer_ToContiguous`" -#: ../../whatsnew/3.11.rst:2216 +#: ../../whatsnew/3.11.rst:2220 msgid ":c:func:`PyBuffer_FromContiguous`" msgstr ":c:func:`PyBuffer_FromContiguous`" -#: ../../whatsnew/3.11.rst:2217 +#: ../../whatsnew/3.11.rst:2221 msgid ":c:func:`PyBuffer_CopyData`" msgstr ":c:func:`PyBuffer_CopyData`" -#: ../../whatsnew/3.11.rst:2218 +#: ../../whatsnew/3.11.rst:2222 msgid ":c:func:`PyBuffer_IsContiguous`" msgstr ":c:func:`PyBuffer_IsContiguous`" -#: ../../whatsnew/3.11.rst:2219 +#: ../../whatsnew/3.11.rst:2223 msgid ":c:func:`PyBuffer_FillContiguousStrides`" msgstr ":c:func:`PyBuffer_FillContiguousStrides`" -#: ../../whatsnew/3.11.rst:2220 +#: ../../whatsnew/3.11.rst:2224 msgid ":c:func:`PyBuffer_FillInfo`" msgstr ":c:func:`PyBuffer_FillInfo`" -#: ../../whatsnew/3.11.rst:2221 +#: ../../whatsnew/3.11.rst:2225 msgid ":c:func:`PyBuffer_Release`" msgstr ":c:func:`PyBuffer_Release`" -#: ../../whatsnew/3.11.rst:2222 +#: ../../whatsnew/3.11.rst:2226 msgid ":c:func:`PyMemoryView_FromBuffer`" msgstr ":c:func:`PyMemoryView_FromBuffer`" -#: ../../whatsnew/3.11.rst:2223 +#: ../../whatsnew/3.11.rst:2227 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` type slots" msgstr "" -#: ../../whatsnew/3.11.rst:2226 +#: ../../whatsnew/3.11.rst:2230 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2228 +#: ../../whatsnew/3.11.rst:2232 msgid "" "Added the :c:data:`PyType_GetModuleByDef` function, used to get the module " "in which a method was defined, in cases where this information is not " @@ -3447,7 +3453,7 @@ msgid "" "in :issue:`46613`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2233 +#: ../../whatsnew/3.11.rst:2237 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:" @@ -3455,14 +3461,14 @@ msgid "" "`PyFloat_Unpack8`. (Contributed by Victor Stinner in :issue:`46906`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2239 +#: ../../whatsnew/3.11.rst:2243 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`." msgstr "" -#: ../../whatsnew/3.11.rst:2243 +#: ../../whatsnew/3.11.rst:2247 msgid "" "Added two new functions to get and set the active exception instance: :c:" "func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " @@ -3471,13 +3477,13 @@ msgid "" "exceptions. (Contributed by Irit Katriel in :issue:`46343`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2250 +#: ../../whatsnew/3.11.rst:2254 msgid "" "Added the :c:member:`PyConfig.safe_path` member. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2261 +#: ../../whatsnew/3.11.rst:2265 msgid "" "Some macros have been converted to static inline functions to avoid `macro " "pitfalls `_. The " @@ -3489,7 +3495,7 @@ msgid "" "Stinner and Erlend E. Aasland in :gh:`89653`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2272 +#: ../../whatsnew/3.11.rst:2276 msgid "" ":c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback`` " "arguments, the interpreter now derives those values from the exception " @@ -3497,14 +3503,14 @@ msgid "" "all three arguments. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2278 +#: ../../whatsnew/3.11.rst:2282 msgid "" ":c:func:`PyErr_GetExcInfo()` now derives the ``type`` and ``traceback`` " "fields of the result from the exception instance (the ``value`` field). " "(Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2282 +#: ../../whatsnew/3.11.rst:2286 msgid "" ":c:struct:`_frozen` has a new ``is_package`` field to indicate whether or " "not the frozen module is a package. Previously, a negative value in the " @@ -3512,14 +3518,14 @@ msgid "" "``size``. (Contributed by Kumar Aditya in :issue:`46608`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2288 +#: ../../whatsnew/3.11.rst:2292 msgid "" ":c:func:`_PyFrameEvalFunction` now takes ``_PyInterpreterFrame*`` as its " "second parameter, instead of ``PyFrameObject*``. See :pep:`523` for more " "details of how to use this function pointer type." msgstr "" -#: ../../whatsnew/3.11.rst:2292 +#: ../../whatsnew/3.11.rst:2296 msgid "" ":c:func:`PyCode_New` and :c:func:`PyCode_NewWithPosOnlyArgs` now take an " "additional ``exception_table`` argument. Using these functions should be " @@ -3528,7 +3534,7 @@ msgid "" "method." msgstr "" -#: ../../whatsnew/3.11.rst:2298 +#: ../../whatsnew/3.11.rst:2302 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " "``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" @@ -3538,35 +3544,35 @@ msgid "" "and :gh:`94936`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2306 +#: ../../whatsnew/3.11.rst:2310 msgid "" "The old trashcan macros (``Py_TRASHCAN_SAFE_BEGIN``/" "``Py_TRASHCAN_SAFE_END``) are now deprecated. They should be replaced by the " "new macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.11.rst:2310 +#: ../../whatsnew/3.11.rst:2314 msgid "A tp_dealloc function that has the old macros, such as::" msgstr "" -#: ../../whatsnew/3.11.rst:2321 +#: ../../whatsnew/3.11.rst:2325 msgid "should migrate to the new macros as follows::" msgstr "" -#: ../../whatsnew/3.11.rst:2332 +#: ../../whatsnew/3.11.rst:2336 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in." msgstr "" -#: ../../whatsnew/3.11.rst:2335 +#: ../../whatsnew/3.11.rst:2339 msgid "" "To support older Python versions in the same codebase, you can define the " "following macros and use them throughout the code (credit: these were copied " "from the ``mypy`` codebase)::" msgstr "" -#: ../../whatsnew/3.11.rst:2347 +#: ../../whatsnew/3.11.rst:2351 msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " "with the :const:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function (:" @@ -3574,7 +3580,7 @@ msgid "" "issue:`44263`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2352 +#: ../../whatsnew/3.11.rst:2356 msgid "" "Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " "the :pep:`590` vectorcall protocol. Previously, this was only possible for :" @@ -3582,7 +3588,7 @@ msgid "" "issue:`43908`)" msgstr "" -#: ../../whatsnew/3.11.rst:2357 +#: ../../whatsnew/3.11.rst:2361 msgid "" "Since :c:func:`Py_TYPE()` is changed to a inline static function, " "``Py_TYPE(obj) = new_type`` must be replaced with ``Py_SET_TYPE(obj, " @@ -3590,11 +3596,11 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.11.rst:2369 ../../whatsnew/3.11.rst:2383 +#: ../../whatsnew/3.11.rst:2373 ../../whatsnew/3.11.rst:2387 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2371 +#: ../../whatsnew/3.11.rst:2375 msgid "" "Since :c:func:`Py_SIZE()` is changed to a inline static function, " "``Py_SIZE(obj) = new_size`` must be replaced with ``Py_SET_SIZE(obj, " @@ -3602,7 +3608,7 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.11.rst:2385 +#: ../../whatsnew/3.11.rst:2389 msgid "" "```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " @@ -3611,7 +3617,7 @@ msgid "" "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2391 +#: ../../whatsnew/3.11.rst:2395 msgid "" "The non-limited API files ``cellobject.h``, ``classobject.h``, ``code.h``, " "``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have " @@ -3622,7 +3628,7 @@ msgid "" "instead. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2399 +#: ../../whatsnew/3.11.rst:2403 msgid "" "The :c:func:`PyUnicode_CHECK_INTERNED` macro has been excluded from the " "limited C API. It was never usable there, because it used internal " @@ -3630,149 +3636,149 @@ msgid "" "Victor Stinner in :issue:`46007`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2404 +#: ../../whatsnew/3.11.rst:2408 msgid "" "The following frame functions and type are now directly available with " "``#include ``, it's no longer needed to add ``#include " "``:" msgstr "" -#: ../../whatsnew/3.11.rst:2408 +#: ../../whatsnew/3.11.rst:2412 msgid ":c:func:`PyFrame_Check`" msgstr ":c:func:`PyFrame_Check`" -#: ../../whatsnew/3.11.rst:2409 +#: ../../whatsnew/3.11.rst:2413 msgid ":c:func:`PyFrame_GetBack`" msgstr ":c:func:`PyFrame_GetBack`" -#: ../../whatsnew/3.11.rst:2410 +#: ../../whatsnew/3.11.rst:2414 msgid ":c:func:`PyFrame_GetBuiltins`" msgstr ":c:func:`PyFrame_GetBuiltins`" -#: ../../whatsnew/3.11.rst:2411 +#: ../../whatsnew/3.11.rst:2415 msgid ":c:func:`PyFrame_GetGenerator`" msgstr ":c:func:`PyFrame_GetGenerator`" -#: ../../whatsnew/3.11.rst:2412 +#: ../../whatsnew/3.11.rst:2416 msgid ":c:func:`PyFrame_GetGlobals`" msgstr ":c:func:`PyFrame_GetGlobals`" -#: ../../whatsnew/3.11.rst:2413 +#: ../../whatsnew/3.11.rst:2417 msgid ":c:func:`PyFrame_GetLasti`" msgstr ":c:func:`PyFrame_GetLasti`" -#: ../../whatsnew/3.11.rst:2414 +#: ../../whatsnew/3.11.rst:2418 msgid ":c:func:`PyFrame_GetLocals`" msgstr ":c:func:`PyFrame_GetLocals`" -#: ../../whatsnew/3.11.rst:2415 +#: ../../whatsnew/3.11.rst:2419 msgid ":c:type:`PyFrame_Type`" msgstr ":c:type:`PyFrame_Type`" -#: ../../whatsnew/3.11.rst:2417 +#: ../../whatsnew/3.11.rst:2421 msgid "(Contributed by Victor Stinner in :gh:`93937`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2421 +#: ../../whatsnew/3.11.rst:2425 msgid "" "The :c:type:`PyFrameObject` structure members have been removed from the " "public C API." msgstr "" -#: ../../whatsnew/3.11.rst:2424 +#: ../../whatsnew/3.11.rst:2428 msgid "" "While the documentation notes that the :c:type:`PyFrameObject` fields are " "subject to change at any time, they have been stable for a long time and " "were used in several popular extensions." msgstr "" -#: ../../whatsnew/3.11.rst:2428 +#: ../../whatsnew/3.11.rst:2432 msgid "" "In Python 3.11, the frame struct was reorganized to allow performance " "optimizations. Some fields were removed entirely, as they were details of " "the old implementation." msgstr "" -#: ../../whatsnew/3.11.rst:2432 +#: ../../whatsnew/3.11.rst:2436 msgid ":c:type:`PyFrameObject` fields:" msgstr "" -#: ../../whatsnew/3.11.rst:2434 +#: ../../whatsnew/3.11.rst:2438 msgid "``f_back``: use :c:func:`PyFrame_GetBack`." msgstr "" -#: ../../whatsnew/3.11.rst:2435 +#: ../../whatsnew/3.11.rst:2439 msgid "``f_blockstack``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2436 +#: ../../whatsnew/3.11.rst:2440 msgid "``f_builtins``: use :c:func:`PyFrame_GetBuiltins`." msgstr "" -#: ../../whatsnew/3.11.rst:2437 +#: ../../whatsnew/3.11.rst:2441 msgid "``f_code``: use :c:func:`PyFrame_GetCode`." msgstr "" -#: ../../whatsnew/3.11.rst:2438 +#: ../../whatsnew/3.11.rst:2442 msgid "``f_gen``: use :c:func:`PyFrame_GetGenerator`." msgstr "" -#: ../../whatsnew/3.11.rst:2439 +#: ../../whatsnew/3.11.rst:2443 msgid "``f_globals``: use :c:func:`PyFrame_GetGlobals`." msgstr "" -#: ../../whatsnew/3.11.rst:2440 +#: ../../whatsnew/3.11.rst:2444 msgid "``f_iblock``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2441 +#: ../../whatsnew/3.11.rst:2445 msgid "" "``f_lasti``: use :c:func:`PyFrame_GetLasti`. Code using ``f_lasti`` with " "``PyCode_Addr2Line()`` should use :c:func:`PyFrame_GetLineNumber` instead; " "it may be faster." msgstr "" -#: ../../whatsnew/3.11.rst:2444 +#: ../../whatsnew/3.11.rst:2448 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" msgstr "" -#: ../../whatsnew/3.11.rst:2445 +#: ../../whatsnew/3.11.rst:2449 msgid "``f_locals``: use :c:func:`PyFrame_GetLocals`." msgstr "" -#: ../../whatsnew/3.11.rst:2446 +#: ../../whatsnew/3.11.rst:2450 msgid "``f_stackdepth``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2447 +#: ../../whatsnew/3.11.rst:2451 msgid "``f_state``: no public API (renamed to ``f_frame.f_state``)." msgstr "" -#: ../../whatsnew/3.11.rst:2448 +#: ../../whatsnew/3.11.rst:2452 msgid "``f_trace``: no public API." msgstr "" -#: ../../whatsnew/3.11.rst:2449 +#: ../../whatsnew/3.11.rst:2453 msgid "" "``f_trace_lines``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_lines\")``." msgstr "" -#: ../../whatsnew/3.11.rst:2450 +#: ../../whatsnew/3.11.rst:2454 msgid "" "``f_trace_opcodes``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_opcodes\")``." msgstr "" -#: ../../whatsnew/3.11.rst:2451 +#: ../../whatsnew/3.11.rst:2455 msgid "``f_localsplus``: no public API (renamed to ``f_frame.localsplus``)." msgstr "" -#: ../../whatsnew/3.11.rst:2452 +#: ../../whatsnew/3.11.rst:2456 msgid "``f_valuestack``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2454 +#: ../../whatsnew/3.11.rst:2458 msgid "" "The Python frame object is now created lazily. A side effect is that the " "``f_back`` member must not be accessed directly, since its value is now also " @@ -3780,7 +3786,7 @@ msgid "" "instead." msgstr "" -#: ../../whatsnew/3.11.rst:2459 +#: ../../whatsnew/3.11.rst:2463 msgid "" "Debuggers that accessed the ``f_locals`` directly *must* call :c:func:" "`PyFrame_GetLocals` instead. They no longer need to call :c:func:" @@ -3789,71 +3795,71 @@ msgid "" "now managed by the virtual machine." msgstr "" -#: ../../whatsnew/3.11.rst:2465 +#: ../../whatsnew/3.11.rst:2469 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2475 +#: ../../whatsnew/3.11.rst:2479 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2485 +#: ../../whatsnew/3.11.rst:2489 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." msgstr "" -#: ../../whatsnew/3.11.rst:2489 +#: ../../whatsnew/3.11.rst:2493 msgid "Changes of the :c:type:`PyThreadState` structure members:" msgstr "" -#: ../../whatsnew/3.11.rst:2491 +#: ../../whatsnew/3.11.rst:2495 msgid "" "``frame``: removed, use :c:func:`PyThreadState_GetFrame` (function added to " "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " "reference`, need to call :c:func:`Py_XDECREF`." msgstr "" -#: ../../whatsnew/3.11.rst:2495 +#: ../../whatsnew/3.11.rst:2499 msgid "" "``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" "`43760`)." msgstr "" -#: ../../whatsnew/3.11.rst:2498 +#: ../../whatsnew/3.11.rst:2502 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." msgstr "" -#: ../../whatsnew/3.11.rst:2500 +#: ../../whatsnew/3.11.rst:2504 msgid "``stackcheck_counter``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2502 +#: ../../whatsnew/3.11.rst:2506 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2512 +#: ../../whatsnew/3.11.rst:2516 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2538 +#: ../../whatsnew/3.11.rst:2542 msgid "" "Or use `the pythoncapi-compat project `__ to get these functions on old Python functions." msgstr "" -#: ../../whatsnew/3.11.rst:2542 +#: ../../whatsnew/3.11.rst:2546 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." msgstr "" -#: ../../whatsnew/3.11.rst:2545 +#: ../../whatsnew/3.11.rst:2549 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to 1 " "for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -3861,7 +3867,7 @@ msgid "" "path and replace any values added to ``module_search_paths``." msgstr "" -#: ../../whatsnew/3.11.rst:2550 +#: ../../whatsnew/3.11.rst:2554 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 " @@ -3870,177 +3876,177 @@ msgid "" "object and modify it directly." msgstr "" -#: ../../whatsnew/3.11.rst:2561 +#: ../../whatsnew/3.11.rst:2565 msgid "" "Deprecate the following functions to configure the Python initialization:" msgstr "" -#: ../../whatsnew/3.11.rst:2563 +#: ../../whatsnew/3.11.rst:2567 msgid ":c:func:`PySys_AddWarnOptionUnicode`" msgstr ":c:func:`PySys_AddWarnOptionUnicode`" -#: ../../whatsnew/3.11.rst:2564 +#: ../../whatsnew/3.11.rst:2568 msgid ":c:func:`PySys_AddWarnOption`" msgstr ":c:func:`PySys_AddWarnOption`" -#: ../../whatsnew/3.11.rst:2565 +#: ../../whatsnew/3.11.rst:2569 msgid ":c:func:`PySys_AddXOption`" msgstr ":c:func:`PySys_AddXOption`" -#: ../../whatsnew/3.11.rst:2566 +#: ../../whatsnew/3.11.rst:2570 msgid ":c:func:`PySys_HasWarnOptions`" msgstr ":c:func:`PySys_HasWarnOptions`" -#: ../../whatsnew/3.11.rst:2567 +#: ../../whatsnew/3.11.rst:2571 msgid ":c:func:`PySys_SetArgvEx`" msgstr ":c:func:`PySys_SetArgvEx`" -#: ../../whatsnew/3.11.rst:2568 +#: ../../whatsnew/3.11.rst:2572 msgid ":c:func:`PySys_SetArgv`" msgstr ":c:func:`PySys_SetArgv`" -#: ../../whatsnew/3.11.rst:2569 +#: ../../whatsnew/3.11.rst:2573 msgid ":c:func:`PySys_SetPath`" msgstr ":c:func:`PySys_SetPath`" -#: ../../whatsnew/3.11.rst:2570 +#: ../../whatsnew/3.11.rst:2574 msgid ":c:func:`Py_SetPath`" msgstr ":c:func:`Py_SetPath`" -#: ../../whatsnew/3.11.rst:2571 +#: ../../whatsnew/3.11.rst:2575 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../whatsnew/3.11.rst:2572 +#: ../../whatsnew/3.11.rst:2576 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../whatsnew/3.11.rst:2573 +#: ../../whatsnew/3.11.rst:2577 msgid ":c:func:`Py_SetStandardStreamEncoding`" msgstr ":c:func:`Py_SetStandardStreamEncoding`" -#: ../../whatsnew/3.11.rst:2574 +#: ../../whatsnew/3.11.rst:2578 msgid ":c:func:`_Py_SetProgramFullPath`" msgstr ":c:func:`_Py_SetProgramFullPath`" -#: ../../whatsnew/3.11.rst:2576 +#: ../../whatsnew/3.11.rst:2580 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`). (Contributed by Victor " "Stinner in :gh:`88279`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2580 +#: ../../whatsnew/3.11.rst:2584 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2589 +#: ../../whatsnew/3.11.rst:2593 msgid "" "The following C APIs have been deprecated in earlier Python releases, and " "will be removed in Python 3.12." msgstr "" -#: ../../whatsnew/3.11.rst:2592 +#: ../../whatsnew/3.11.rst:2596 msgid ":c:func:`PyUnicode_AS_DATA`" msgstr ":c:func:`PyUnicode_AS_DATA`" -#: ../../whatsnew/3.11.rst:2593 +#: ../../whatsnew/3.11.rst:2597 msgid ":c:func:`PyUnicode_AS_UNICODE`" msgstr ":c:func:`PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.11.rst:2594 +#: ../../whatsnew/3.11.rst:2598 msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.11.rst:2595 +#: ../../whatsnew/3.11.rst:2599 msgid ":c:func:`PyUnicode_AsUnicode`" msgstr ":c:func:`PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2596 +#: ../../whatsnew/3.11.rst:2600 msgid ":c:func:`PyUnicode_FromUnicode`" msgstr ":c:func:`PyUnicode_FromUnicode`" -#: ../../whatsnew/3.11.rst:2597 +#: ../../whatsnew/3.11.rst:2601 msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.11.rst:2598 +#: ../../whatsnew/3.11.rst:2602 msgid ":c:func:`PyUnicode_GET_SIZE`" msgstr ":c:func:`PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.11.rst:2599 +#: ../../whatsnew/3.11.rst:2603 msgid ":c:func:`PyUnicode_GetSize`" msgstr ":c:func:`PyUnicode_GetSize`" -#: ../../whatsnew/3.11.rst:2600 +#: ../../whatsnew/3.11.rst:2604 msgid ":c:func:`PyUnicode_IS_COMPACT`" msgstr ":c:func:`PyUnicode_IS_COMPACT`" -#: ../../whatsnew/3.11.rst:2601 +#: ../../whatsnew/3.11.rst:2605 msgid ":c:func:`PyUnicode_IS_READY`" msgstr ":c:func:`PyUnicode_IS_READY`" -#: ../../whatsnew/3.11.rst:2602 +#: ../../whatsnew/3.11.rst:2606 msgid ":c:func:`PyUnicode_READY`" msgstr ":c:func:`PyUnicode_READY`" -#: ../../whatsnew/3.11.rst:2603 +#: ../../whatsnew/3.11.rst:2607 msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" -#: ../../whatsnew/3.11.rst:2604 +#: ../../whatsnew/3.11.rst:2608 msgid ":c:func:`_PyUnicode_AsUnicode`" msgstr ":c:func:`_PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2605 +#: ../../whatsnew/3.11.rst:2609 msgid ":c:macro:`PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.11.rst:2606 +#: ../../whatsnew/3.11.rst:2610 msgid ":c:type:`PyUnicodeObject`" msgstr ":c:type:`PyUnicodeObject`" -#: ../../whatsnew/3.11.rst:2607 +#: ../../whatsnew/3.11.rst:2611 msgid ":c:func:`PyUnicode_InternImmortal()`" msgstr ":c:func:`PyUnicode_InternImmortal()`" -#: ../../whatsnew/3.11.rst:2615 +#: ../../whatsnew/3.11.rst:2619 msgid "" ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2619 +#: ../../whatsnew/3.11.rst:2623 msgid "Remove the following math macros using the ``errno`` variable:" msgstr "" -#: ../../whatsnew/3.11.rst:2621 +#: ../../whatsnew/3.11.rst:2625 msgid "``Py_ADJUST_ERANGE1()``" msgstr "``Py_ADJUST_ERANGE1()``" -#: ../../whatsnew/3.11.rst:2622 +#: ../../whatsnew/3.11.rst:2626 msgid "``Py_ADJUST_ERANGE2()``" msgstr "``Py_ADJUST_ERANGE2()``" -#: ../../whatsnew/3.11.rst:2623 +#: ../../whatsnew/3.11.rst:2627 msgid "``Py_OVERFLOWED()``" msgstr "``Py_OVERFLOWED()``" -#: ../../whatsnew/3.11.rst:2624 +#: ../../whatsnew/3.11.rst:2628 msgid "``Py_SET_ERANGE_IF_OVERFLOW()``" msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" -#: ../../whatsnew/3.11.rst:2625 +#: ../../whatsnew/3.11.rst:2629 msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2627 +#: ../../whatsnew/3.11.rst:2631 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2629 +#: ../../whatsnew/3.11.rst:2633 msgid "" "Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated " "since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()`` " @@ -4048,62 +4054,62 @@ msgid "" "(Contributed by Victor Stinner in :issue:`41123`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2634 +#: ../../whatsnew/3.11.rst:2638 msgid "" "Remove the ``pystrhex.h`` header file. It only contains private functions. C " "extensions should only include the main ```` header file. " "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2638 +#: ../../whatsnew/3.11.rst:2642 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" "`45440`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2642 +#: ../../whatsnew/3.11.rst:2646 msgid "" "The following items are no longer available when :c:macro:`Py_LIMITED_API` " "is defined:" msgstr "" -#: ../../whatsnew/3.11.rst:2645 +#: ../../whatsnew/3.11.rst:2649 msgid ":c:func:`PyMarshal_WriteLongToFile`" msgstr ":c:func:`PyMarshal_WriteLongToFile`" -#: ../../whatsnew/3.11.rst:2646 +#: ../../whatsnew/3.11.rst:2650 msgid ":c:func:`PyMarshal_WriteObjectToFile`" msgstr ":c:func:`PyMarshal_WriteObjectToFile`" -#: ../../whatsnew/3.11.rst:2647 +#: ../../whatsnew/3.11.rst:2651 msgid ":c:func:`PyMarshal_ReadObjectFromString`" msgstr ":c:func:`PyMarshal_ReadObjectFromString`" -#: ../../whatsnew/3.11.rst:2648 +#: ../../whatsnew/3.11.rst:2652 msgid ":c:func:`PyMarshal_WriteObjectToString`" msgstr ":c:func:`PyMarshal_WriteObjectToString`" -#: ../../whatsnew/3.11.rst:2649 +#: ../../whatsnew/3.11.rst:2653 msgid "the ``Py_MARSHAL_VERSION`` macro" msgstr "``Py_MARSHAL_VERSION`` 巨集" -#: ../../whatsnew/3.11.rst:2651 +#: ../../whatsnew/3.11.rst:2655 msgid "These are not part of the :ref:`limited API `." msgstr "" -#: ../../whatsnew/3.11.rst:2653 +#: ../../whatsnew/3.11.rst:2657 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2655 +#: ../../whatsnew/3.11.rst:2659 msgid "" "Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API. It never " "worked since the :c:type:`PyWeakReference` structure is opaque in the " "limited C API. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2660 +#: ../../whatsnew/3.11.rst:2664 msgid "" "Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed in the public " "C API by mistake, it must only be used by Python internally. Use the " @@ -4111,90 +4117,90 @@ msgid "" "in :issue:`40170`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2665 +#: ../../whatsnew/3.11.rst:2669 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2671 +#: ../../whatsnew/3.11.rst:2675 msgid "" "Remove the :c:type:`Py_UNICODE` encoder APIs, as they have been deprecated " "since Python 3.3, are little used and are inefficient relative to the " "recommended alternatives." msgstr "" -#: ../../whatsnew/3.11.rst:2676 +#: ../../whatsnew/3.11.rst:2680 msgid "The removed functions are:" msgstr "" -#: ../../whatsnew/3.11.rst:2678 +#: ../../whatsnew/3.11.rst:2682 msgid ":func:`!PyUnicode_Encode`" msgstr ":func:`!PyUnicode_Encode`" -#: ../../whatsnew/3.11.rst:2679 +#: ../../whatsnew/3.11.rst:2683 msgid ":func:`!PyUnicode_EncodeASCII`" msgstr ":func:`!PyUnicode_EncodeASCII`" -#: ../../whatsnew/3.11.rst:2680 +#: ../../whatsnew/3.11.rst:2684 msgid ":func:`!PyUnicode_EncodeLatin1`" msgstr ":func:`!PyUnicode_EncodeLatin1`" -#: ../../whatsnew/3.11.rst:2681 +#: ../../whatsnew/3.11.rst:2685 msgid ":func:`!PyUnicode_EncodeUTF7`" msgstr ":func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.11.rst:2682 +#: ../../whatsnew/3.11.rst:2686 msgid ":func:`!PyUnicode_EncodeUTF8`" msgstr ":func:`!PyUnicode_EncodeUTF8`" -#: ../../whatsnew/3.11.rst:2683 +#: ../../whatsnew/3.11.rst:2687 msgid ":func:`!PyUnicode_EncodeUTF16`" msgstr ":func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.11.rst:2684 +#: ../../whatsnew/3.11.rst:2688 msgid ":func:`!PyUnicode_EncodeUTF32`" msgstr ":func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.11.rst:2685 +#: ../../whatsnew/3.11.rst:2689 msgid ":func:`!PyUnicode_EncodeUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2686 +#: ../../whatsnew/3.11.rst:2690 msgid ":func:`!PyUnicode_EncodeRawUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeRawUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2687 +#: ../../whatsnew/3.11.rst:2691 msgid ":func:`!PyUnicode_EncodeCharmap`" msgstr ":func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.11.rst:2688 +#: ../../whatsnew/3.11.rst:2692 msgid ":func:`!PyUnicode_TranslateCharmap`" msgstr ":func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.11.rst:2689 +#: ../../whatsnew/3.11.rst:2693 msgid ":func:`!PyUnicode_EncodeDecimal`" msgstr ":func:`!PyUnicode_EncodeDecimal`" -#: ../../whatsnew/3.11.rst:2690 +#: ../../whatsnew/3.11.rst:2694 msgid ":func:`!PyUnicode_TransformDecimalToASCII`" msgstr ":func:`!PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.11.rst:2692 +#: ../../whatsnew/3.11.rst:2696 msgid "" "See :pep:`624` for details and :pep:`migration guidance <624#alternative-" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2698 +#: ../../whatsnew/3.11.rst:2702 msgid "Notable Changes in 3.11.4" msgstr "" -#: ../../whatsnew/3.11.rst:2701 +#: ../../whatsnew/3.11.rst:2705 msgid "tarfile" msgstr "" -#: ../../whatsnew/3.11.rst:2703 +#: ../../whatsnew/3.11.rst:2707 msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " From 89b392b93ab147820d100f99244b6714e54db5d9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 May 2023 00:35:01 +0000 Subject: [PATCH 097/130] sync with cpython c39500db --- library/traceback.po | 102 ++++++++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 41 deletions(-) diff --git a/library/traceback.po b/library/traceback.po index bfe91bc9c6..f77f931d90 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-05-30 00:33+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -259,7 +259,7 @@ msgid "" "capture data for later printing in a lightweight fashion." msgstr "" -#: ../../library/traceback.rst:223 ../../library/traceback.rst:283 +#: ../../library/traceback.rst:223 ../../library/traceback.rst:297 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." @@ -273,122 +273,142 @@ msgid "" "is ``None`` and ``__suppress_context__`` is false." msgstr "" -#: ../../library/traceback.rst:231 ../../library/traceback.rst:286 +#: ../../library/traceback.rst:231 ../../library/traceback.rst:300 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:235 +#: ../../library/traceback.rst:233 +msgid "" +"*max_group_width* and *max_group_depth* control the formatting of exception " +"groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting " +"level of the group, and the width refers to the size of a single exception " +"group's exceptions array. The formatted output is truncated when either " +"limit is exceeded." +msgstr "" + +#: ../../library/traceback.rst:241 msgid "A :class:`TracebackException` of the original ``__cause__``." msgstr "" -#: ../../library/traceback.rst:239 +#: ../../library/traceback.rst:245 msgid "A :class:`TracebackException` of the original ``__context__``." msgstr "" -#: ../../library/traceback.rst:243 +#: ../../library/traceback.rst:249 +msgid "" +"If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of :" +"class:`TracebackException` instances representing the nested exceptions. " +"Otherwise it is ``None``." +msgstr "" + +#: ../../library/traceback.rst:257 msgid "The ``__suppress_context__`` value from the original exception." msgstr "" -#: ../../library/traceback.rst:247 +#: ../../library/traceback.rst:261 msgid "" "The ``__notes__`` value from the original exception, or ``None`` if the " "exception does not have any notes. If it is not ``None`` is it formatted in " "the traceback after the exception string." msgstr "" -#: ../../library/traceback.rst:255 +#: ../../library/traceback.rst:269 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:259 +#: ../../library/traceback.rst:273 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:263 +#: ../../library/traceback.rst:277 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:267 +#: ../../library/traceback.rst:281 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:271 +#: ../../library/traceback.rst:285 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:275 +#: ../../library/traceback.rst:289 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:279 +#: ../../library/traceback.rst:293 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:290 +#: ../../library/traceback.rst:304 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:297 +#: ../../library/traceback.rst:311 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:299 +#: ../../library/traceback.rst:313 msgid "" "If *chain* is not ``True``, ``__cause__`` and ``__context__`` will not be " "formatted." msgstr "" -#: ../../library/traceback.rst:302 +#: ../../library/traceback.rst:316 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: ../../library/traceback.rst:306 ../../library/traceback.rst:320 +#: ../../library/traceback.rst:320 ../../library/traceback.rst:334 msgid "" "The message indicating which exception occurred is always the last string in " "the output." msgstr "" -#: ../../library/traceback.rst:311 +#: ../../library/traceback.rst:325 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:313 +#: ../../library/traceback.rst:327 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:315 +#: ../../library/traceback.rst:329 msgid "" "Normally, the generator emits a single string; however, for :exc:" "`SyntaxError` exceptions, it emits several lines that (when printed) display " "detailed information about where the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:323 +#: ../../library/traceback.rst:337 msgid "Added the *compact* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/traceback.rst:328 +#: ../../library/traceback.rst:340 +msgid "Added the *max_group_width* and *max_group_depth* parameters." +msgstr "" + +#: ../../library/traceback.rst:345 msgid ":class:`StackSummary` Objects" msgstr ":class:`StackSummary` 物件" -#: ../../library/traceback.rst:332 +#: ../../library/traceback.rst:349 msgid "" ":class:`StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:338 +#: ../../library/traceback.rst:355 msgid "" "Construct a :class:`StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: ../../library/traceback.rst:342 +#: ../../library/traceback.rst:359 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -398,14 +418,14 @@ msgid "" "class:`FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:352 +#: ../../library/traceback.rst:369 msgid "" "Construct a :class:`StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with filename, lineno, name, line as the elements." msgstr "" -#: ../../library/traceback.rst:358 +#: ../../library/traceback.rst:375 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single frame from the stack. Each string ends in a " @@ -413,18 +433,18 @@ msgid "" "with source text lines." msgstr "" -#: ../../library/traceback.rst:363 +#: ../../library/traceback.rst:380 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: ../../library/traceback.rst:367 +#: ../../library/traceback.rst:384 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:372 +#: ../../library/traceback.rst:389 msgid "" "Returns a string for printing one of the frames involved in the stack. This " "method is called for each :class:`FrameSummary` object to be printed by :" @@ -432,16 +452,16 @@ msgid "" "from the output." msgstr "" -#: ../../library/traceback.rst:381 +#: ../../library/traceback.rst:398 msgid ":class:`FrameSummary` Objects" msgstr ":class:`FrameSummary` 物件" -#: ../../library/traceback.rst:385 +#: ../../library/traceback.rst:402 msgid "" "A :class:`FrameSummary` object represents a single frame in a traceback." msgstr "" -#: ../../library/traceback.rst:389 +#: ../../library/traceback.rst:406 msgid "" "Represent a single frame in the traceback or stack that is being formatted " "or printed. It may optionally have a stringified version of the frames " @@ -454,11 +474,11 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:402 +#: ../../library/traceback.rst:419 msgid "Traceback Examples" msgstr "" -#: ../../library/traceback.rst:404 +#: ../../library/traceback.rst:421 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -466,23 +486,23 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:426 +#: ../../library/traceback.rst:443 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:461 +#: ../../library/traceback.rst:478 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:503 +#: ../../library/traceback.rst:520 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:529 +#: ../../library/traceback.rst:546 msgid "This last example demonstrates the final few formatting functions:" msgstr "" From 88702868f18b50823385871c78a56e06dfe06694 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 1 Jun 2023 00:44:55 +0000 Subject: [PATCH 098/130] sync with cpython 3b0747af --- library/wave.po | 141 +++++++++++++++++++++++++----------------------- 1 file changed, 75 insertions(+), 66 deletions(-) diff --git a/library/wave.po b/library/wave.po index f7ccfb8906..066cd85806 100644 --- a/library/wave.po +++ b/library/wave.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-24 00:21+0000\n" +"POT-Creation-Date: 2023-06-01 00:43+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,43 +28,43 @@ msgstr "**原始碼:**\\ :source:`Lib/wave.py`" #: ../../library/wave.rst:14 msgid "" -"The :mod:`wave` module provides a convenient interface to the WAV sound " -"format. Only files using ``WAVE_FORMAT_PCM`` are supported. Note that this " -"does not include files using ``WAVE_FORMAT_EXTENSIBLE`` even if the " -"subformat is PCM." +"The :mod:`wave` module provides a convenient interface to the Waveform Audio " +"\"WAVE\" (or \"WAV\") file format. Only files using ``WAVE_FORMAT_PCM`` are " +"supported. Note that this does not include files using " +"``WAVE_FORMAT_EXTENSIBLE`` even if the subformat is PCM." msgstr "" -#: ../../library/wave.rst:18 +#: ../../library/wave.rst:19 msgid "The :mod:`wave` module defines the following function and exception:" msgstr "" -#: ../../library/wave.rst:23 +#: ../../library/wave.rst:24 msgid "" "If *file* is a string, open the file by that name, otherwise treat it as a " "file-like object. *mode* can be:" msgstr "" -#: ../../library/wave.rst:27 +#: ../../library/wave.rst:28 msgid "``'rb'``" msgstr "``'rb'``" -#: ../../library/wave.rst:27 +#: ../../library/wave.rst:28 msgid "Read only mode." msgstr "" -#: ../../library/wave.rst:30 +#: ../../library/wave.rst:31 msgid "``'wb'``" msgstr "``'wb'``" -#: ../../library/wave.rst:30 +#: ../../library/wave.rst:31 msgid "Write only mode." msgstr "" -#: ../../library/wave.rst:32 +#: ../../library/wave.rst:33 msgid "Note that it does not allow read/write WAV files." msgstr "" -#: ../../library/wave.rst:34 +#: ../../library/wave.rst:35 msgid "" "A *mode* of ``'rb'`` returns a :class:`Wave_read` object, while a *mode* of " "``'wb'`` returns a :class:`Wave_write` object. If *mode* is omitted and a " @@ -72,22 +72,21 @@ msgid "" "value for *mode*." msgstr "" -#: ../../library/wave.rst:39 +#: ../../library/wave.rst:40 msgid "" "If you pass in a file-like object, the wave object will not close it when " -"its :meth:`close` method is called; it is the caller's responsibility to " -"close the file object." +"its ``close()`` method is called; it is the caller's responsibility to close " +"the file object." msgstr "" -#: ../../library/wave.rst:43 +#: ../../library/wave.rst:44 msgid "" "The :func:`.open` function may be used in a :keyword:`with` statement. When " -"the :keyword:`!with` block completes, the :meth:`Wave_read.close() ` or :meth:`Wave_write.close() ` " -"method is called." +"the :keyword:`!with` block completes, the :meth:`Wave_read.close()` or :meth:" +"`Wave_write.close()` method is called." msgstr "" -#: ../../library/wave.rst:48 ../../library/wave.rst:164 +#: ../../library/wave.rst:48 ../../library/wave.rst:172 msgid "Added support for unseekable files." msgstr "" @@ -101,112 +100,122 @@ msgstr "" msgid "Wave_read Objects" msgstr "Wave_read 物件" -#: ../../library/wave.rst:62 +#: ../../library/wave.rst:64 +msgid "Read a WAV file." +msgstr "" + +#: ../../library/wave.rst:66 msgid "" "Wave_read objects, as returned by :func:`.open`, have the following methods:" msgstr "" -#: ../../library/wave.rst:67 +#: ../../library/wave.rst:71 msgid "" "Close the stream if it was opened by :mod:`wave`, and make the instance " "unusable. This is called automatically on object collection." msgstr "" -#: ../../library/wave.rst:73 +#: ../../library/wave.rst:77 msgid "Returns number of audio channels (``1`` for mono, ``2`` for stereo)." msgstr "" -#: ../../library/wave.rst:78 +#: ../../library/wave.rst:82 msgid "Returns sample width in bytes." msgstr "" -#: ../../library/wave.rst:83 +#: ../../library/wave.rst:87 msgid "Returns sampling frequency." msgstr "" -#: ../../library/wave.rst:88 +#: ../../library/wave.rst:92 msgid "Returns number of audio frames." msgstr "" -#: ../../library/wave.rst:93 +#: ../../library/wave.rst:97 msgid "Returns compression type (``'NONE'`` is the only supported type)." msgstr "" -#: ../../library/wave.rst:98 +#: ../../library/wave.rst:102 msgid "" "Human-readable version of :meth:`getcomptype`. Usually ``'not compressed'`` " "parallels ``'NONE'``." msgstr "" -#: ../../library/wave.rst:104 +#: ../../library/wave.rst:108 msgid "" "Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, " -"framerate, nframes, comptype, compname)``, equivalent to output of the :meth:" -"`get\\*` methods." +"framerate, nframes, comptype, compname)``, equivalent to output of the " +"``get*()`` methods." msgstr "" -#: ../../library/wave.rst:111 +#: ../../library/wave.rst:115 msgid "" "Reads and returns at most *n* frames of audio, as a :class:`bytes` object." msgstr "" -#: ../../library/wave.rst:116 +#: ../../library/wave.rst:120 msgid "Rewind the file pointer to the beginning of the audio stream." msgstr "" -#: ../../library/wave.rst:118 +#: ../../library/wave.rst:122 msgid "" "The following two methods are defined for compatibility with the :mod:`aifc` " "module, and don't do anything interesting." msgstr "" -#: ../../library/wave.rst:124 +#: ../../library/wave.rst:128 msgid "Returns ``None``." msgstr "" -#: ../../library/wave.rst:129 +#: ../../library/wave.rst:133 msgid "Raise an error." msgstr "" -#: ../../library/wave.rst:131 +#: ../../library/wave.rst:135 msgid "" "The following two methods define a term \"position\" which is compatible " "between them, and is otherwise implementation dependent." msgstr "" -#: ../../library/wave.rst:137 +#: ../../library/wave.rst:141 msgid "Set the file pointer to the specified position." msgstr "" -#: ../../library/wave.rst:142 +#: ../../library/wave.rst:146 msgid "Return current file pointer position." msgstr "" -#: ../../library/wave.rst:148 +#: ../../library/wave.rst:152 msgid "Wave_write Objects" msgstr "Wave_write 物件" -#: ../../library/wave.rst:150 +#: ../../library/wave.rst:156 +msgid "Write a WAV file." +msgstr "" + +#: ../../library/wave.rst:158 +msgid "Wave_write objects, as returned by :func:`.open`." +msgstr "" + +#: ../../library/wave.rst:160 msgid "" "For seekable output streams, the ``wave`` header will automatically be " "updated to reflect the number of frames actually written. For unseekable " "streams, the *nframes* value must be accurate when the first frame data is " "written. An accurate *nframes* value can be achieved either by calling :" -"meth:`~Wave_write.setnframes` or :meth:`~Wave_write.setparams` with the " -"number of frames that will be written before :meth:`~Wave_write.close` is " -"called and then using :meth:`~Wave_write.writeframesraw` to write the frame " -"data, or by calling :meth:`~Wave_write.writeframes` with all of the frame " -"data to be written. In the latter case :meth:`~Wave_write.writeframes` will " -"calculate the number of frames in the data and set *nframes* accordingly " -"before writing the frame data." +"meth:`setnframes` or :meth:`setparams` with the number of frames that will " +"be written before :meth:`close` is called and then using :meth:" +"`writeframesraw` to write the frame data, or by calling :meth:`writeframes` " +"with all of the frame data to be written. In the latter case :meth:" +"`writeframes` will calculate the number of frames in the data and set " +"*nframes* accordingly before writing the frame data." msgstr "" -#: ../../library/wave.rst:162 -msgid "" -"Wave_write objects, as returned by :func:`.open`, have the following methods:" +#: ../../library/wave.rst:175 +msgid "Wave_write objects have the following methods:" msgstr "" -#: ../../library/wave.rst:170 +#: ../../library/wave.rst:179 msgid "" "Make sure *nframes* is correct, and close the file if it was opened by :mod:" "`wave`. This method is called upon object collection. It will raise an " @@ -214,57 +223,57 @@ msgid "" "the number of frames actually written." msgstr "" -#: ../../library/wave.rst:178 +#: ../../library/wave.rst:187 msgid "Set the number of channels." msgstr "" -#: ../../library/wave.rst:183 +#: ../../library/wave.rst:192 msgid "Set the sample width to *n* bytes." msgstr "" -#: ../../library/wave.rst:188 +#: ../../library/wave.rst:197 msgid "Set the frame rate to *n*." msgstr "" -#: ../../library/wave.rst:190 +#: ../../library/wave.rst:199 msgid "A non-integral input to this method is rounded to the nearest integer." msgstr "" -#: ../../library/wave.rst:197 +#: ../../library/wave.rst:206 msgid "" "Set the number of frames to *n*. This will be changed later if the number " "of frames actually written is different (this update attempt will raise an " "error if the output stream is not seekable)." msgstr "" -#: ../../library/wave.rst:204 +#: ../../library/wave.rst:213 msgid "" "Set the compression type and description. At the moment, only compression " "type ``NONE`` is supported, meaning no compression." msgstr "" -#: ../../library/wave.rst:210 +#: ../../library/wave.rst:219 msgid "" "The *tuple* should be ``(nchannels, sampwidth, framerate, nframes, comptype, " -"compname)``, with values valid for the :meth:`set\\*` methods. Sets all " +"compname)``, with values valid for the ``set*()`` methods. Sets all " "parameters." msgstr "" -#: ../../library/wave.rst:217 +#: ../../library/wave.rst:226 msgid "" "Return current position in the file, with the same disclaimer for the :meth:" "`Wave_read.tell` and :meth:`Wave_read.setpos` methods." msgstr "" -#: ../../library/wave.rst:223 +#: ../../library/wave.rst:232 msgid "Write audio frames, without correcting *nframes*." msgstr "" -#: ../../library/wave.rst:225 ../../library/wave.rst:236 +#: ../../library/wave.rst:234 ../../library/wave.rst:245 msgid "Any :term:`bytes-like object` is now accepted." msgstr "" -#: ../../library/wave.rst:231 +#: ../../library/wave.rst:240 msgid "" "Write audio frames and make sure *nframes* is correct. It will raise an " "error if the output stream is not seekable and the total number of frames " @@ -272,7 +281,7 @@ msgid "" "previously set value for *nframes*." msgstr "" -#: ../../library/wave.rst:240 +#: ../../library/wave.rst:248 msgid "" "Note that it is invalid to set any parameters after calling :meth:" "`writeframes` or :meth:`writeframesraw`, and any attempt to do so will " From 39744f7651186bd76abc67450c76f98d82184248 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 3 Jun 2023 00:35:41 +0000 Subject: [PATCH 099/130] sync with cpython 8de607ab --- c-api/marshal.po | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/c-api/marshal.po b/c-api/marshal.po index 0ea6aa8ca2..d09e2fdd86 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-06-03 00:33+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,56 +50,62 @@ msgid "" "native :c:expr:`long` type. *version* indicates the file format." msgstr "" -#: ../../c-api/marshal.rst:31 +#: ../../c-api/marshal.rst:28 ../../c-api/marshal.rst:36 +msgid "" +"This function can fail, in which case it sets the error indicator. Use :c:" +"func:`PyErr_Occurred` to check for that." +msgstr "" + +#: ../../c-api/marshal.rst:33 msgid "" "Marshal a Python object, *value*, to *file*. *version* indicates the file " "format." msgstr "" -#: ../../c-api/marshal.rst:37 +#: ../../c-api/marshal.rst:41 msgid "" "Return a bytes object containing the marshalled representation of *value*. " "*version* indicates the file format." msgstr "" -#: ../../c-api/marshal.rst:41 +#: ../../c-api/marshal.rst:45 msgid "The following functions allow marshalled values to be read back in." msgstr "" -#: ../../c-api/marshal.rst:46 +#: ../../c-api/marshal.rst:50 msgid "" "Return a C :c:expr:`long` from the data stream in a :c:expr:`FILE*` opened " "for reading. Only a 32-bit value can be read in using this function, " "regardless of the native size of :c:expr:`long`." msgstr "" -#: ../../c-api/marshal.rst:50 ../../c-api/marshal.rst:60 +#: ../../c-api/marshal.rst:54 ../../c-api/marshal.rst:64 msgid "" "On error, sets the appropriate exception (:exc:`EOFError`) and returns " "``-1``." msgstr "" -#: ../../c-api/marshal.rst:56 +#: ../../c-api/marshal.rst:60 msgid "" "Return a C :c:expr:`short` from the data stream in a :c:expr:`FILE*` opened " "for reading. Only a 16-bit value can be read in using this function, " "regardless of the native size of :c:expr:`short`." msgstr "" -#: ../../c-api/marshal.rst:66 +#: ../../c-api/marshal.rst:70 msgid "" "Return a Python object from the data stream in a :c:expr:`FILE*` opened for " "reading." msgstr "" -#: ../../c-api/marshal.rst:69 ../../c-api/marshal.rst:83 -#: ../../c-api/marshal.rst:92 +#: ../../c-api/marshal.rst:73 ../../c-api/marshal.rst:87 +#: ../../c-api/marshal.rst:96 msgid "" "On error, sets the appropriate exception (:exc:`EOFError`, :exc:`ValueError` " "or :exc:`TypeError`) and returns ``NULL``." msgstr "" -#: ../../c-api/marshal.rst:75 +#: ../../c-api/marshal.rst:79 msgid "" "Return a Python object from the data stream in a :c:expr:`FILE*` opened for " "reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function " @@ -110,7 +116,7 @@ msgid "" "anything else from the file." msgstr "" -#: ../../c-api/marshal.rst:89 +#: ../../c-api/marshal.rst:93 msgid "" "Return a Python object from the data stream in a byte buffer containing " "*len* bytes pointed to by *data*." From 6ba412dd9863bbbccd0e8db12c6d945af6250b69 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 5 Jun 2023 00:37:00 +0000 Subject: [PATCH 100/130] sync with cpython aca77b55 --- library/socket.po | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/socket.po b/library/socket.po index fb66f147ad..770d27a26a 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-05 00:35+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-" @@ -1645,8 +1645,9 @@ msgid "" msgstr "" #: ../../library/socket.rst:1431 -msgid "This is equivalent to checking ``socket.gettimeout() == 0``." -msgstr "" +#, fuzzy +msgid "This is equivalent to checking ``socket.gettimeout() != 0``." +msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" #: ../../library/socket.rst:1438 msgid "" From 98082097307ea2560bad8e25b163e9f6a0b8212d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Jun 2023 00:37:09 +0000 Subject: [PATCH 101/130] sync with cpython faae548e --- library/traceback.po | 78 +++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/library/traceback.po b/library/traceback.po index f77f931d90..868e33f73f 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-30 00:33+0000\n" +"POT-Creation-Date: 2023-06-06 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -259,7 +259,7 @@ msgid "" "capture data for later printing in a lightweight fashion." msgstr "" -#: ../../library/traceback.rst:223 ../../library/traceback.rst:297 +#: ../../library/traceback.rst:223 ../../library/traceback.rst:311 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." @@ -273,7 +273,7 @@ msgid "" "is ``None`` and ``__suppress_context__`` is false." msgstr "" -#: ../../library/traceback.rst:231 ../../library/traceback.rst:300 +#: ../../library/traceback.rst:231 ../../library/traceback.rst:314 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" @@ -330,85 +330,97 @@ msgid "For syntax errors - the line number where the error occurred." msgstr "" #: ../../library/traceback.rst:285 +msgid "" +"For syntax errors - the end line number where the error occurred. Can be " +"``None`` if not present." +msgstr "" + +#: ../../library/traceback.rst:292 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:289 +#: ../../library/traceback.rst:296 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:293 +#: ../../library/traceback.rst:300 +msgid "" +"For syntax errors - the end offset into the text where the error occurred. " +"Can be ``None`` if not present." +msgstr "" + +#: ../../library/traceback.rst:307 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:304 +#: ../../library/traceback.rst:318 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:311 +#: ../../library/traceback.rst:325 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:313 +#: ../../library/traceback.rst:327 msgid "" "If *chain* is not ``True``, ``__cause__`` and ``__context__`` will not be " "formatted." msgstr "" -#: ../../library/traceback.rst:316 +#: ../../library/traceback.rst:330 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: ../../library/traceback.rst:320 ../../library/traceback.rst:334 +#: ../../library/traceback.rst:334 ../../library/traceback.rst:348 msgid "" "The message indicating which exception occurred is always the last string in " "the output." msgstr "" -#: ../../library/traceback.rst:325 +#: ../../library/traceback.rst:339 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:327 +#: ../../library/traceback.rst:341 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:329 +#: ../../library/traceback.rst:343 msgid "" "Normally, the generator emits a single string; however, for :exc:" "`SyntaxError` exceptions, it emits several lines that (when printed) display " "detailed information about where the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:337 +#: ../../library/traceback.rst:351 msgid "Added the *compact* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/traceback.rst:340 +#: ../../library/traceback.rst:354 msgid "Added the *max_group_width* and *max_group_depth* parameters." msgstr "" -#: ../../library/traceback.rst:345 +#: ../../library/traceback.rst:359 msgid ":class:`StackSummary` Objects" msgstr ":class:`StackSummary` 物件" -#: ../../library/traceback.rst:349 +#: ../../library/traceback.rst:363 msgid "" ":class:`StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:355 +#: ../../library/traceback.rst:369 msgid "" "Construct a :class:`StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: ../../library/traceback.rst:359 +#: ../../library/traceback.rst:373 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -418,14 +430,14 @@ msgid "" "class:`FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:369 +#: ../../library/traceback.rst:383 msgid "" "Construct a :class:`StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with filename, lineno, name, line as the elements." msgstr "" -#: ../../library/traceback.rst:375 +#: ../../library/traceback.rst:389 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single frame from the stack. Each string ends in a " @@ -433,18 +445,18 @@ msgid "" "with source text lines." msgstr "" -#: ../../library/traceback.rst:380 +#: ../../library/traceback.rst:394 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: ../../library/traceback.rst:384 +#: ../../library/traceback.rst:398 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:389 +#: ../../library/traceback.rst:403 msgid "" "Returns a string for printing one of the frames involved in the stack. This " "method is called for each :class:`FrameSummary` object to be printed by :" @@ -452,16 +464,16 @@ msgid "" "from the output." msgstr "" -#: ../../library/traceback.rst:398 +#: ../../library/traceback.rst:412 msgid ":class:`FrameSummary` Objects" msgstr ":class:`FrameSummary` 物件" -#: ../../library/traceback.rst:402 +#: ../../library/traceback.rst:416 msgid "" "A :class:`FrameSummary` object represents a single frame in a traceback." msgstr "" -#: ../../library/traceback.rst:406 +#: ../../library/traceback.rst:420 msgid "" "Represent a single frame in the traceback or stack that is being formatted " "or printed. It may optionally have a stringified version of the frames " @@ -474,11 +486,11 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:419 +#: ../../library/traceback.rst:433 msgid "Traceback Examples" msgstr "" -#: ../../library/traceback.rst:421 +#: ../../library/traceback.rst:435 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -486,23 +498,23 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:443 +#: ../../library/traceback.rst:457 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:478 +#: ../../library/traceback.rst:492 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:520 +#: ../../library/traceback.rst:534 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:546 +#: ../../library/traceback.rst:560 msgid "This last example demonstrates the final few formatting functions:" msgstr "" From 5dc1391e359b49d4d6107d80836db0a25c7e0509 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 8 Jun 2023 00:37:25 +0000 Subject: [PATCH 102/130] sync with cpython acf3916e --- library/stdtypes.po | 255 ++++---- library/string.po | 343 +++++------ library/typing.po | 1263 ++++++++++++++++++++------------------ reference/expressions.po | 796 ++++++++++++------------ 4 files changed, 1377 insertions(+), 1280 deletions(-) diff --git a/library/stdtypes.po b/library/stdtypes.po index 3137e985e9..f57df71d61 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-08 00:35+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -5517,74 +5517,83 @@ msgstr "" #: ../../library/stdtypes.rst:5114 msgid "" +"The ``|`` operand cannot be used at runtime to define unions where one or " +"more members is a forward reference. For example, ``int | \"Foo\"``, where " +"``\"Foo\"`` is a reference to a class not yet defined, will fail at runtime. " +"For unions which include forward references, present the whole expression as " +"a string, e.g. ``\"int | Foo\"``." +msgstr "" + +#: ../../library/stdtypes.rst:5122 +msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5116 +#: ../../library/stdtypes.rst:5124 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5120 +#: ../../library/stdtypes.rst:5128 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5124 +#: ../../library/stdtypes.rst:5132 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5128 +#: ../../library/stdtypes.rst:5136 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5132 +#: ../../library/stdtypes.rst:5140 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5139 +#: ../../library/stdtypes.rst:5147 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5145 +#: ../../library/stdtypes.rst:5153 msgid "" "However, union objects containing :ref:`parameterized generics ` cannot be used::" msgstr "" -#: ../../library/stdtypes.rst:5153 +#: ../../library/stdtypes.rst:5161 msgid "" "The user-exposed type for the union object can be accessed from :data:`types." "UnionType` and used for :func:`isinstance` checks. An object cannot be " "instantiated from the type::" msgstr "" -#: ../../library/stdtypes.rst:5166 +#: ../../library/stdtypes.rst:5174 msgid "" "The :meth:`__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`__or__`, the Union may override " "it::" msgstr "" -#: ../../library/stdtypes.rst:5184 +#: ../../library/stdtypes.rst:5192 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5192 +#: ../../library/stdtypes.rst:5200 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5194 +#: ../../library/stdtypes.rst:5202 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5201 +#: ../../library/stdtypes.rst:5209 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5203 +#: ../../library/stdtypes.rst:5211 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -5595,7 +5604,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5210 +#: ../../library/stdtypes.rst:5218 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5606,32 +5615,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5218 +#: ../../library/stdtypes.rst:5226 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5226 +#: ../../library/stdtypes.rst:5234 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5228 +#: ../../library/stdtypes.rst:5236 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5234 +#: ../../library/stdtypes.rst:5242 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5236 +#: ../../library/stdtypes.rst:5244 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:5239 +#: ../../library/stdtypes.rst:5247 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5639,15 +5648,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5243 +#: ../../library/stdtypes.rst:5251 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`\\ 。" -#: ../../library/stdtypes.rst:5249 +#: ../../library/stdtypes.rst:5257 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5253 +#: ../../library/stdtypes.rst:5261 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: built-in methods (such as :meth:`append` on lists) and " @@ -5655,7 +5664,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:5258 +#: ../../library/stdtypes.rst:5266 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :dfn:" @@ -5667,7 +5676,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5267 +#: ../../library/stdtypes.rst:5275 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5677,15 +5686,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5287 ../../library/stdtypes.rst:5318 +#: ../../library/stdtypes.rst:5295 ../../library/stdtypes.rst:5326 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`\\ 。" -#: ../../library/stdtypes.rst:5295 +#: ../../library/stdtypes.rst:5303 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5301 +#: ../../library/stdtypes.rst:5309 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5695,23 +5704,23 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5308 +#: ../../library/stdtypes.rst:5316 msgid "" "Accessing ``__code__`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"__code__\"``." msgstr "" -#: ../../library/stdtypes.rst:5315 +#: ../../library/stdtypes.rst:5323 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:5324 +#: ../../library/stdtypes.rst:5332 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5330 +#: ../../library/stdtypes.rst:5338 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -5719,30 +5728,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5335 +#: ../../library/stdtypes.rst:5343 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5341 +#: ../../library/stdtypes.rst:5349 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5343 +#: ../../library/stdtypes.rst:5351 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:5347 +#: ../../library/stdtypes.rst:5355 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5354 +#: ../../library/stdtypes.rst:5362 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5356 +#: ../../library/stdtypes.rst:5364 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5750,15 +5759,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5361 +#: ../../library/stdtypes.rst:5369 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5367 +#: ../../library/stdtypes.rst:5375 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5369 +#: ../../library/stdtypes.rst:5377 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -5766,15 +5775,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5374 +#: ../../library/stdtypes.rst:5382 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5380 +#: ../../library/stdtypes.rst:5388 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5390 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5785,81 +5794,81 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5395 +#: ../../library/stdtypes.rst:5403 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5401 +#: ../../library/stdtypes.rst:5409 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:5411 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5410 +#: ../../library/stdtypes.rst:5418 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5412 +#: ../../library/stdtypes.rst:5420 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:5419 +#: ../../library/stdtypes.rst:5427 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5425 +#: ../../library/stdtypes.rst:5433 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5430 +#: ../../library/stdtypes.rst:5438 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5435 +#: ../../library/stdtypes.rst:5443 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5441 +#: ../../library/stdtypes.rst:5449 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5449 +#: ../../library/stdtypes.rst:5457 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5455 +#: ../../library/stdtypes.rst:5463 msgid "" "This method can be overridden by a metaclass to customize the method " "resolution order for its instances. It is called at class instantiation, " "and its result is stored in :attr:`~class.__mro__`." msgstr "" -#: ../../library/stdtypes.rst:5462 +#: ../../library/stdtypes.rst:5470 msgid "" "Each class keeps a list of weak references to its immediate subclasses. " "This method returns a list of all those references still alive. The list is " "in definition order. Example::" msgstr "" -#: ../../library/stdtypes.rst:5473 +#: ../../library/stdtypes.rst:5481 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5475 +#: ../../library/stdtypes.rst:5483 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -5867,7 +5876,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5480 +#: ../../library/stdtypes.rst:5488 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -5877,25 +5886,25 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5487 +#: ../../library/stdtypes.rst:5495 msgid "" "Limiting conversion size offers a practical way to avoid `CVE-2020-10735 " "`_." msgstr "" -#: ../../library/stdtypes.rst:5490 +#: ../../library/stdtypes.rst:5498 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " "Underscores and the sign are not counted towards the limit." msgstr "" -#: ../../library/stdtypes.rst:5494 +#: ../../library/stdtypes.rst:5502 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5516 +#: ../../library/stdtypes.rst:5524 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -5903,94 +5912,94 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5521 +#: ../../library/stdtypes.rst:5529 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5536 +#: ../../library/stdtypes.rst:5544 msgid "Affected APIs" msgstr "" -#: ../../library/stdtypes.rst:5538 +#: ../../library/stdtypes.rst:5546 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5541 +#: ../../library/stdtypes.rst:5549 msgid "``int(string)`` with default base 10." msgstr "" -#: ../../library/stdtypes.rst:5542 +#: ../../library/stdtypes.rst:5550 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5543 +#: ../../library/stdtypes.rst:5551 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5552 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5545 +#: ../../library/stdtypes.rst:5553 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5548 +#: ../../library/stdtypes.rst:5556 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5550 +#: ../../library/stdtypes.rst:5558 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5559 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr "" -#: ../../library/stdtypes.rst:5552 +#: ../../library/stdtypes.rst:5560 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr "" -#: ../../library/stdtypes.rst:5553 +#: ../../library/stdtypes.rst:5561 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5554 +#: ../../library/stdtypes.rst:5562 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5555 +#: ../../library/stdtypes.rst:5563 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5558 +#: ../../library/stdtypes.rst:5566 msgid "Configuring the limit" msgstr "" -#: ../../library/stdtypes.rst:5560 +#: ../../library/stdtypes.rst:5568 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" msgstr "" -#: ../../library/stdtypes.rst:5563 +#: ../../library/stdtypes.rst:5571 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " "the limitation." msgstr "" -#: ../../library/stdtypes.rst:5566 +#: ../../library/stdtypes.rst:5574 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" msgstr "" -#: ../../library/stdtypes.rst:5568 +#: ../../library/stdtypes.rst:5576 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -5999,38 +6008,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5574 +#: ../../library/stdtypes.rst:5582 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5577 +#: ../../library/stdtypes.rst:5585 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " "their own limit." msgstr "" -#: ../../library/stdtypes.rst:5581 +#: ../../library/stdtypes.rst:5589 msgid "" "Information about the default and minimum can be found in :attr:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5583 +#: ../../library/stdtypes.rst:5591 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5585 +#: ../../library/stdtypes.rst:5593 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:5592 +#: ../../library/stdtypes.rst:5600 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -6042,7 +6051,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5601 +#: ../../library/stdtypes.rst:5609 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -6050,11 +6059,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5607 +#: ../../library/stdtypes.rst:5615 msgid "Recommended configuration" msgstr "" -#: ../../library/stdtypes.rst:5609 +#: ../../library/stdtypes.rst:5617 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -6062,45 +6071,45 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.11." msgstr "" -#: ../../library/stdtypes.rst:5614 +#: ../../library/stdtypes.rst:5622 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:5626 +#: ../../library/stdtypes.rst:5634 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5630 +#: ../../library/stdtypes.rst:5638 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5631 +#: ../../library/stdtypes.rst:5639 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5634 +#: ../../library/stdtypes.rst:5642 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5637 +#: ../../library/stdtypes.rst:5645 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5639 +#: ../../library/stdtypes.rst:5647 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:5642 +#: ../../library/stdtypes.rst:5650 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -6115,7 +6124,7 @@ msgstr "內建型別" #: ../../library/stdtypes.rst:390 ../../library/stdtypes.rst:907 #: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:1096 #: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5326 +#: ../../library/stdtypes.rst:5334 msgid "types" msgstr "" @@ -6141,7 +6150,7 @@ msgid "value" msgstr "" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:80 -#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:5398 msgid "Boolean" msgstr "" @@ -6185,11 +6194,11 @@ msgstr "" "\n" "::" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5398 msgid "False" msgstr "" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5398 msgid "True" msgstr "" @@ -6250,8 +6259,8 @@ msgstr "``is not``" #: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:2485 #: ../../library/stdtypes.rst:2592 ../../library/stdtypes.rst:4168 #: ../../library/stdtypes.rst:4369 ../../library/stdtypes.rst:4838 -#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5251 -#: ../../library/stdtypes.rst:5290 +#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5259 +#: ../../library/stdtypes.rst:5298 msgid "object" msgstr "" @@ -6345,8 +6354,8 @@ msgstr "" #: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:907 #: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5297 ../../library/stdtypes.rst:5311 -#: ../../library/stdtypes.rst:5326 +#: ../../library/stdtypes.rst:5305 ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5334 msgid "built-in function" msgstr "" @@ -6414,7 +6423,7 @@ msgid "conjugate() (complex number method)" msgstr "" #: ../../library/stdtypes.rst:332 ../../library/stdtypes.rst:1563 -#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:5326 +#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:5334 #, fuzzy msgid "module" msgstr "模組" @@ -6592,7 +6601,7 @@ msgid "bytearray" msgstr "" #: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5326 +#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5334 msgid "type" msgstr "" @@ -6825,42 +6834,42 @@ msgstr "" msgid "union" msgstr "" -#: ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:5259 msgid "method" msgstr "" -#: ../../library/stdtypes.rst:5290 +#: ../../library/stdtypes.rst:5298 msgid "code" msgstr "" -#: ../../library/stdtypes.rst:5290 +#: ../../library/stdtypes.rst:5298 msgid "code object" msgstr "" -#: ../../library/stdtypes.rst:5297 +#: ../../library/stdtypes.rst:5305 msgid "compile" msgstr "" -#: ../../library/stdtypes.rst:5297 +#: ../../library/stdtypes.rst:5305 msgid "__code__ (function object attribute)" msgstr "" -#: ../../library/stdtypes.rst:5311 +#: ../../library/stdtypes.rst:5319 msgid "exec" msgstr "" -#: ../../library/stdtypes.rst:5311 +#: ../../library/stdtypes.rst:5319 msgid "eval" msgstr "" -#: ../../library/stdtypes.rst:5350 +#: ../../library/stdtypes.rst:5358 msgid "..." msgstr "" -#: ../../library/stdtypes.rst:5350 +#: ../../library/stdtypes.rst:5358 msgid "ellipsis literal" msgstr "" -#: ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:5398 msgid "values" msgstr "" diff --git a/library/string.po b/library/string.po index 983b683bc2..4e7c34ed6f 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-08 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -272,34 +272,35 @@ msgstr "另請參閱 :ref:`formatspec` 部份。" msgid "" "The *field_name* itself begins with an *arg_name* that is either a number or " "a keyword. If it's a number, it refers to a positional argument, and if " -"it's a keyword, it refers to a named keyword argument. If the numerical " -"arg_names in a format string are 0, 1, 2, ... in sequence, they can all be " -"omitted (not just some) and the numbers 0, 1, 2, ... will be automatically " -"inserted in that order. Because *arg_name* is not quote-delimited, it is not " -"possible to specify arbitrary dictionary keys (e.g., the strings ``'10'`` or " -"``':-]'``) within a format string. The *arg_name* can be followed by any " -"number of index or attribute expressions. An expression of the form ``'." -"name'`` selects the named attribute using :func:`getattr`, while an " -"expression of the form ``'[index]'`` does an index lookup using :func:" -"`__getitem__`." +"it's a keyword, it refers to a named keyword argument. An *arg_name* is " +"treated as a number if a call to :meth:`str.isdecimal` on the string would " +"return true. If the numerical arg_names in a format string are 0, 1, 2, ... " +"in sequence, they can all be omitted (not just some) and the numbers 0, 1, " +"2, ... will be automatically inserted in that order. Because *arg_name* is " +"not quote-delimited, it is not possible to specify arbitrary dictionary keys " +"(e.g., the strings ``'10'`` or ``':-]'``) within a format string. The " +"*arg_name* can be followed by any number of index or attribute expressions. " +"An expression of the form ``'.name'`` selects the named attribute using :" +"func:`getattr`, while an expression of the form ``'[index]'`` does an index " +"lookup using :func:`__getitem__`." msgstr "" -#: ../../library/string.rst:240 +#: ../../library/string.rst:242 msgid "" "The positional argument specifiers can be omitted for :meth:`str.format`, so " "``'{} {}'.format(a, b)`` is equivalent to ``'{0} {1}'.format(a, b)``." msgstr "" -#: ../../library/string.rst:244 +#: ../../library/string.rst:246 msgid "" "The positional argument specifiers can be omitted for :class:`Formatter`." msgstr "" -#: ../../library/string.rst:247 +#: ../../library/string.rst:249 msgid "Some simple format string examples::" msgstr "" -#: ../../library/string.rst:256 +#: ../../library/string.rst:258 msgid "" "The *conversion* field causes a type coercion before formatting. Normally, " "the job of formatting a value is done by the :meth:`__format__` method of " @@ -309,21 +310,21 @@ msgid "" "normal formatting logic is bypassed." msgstr "" -#: ../../library/string.rst:263 +#: ../../library/string.rst:265 msgid "" "Three conversion flags are currently supported: ``'!s'`` which calls :func:" "`str` on the value, ``'!r'`` which calls :func:`repr` and ``'!a'`` which " "calls :func:`ascii`." msgstr "" -#: ../../library/string.rst:267 +#: ../../library/string.rst:269 msgid "Some examples::" msgstr "" "一些範例:\n" "\n" "::" -#: ../../library/string.rst:273 +#: ../../library/string.rst:275 msgid "" "The *format_spec* field contains a specification of how the value should be " "presented, including such details as field width, alignment, padding, " @@ -331,13 +332,13 @@ msgid "" "\"formatting mini-language\" or interpretation of the *format_spec*." msgstr "" -#: ../../library/string.rst:278 +#: ../../library/string.rst:280 msgid "" "Most built-in types support a common formatting mini-language, which is " "described in the next section." msgstr "" -#: ../../library/string.rst:281 +#: ../../library/string.rst:283 msgid "" "A *format_spec* field can also include nested replacement fields within it. " "These nested replacement fields may contain a field name, conversion flag " @@ -347,15 +348,15 @@ msgid "" "to be dynamically specified." msgstr "" -#: ../../library/string.rst:288 +#: ../../library/string.rst:290 msgid "See the :ref:`formatexamples` section for some examples." msgstr "範例請見 :ref:`formatexamples`\\ 。" -#: ../../library/string.rst:294 +#: ../../library/string.rst:296 msgid "Format Specification Mini-Language" msgstr "" -#: ../../library/string.rst:296 +#: ../../library/string.rst:298 msgid "" "\"Format specifications\" are used within replacement fields contained " "within a format string to define how individual values are presented (see :" @@ -364,25 +365,25 @@ msgid "" "how the format specification is to be interpreted." msgstr "" -#: ../../library/string.rst:303 +#: ../../library/string.rst:305 msgid "" "Most built-in types implement the following options for format " "specifications, although some of the formatting options are only supported " "by the numeric types." msgstr "" -#: ../../library/string.rst:306 +#: ../../library/string.rst:308 msgid "" "A general convention is that an empty format specification produces the same " "result as if you had called :func:`str` on the value. A non-empty format " "specification typically modifies the result." msgstr "" -#: ../../library/string.rst:310 +#: ../../library/string.rst:312 msgid "The general form of a *standard format specifier* is:" msgstr "" -#: ../../library/string.rst:322 +#: ../../library/string.rst:324 msgid "" "If a valid *align* value is specified, it can be preceded by a *fill* " "character that can be any character and defaults to a space if omitted. It " @@ -393,45 +394,45 @@ msgid "" "the :func:`format` function." msgstr "" -#: ../../library/string.rst:331 +#: ../../library/string.rst:333 msgid "The meaning of the various alignment options is as follows:" msgstr "" -#: ../../library/string.rst:340 ../../library/string.rst:371 +#: ../../library/string.rst:342 ../../library/string.rst:373 msgid "Option" msgstr "" -#: ../../library/string.rst:340 ../../library/string.rst:371 -#: ../../library/string.rst:454 ../../library/string.rst:465 -#: ../../library/string.rst:500 +#: ../../library/string.rst:342 ../../library/string.rst:373 +#: ../../library/string.rst:456 ../../library/string.rst:467 +#: ../../library/string.rst:502 msgid "Meaning" msgstr "" -#: ../../library/string.rst:342 +#: ../../library/string.rst:344 msgid "``'<'``" msgstr "``'<'``" -#: ../../library/string.rst:342 +#: ../../library/string.rst:344 msgid "" "Forces the field to be left-aligned within the available space (this is the " "default for most objects)." msgstr "" -#: ../../library/string.rst:345 +#: ../../library/string.rst:347 msgid "``'>'``" msgstr "``'>'``" -#: ../../library/string.rst:345 +#: ../../library/string.rst:347 msgid "" "Forces the field to be right-aligned within the available space (this is the " "default for numbers)." msgstr "" -#: ../../library/string.rst:348 +#: ../../library/string.rst:350 msgid "``'='``" msgstr "``'='``" -#: ../../library/string.rst:348 +#: ../../library/string.rst:350 msgid "" "Forces the padding to be placed after the sign (if any) but before the " "digits. This is used for printing fields in the form '+000000120'. This " @@ -439,69 +440,69 @@ msgid "" "for numbers when '0' immediately precedes the field width." msgstr "" -#: ../../library/string.rst:354 +#: ../../library/string.rst:356 msgid "``'^'``" msgstr "``'^'``" -#: ../../library/string.rst:354 +#: ../../library/string.rst:356 msgid "Forces the field to be centered within the available space." msgstr "" -#: ../../library/string.rst:358 +#: ../../library/string.rst:360 msgid "" "Note that unless a minimum field width is defined, the field width will " "always be the same size as the data to fill it, so that the alignment option " "has no meaning in this case." msgstr "" -#: ../../library/string.rst:362 +#: ../../library/string.rst:364 msgid "" "The *sign* option is only valid for number types, and can be one of the " "following:" msgstr "" -#: ../../library/string.rst:373 +#: ../../library/string.rst:375 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/string.rst:373 +#: ../../library/string.rst:375 msgid "" "indicates that a sign should be used for both positive as well as negative " "numbers." msgstr "" -#: ../../library/string.rst:376 +#: ../../library/string.rst:378 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/string.rst:376 +#: ../../library/string.rst:378 msgid "" "indicates that a sign should be used only for negative numbers (this is the " "default behavior)." msgstr "" -#: ../../library/string.rst:365 ../../library/string.rst:379 +#: ../../library/string.rst:367 ../../library/string.rst:381 msgid "space" msgstr "" -#: ../../library/string.rst:379 +#: ../../library/string.rst:381 msgid "" "indicates that a leading space should be used on positive numbers, and a " "minus sign on negative numbers." msgstr "" -#: ../../library/string.rst:386 +#: ../../library/string.rst:388 msgid "" "The ``'z'`` option coerces negative zero floating-point values to positive " "zero after rounding to the format precision. This option is only valid for " "floating-point presentation types." msgstr "" -#: ../../library/string.rst:390 +#: ../../library/string.rst:392 msgid "Added the ``'z'`` option (see also :pep:`682`)." msgstr "新增 ``'z'`` 選項(請見 :pep:`682`\\ )。" -#: ../../library/string.rst:395 +#: ../../library/string.rst:397 msgid "" "The ``'#'`` option causes the \"alternate form\" to be used for the " "conversion. The alternate form is defined differently for different types. " @@ -515,17 +516,17 @@ msgid "" "and ``'G'`` conversions, trailing zeros are not removed from the result." msgstr "" -#: ../../library/string.rst:409 +#: ../../library/string.rst:411 msgid "" "The ``','`` option signals the use of a comma for a thousands separator. For " "a locale aware separator, use the ``'n'`` integer presentation type instead." msgstr "" -#: ../../library/string.rst:413 +#: ../../library/string.rst:415 msgid "Added the ``','`` option (see also :pep:`378`)." msgstr "新增 ``','`` 選項(請見 :pep:`378`\\ )。" -#: ../../library/string.rst:418 +#: ../../library/string.rst:420 msgid "" "The ``'_'`` option signals the use of an underscore for a thousands " "separator for floating point presentation types and for integer presentation " @@ -534,18 +535,18 @@ msgid "" "presentation types, specifying this option is an error." msgstr "" -#: ../../library/string.rst:425 +#: ../../library/string.rst:427 msgid "Added the ``'_'`` option (see also :pep:`515`)." msgstr "新增 ``'_'`` 選項(請見 :pep:`515`\\ )。" -#: ../../library/string.rst:428 +#: ../../library/string.rst:430 msgid "" "*width* is a decimal integer defining the minimum total field width, " "including any prefixes, separators, and other formatting characters. If not " "specified, then the field width will be determined by the content." msgstr "" -#: ../../library/string.rst:432 +#: ../../library/string.rst:434 msgid "" "When no explicit alignment is given, preceding the *width* field by a zero " "(``'0'``) character enables sign-aware zero-padding for numeric types. This " @@ -553,13 +554,13 @@ msgid "" "``'='``." msgstr "" -#: ../../library/string.rst:437 +#: ../../library/string.rst:439 msgid "" "Preceding the *width* field by ``'0'`` no longer affects the default " "alignment for strings." msgstr "" -#: ../../library/string.rst:441 +#: ../../library/string.rst:443 msgid "" "The *precision* is a decimal integer indicating how many digits should be " "displayed after the decimal point for presentation types ``'f'`` and " @@ -570,110 +571,110 @@ msgid "" "types." msgstr "" -#: ../../library/string.rst:449 +#: ../../library/string.rst:451 msgid "Finally, the *type* determines how the data should be presented." msgstr "" -#: ../../library/string.rst:451 +#: ../../library/string.rst:453 msgid "The available string presentation types are:" msgstr "" -#: ../../library/string.rst:454 ../../library/string.rst:465 -#: ../../library/string.rst:500 +#: ../../library/string.rst:456 ../../library/string.rst:467 +#: ../../library/string.rst:502 msgid "Type" msgstr "" -#: ../../library/string.rst:456 +#: ../../library/string.rst:458 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/string.rst:456 +#: ../../library/string.rst:458 msgid "String format. This is the default type for strings and may be omitted." msgstr "" -#: ../../library/string.rst:459 ../../library/string.rst:488 -#: ../../library/string.rst:575 +#: ../../library/string.rst:461 ../../library/string.rst:490 +#: ../../library/string.rst:577 msgid "None" msgstr "None" -#: ../../library/string.rst:459 +#: ../../library/string.rst:461 msgid "The same as ``'s'``." msgstr "" -#: ../../library/string.rst:462 +#: ../../library/string.rst:464 msgid "The available integer presentation types are:" msgstr "" -#: ../../library/string.rst:467 +#: ../../library/string.rst:469 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/string.rst:467 +#: ../../library/string.rst:469 msgid "Binary format. Outputs the number in base 2." msgstr "" -#: ../../library/string.rst:469 +#: ../../library/string.rst:471 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/string.rst:469 +#: ../../library/string.rst:471 msgid "" "Character. Converts the integer to the corresponding unicode character " "before printing." msgstr "" -#: ../../library/string.rst:472 +#: ../../library/string.rst:474 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/string.rst:472 +#: ../../library/string.rst:474 msgid "Decimal Integer. Outputs the number in base 10." msgstr "" -#: ../../library/string.rst:474 +#: ../../library/string.rst:476 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/string.rst:474 +#: ../../library/string.rst:476 msgid "Octal format. Outputs the number in base 8." msgstr "" -#: ../../library/string.rst:476 +#: ../../library/string.rst:478 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/string.rst:476 +#: ../../library/string.rst:478 msgid "" "Hex format. Outputs the number in base 16, using lower-case letters for the " "digits above 9." msgstr "" -#: ../../library/string.rst:479 +#: ../../library/string.rst:481 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/string.rst:479 +#: ../../library/string.rst:481 msgid "" "Hex format. Outputs the number in base 16, using upper-case letters for the " "digits above 9. In case ``'#'`` is specified, the prefix ``'0x'`` will be " "upper-cased to ``'0X'`` as well." msgstr "" -#: ../../library/string.rst:484 ../../library/string.rst:568 +#: ../../library/string.rst:486 ../../library/string.rst:570 msgid "``'n'``" msgstr "``'n'``" -#: ../../library/string.rst:484 +#: ../../library/string.rst:486 msgid "" "Number. This is the same as ``'d'``, except that it uses the current locale " "setting to insert the appropriate number separator characters." msgstr "" -#: ../../library/string.rst:488 +#: ../../library/string.rst:490 msgid "The same as ``'d'``." msgstr "" -#: ../../library/string.rst:491 +#: ../../library/string.rst:493 msgid "" "In addition to the above presentation types, integers can be formatted with " "the floating point presentation types listed below (except ``'n'`` and " @@ -681,17 +682,17 @@ msgid "" "floating point number before formatting." msgstr "" -#: ../../library/string.rst:496 +#: ../../library/string.rst:498 msgid "" "The available presentation types for :class:`float` and :class:`~decimal." "Decimal` values are:" msgstr "" -#: ../../library/string.rst:502 +#: ../../library/string.rst:504 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/string.rst:502 +#: ../../library/string.rst:504 msgid "" "Scientific notation. For a given precision ``p``, formats the number in " "scientific notation with the letter 'e' separating the coefficient from the " @@ -703,21 +704,21 @@ msgid "" "removed unless the ``#`` option is used." msgstr "" -#: ../../library/string.rst:514 +#: ../../library/string.rst:516 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/string.rst:514 +#: ../../library/string.rst:516 msgid "" "Scientific notation. Same as ``'e'`` except it uses an upper case 'E' as the " "separator character." msgstr "" -#: ../../library/string.rst:517 +#: ../../library/string.rst:519 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/string.rst:517 +#: ../../library/string.rst:519 msgid "" "Fixed-point notation. For a given precision ``p``, formats the number as a " "decimal number with exactly ``p`` digits following the decimal point. With " @@ -728,21 +729,21 @@ msgid "" "used." msgstr "" -#: ../../library/string.rst:527 +#: ../../library/string.rst:529 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/string.rst:527 +#: ../../library/string.rst:529 msgid "" "Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and " "``inf`` to ``INF``." msgstr "" -#: ../../library/string.rst:530 +#: ../../library/string.rst:532 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/string.rst:530 +#: ../../library/string.rst:532 msgid "" "General format. For a given precision ``p >= 1``, this rounds the number to " "``p`` significant digits and then formats the result in either fixed-point " @@ -750,7 +751,7 @@ msgid "" "``0`` is treated as equivalent to a precision of ``1``." msgstr "" -#: ../../library/string.rst:537 +#: ../../library/string.rst:539 msgid "" "The precise rules are as follows: suppose that the result formatted with " "presentation type ``'e'`` and precision ``p-1`` would have exponent " @@ -763,7 +764,7 @@ msgid "" "unless the ``'#'`` option is used." msgstr "" -#: ../../library/string.rst:550 +#: ../../library/string.rst:552 msgid "" "With no precision given, uses a precision of ``6`` significant digits for :" "class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result " @@ -773,40 +774,40 @@ msgid "" "notation is used otherwise." msgstr "" -#: ../../library/string.rst:559 +#: ../../library/string.rst:561 msgid "" "Positive and negative infinity, positive and negative zero, and nans, are " "formatted as ``inf``, ``-inf``, ``0``, ``-0`` and ``nan`` respectively, " "regardless of the precision." msgstr "" -#: ../../library/string.rst:564 +#: ../../library/string.rst:566 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/string.rst:564 +#: ../../library/string.rst:566 msgid "" "General format. Same as ``'g'`` except switches to ``'E'`` if the number " "gets too large. The representations of infinity and NaN are uppercased, too." msgstr "" -#: ../../library/string.rst:568 +#: ../../library/string.rst:570 msgid "" "Number. This is the same as ``'g'``, except that it uses the current locale " "setting to insert the appropriate number separator characters." msgstr "" -#: ../../library/string.rst:572 +#: ../../library/string.rst:574 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/string.rst:572 +#: ../../library/string.rst:574 msgid "" "Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) " "format, followed by a percent sign." msgstr "" -#: ../../library/string.rst:575 +#: ../../library/string.rst:577 msgid "" "For :class:`float` this is the same as ``'g'``, except that when fixed-point " "notation is used to format the result, it always includes at least one digit " @@ -814,96 +815,96 @@ msgid "" "represent the given value faithfully." msgstr "" -#: ../../library/string.rst:581 +#: ../../library/string.rst:583 msgid "" "For :class:`~decimal.Decimal`, this is the same as either ``'g'`` or ``'G'`` " "depending on the value of ``context.capitals`` for the current decimal " "context." msgstr "" -#: ../../library/string.rst:585 +#: ../../library/string.rst:587 msgid "" "The overall effect is to match the output of :func:`str` as altered by the " "other format modifiers." msgstr "" -#: ../../library/string.rst:593 +#: ../../library/string.rst:595 msgid "Format examples" msgstr "" -#: ../../library/string.rst:595 +#: ../../library/string.rst:597 msgid "" "This section contains examples of the :meth:`str.format` syntax and " "comparison with the old ``%``-formatting." msgstr "" -#: ../../library/string.rst:598 +#: ../../library/string.rst:600 msgid "" "In most of the cases the syntax is similar to the old ``%``-formatting, with " "the addition of the ``{}`` and with ``:`` used instead of ``%``. For " "example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``." msgstr "" -#: ../../library/string.rst:602 +#: ../../library/string.rst:604 msgid "" "The new format syntax also supports new and different options, shown in the " "following examples." msgstr "" -#: ../../library/string.rst:605 +#: ../../library/string.rst:607 msgid "Accessing arguments by position::" msgstr "" -#: ../../library/string.rst:618 +#: ../../library/string.rst:620 msgid "Accessing arguments by name::" msgstr "" -#: ../../library/string.rst:626 +#: ../../library/string.rst:628 msgid "Accessing arguments' attributes::" msgstr "" -#: ../../library/string.rst:641 +#: ../../library/string.rst:643 msgid "Accessing arguments' items::" msgstr "" -#: ../../library/string.rst:647 +#: ../../library/string.rst:649 msgid "Replacing ``%s`` and ``%r``::" msgstr "" -#: ../../library/string.rst:652 +#: ../../library/string.rst:654 msgid "Aligning the text and specifying a width::" msgstr "" -#: ../../library/string.rst:663 +#: ../../library/string.rst:665 msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" msgstr "" -#: ../../library/string.rst:672 +#: ../../library/string.rst:674 msgid "" "Replacing ``%x`` and ``%o`` and converting the value to different bases::" msgstr "" -#: ../../library/string.rst:681 +#: ../../library/string.rst:683 msgid "Using the comma as a thousands separator::" msgstr "" -#: ../../library/string.rst:686 +#: ../../library/string.rst:688 msgid "Expressing a percentage::" msgstr "" -#: ../../library/string.rst:693 +#: ../../library/string.rst:695 msgid "Using type-specific formatting::" msgstr "" -#: ../../library/string.rst:700 +#: ../../library/string.rst:702 msgid "Nesting arguments and more complex examples::" msgstr "" -#: ../../library/string.rst:734 +#: ../../library/string.rst:736 msgid "Template strings" msgstr "" -#: ../../library/string.rst:736 +#: ../../library/string.rst:738 msgid "" "Template strings provide simpler string substitutions as described in :pep:" "`292`. A primary use case for template strings is for internationalization " @@ -913,17 +914,17 @@ msgid "" "the `flufl.i18n `_ package." msgstr "" -#: ../../library/string.rst:746 +#: ../../library/string.rst:748 msgid "" "Template strings support ``$``-based substitutions, using the following " "rules:" msgstr "" -#: ../../library/string.rst:748 +#: ../../library/string.rst:750 msgid "``$$`` is an escape; it is replaced with a single ``$``." msgstr "" -#: ../../library/string.rst:750 +#: ../../library/string.rst:752 msgid "" "``$identifier`` names a substitution placeholder matching a mapping key of " "``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any " @@ -933,30 +934,30 @@ msgid "" "specification." msgstr "" -#: ../../library/string.rst:757 +#: ../../library/string.rst:759 msgid "" "``${identifier}`` is equivalent to ``$identifier``. It is required when " "valid identifier characters follow the placeholder but are not part of the " "placeholder, such as ``\"${noun}ification\"``." msgstr "" -#: ../../library/string.rst:761 +#: ../../library/string.rst:763 msgid "" "Any other appearance of ``$`` in the string will result in a :exc:" "`ValueError` being raised." msgstr "" -#: ../../library/string.rst:764 +#: ../../library/string.rst:766 msgid "" "The :mod:`string` module provides a :class:`Template` class that implements " "these rules. The methods of :class:`Template` are:" msgstr "" -#: ../../library/string.rst:770 +#: ../../library/string.rst:772 msgid "The constructor takes a single argument which is the template string." msgstr "" -#: ../../library/string.rst:775 +#: ../../library/string.rst:777 msgid "" "Performs the template substitution, returning a new string. *mapping* is " "any dictionary-like object with keys that match the placeholders in the " @@ -965,7 +966,7 @@ msgid "" "there are duplicates, the placeholders from *kwds* take precedence." msgstr "" -#: ../../library/string.rst:784 +#: ../../library/string.rst:786 msgid "" "Like :meth:`substitute`, except that if placeholders are missing from " "*mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the " @@ -974,7 +975,7 @@ msgid "" "simply return ``$`` instead of raising :exc:`ValueError`." msgstr "" -#: ../../library/string.rst:790 +#: ../../library/string.rst:792 msgid "" "While other exceptions may still occur, this method is called \"safe\" " "because it always tries to return a usable string instead of raising an " @@ -984,33 +985,33 @@ msgid "" "Python identifiers." msgstr "" -#: ../../library/string.rst:800 +#: ../../library/string.rst:802 msgid "" "Returns false if the template has invalid placeholders that will cause :meth:" "`substitute` to raise :exc:`ValueError`." msgstr "" -#: ../../library/string.rst:808 +#: ../../library/string.rst:810 msgid "" "Returns a list of the valid identifiers in the template, in the order they " "first appear, ignoring any invalid identifiers." msgstr "" -#: ../../library/string.rst:813 +#: ../../library/string.rst:815 msgid ":class:`Template` instances also provide one public data attribute:" msgstr "" -#: ../../library/string.rst:817 +#: ../../library/string.rst:819 msgid "" "This is the object passed to the constructor's *template* argument. In " "general, you shouldn't change it, but read-only access is not enforced." msgstr "" -#: ../../library/string.rst:820 +#: ../../library/string.rst:822 msgid "Here is an example of how to use a Template::" msgstr "" -#: ../../library/string.rst:838 +#: ../../library/string.rst:840 msgid "" "Advanced usage: you can derive subclasses of :class:`Template` to customize " "the placeholder syntax, delimiter character, or the entire regular " @@ -1018,7 +1019,7 @@ msgid "" "these class attributes:" msgstr "" -#: ../../library/string.rst:843 +#: ../../library/string.rst:845 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " @@ -1028,7 +1029,7 @@ msgid "" "the subclass's class namespace)." msgstr "" -#: ../../library/string.rst:850 +#: ../../library/string.rst:852 msgid "" "*idpattern* -- This is the regular expression describing the pattern for non-" "braced placeholders. The default value is the regular expression ``(?a:[_a-" @@ -1036,19 +1037,19 @@ msgid "" "pattern will also apply to braced placeholders." msgstr "" -#: ../../library/string.rst:857 +#: ../../library/string.rst:859 msgid "" "Since default *flags* is ``re.IGNORECASE``, pattern ``[a-z]`` can match with " "some non-ASCII characters. That's why we use the local ``a`` flag here." msgstr "" -#: ../../library/string.rst:861 +#: ../../library/string.rst:863 msgid "" "*braceidpattern* can be used to define separate patterns used inside and " "outside the braces." msgstr "" -#: ../../library/string.rst:865 +#: ../../library/string.rst:867 msgid "" "*braceidpattern* -- This is like *idpattern* but describes the pattern for " "braced placeholders. Defaults to ``None`` which means to fall back to " @@ -1057,7 +1058,7 @@ msgid "" "unbraced placeholders." msgstr "" -#: ../../library/string.rst:873 +#: ../../library/string.rst:875 msgid "" "*flags* -- The regular expression flags that will be applied when compiling " "the regular expression used for recognizing substitutions. The default " @@ -1066,7 +1067,7 @@ msgid "" "regular expressions." msgstr "" -#: ../../library/string.rst:881 +#: ../../library/string.rst:883 msgid "" "Alternatively, you can provide the entire regular expression pattern by " "overriding the class attribute *pattern*. If you do this, the value must be " @@ -1075,41 +1076,41 @@ msgid "" "placeholder rule:" msgstr "" -#: ../../library/string.rst:887 +#: ../../library/string.rst:889 msgid "" "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " "default pattern." msgstr "" -#: ../../library/string.rst:890 +#: ../../library/string.rst:892 msgid "" "*named* -- This group matches the unbraced placeholder name; it should not " "include the delimiter in capturing group." msgstr "" -#: ../../library/string.rst:893 +#: ../../library/string.rst:895 msgid "" "*braced* -- This group matches the brace enclosed placeholder name; it " "should not include either the delimiter or braces in the capturing group." msgstr "" -#: ../../library/string.rst:896 +#: ../../library/string.rst:898 msgid "" "*invalid* -- This group matches any other delimiter pattern (usually a " "single delimiter), and it should appear last in the regular expression." msgstr "" -#: ../../library/string.rst:899 +#: ../../library/string.rst:901 msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." msgstr "" -#: ../../library/string.rst:904 +#: ../../library/string.rst:906 msgid "Helper functions" msgstr "" -#: ../../library/string.rst:908 +#: ../../library/string.rst:910 msgid "" "Split the argument into words using :meth:`str.split`, capitalize each word " "using :meth:`str.capitalize`, and join the capitalized words using :meth:" @@ -1123,10 +1124,10 @@ msgstr "" msgid "{} (curly brackets)" msgstr "" -#: ../../library/string.rst:195 ../../library/string.rst:333 -#: ../../library/string.rst:365 ../../library/string.rst:384 -#: ../../library/string.rst:393 ../../library/string.rst:407 -#: ../../library/string.rst:416 +#: ../../library/string.rst:195 ../../library/string.rst:335 +#: ../../library/string.rst:367 ../../library/string.rst:386 +#: ../../library/string.rst:395 ../../library/string.rst:409 +#: ../../library/string.rst:418 msgid "in string formatting" msgstr "" @@ -1146,50 +1147,50 @@ msgstr "" msgid ": (colon)" msgstr "" -#: ../../library/string.rst:333 +#: ../../library/string.rst:335 msgid "< (less)" msgstr "" -#: ../../library/string.rst:333 +#: ../../library/string.rst:335 msgid "> (greater)" msgstr "" -#: ../../library/string.rst:333 +#: ../../library/string.rst:335 msgid "= (equals)" msgstr "" -#: ../../library/string.rst:333 +#: ../../library/string.rst:335 msgid "^ (caret)" msgstr "" -#: ../../library/string.rst:365 +#: ../../library/string.rst:367 msgid "+ (plus)" msgstr "" -#: ../../library/string.rst:365 +#: ../../library/string.rst:367 msgid "- (minus)" msgstr "" -#: ../../library/string.rst:384 +#: ../../library/string.rst:386 msgid "z" msgstr "" -#: ../../library/string.rst:393 +#: ../../library/string.rst:395 msgid "# (hash)" msgstr "" -#: ../../library/string.rst:407 +#: ../../library/string.rst:409 msgid ", (comma)" msgstr "" -#: ../../library/string.rst:416 +#: ../../library/string.rst:418 msgid "_ (underscore)" msgstr "" -#: ../../library/string.rst:744 +#: ../../library/string.rst:746 msgid "$ (dollar)" msgstr "" -#: ../../library/string.rst:744 +#: ../../library/string.rst:746 msgid "in template strings" msgstr "" diff --git a/library/typing.po b/library/typing.po index c3512ff19a..cf76fb7c28 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-28 00:33+0000\n" +"POT-Creation-Date: 2023-06-08 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -22,18 +22,18 @@ msgstr "" msgid ":mod:`typing` --- Support for type hints" msgstr "" -#: ../../library/typing.rst:10 +#: ../../library/typing.rst:16 msgid "**Source code:** :source:`Lib/typing.py`" msgstr "**原始碼:**\\ :source:`Lib/typing.py`" -#: ../../library/typing.rst:14 +#: ../../library/typing.rst:20 msgid "" "The Python runtime does not enforce function and variable type annotations. " "They can be used by third party tools such as type checkers, IDEs, linters, " "etc." msgstr "" -#: ../../library/typing.rst:20 +#: ../../library/typing.rst:26 msgid "" "This module provides runtime support for type hints. The most fundamental " "support consists of the types :data:`Any`, :data:`Union`, :data:`Callable`, :" @@ -41,38 +41,38 @@ msgid "" "`484`. For a simplified introduction to type hints, see :pep:`483`." msgstr "" -#: ../../library/typing.rst:26 +#: ../../library/typing.rst:32 msgid "" "The function below takes and returns a string and is annotated as follows::" msgstr "" -#: ../../library/typing.rst:31 +#: ../../library/typing.rst:37 msgid "" "In the function ``greeting``, the argument ``name`` is expected to be of " "type :class:`str` and the return type :class:`str`. Subtypes are accepted as " "arguments." msgstr "" -#: ../../library/typing.rst:35 +#: ../../library/typing.rst:41 msgid "" "New features are frequently added to the ``typing`` module. The " "`typing_extensions `_ package " "provides backports of these new features to older versions of Python." msgstr "" -#: ../../library/typing.rst:39 +#: ../../library/typing.rst:45 msgid "" "For a summary of deprecated features and a deprecation timeline, please see " "`Deprecation Timeline of Major Features`_." msgstr "" -#: ../../library/typing.rst:44 +#: ../../library/typing.rst:50 msgid "" "For a quick overview of type hints, refer to `this cheat sheet `_." msgstr "" -#: ../../library/typing.rst:47 +#: ../../library/typing.rst:53 msgid "" "The \"Type System Reference\" section of https://mypy.readthedocs.io/ -- " "since the Python typing system is standardised via PEPs, this reference " @@ -80,207 +80,207 @@ msgid "" "still be specific to mypy." msgstr "" -#: ../../library/typing.rst:52 +#: ../../library/typing.rst:58 msgid "" "The documentation at https://typing.readthedocs.io/ serves as useful " "reference for type system features, useful typing related tools and typing " "best practices." msgstr "" -#: ../../library/typing.rst:58 +#: ../../library/typing.rst:64 msgid "Relevant PEPs" msgstr "" -#: ../../library/typing.rst:60 +#: ../../library/typing.rst:66 msgid "" "Since the initial introduction of type hints in :pep:`484` and :pep:`483`, a " "number of PEPs have modified and enhanced Python's framework for type " -"annotations. These include:" +"annotations:" msgstr "" -#: ../../library/typing.rst:65 +#: ../../library/typing.rst:76 msgid ":pep:`526`: Syntax for Variable Annotations" msgstr "" -#: ../../library/typing.rst:65 +#: ../../library/typing.rst:76 msgid "" "*Introducing* syntax for annotating variables outside of function " "definitions, and :data:`ClassVar`" msgstr "" -#: ../../library/typing.rst:68 +#: ../../library/typing.rst:79 msgid ":pep:`544`: Protocols: Structural subtyping (static duck typing)" msgstr "" -#: ../../library/typing.rst:68 +#: ../../library/typing.rst:79 msgid "" "*Introducing* :class:`Protocol` and the :func:" "`@runtime_checkable` decorator" msgstr "" -#: ../../library/typing.rst:71 +#: ../../library/typing.rst:82 msgid ":pep:`585`: Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/typing.rst:71 +#: ../../library/typing.rst:82 msgid "" "*Introducing* :class:`types.GenericAlias` and the ability to use standard " "library classes as :ref:`generic types`" msgstr "" -#: ../../library/typing.rst:73 +#: ../../library/typing.rst:84 msgid ":pep:`586`: Literal Types" msgstr "" -#: ../../library/typing.rst:74 +#: ../../library/typing.rst:85 msgid "*Introducing* :data:`Literal`" msgstr "" -#: ../../library/typing.rst:75 +#: ../../library/typing.rst:86 msgid "" ":pep:`589`: TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys" msgstr "" -#: ../../library/typing.rst:76 +#: ../../library/typing.rst:87 msgid "*Introducing* :class:`TypedDict`" msgstr "" -#: ../../library/typing.rst:77 +#: ../../library/typing.rst:88 msgid ":pep:`591`: Adding a final qualifier to typing" msgstr "" -#: ../../library/typing.rst:78 +#: ../../library/typing.rst:89 msgid "*Introducing* :data:`Final` and the :func:`@final` decorator" msgstr "" -#: ../../library/typing.rst:79 +#: ../../library/typing.rst:90 msgid ":pep:`593`: Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:80 +#: ../../library/typing.rst:91 msgid "*Introducing* :data:`Annotated`" msgstr "" -#: ../../library/typing.rst:83 +#: ../../library/typing.rst:94 msgid ":pep:`604`: Allow writing union types as ``X | Y``" msgstr "" -#: ../../library/typing.rst:82 +#: ../../library/typing.rst:93 msgid "" "*Introducing* :data:`types.UnionType` and the ability to use the binary-or " "operator ``|`` to signify a :ref:`union of types`" msgstr "" -#: ../../library/typing.rst:85 +#: ../../library/typing.rst:96 msgid ":pep:`612`: Parameter Specification Variables" msgstr "" -#: ../../library/typing.rst:86 +#: ../../library/typing.rst:97 msgid "*Introducing* :class:`ParamSpec` and :data:`Concatenate`" msgstr "" -#: ../../library/typing.rst:87 +#: ../../library/typing.rst:98 msgid ":pep:`613`: Explicit Type Aliases" msgstr "" -#: ../../library/typing.rst:88 +#: ../../library/typing.rst:99 msgid "*Introducing* :data:`TypeAlias`" msgstr "*引入* :data:`TypeAlias`" -#: ../../library/typing.rst:89 +#: ../../library/typing.rst:100 msgid ":pep:`646`: Variadic Generics" msgstr "" -#: ../../library/typing.rst:90 +#: ../../library/typing.rst:101 msgid "*Introducing* :data:`TypeVarTuple`" msgstr "*引入* :data:`TypeVarTuple`" -#: ../../library/typing.rst:91 +#: ../../library/typing.rst:102 msgid ":pep:`647`: User-Defined Type Guards" msgstr "" -#: ../../library/typing.rst:92 +#: ../../library/typing.rst:103 msgid "*Introducing* :data:`TypeGuard`" msgstr "*引入* :data:`TypeGuard`" -#: ../../library/typing.rst:93 +#: ../../library/typing.rst:104 msgid "" ":pep:`655`: Marking individual TypedDict items as required or potentially " "missing" msgstr "" -#: ../../library/typing.rst:94 +#: ../../library/typing.rst:105 msgid "*Introducing* :data:`Required` and :data:`NotRequired`" msgstr "*引入* :data:`Required` 和 :data:`NotRequired`" -#: ../../library/typing.rst:95 +#: ../../library/typing.rst:106 msgid ":pep:`673`: Self type" msgstr "" -#: ../../library/typing.rst:96 +#: ../../library/typing.rst:107 msgid "*Introducing* :data:`Self`" msgstr "*引入* :data:`Self`" -#: ../../library/typing.rst:97 +#: ../../library/typing.rst:108 msgid ":pep:`675`: Arbitrary Literal String Type" msgstr "" -#: ../../library/typing.rst:98 +#: ../../library/typing.rst:109 msgid "*Introducing* :data:`LiteralString`" msgstr "*引入* :data:`LiteralString`" -#: ../../library/typing.rst:100 +#: ../../library/typing.rst:111 msgid ":pep:`681`: Data Class Transforms" msgstr "" -#: ../../library/typing.rst:100 +#: ../../library/typing.rst:111 msgid "" "*Introducing* the :func:`@dataclass_transform` decorator" msgstr "*引入* :func:`@dataclass_transform` 裝飾器" -#: ../../library/typing.rst:105 +#: ../../library/typing.rst:121 msgid "Type aliases" msgstr "" -#: ../../library/typing.rst:107 +#: ../../library/typing.rst:123 msgid "" "A type alias is defined by assigning the type to the alias. In this example, " "``Vector`` and ``list[float]`` will be treated as interchangeable synonyms::" msgstr "" -#: ../../library/typing.rst:118 +#: ../../library/typing.rst:134 msgid "" "Type aliases are useful for simplifying complex type signatures. For " "example::" msgstr "" -#: ../../library/typing.rst:136 +#: ../../library/typing.rst:152 msgid "" "Note that ``None`` as a type hint is a special case and is replaced by " "``type(None)``." msgstr "" -#: ../../library/typing.rst:139 +#: ../../library/typing.rst:155 msgid "" "Type aliases may be marked with :data:`TypeAlias` to make it explicit that " "the statement is a type alias declaration, not a normal variable assignment::" msgstr "" -#: ../../library/typing.rst:149 +#: ../../library/typing.rst:165 msgid "NewType" msgstr "NewType" -#: ../../library/typing.rst:151 +#: ../../library/typing.rst:167 msgid "Use the :class:`NewType` helper to create distinct types::" msgstr "" -#: ../../library/typing.rst:158 +#: ../../library/typing.rst:174 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. This is useful in helping catch logical errors::" msgstr "" -#: ../../library/typing.rst:170 +#: ../../library/typing.rst:186 msgid "" "You may still perform all ``int`` operations on a variable of type " "``UserId``, but the result will always be of type ``int``. This lets you " @@ -288,7 +288,7 @@ msgid "" "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" -#: ../../library/typing.rst:178 +#: ../../library/typing.rst:194 msgid "" "Note that these checks are enforced only by the static type checker. At " "runtime, the statement ``Derived = NewType('Derived', Base)`` will make " @@ -297,31 +297,31 @@ msgid "" "class or introduce much overhead beyond that of a regular function call." msgstr "" -#: ../../library/typing.rst:184 +#: ../../library/typing.rst:200 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" -#: ../../library/typing.rst:187 +#: ../../library/typing.rst:203 msgid "It is invalid to create a subtype of ``Derived``::" msgstr "" -#: ../../library/typing.rst:196 +#: ../../library/typing.rst:212 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" -#: ../../library/typing.rst:204 +#: ../../library/typing.rst:220 msgid "and typechecking for ``ProUserId`` will work as expected." msgstr "" -#: ../../library/typing.rst:206 +#: ../../library/typing.rst:222 msgid "See :pep:`484` for more details." msgstr "更多細節請見 :pep:`484`\\ 。" -#: ../../library/typing.rst:210 +#: ../../library/typing.rst:226 msgid "" "Recall that the use of a type alias declares two types to be *equivalent* to " "one another. Doing ``Alias = Original`` will make the static type checker " @@ -329,7 +329,7 @@ msgid "" "This is useful when you want to simplify complex type signatures." msgstr "" -#: ../../library/typing.rst:215 +#: ../../library/typing.rst:231 msgid "" "In contrast, ``NewType`` declares one type to be a *subtype* of another. " "Doing ``Derived = NewType('Derived', Original)`` will make the static type " @@ -339,39 +339,46 @@ msgid "" "errors with minimal runtime cost." msgstr "" -#: ../../library/typing.rst:224 +#: ../../library/typing.rst:240 msgid "" -"``NewType`` is now a class rather than a function. There is some additional " -"runtime cost when calling ``NewType`` over a regular function. However, " -"this cost will be reduced in 3.11.0." +"``NewType`` is now a class rather than a function. As a result, there is " +"some additional runtime cost when calling ``NewType`` over a regular " +"function." msgstr "" -#: ../../library/typing.rst:231 +#: ../../library/typing.rst:245 +msgid "" +"The performance of calling ``NewType`` has been restored to its level in " +"Python 3.9." +msgstr "" + +#: ../../library/typing.rst:251 msgid "Callable" msgstr "" -#: ../../library/typing.rst:233 +#: ../../library/typing.rst:253 msgid "" "Frameworks expecting callback functions of specific signatures might be type " "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:236 ../../library/typing.rst:1192 -#: ../../library/typing.rst:2889 -msgid "For example::" +#: ../../library/typing.rst:256 ../../library/typing.rst:1241 +#: ../../library/typing.rst:3018 +#, fuzzy +msgid "For example:" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:251 +#: ../../library/typing.rst:274 msgid "" "It is possible to declare the return type of a callable without specifying " "the call signature by substituting a literal ellipsis for the list of " "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:255 ../../library/typing.rst:871 +#: ../../library/typing.rst:278 ../../library/typing.rst:931 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -382,97 +389,97 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:263 ../../library/typing.rst:883 +#: ../../library/typing.rst:286 ../../library/typing.rst:943 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:268 +#: ../../library/typing.rst:291 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:274 +#: ../../library/typing.rst:297 msgid "Generics" msgstr "" -#: ../../library/typing.rst:276 +#: ../../library/typing.rst:299 msgid "" "Since type information about objects kept in containers cannot be statically " -"inferred in a generic way, abstract base classes have been extended to " -"support subscription to denote expected types for container elements." +"inferred in a generic way, many container classes in the standard library " +"support subscription to denote the expected types of container elements." msgstr "" -#: ../../library/typing.rst:287 +#: ../../library/typing.rst:316 msgid "" "Generics can be parameterized by using a factory available in typing called :" "class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:303 +#: ../../library/typing.rst:332 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:305 +#: ../../library/typing.rst:334 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:331 +#: ../../library/typing.rst:360 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:335 +#: ../../library/typing.rst:364 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[T]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:344 +#: ../../library/typing.rst:373 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:356 +#: ../../library/typing.rst:385 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:367 +#: ../../library/typing.rst:396 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:377 +#: ../../library/typing.rst:406 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:387 +#: ../../library/typing.rst:416 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:389 +#: ../../library/typing.rst:418 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " -"but implicitly inherits from ``Iterable[Any]``::" +"but implicitly inherits from ``Iterable[Any]``:" msgstr "" -#: ../../library/typing.rst:397 +#: ../../library/typing.rst:429 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:414 +#: ../../library/typing.rst:446 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:417 +#: ../../library/typing.rst:449 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -482,7 +489,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:433 +#: ../../library/typing.rst:465 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -490,20 +497,20 @@ msgid "" "converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:445 +#: ../../library/typing.rst:477 msgid "" -"Do note that generics with :class:`ParamSpec` may not have correct " +"Note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:449 +#: ../../library/typing.rst:481 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:453 +#: ../../library/typing.rst:485 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -511,24 +518,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:460 +#: ../../library/typing.rst:492 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:462 +#: ../../library/typing.rst:494 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:466 +#: ../../library/typing.rst:498 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:484 +#: ../../library/typing.rst:516 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -537,19 +544,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:490 +#: ../../library/typing.rst:522 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:503 +#: ../../library/typing.rst:535 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:506 +#: ../../library/typing.rst:538 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -557,7 +564,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:511 +#: ../../library/typing.rst:543 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -565,24 +572,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:533 +#: ../../library/typing.rst:565 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:538 +#: ../../library/typing.rst:570 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:540 +#: ../../library/typing.rst:572 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:544 +#: ../../library/typing.rst:576 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -591,7 +598,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:557 +#: ../../library/typing.rst:589 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -600,38 +607,39 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:573 +#: ../../library/typing.rst:605 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:578 +#: ../../library/typing.rst:610 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:580 +#: ../../library/typing.rst:612 msgid "The module defines the following classes, functions and decorators." msgstr "" -#: ../../library/typing.rst:584 +#: ../../library/typing.rst:616 msgid "" -"This module defines several types that are subclasses of pre-existing " -"standard library classes which also extend :class:`Generic` to support type " -"variables inside ``[]``. These types became redundant in Python 3.9 when the " -"corresponding pre-existing classes were enhanced to support ``[]``." +"This module defines several deprecated aliases to pre-existing standard " +"library classes. These were originally included in the typing module in " +"order to support parameterizing these generic classes using ``[]``. However, " +"the aliases became redundant in Python 3.9 when the corresponding pre-" +"existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:590 +#: ../../library/typing.rst:622 msgid "" "The redundant types are deprecated as of Python 3.9 but no deprecation " -"warnings will be issued by the interpreter. It is expected that type " -"checkers will flag the deprecated types when the checked program targets " -"Python 3.9 or newer." +"warnings are issued by the interpreter. It is expected that type checkers " +"will flag the deprecated types when the checked program targets Python 3.9 " +"or newer." msgstr "" -#: ../../library/typing.rst:595 +#: ../../library/typing.rst:627 msgid "" "The deprecated types will be removed from the :mod:`typing` module no sooner " "than the first Python version released 5 years after the release of Python " @@ -639,50 +647,50 @@ msgid "" "Collections*." msgstr "" -#: ../../library/typing.rst:601 +#: ../../library/typing.rst:633 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:604 +#: ../../library/typing.rst:636 msgid "Special types" msgstr "" -#: ../../library/typing.rst:606 +#: ../../library/typing.rst:638 msgid "These can be used as types in annotations and do not support ``[]``." msgstr "" -#: ../../library/typing.rst:610 +#: ../../library/typing.rst:642 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:612 +#: ../../library/typing.rst:644 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:613 +#: ../../library/typing.rst:645 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:615 +#: ../../library/typing.rst:647 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:622 +#: ../../library/typing.rst:654 msgid "" "``AnyStr`` is a :ref:`constrained type variable ` defined as ``AnyStr = TypeVar('AnyStr', str, bytes)``." msgstr "" -#: ../../library/typing.rst:625 +#: ../../library/typing.rst:657 msgid "" "It is meant to be used for functions that may accept any kind of string " "without allowing different kinds of strings to mix. For example::" msgstr "" -#: ../../library/typing.rst:637 +#: ../../library/typing.rst:669 msgid "" "Special type that includes only literal strings. A string literal is " "compatible with ``LiteralString``, as is another ``LiteralString``, but an " @@ -690,47 +698,48 @@ msgid "" "``LiteralString``-typed objects is also acceptable as a ``LiteralString``." msgstr "" -#: ../../library/typing.rst:643 ../../library/typing.rst:2518 -msgid "Example::" +#: ../../library/typing.rst:675 +#, fuzzy +msgid "Example:" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:657 +#: ../../library/typing.rst:691 msgid "" "This is useful for sensitive APIs where arbitrary user-generated strings " "could generate problems. For example, the two cases above that generate type " "checker errors could be vulnerable to an SQL injection attack." msgstr "" -#: ../../library/typing.rst:662 +#: ../../library/typing.rst:696 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:668 +#: ../../library/typing.rst:702 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:671 +#: ../../library/typing.rst:705 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:691 +#: ../../library/typing.rst:725 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:696 +#: ../../library/typing.rst:730 msgid "Special type indicating that a function never returns. For example::" msgstr "" -#: ../../library/typing.rst:704 +#: ../../library/typing.rst:738 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -738,150 +747,169 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:715 +#: ../../library/typing.rst:749 msgid "Special type to represent the current enclosed class. For example::" msgstr "" -#: ../../library/typing.rst:726 +#: ../../library/typing.rst:760 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:738 +#: ../../library/typing.rst:772 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:745 +#: ../../library/typing.rst:779 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:748 +#: ../../library/typing.rst:782 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:750 +#: ../../library/typing.rst:784 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:752 +#: ../../library/typing.rst:786 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:754 +#: ../../library/typing.rst:788 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:760 +#: ../../library/typing.rst:794 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `. For example::" +"aliases>`." msgstr "" -#: ../../library/typing.rst:767 -msgid "See :pep:`613` for more details about explicit type aliases." +#: ../../library/typing.rst:796 ../../library/typing.rst:1287 +msgid "For example::" msgstr "" +"舉例來說:\n" +"\n" +"::" -#: ../../library/typing.rst:772 +#: ../../library/typing.rst:802 +msgid "" +"``TypeAlias`` is particularly useful for annotating aliases that make use of " +"forward references, as it can be hard for type checkers to distinguish these " +"from normal variable assignments:" +msgstr "" + +#: ../../library/typing.rst:822 +#, fuzzy +msgid "See :pep:`613` for more details." +msgstr "更多細節請見 :pep:`673`。" + +#: ../../library/typing.rst:827 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:774 +#: ../../library/typing.rst:829 msgid "" "These can be used as types in annotations using ``[]``, each having a unique " "syntax." msgstr "" -#: ../../library/typing.rst:778 +#: ../../library/typing.rst:833 +msgid "Deprecated alias for :class:`tuple`." +msgstr "" + +#: ../../library/typing.rst:835 msgid "" -"Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the " -"first item of type X and the second of type Y. The type of the empty tuple " -"can be written as ``Tuple[()]``." +"``Tuple[X, Y]`` is the type of a tuple of two items with the first item of " +"type X and the second of type Y. The type of the empty tuple can be written " +"as ``Tuple[()]``." msgstr "" -#: ../../library/typing.rst:782 +#: ../../library/typing.rst:839 msgid "" "Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " "variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " "float and a string." msgstr "" -#: ../../library/typing.rst:786 +#: ../../library/typing.rst:843 msgid "" "To specify a variable-length tuple of homogeneous type, use literal " -"ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` is equivalent to " -"``Tuple[Any, ...]``, and in turn to :class:`tuple`." +"ellipsis, e.g. ``Tuple[int, ...]``. A plain ``Tuple`` annotation is " +"equivalent to ``tuple``, ``Tuple[Any, ...]``, or ``tuple[Any, ...]``." msgstr "" -#: ../../library/typing.rst:790 +#: ../../library/typing.rst:847 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:796 +#: ../../library/typing.rst:853 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:798 +#: ../../library/typing.rst:855 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:800 +#: ../../library/typing.rst:857 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:802 +#: ../../library/typing.rst:859 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:806 +#: ../../library/typing.rst:863 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:810 +#: ../../library/typing.rst:867 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:814 +#: ../../library/typing.rst:871 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:818 +#: ../../library/typing.rst:875 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:820 +#: ../../library/typing.rst:877 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:822 +#: ../../library/typing.rst:879 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:825 +#: ../../library/typing.rst:882 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:831 +#: ../../library/typing.rst:888 msgid "Optional type." msgstr "" -#: ../../library/typing.rst:833 +#: ../../library/typing.rst:890 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:892 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -889,31 +917,38 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:843 +#: ../../library/typing.rst:900 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:850 +#: ../../library/typing.rst:907 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:856 -msgid "Callable type; ``Callable[[int], str]`` is a function of (int) -> str." +#: ../../library/typing.rst:913 +msgid "Deprecated alias to :class:`collections.abc.Callable`." +msgstr "" + +#: ../../library/typing.rst:915 +msgid "" +"``Callable[[int], str]`` signifies a function that takes a single parameter " +"of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:858 +#: ../../library/typing.rst:918 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " -"types or an ellipsis; the return type must be a single type." +"types, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return " +"type must be a single type." msgstr "" -#: ../../library/typing.rst:863 +#: ../../library/typing.rst:923 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -923,19 +958,19 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:879 +#: ../../library/typing.rst:939 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:888 +#: ../../library/typing.rst:948 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:893 +#: ../../library/typing.rst:953 msgid "" "Used with :data:`Callable` and :class:`ParamSpec` to type annotate a higher " "order callable which adds, removes, or transforms parameters of another " @@ -945,7 +980,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:901 +#: ../../library/typing.rst:961 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -956,29 +991,33 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:940 ../../library/typing.rst:1564 +#: ../../library/typing.rst:1000 ../../library/typing.rst:1665 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:942 +#: ../../library/typing.rst:1002 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:947 +#: ../../library/typing.rst:1007 +msgid "Deprecated alias to :class:`type`." +msgstr "" + +#: ../../library/typing.rst:1009 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " -"contrast, a variable annotated with ``Type[C]`` may accept values that are " -"classes themselves -- specifically, it will accept the *class object* of " -"``C``. For example::" +"contrast, a variable annotated with ``type[C]`` or ``Type[C]`` may accept " +"values that are classes themselves -- specifically, it will accept the " +"*class object* of ``C``. For example::" msgstr "" -#: ../../library/typing.rst:956 +#: ../../library/typing.rst:1018 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:968 +#: ../../library/typing.rst:1030 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -988,39 +1027,39 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:976 +#: ../../library/typing.rst:1038 msgid "" "The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:982 +#: ../../library/typing.rst:1044 msgid "" "``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " "``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:987 +#: ../../library/typing.rst:1049 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:993 +#: ../../library/typing.rst:1055 msgid "" "A type that can be used to indicate to type checkers that the corresponding " "variable or function parameter has a value equivalent to the provided " "literal (or one of several literals). For example::" msgstr "" -#: ../../library/typing.rst:1007 +#: ../../library/typing.rst:1069 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:1013 +#: ../../library/typing.rst:1075 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1028,22 +1067,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1021 +#: ../../library/typing.rst:1083 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1023 +#: ../../library/typing.rst:1085 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1031 +#: ../../library/typing.rst:1093 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1033 +#: ../../library/typing.rst:1095 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1051,46 +1090,46 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1047 +#: ../../library/typing.rst:1109 msgid "" "A special typing construct to indicate to type checkers that a name cannot " "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1059 ../../library/typing.rst:2759 +#: ../../library/typing.rst:1121 ../../library/typing.rst:2882 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1068 +#: ../../library/typing.rst:1130 msgid "" "Special typing constructs that mark individual keys of a :class:`TypedDict` " "as either required or non-required respectively." msgstr "" -#: ../../library/typing.rst:1071 +#: ../../library/typing.rst:1133 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1077 +#: ../../library/typing.rst:1139 msgid "" "A type, introduced in :pep:`593` (``Flexible function and variable " "annotations``), to decorate existing types with context-specific metadata " "(possibly multiple pieces of it, as ``Annotated`` is variadic). " "Specifically, a type ``T`` can be annotated with metadata ``x`` via the " "typehint ``Annotated[T, x]``. This metadata can be used for either static " -"analysis or at runtime. If a library (or tool) encounters a typehint " -"``Annotated[T, x]`` and has no special logic for metadata ``x``, it should " -"ignore it and simply treat the type as ``T``. Unlike the ``no_type_check`` " -"functionality that currently exists in the ``typing`` module which " -"completely disables typechecking annotations on a function or a class, the " -"``Annotated`` type allows for both static typechecking of ``T`` (which can " -"safely ignore ``x``) together with runtime access to ``x`` within a specific " -"application." +"analysis or at runtime: at runtime, it is stored in a :attr:`__metadata__` " +"attribute. If a library (or tool) encounters a typehint ``Annotated[T, x]`` " +"and has no special logic for metadata ``x``, it should ignore it and simply " +"treat the type as ``T``. Unlike the ``no_type_check`` functionality that " +"currently exists in the ``typing`` module which completely disables " +"typechecking annotations on a function or a class, the ``Annotated`` type " +"allows for both static typechecking of ``T`` (which can safely ignore ``x``) " +"together with runtime access to ``x`` within a specific application." msgstr "" -#: ../../library/typing.rst:1091 +#: ../../library/typing.rst:1154 msgid "" "Ultimately, the responsibility of how to interpret the annotations (if at " "all) is the responsibility of the tool or library encountering the " @@ -1099,81 +1138,87 @@ msgid "" "using ``isinstance()``)." msgstr "" -#: ../../library/typing.rst:1097 +#: ../../library/typing.rst:1160 msgid "" "When a tool or a library does not support annotations or encounters an " "unknown annotation it should just ignore it and treat annotated type as the " "underlying type." msgstr "" -#: ../../library/typing.rst:1101 +#: ../../library/typing.rst:1164 msgid "" "It's up to the tool consuming the annotations to decide whether the client " "is allowed to have several annotations on one type and how to merge those " "annotations." msgstr "" -#: ../../library/typing.rst:1105 +#: ../../library/typing.rst:1168 msgid "" "Since the ``Annotated`` type allows you to put several annotations of the " "same (or different) type(s) on any node, the tools or libraries consuming " "those annotations are in charge of dealing with potential duplicates. For " -"example, if you are doing value range analysis you might allow this::" +"example, if you are doing value range analysis you might allow this:" msgstr "" -#: ../../library/typing.rst:1114 +#: ../../library/typing.rst:1184 msgid "" "Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " "the extra annotations at runtime." msgstr "" -#: ../../library/typing.rst:1117 +#: ../../library/typing.rst:1187 msgid "The details of the syntax:" msgstr "" -#: ../../library/typing.rst:1119 +#: ../../library/typing.rst:1189 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1121 +#: ../../library/typing.rst:1191 msgid "" "Multiple type annotations are supported (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1126 +#: ../../library/typing.rst:1200 msgid "" "``Annotated`` must be called with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1129 +#: ../../library/typing.rst:1203 msgid "" "The order of the annotations is preserved and matters for equality checks::" msgstr "" -#: ../../library/typing.rst:1136 +#: ../../library/typing.rst:1210 msgid "" "Nested ``Annotated`` types are flattened, with metadata ordered starting " "with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1143 +#: ../../library/typing.rst:1217 msgid "Duplicated annotations are not removed::" msgstr "" -#: ../../library/typing.rst:1149 -msgid "``Annotated`` can be used with nested and generic aliases::" +#: ../../library/typing.rst:1223 +msgid "``Annotated`` can be used with nested and generic aliases:" +msgstr "" + +#: ../../library/typing.rst:1238 +msgid "" +"At runtime, the metadata associated with an ``Annotated`` type can be " +"retrieved via the ``__metadata__`` attribute." msgstr "" -#: ../../library/typing.rst:1162 +#: ../../library/typing.rst:1257 msgid "" "Special typing form used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1166 +#: ../../library/typing.rst:1261 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1182,44 +1227,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1181 +#: ../../library/typing.rst:1276 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1185 +#: ../../library/typing.rst:1280 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1188 +#: ../../library/typing.rst:1283 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1189 +#: ../../library/typing.rst:1284 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1206 +#: ../../library/typing.rst:1301 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1210 +#: ../../library/typing.rst:1305 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1216 +#: ../../library/typing.rst:1311 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1228,13 +1273,13 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1222 +#: ../../library/typing.rst:1317 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1229 +#: ../../library/typing.rst:1324 msgid "" "A typing operator that conceptually marks an object as having been unpacked. " "For example, using the unpack operator ``*`` on a :class:`type variable " @@ -1242,7 +1287,7 @@ msgid "" "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1239 +#: ../../library/typing.rst:1334 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1250,44 +1295,44 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1256 +#: ../../library/typing.rst:1351 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1258 +#: ../../library/typing.rst:1353 msgid "" "The following objects are not used directly in annotations. Instead, they " "are building blocks for creating generic types." msgstr "" -#: ../../library/typing.rst:1263 +#: ../../library/typing.rst:1358 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1265 +#: ../../library/typing.rst:1360 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1274 +#: ../../library/typing.rst:1369 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1287 +#: ../../library/typing.rst:1382 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1289 ../../library/typing.rst:1385 -#: ../../library/typing.rst:1489 ../../library/typing.rst:1595 +#: ../../library/typing.rst:1384 ../../library/typing.rst:1480 +#: ../../library/typing.rst:1590 ../../library/typing.rst:1696 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1295 +#: ../../library/typing.rst:1390 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1295,69 +1340,69 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1316 +#: ../../library/typing.rst:1411 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1319 +#: ../../library/typing.rst:1414 msgid "" "Created type variables may be explicitly marked covariant or contravariant " "by passing ``covariant=True`` or ``contravariant=True``. By default, type " "variables are invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1324 +#: ../../library/typing.rst:1419 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1339 +#: ../../library/typing.rst:1434 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1347 +#: ../../library/typing.rst:1442 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1358 +#: ../../library/typing.rst:1453 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1362 +#: ../../library/typing.rst:1457 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1366 +#: ../../library/typing.rst:1461 msgid "Whether the type var has been marked as covariant." msgstr "" -#: ../../library/typing.rst:1370 +#: ../../library/typing.rst:1465 msgid "Whether the type var has been marked as contravariant." msgstr "" -#: ../../library/typing.rst:1374 +#: ../../library/typing.rst:1469 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1378 +#: ../../library/typing.rst:1473 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1382 +#: ../../library/typing.rst:1477 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1393 +#: ../../library/typing.rst:1488 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1365,7 +1410,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1415 +#: ../../library/typing.rst:1510 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1375,36 +1420,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1423 +#: ../../library/typing.rst:1518 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1430 +#: ../../library/typing.rst:1525 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1439 +#: ../../library/typing.rst:1534 msgid "" -"Type variable tuples can be happily combined with normal type variables::" +"Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1452 +#: ../../library/typing.rst:1553 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1459 +#: ../../library/typing.rst:1560 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1469 +#: ../../library/typing.rst:1570 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1413,21 +1458,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1476 +#: ../../library/typing.rst:1577 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1480 +#: ../../library/typing.rst:1581 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1486 +#: ../../library/typing.rst:1587 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1493 +#: ../../library/typing.rst:1594 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1437,7 +1482,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1500 +#: ../../library/typing.rst:1601 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1445,27 +1490,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1524 +#: ../../library/typing.rst:1625 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1528 +#: ../../library/typing.rst:1629 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1530 +#: ../../library/typing.rst:1631 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1537 +#: ../../library/typing.rst:1638 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1478,11 +1523,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1549 +#: ../../library/typing.rst:1650 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1551 +#: ../../library/typing.rst:1652 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1491,17 +1536,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1560 +#: ../../library/typing.rst:1661 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1566 +#: ../../library/typing.rst:1667 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1571 +#: ../../library/typing.rst:1672 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1509,44 +1554,44 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1576 +#: ../../library/typing.rst:1677 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``::" msgstr "" -#: ../../library/typing.rst:1587 +#: ../../library/typing.rst:1688 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1589 +#: ../../library/typing.rst:1690 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1593 +#: ../../library/typing.rst:1694 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1601 +#: ../../library/typing.rst:1702 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1605 +#: ../../library/typing.rst:1706 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1614 +#: ../../library/typing.rst:1715 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1616 +#: ../../library/typing.rst:1717 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1555,77 +1600,77 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1622 +#: ../../library/typing.rst:1723 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1632 +#: ../../library/typing.rst:1733 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1638 +#: ../../library/typing.rst:1739 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1642 +#: ../../library/typing.rst:1743 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1645 +#: ../../library/typing.rst:1746 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1648 +#: ../../library/typing.rst:1749 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1652 +#: ../../library/typing.rst:1753 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1656 +#: ../../library/typing.rst:1757 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1661 +#: ../../library/typing.rst:1762 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1671 +#: ../../library/typing.rst:1772 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1675 +#: ../../library/typing.rst:1776 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1679 +#: ../../library/typing.rst:1780 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1683 +#: ../../library/typing.rst:1784 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1688 +#: ../../library/typing.rst:1789 msgid "" "Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1694 +#: ../../library/typing.rst:1795 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1706 +#: ../../library/typing.rst:1807 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1633,15 +1678,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1711 +#: ../../library/typing.rst:1812 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1824 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1725 +#: ../../library/typing.rst:1826 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1650,7 +1695,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1745 +#: ../../library/typing.rst:1846 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1661,7 +1706,7 @@ msgid "" "SSLObject`." msgstr "" -#: ../../library/typing.rst:1756 +#: ../../library/typing.rst:1857 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1669,13 +1714,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1767 +#: ../../library/typing.rst:1868 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1770 +#: ../../library/typing.rst:1871 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1683,53 +1728,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1786 +#: ../../library/typing.rst:1887 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1790 +#: ../../library/typing.rst:1891 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1794 +#: ../../library/typing.rst:1895 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:1902 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1802 +#: ../../library/typing.rst:1903 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1814 +#: ../../library/typing.rst:1915 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1825 +#: ../../library/typing.rst:1926 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1828 +#: ../../library/typing.rst:1929 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1838 +#: ../../library/typing.rst:1939 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1737,225 +1782,249 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1843 +#: ../../library/typing.rst:1944 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:1858 +#: ../../library/typing.rst:1959 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1865 +#: ../../library/typing.rst:1966 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1873 +#: ../../library/typing.rst:1974 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:1891 +#: ../../library/typing.rst:1992 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:1897 +#: ../../library/typing.rst:1996 +msgid "T = TypeVar(\"T\")" +msgstr "" + +#: ../../library/typing.rst:2000 +msgid "class Group(TypedDict, Generic[T]):" +msgstr "" + +#: ../../library/typing.rst:1999 +msgid "key: T group: list[T]" +msgstr "" + +#: ../../library/typing.rst:2002 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:1903 +#: ../../library/typing.rst:2008 msgid "" -"``Point2D.__total__`` gives the value of the ``total`` argument. Example::" +"``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:1923 +#: ../../library/typing.rst:2030 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:1926 +#: ../../library/typing.rst:2033 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:1929 +#: ../../library/typing.rst:2036 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " "same ``TypedDict`` . This is done by declaring a ``TypedDict`` with one " "value for the ``total`` argument and then inheriting from it in another " -"``TypedDict`` with a different value for ``total``::" +"``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:1950 +#: ../../library/typing.rst:2059 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1954 +#: ../../library/typing.rst:2063 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:1958 +#: ../../library/typing.rst:2067 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:1962 +#: ../../library/typing.rst:2071 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1965 +#: ../../library/typing.rst:2074 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:2078 +msgid "Deprecated alias to :class:`dict`." +msgstr "" + +#: ../../library/typing.rst:2080 msgid "" -"A generic version of :class:`dict`. Useful for annotating return types. To " -"annotate arguments it is preferred to use an abstract collection type such " -"as :class:`Mapping`." +"Note that to annotate arguments, it is preferred to use an abstract " +"collection type such as :class:`Mapping` rather than to use :class:`dict` " +"or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:1973 +#: ../../library/typing.rst:2084 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1978 +#: ../../library/typing.rst:2089 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1984 +#: ../../library/typing.rst:2095 +msgid "Deprecated alias to :class:`list`." +msgstr "" + +#: ../../library/typing.rst:2097 msgid "" -"Generic version of :class:`list`. Useful for annotating return types. To " -"annotate arguments it is preferred to use an abstract collection type such " -"as :class:`Sequence` or :class:`Iterable`." +"Note that to annotate arguments, it is preferred to use an abstract " +"collection type such as :class:`Sequence` or :class:`Iterable` rather than " +"to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:1989 +#: ../../library/typing.rst:2101 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1999 +#: ../../library/typing.rst:2111 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2005 +#: ../../library/typing.rst:2117 +msgid "Deprecated alias to :class:`builtins.set `." +msgstr "" + +#: ../../library/typing.rst:2119 msgid "" -"A generic version of :class:`builtins.set `. Useful for annotating " -"return types. To annotate arguments it is preferred to use an abstract " -"collection type such as :class:`AbstractSet`." +"Note that to annotate arguments, it is preferred to use an abstract " +"collection type such as :class:`AbstractSet` rather than to use :class:`set` " +"or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2009 +#: ../../library/typing.rst:2123 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2015 -msgid "A generic version of :class:`builtins.frozenset `." +#: ../../library/typing.rst:2129 +msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2017 +#: ../../library/typing.rst:2131 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2022 +#: ../../library/typing.rst:2136 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:2025 +#: ../../library/typing.rst:2139 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2029 -msgid "A generic version of :class:`collections.defaultdict`." +#: ../../library/typing.rst:2143 +msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2033 +#: ../../library/typing.rst:2147 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2039 -msgid "A generic version of :class:`collections.OrderedDict`." +#: ../../library/typing.rst:2153 +msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2043 +#: ../../library/typing.rst:2157 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2049 -msgid "A generic version of :class:`collections.ChainMap`." +#: ../../library/typing.rst:2163 +msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2054 +#: ../../library/typing.rst:2168 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2060 -msgid "A generic version of :class:`collections.Counter`." +#: ../../library/typing.rst:2174 +msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2065 +#: ../../library/typing.rst:2179 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2071 -msgid "A generic version of :class:`collections.deque`." +#: ../../library/typing.rst:2185 +msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2076 +#: ../../library/typing.rst:2190 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2081 +#: ../../library/typing.rst:2195 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2087 +#: ../../library/typing.rst:2201 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2094 +#: ../../library/typing.rst:2208 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2099 +#: ../../library/typing.rst:2213 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1963,439 +2032,457 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2109 +#: ../../library/typing.rst:2223 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2110 +#: ../../library/typing.rst:2224 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2116 +#: ../../library/typing.rst:2230 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:2120 +#: ../../library/typing.rst:2234 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2128 +#: ../../library/typing.rst:2242 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2135 +#: ../../library/typing.rst:2249 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2138 +#: ../../library/typing.rst:2252 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2142 -msgid "A generic version of :class:`collections.abc.Set`." +#: ../../library/typing.rst:2256 +msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2144 +#: ../../library/typing.rst:2258 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2150 +#: ../../library/typing.rst:2264 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2154 +#: ../../library/typing.rst:2268 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2158 -msgid "A generic version of :class:`collections.abc.Collection`" +#: ../../library/typing.rst:2272 +msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2162 +#: ../../library/typing.rst:2276 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2168 -msgid "A generic version of :class:`collections.abc.Container`." +#: ../../library/typing.rst:2282 +msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2170 +#: ../../library/typing.rst:2284 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2176 -msgid "A generic version of :class:`collections.abc.ItemsView`." +#: ../../library/typing.rst:2290 +msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2178 +#: ../../library/typing.rst:2292 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2184 -msgid "A generic version of :class:`collections.abc.KeysView`." +#: ../../library/typing.rst:2298 +msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2186 +#: ../../library/typing.rst:2300 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2192 +#: ../../library/typing.rst:2306 msgid "" -"A generic version of :class:`collections.abc.Mapping`. This type can be used " +"Deprecated alias to :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:2198 +#: ../../library/typing.rst:2312 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2204 -msgid "A generic version of :class:`collections.abc.MappingView`." +#: ../../library/typing.rst:2318 +msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2206 +#: ../../library/typing.rst:2320 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2212 -msgid "A generic version of :class:`collections.abc.MutableMapping`." +#: ../../library/typing.rst:2326 +msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2214 +#: ../../library/typing.rst:2328 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2221 -msgid "A generic version of :class:`collections.abc.MutableSequence`." +#: ../../library/typing.rst:2335 +msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2223 +#: ../../library/typing.rst:2337 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2230 -msgid "A generic version of :class:`collections.abc.MutableSet`." +#: ../../library/typing.rst:2344 +msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2232 +#: ../../library/typing.rst:2346 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2238 -msgid "A generic version of :class:`collections.abc.Sequence`." +#: ../../library/typing.rst:2352 +msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2240 +#: ../../library/typing.rst:2354 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2246 -msgid "A generic version of :class:`collections.abc.ValuesView`." +#: ../../library/typing.rst:2360 +msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2248 +#: ../../library/typing.rst:2362 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2253 +#: ../../library/typing.rst:2367 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2257 -msgid "A generic version of :class:`collections.abc.Iterable`." +#: ../../library/typing.rst:2371 +msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2259 +#: ../../library/typing.rst:2373 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2265 -msgid "A generic version of :class:`collections.abc.Iterator`." +#: ../../library/typing.rst:2379 +msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2267 +#: ../../library/typing.rst:2381 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2273 +#: ../../library/typing.rst:2387 +msgid "Deprecated alias to :class:`collections.abc.Generator`." +msgstr "" + +#: ../../library/typing.rst:2389 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2282 +#: ../../library/typing.rst:2398 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2286 +#: ../../library/typing.rst:2402 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2294 +#: ../../library/typing.rst:2410 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2302 +#: ../../library/typing.rst:2418 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2308 -msgid "An alias to :class:`collections.abc.Hashable`." +#: ../../library/typing.rst:2424 +msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2312 -msgid "A generic version of :class:`collections.abc.Reversible`." +#: ../../library/typing.rst:2428 +msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2314 +#: ../../library/typing.rst:2430 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2320 -msgid "An alias to :class:`collections.abc.Sized`." +#: ../../library/typing.rst:2436 +msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2323 +#: ../../library/typing.rst:2439 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2327 +#: ../../library/typing.rst:2443 +msgid "Deprecated alias to :class:`collections.abc.Coroutine`." +msgstr "" + +#: ../../library/typing.rst:2445 msgid "" -"A generic version of :class:`collections.abc.Coroutine`. The variance and " -"order of type variables correspond to those of :class:`Generator`, for " -"example::" +"The variance and order of type variables correspond to those of :class:" +"`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:2339 +#: ../../library/typing.rst:2456 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2345 +#: ../../library/typing.rst:2462 +msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." +msgstr "" + +#: ../../library/typing.rst:2464 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2354 +#: ../../library/typing.rst:2473 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2358 +#: ../../library/typing.rst:2477 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2366 +#: ../../library/typing.rst:2485 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2376 +#: ../../library/typing.rst:2495 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2383 -msgid "A generic version of :class:`collections.abc.AsyncIterable`." +#: ../../library/typing.rst:2502 +msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2387 +#: ../../library/typing.rst:2506 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2393 -msgid "A generic version of :class:`collections.abc.AsyncIterator`." +#: ../../library/typing.rst:2512 +msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2397 +#: ../../library/typing.rst:2516 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2403 -msgid "A generic version of :class:`collections.abc.Awaitable`." +#: ../../library/typing.rst:2522 +msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2407 +#: ../../library/typing.rst:2526 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2413 +#: ../../library/typing.rst:2532 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2417 -msgid "A generic version of :class:`contextlib.AbstractContextManager`." +#: ../../library/typing.rst:2536 +msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2422 +#: ../../library/typing.rst:2541 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2429 -msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." +#: ../../library/typing.rst:2548 +msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2434 +#: ../../library/typing.rst:2553 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2440 +#: ../../library/typing.rst:2559 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2442 +#: ../../library/typing.rst:2561 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2446 +#: ../../library/typing.rst:2565 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2451 +#: ../../library/typing.rst:2570 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2455 +#: ../../library/typing.rst:2574 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2459 +#: ../../library/typing.rst:2578 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2463 +#: ../../library/typing.rst:2582 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2469 +#: ../../library/typing.rst:2588 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2473 +#: ../../library/typing.rst:2592 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2596 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2481 +#: ../../library/typing.rst:2600 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2483 +#: ../../library/typing.rst:2602 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2490 +#: ../../library/typing.rst:2609 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2492 +#: ../../library/typing.rst:2611 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2495 +#: ../../library/typing.rst:2614 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2502 +#: ../../library/typing.rst:2621 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2516 +#: ../../library/typing.rst:2635 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2529 +#: ../../library/typing.rst:2637 +msgid "Example::" +msgstr "" +"舉例來說:\n" +"\n" +"::" + +#: ../../library/typing.rst:2648 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " @@ -2408,53 +2495,53 @@ msgid "" "bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2541 +#: ../../library/typing.rst:2660 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2544 +#: ../../library/typing.rst:2663 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2552 +#: ../../library/typing.rst:2671 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2554 +#: ../../library/typing.rst:2673 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2560 +#: ../../library/typing.rst:2679 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2563 +#: ../../library/typing.rst:2682 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2568 +#: ../../library/typing.rst:2687 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2573 +#: ../../library/typing.rst:2692 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2583 +#: ../../library/typing.rst:2702 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -2463,19 +2550,19 @@ msgid "" "`dataclasses.dataclass`-like behaviors." msgstr "" -#: ../../library/typing.rst:2589 -msgid "Example usage with a decorator function::" +#: ../../library/typing.rst:2708 +msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2603 +#: ../../library/typing.rst:2724 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2612 +#: ../../library/typing.rst:2733 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2623 +#: ../../library/typing.rst:2744 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*. *func* is the function object for the implementation of the " @@ -2621,25 +2708,25 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2725 +#: ../../library/typing.rst:2848 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2733 +#: ../../library/typing.rst:2856 msgid "" "Clear all registered overloads in the internal registry. This can be used to " "reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2741 +#: ../../library/typing.rst:2864 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2764 +#: ../../library/typing.rst:2887 msgid "" "The decorator will now set the ``__final__`` attribute to ``True`` on the " "decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2649,59 +2736,59 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2775 +#: ../../library/typing.rst:2898 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2777 +#: ../../library/typing.rst:2900 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods and classes defined in that class (but not to " "methods defined in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2781 +#: ../../library/typing.rst:2904 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2785 +#: ../../library/typing.rst:2908 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2787 +#: ../../library/typing.rst:2910 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2792 +#: ../../library/typing.rst:2915 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2794 +#: ../../library/typing.rst:2917 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2805 +#: ../../library/typing.rst:2928 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2809 +#: ../../library/typing.rst:2932 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2813 +#: ../../library/typing.rst:2936 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2816 +#: ../../library/typing.rst:2939 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2710,56 +2797,56 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2822 +#: ../../library/typing.rst:2945 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " -"more information). For example::" +"more information). For example:" msgstr "" -#: ../../library/typing.rst:2837 +#: ../../library/typing.rst:2962 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2842 +#: ../../library/typing.rst:2967 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2845 +#: ../../library/typing.rst:2970 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2852 +#: ../../library/typing.rst:2977 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``. If ``X`` is a generic alias for a builtin or :" "mod:`collections` class, it gets normalized to the original class. If ``X`` " "is an instance of :class:`ParamSpecArgs` or :class:`ParamSpecKwargs`, return " "the underlying :class:`ParamSpec`. Return ``None`` for unsupported objects. " -"Examples::" +"Examples:" msgstr "" -#: ../../library/typing.rst:2871 +#: ../../library/typing.rst:2998 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``. If ``X`` is a union or :" "class:`Literal` contained in another generic type, the order of ``(Y, " "Z, ...)`` may be different from the order of the original arguments ``[Y, " "Z, ...]`` due to type caching. Return ``()`` for unsupported objects. " -"Examples::" +"Examples:" msgstr "" -#: ../../library/typing.rst:2887 +#: ../../library/typing.rst:3016 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2902 +#: ../../library/typing.rst:3037 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2767,24 +2854,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2908 +#: ../../library/typing.rst:3043 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2915 +#: ../../library/typing.rst:3050 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2919 +#: ../../library/typing.rst:3054 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2928 +#: ../../library/typing.rst:3063 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2792,7 +2879,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2935 +#: ../../library/typing.rst:3070 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2800,11 +2887,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2944 +#: ../../library/typing.rst:3079 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:2946 +#: ../../library/typing.rst:3081 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2812,76 +2899,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:2951 +#: ../../library/typing.rst:3086 msgid "Feature" msgstr "" -#: ../../library/typing.rst:2951 +#: ../../library/typing.rst:3086 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:2951 +#: ../../library/typing.rst:3086 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:2951 +#: ../../library/typing.rst:3086 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:2953 +#: ../../library/typing.rst:3088 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:2953 +#: ../../library/typing.rst:3088 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:2953 +#: ../../library/typing.rst:3088 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:2953 +#: ../../library/typing.rst:3088 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:2956 +#: ../../library/typing.rst:3091 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:2956 ../../library/typing.rst:2959 +#: ../../library/typing.rst:3091 ../../library/typing.rst:3094 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:2956 ../../library/typing.rst:2961 +#: ../../library/typing.rst:3091 ../../library/typing.rst:3096 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:2956 +#: ../../library/typing.rst:3091 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:2959 +#: ../../library/typing.rst:3094 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2959 +#: ../../library/typing.rst:3094 msgid "3.14" msgstr "" -#: ../../library/typing.rst:2959 +#: ../../library/typing.rst:3094 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:2961 +#: ../../library/typing.rst:3096 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2961 +#: ../../library/typing.rst:3096 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:2961 +#: ../../library/typing.rst:3096 msgid ":gh:`92332`" msgstr ":gh:`92332`" diff --git a/reference/expressions.po b/reference/expressions.po index fb52f3ca3e..63b0164e84 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-08 00:35+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -802,7 +802,7 @@ msgid "" "receive the value." msgstr "" -#: ../../reference/expressions.rst:745 +#: ../../reference/expressions.rst:746 msgid "" "Returns an awaitable that raises an exception of type ``type`` at the point " "where the asynchronous generator was paused, and returns the next value " @@ -814,7 +814,7 @@ msgid "" "that exception propagates to the caller of the awaitable." msgstr "" -#: ../../reference/expressions.rst:760 +#: ../../reference/expressions.rst:761 msgid "" "Returns an awaitable that when run will throw a :exc:`GeneratorExit` into " "the asynchronous generator function at the point where it was paused. If the " @@ -830,25 +830,25 @@ msgid "" "will return an awaitable that does nothing." msgstr "" -#: ../../reference/expressions.rst:776 +#: ../../reference/expressions.rst:777 msgid "Primaries" msgstr "" -#: ../../reference/expressions.rst:780 +#: ../../reference/expressions.rst:781 msgid "" "Primaries represent the most tightly bound operations of the language. Their " "syntax is:" msgstr "" -#: ../../reference/expressions.rst:790 +#: ../../reference/expressions.rst:791 msgid "Attribute references" msgstr "" -#: ../../reference/expressions.rst:796 +#: ../../reference/expressions.rst:797 msgid "An attribute reference is a primary followed by a period and a name:" msgstr "" -#: ../../reference/expressions.rst:806 +#: ../../reference/expressions.rst:807 msgid "" "The primary must evaluate to an object of a type that supports attribute " "references, which most objects do. This object is then asked to produce the " @@ -859,11 +859,11 @@ msgid "" "evaluations of the same attribute reference may yield different objects." msgstr "" -#: ../../reference/expressions.rst:818 +#: ../../reference/expressions.rst:819 msgid "Subscriptions" msgstr "" -#: ../../reference/expressions.rst:833 +#: ../../reference/expressions.rst:834 msgid "" "The subscription of an instance of a :ref:`container class ` " "will generally select an element from the container. The subscription of a :" @@ -871,13 +871,13 @@ msgid "" "`GenericAlias ` object." msgstr "" -#: ../../reference/expressions.rst:841 +#: ../../reference/expressions.rst:842 msgid "" "When an object is subscripted, the interpreter will evaluate the primary and " "the expression list." msgstr "" -#: ../../reference/expressions.rst:844 +#: ../../reference/expressions.rst:845 msgid "" "The primary must evaluate to an object that supports subscription. An object " "may support subscription through defining one or both of :meth:`~object." @@ -887,20 +887,20 @@ msgid "" "called instead of ``__getitem__``, see :ref:`classgetitem-versus-getitem`." msgstr "" -#: ../../reference/expressions.rst:851 +#: ../../reference/expressions.rst:852 msgid "" "If the expression list contains at least one comma, it will evaluate to a :" "class:`tuple` containing the items of the expression list. Otherwise, the " "expression list will evaluate to the value of the list's sole member." msgstr "" -#: ../../reference/expressions.rst:855 +#: ../../reference/expressions.rst:856 msgid "" "For built-in objects, there are two types of objects that support " "subscription via :meth:`~object.__getitem__`:" msgstr "" -#: ../../reference/expressions.rst:858 +#: ../../reference/expressions.rst:859 msgid "" "Mappings. If the primary is a :term:`mapping`, the expression list must " "evaluate to an object whose value is one of the keys of the mapping, and the " @@ -908,7 +908,7 @@ msgid "" "An example of a builtin mapping class is the :class:`dict` class." msgstr "" -#: ../../reference/expressions.rst:862 +#: ../../reference/expressions.rst:863 msgid "" "Sequences. If the primary is a :term:`sequence`, the expression list must " "evaluate to an :class:`int` or a :class:`slice` (as discussed in the " @@ -916,7 +916,7 @@ msgid "" "`str`, :class:`list` and :class:`tuple` classes." msgstr "" -#: ../../reference/expressions.rst:867 +#: ../../reference/expressions.rst:868 msgid "" "The formal syntax makes no special provision for negative indices in :term:" "`sequences `. However, built-in sequences all provide a :meth:" @@ -930,25 +930,25 @@ msgid "" "support." msgstr "" -#: ../../reference/expressions.rst:881 +#: ../../reference/expressions.rst:882 msgid "" "A :class:`string ` is a special kind of sequence whose items are " "*characters*. A character is not a separate data type but a string of " "exactly one character." msgstr "" -#: ../../reference/expressions.rst:889 +#: ../../reference/expressions.rst:890 msgid "Slicings" msgstr "" -#: ../../reference/expressions.rst:903 +#: ../../reference/expressions.rst:904 msgid "" "A slicing selects a range of items in a sequence object (e.g., a string, " "tuple or list). Slicings may be used as expressions or as targets in " "assignment or :keyword:`del` statements. The syntax for a slicing:" msgstr "" -#: ../../reference/expressions.rst:916 +#: ../../reference/expressions.rst:917 msgid "" "There is ambiguity in the formal syntax here: anything that looks like an " "expression list also looks like a slice list, so any subscription can be " @@ -958,7 +958,7 @@ msgid "" "the case if the slice list contains no proper slice)." msgstr "" -#: ../../reference/expressions.rst:928 +#: ../../reference/expressions.rst:929 msgid "" "The semantics for a slicing are as follows. The primary is indexed (using " "the same :meth:`__getitem__` method as normal subscription) with a key that " @@ -973,23 +973,23 @@ msgid "" "expressions." msgstr "" -#: ../../reference/expressions.rst:952 +#: ../../reference/expressions.rst:953 msgid "Calls" msgstr "" -#: ../../reference/expressions.rst:954 +#: ../../reference/expressions.rst:955 msgid "" "A call calls a callable object (e.g., a :term:`function`) with a possibly " "empty series of :term:`arguments `:" msgstr "" -#: ../../reference/expressions.rst:971 +#: ../../reference/expressions.rst:972 msgid "" "An optional trailing comma may be present after the positional and keyword " "arguments but does not affect the semantics." msgstr "" -#: ../../reference/expressions.rst:977 +#: ../../reference/expressions.rst:978 msgid "" "The primary must evaluate to a callable object (user-defined functions, " "built-in functions, methods of built-in objects, class objects, methods of " @@ -999,7 +999,7 @@ msgid "" "formal :term:`parameter` lists." msgstr "" -#: ../../reference/expressions.rst:985 +#: ../../reference/expressions.rst:986 msgid "" "If keyword arguments are present, they are first converted to positional " "arguments, as follows. First, a list of unfilled slots is created for the " @@ -1020,7 +1020,7 @@ msgid "" "filled slots is used as the argument list for the call." msgstr "" -#: ../../reference/expressions.rst:1005 +#: ../../reference/expressions.rst:1006 msgid "" "An implementation may provide built-in functions whose positional parameters " "do not have names, even if they are 'named' for the purpose of " @@ -1029,7 +1029,7 @@ msgid "" "`PyArg_ParseTuple` to parse their arguments." msgstr "" -#: ../../reference/expressions.rst:1011 +#: ../../reference/expressions.rst:1012 msgid "" "If there are more positional arguments than there are formal parameter " "slots, a :exc:`TypeError` exception is raised, unless a formal parameter " @@ -1038,7 +1038,7 @@ msgid "" "empty tuple if there were no excess positional arguments)." msgstr "" -#: ../../reference/expressions.rst:1017 +#: ../../reference/expressions.rst:1018 msgid "" "If any keyword argument does not correspond to a formal parameter name, a :" "exc:`TypeError` exception is raised, unless a formal parameter using the " @@ -1048,7 +1048,7 @@ msgid "" "(new) empty dictionary if there were no excess keyword arguments." msgstr "" -#: ../../reference/expressions.rst:1028 +#: ../../reference/expressions.rst:1029 msgid "" "If the syntax ``*expression`` appears in the function call, ``expression`` " "must evaluate to an :term:`iterable`. Elements from these iterables are " @@ -1058,20 +1058,20 @@ msgid "" "*y1*, ..., *yM*, *x3*, *x4*." msgstr "" -#: ../../reference/expressions.rst:1035 +#: ../../reference/expressions.rst:1036 msgid "" "A consequence of this is that although the ``*expression`` syntax may appear " "*after* explicit keyword arguments, it is processed *before* the keyword " "arguments (and any ``**expression`` arguments -- see below). So::" msgstr "" -#: ../../reference/expressions.rst:1051 +#: ../../reference/expressions.rst:1052 msgid "" "It is unusual for both keyword arguments and the ``*expression`` syntax to " "be used in the same call, so in practice this confusion does not often arise." msgstr "" -#: ../../reference/expressions.rst:1057 +#: ../../reference/expressions.rst:1058 msgid "" "If the syntax ``**expression`` appears in the function call, ``expression`` " "must evaluate to a :term:`mapping`, the contents of which are treated as " @@ -1080,7 +1080,7 @@ msgid "" "a :exc:`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1063 +#: ../../reference/expressions.rst:1064 msgid "" "When ``**expression`` is used, each key in this mapping must be a string. " "Each value from the mapping is assigned to the first formal parameter " @@ -1092,35 +1092,35 @@ msgid "" "is raised." msgstr "" -#: ../../reference/expressions.rst:1073 +#: ../../reference/expressions.rst:1074 msgid "" "Formal parameters using the syntax ``*identifier`` or ``**identifier`` " "cannot be used as positional argument slots or as keyword argument names." msgstr "" -#: ../../reference/expressions.rst:1076 +#: ../../reference/expressions.rst:1077 msgid "" "Function calls accept any number of ``*`` and ``**`` unpackings, positional " "arguments may follow iterable unpackings (``*``), and keyword arguments may " "follow dictionary unpackings (``**``). Originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1082 +#: ../../reference/expressions.rst:1083 msgid "" "A call always returns some value, possibly ``None``, unless it raises an " "exception. How this value is computed depends on the type of the callable " "object." msgstr "" -#: ../../reference/expressions.rst:1086 +#: ../../reference/expressions.rst:1087 msgid "If it is---" msgstr "" -#: ../../reference/expressions.rst:1099 +#: ../../reference/expressions.rst:1100 msgid "a user-defined function:" msgstr "" -#: ../../reference/expressions.rst:1095 +#: ../../reference/expressions.rst:1096 msgid "" "The code block for the function is executed, passing it the argument list. " "The first thing the code block will do is bind the formal parameters to the " @@ -1129,73 +1129,73 @@ msgid "" "value of the function call." msgstr "" -#: ../../reference/expressions.rst:1113 +#: ../../reference/expressions.rst:1114 msgid "a built-in function or method:" msgstr "" -#: ../../reference/expressions.rst:1112 +#: ../../reference/expressions.rst:1113 msgid "" "The result is up to the interpreter; see :ref:`built-in-funcs` for the " "descriptions of built-in functions and methods." msgstr "" -#: ../../reference/expressions.rst:1120 +#: ../../reference/expressions.rst:1121 msgid "a class object:" msgstr "" -#: ../../reference/expressions.rst:1120 +#: ../../reference/expressions.rst:1121 msgid "A new instance of that class is returned." msgstr "" -#: ../../reference/expressions.rst:1130 +#: ../../reference/expressions.rst:1131 msgid "a class instance method:" msgstr "" -#: ../../reference/expressions.rst:1128 +#: ../../reference/expressions.rst:1129 msgid "" "The corresponding user-defined function is called, with an argument list " "that is one longer than the argument list of the call: the instance becomes " "the first argument." msgstr "" -#: ../../reference/expressions.rst:1139 +#: ../../reference/expressions.rst:1140 msgid "a class instance:" msgstr "" -#: ../../reference/expressions.rst:1137 +#: ../../reference/expressions.rst:1138 msgid "" "The class must define a :meth:`__call__` method; the effect is then the same " "as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1145 ../../reference/expressions.rst:1926 +#: ../../reference/expressions.rst:1146 ../../reference/expressions.rst:1927 msgid "Await expression" msgstr "" -#: ../../reference/expressions.rst:1147 +#: ../../reference/expressions.rst:1148 msgid "" "Suspend the execution of :term:`coroutine` on an :term:`awaitable` object. " "Can only be used inside a :term:`coroutine function`." msgstr "" -#: ../../reference/expressions.rst:1159 +#: ../../reference/expressions.rst:1160 msgid "The power operator" msgstr "" -#: ../../reference/expressions.rst:1165 +#: ../../reference/expressions.rst:1166 msgid "" "The power operator binds more tightly than unary operators on its left; it " "binds less tightly than unary operators on its right. The syntax is:" msgstr "" -#: ../../reference/expressions.rst:1171 +#: ../../reference/expressions.rst:1172 msgid "" "Thus, in an unparenthesized sequence of power and unary operators, the " "operators are evaluated from right to left (this does not constrain the " "evaluation order for the operands): ``-1**2`` results in ``-1``." msgstr "" -#: ../../reference/expressions.rst:1175 +#: ../../reference/expressions.rst:1176 msgid "" "The power operator has the same semantics as the built-in :func:`pow` " "function, when called with two arguments: it yields its left argument raised " @@ -1203,7 +1203,7 @@ msgid "" "converted to a common type, and the result is of that type." msgstr "" -#: ../../reference/expressions.rst:1180 +#: ../../reference/expressions.rst:1181 msgid "" "For int operands, the result has the same type as the operands unless the " "second argument is negative; in that case, all arguments are converted to " @@ -1211,40 +1211,40 @@ msgid "" "``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../reference/expressions.rst:1185 +#: ../../reference/expressions.rst:1186 msgid "" "Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`. " "Raising a negative number to a fractional power results in a :class:" "`complex` number. (In earlier versions it raised a :exc:`ValueError`.)" msgstr "" -#: ../../reference/expressions.rst:1189 +#: ../../reference/expressions.rst:1190 msgid "" "This operation can be customized using the special :meth:`__pow__` method." msgstr "" -#: ../../reference/expressions.rst:1194 +#: ../../reference/expressions.rst:1195 msgid "Unary arithmetic and bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1200 +#: ../../reference/expressions.rst:1201 msgid "All unary arithmetic and bitwise operations have the same priority:" msgstr "" -#: ../../reference/expressions.rst:1211 +#: ../../reference/expressions.rst:1212 msgid "" "The unary ``-`` (minus) operator yields the negation of its numeric " "argument; the operation can be overridden with the :meth:`__neg__` special " "method." msgstr "" -#: ../../reference/expressions.rst:1219 +#: ../../reference/expressions.rst:1220 msgid "" "The unary ``+`` (plus) operator yields its numeric argument unchanged; the " "operation can be overridden with the :meth:`__pos__` special method." msgstr "" -#: ../../reference/expressions.rst:1226 +#: ../../reference/expressions.rst:1227 msgid "" "The unary ``~`` (invert) operator yields the bitwise inversion of its " "integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. " @@ -1252,17 +1252,17 @@ msgid "" "meth:`__invert__` special method." msgstr "" -#: ../../reference/expressions.rst:1235 +#: ../../reference/expressions.rst:1236 msgid "" "In all three cases, if the argument does not have the proper type, a :exc:" "`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1242 +#: ../../reference/expressions.rst:1243 msgid "Binary arithmetic operations" msgstr "" -#: ../../reference/expressions.rst:1246 +#: ../../reference/expressions.rst:1247 msgid "" "The binary arithmetic operations have the conventional priority levels. " "Note that some of these operations also apply to certain non-numeric types. " @@ -1270,7 +1270,7 @@ msgid "" "multiplicative operators and one for additive operators:" msgstr "" -#: ../../reference/expressions.rst:1261 +#: ../../reference/expressions.rst:1262 msgid "" "The ``*`` (multiplication) operator yields the product of its arguments. " "The arguments must either both be numbers, or one argument must be an " @@ -1280,19 +1280,19 @@ msgid "" "an empty sequence." msgstr "" -#: ../../reference/expressions.rst:1267 +#: ../../reference/expressions.rst:1268 msgid "" "This operation can be customized using the special :meth:`__mul__` and :meth:" "`__rmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1274 +#: ../../reference/expressions.rst:1275 msgid "" "The ``@`` (at) operator is intended to be used for matrix multiplication. " "No builtin Python types implement this operator." msgstr "" -#: ../../reference/expressions.rst:1285 +#: ../../reference/expressions.rst:1286 msgid "" "The ``/`` (division) and ``//`` (floor division) operators yield the " "quotient of their arguments. The numeric arguments are first converted to a " @@ -1302,13 +1302,13 @@ msgid "" "the :exc:`ZeroDivisionError` exception." msgstr "" -#: ../../reference/expressions.rst:1292 +#: ../../reference/expressions.rst:1293 msgid "" "This operation can be customized using the special :meth:`__truediv__` and :" "meth:`__floordiv__` methods." msgstr "" -#: ../../reference/expressions.rst:1299 +#: ../../reference/expressions.rst:1300 msgid "" "The ``%`` (modulo) operator yields the remainder from the division of the " "first argument by the second. The numeric arguments are first converted to " @@ -1320,7 +1320,7 @@ msgid "" "absolute value of the second operand [#]_." msgstr "" -#: ../../reference/expressions.rst:1308 +#: ../../reference/expressions.rst:1309 msgid "" "The floor division and modulo operators are connected by the following " "identity: ``x == (x//y)*y + (x%y)``. Floor division and modulo are also " @@ -1328,7 +1328,7 @@ msgid "" "y, x%y)``. [#]_." msgstr "" -#: ../../reference/expressions.rst:1313 +#: ../../reference/expressions.rst:1314 msgid "" "In addition to performing the modulo operation on numbers, the ``%`` " "operator is also overloaded by string objects to perform old-style string " @@ -1337,20 +1337,20 @@ msgid "" "formatting`." msgstr "" -#: ../../reference/expressions.rst:1318 +#: ../../reference/expressions.rst:1319 msgid "" "The *modulo* operation can be customized using the special :meth:`__mod__` " "method." msgstr "" -#: ../../reference/expressions.rst:1320 +#: ../../reference/expressions.rst:1321 msgid "" "The floor division operator, the modulo operator, and the :func:`divmod` " "function are not defined for complex numbers. Instead, convert to a " "floating point number using the :func:`abs` function if appropriate." msgstr "" -#: ../../reference/expressions.rst:1329 +#: ../../reference/expressions.rst:1330 msgid "" "The ``+`` (addition) operator yields the sum of its arguments. The " "arguments must either both be numbers or both be sequences of the same " @@ -1358,84 +1358,84 @@ msgid "" "then added together. In the latter case, the sequences are concatenated." msgstr "" -#: ../../reference/expressions.rst:1334 +#: ../../reference/expressions.rst:1335 msgid "" "This operation can be customized using the special :meth:`__add__` and :meth:" "`__radd__` methods." msgstr "" -#: ../../reference/expressions.rst:1342 +#: ../../reference/expressions.rst:1343 msgid "" "The ``-`` (subtraction) operator yields the difference of its arguments. " "The numeric arguments are first converted to a common type." msgstr "" -#: ../../reference/expressions.rst:1345 +#: ../../reference/expressions.rst:1346 msgid "" "This operation can be customized using the special :meth:`__sub__` method." msgstr "" -#: ../../reference/expressions.rst:1351 +#: ../../reference/expressions.rst:1352 msgid "Shifting operations" msgstr "" -#: ../../reference/expressions.rst:1358 +#: ../../reference/expressions.rst:1359 msgid "" "The shifting operations have lower priority than the arithmetic operations:" msgstr "" -#: ../../reference/expressions.rst:1363 +#: ../../reference/expressions.rst:1364 msgid "" "These operators accept integers as arguments. They shift the first argument " "to the left or right by the number of bits given by the second argument." msgstr "" -#: ../../reference/expressions.rst:1366 +#: ../../reference/expressions.rst:1367 msgid "" "This operation can be customized using the special :meth:`__lshift__` and :" "meth:`__rshift__` methods." msgstr "" -#: ../../reference/expressions.rst:1371 +#: ../../reference/expressions.rst:1372 msgid "" "A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A " "left shift by *n* bits is defined as multiplication with ``pow(2,n)``." msgstr "" -#: ../../reference/expressions.rst:1378 +#: ../../reference/expressions.rst:1379 msgid "Binary bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1382 +#: ../../reference/expressions.rst:1383 msgid "Each of the three bitwise operations has a different priority level:" msgstr "" -#: ../../reference/expressions.rst:1393 +#: ../../reference/expressions.rst:1394 msgid "" "The ``&`` operator yields the bitwise AND of its arguments, which must be " "integers or one of them must be a custom object overriding :meth:`__and__` " "or :meth:`__rand__` special methods." msgstr "" -#: ../../reference/expressions.rst:1402 +#: ../../reference/expressions.rst:1403 msgid "" "The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, " "which must be integers or one of them must be a custom object overriding :" "meth:`__xor__` or :meth:`__rxor__` special methods." msgstr "" -#: ../../reference/expressions.rst:1411 +#: ../../reference/expressions.rst:1412 msgid "" "The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which " "must be integers or one of them must be a custom object overriding :meth:" "`__or__` or :meth:`__ror__` special methods." msgstr "" -#: ../../reference/expressions.rst:1419 +#: ../../reference/expressions.rst:1420 msgid "Comparisons" msgstr "" -#: ../../reference/expressions.rst:1431 +#: ../../reference/expressions.rst:1432 msgid "" "Unlike C, all comparison operations in Python have the same priority, which " "is lower than that of any arithmetic, shifting or bitwise operation. Also " @@ -1443,14 +1443,14 @@ msgid "" "conventional in mathematics:" msgstr "" -#: ../../reference/expressions.rst:1441 +#: ../../reference/expressions.rst:1442 msgid "" "Comparisons yield boolean values: ``True`` or ``False``. Custom :dfn:`rich " "comparison methods` may return non-boolean values. In this case Python will " "call :func:`bool` on such value in boolean contexts." msgstr "" -#: ../../reference/expressions.rst:1447 +#: ../../reference/expressions.rst:1448 msgid "" "Comparisons can be chained arbitrarily, e.g., ``x < y <= z`` is equivalent " "to ``x < y and y <= z``, except that ``y`` is evaluated only once (but in " @@ -1458,7 +1458,7 @@ msgid "" "false)." msgstr "" -#: ../../reference/expressions.rst:1451 +#: ../../reference/expressions.rst:1452 msgid "" "Formally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*, " "*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y opN " @@ -1466,24 +1466,24 @@ msgid "" "each expression is evaluated at most once." msgstr "" -#: ../../reference/expressions.rst:1456 +#: ../../reference/expressions.rst:1457 msgid "" "Note that ``a op1 b op2 c`` doesn't imply any kind of comparison between *a* " "and *c*, so that, e.g., ``x < y > z`` is perfectly legal (though perhaps not " "pretty)." msgstr "" -#: ../../reference/expressions.rst:1463 +#: ../../reference/expressions.rst:1464 msgid "Value comparisons" msgstr "" -#: ../../reference/expressions.rst:1465 +#: ../../reference/expressions.rst:1466 msgid "" "The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the " "values of two objects. The objects do not need to have the same type." msgstr "" -#: ../../reference/expressions.rst:1468 +#: ../../reference/expressions.rst:1469 msgid "" "Chapter :ref:`objects` states that objects have a value (in addition to type " "and identity). The value of an object is a rather abstract notion in " @@ -1495,7 +1495,7 @@ msgid "" "indirectly, by means of their comparison implementation." msgstr "" -#: ../../reference/expressions.rst:1477 +#: ../../reference/expressions.rst:1478 msgid "" "Because all types are (direct or indirect) subtypes of :class:`object`, they " "inherit the default comparison behavior from :class:`object`. Types can " @@ -1503,7 +1503,7 @@ msgid "" "methods` like :meth:`__lt__`, described in :ref:`customization`." msgstr "" -#: ../../reference/expressions.rst:1483 +#: ../../reference/expressions.rst:1484 msgid "" "The default behavior for equality comparison (``==`` and ``!=``) is based on " "the identity of the objects. Hence, equality comparison of instances with " @@ -1513,14 +1513,14 @@ msgid "" "``x is y`` implies ``x == y``)." msgstr "" -#: ../../reference/expressions.rst:1490 +#: ../../reference/expressions.rst:1491 msgid "" "A default order comparison (``<``, ``>``, ``<=``, and ``>=``) is not " "provided; an attempt raises :exc:`TypeError`. A motivation for this default " "behavior is the lack of a similar invariant as for equality." msgstr "" -#: ../../reference/expressions.rst:1494 +#: ../../reference/expressions.rst:1495 msgid "" "The behavior of the default equality comparison, that instances with " "different identities are always unequal, may be in contrast to what types " @@ -1529,13 +1529,13 @@ msgid "" "in fact, a number of built-in types have done that." msgstr "" -#: ../../reference/expressions.rst:1500 +#: ../../reference/expressions.rst:1501 msgid "" "The following list describes the comparison behavior of the most important " "built-in types." msgstr "" -#: ../../reference/expressions.rst:1503 +#: ../../reference/expressions.rst:1504 msgid "" "Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard " "library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can " @@ -1545,7 +1545,7 @@ msgid "" "of precision." msgstr "" -#: ../../reference/expressions.rst:1510 +#: ../../reference/expressions.rst:1511 msgid "" "The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are " "special. Any ordered comparison of a number to a not-a-number value is " @@ -1555,32 +1555,32 @@ msgid "" "is compliant with IEEE 754." msgstr "" -#: ../../reference/expressions.rst:1517 +#: ../../reference/expressions.rst:1518 msgid "" "``None`` and ``NotImplemented`` are singletons. :PEP:`8` advises that " "comparisons for singletons should always be done with ``is`` or ``is not``, " "never the equality operators." msgstr "" -#: ../../reference/expressions.rst:1521 +#: ../../reference/expressions.rst:1522 msgid "" "Binary sequences (instances of :class:`bytes` or :class:`bytearray`) can be " "compared within and across their types. They compare lexicographically " "using the numeric values of their elements." msgstr "" -#: ../../reference/expressions.rst:1525 +#: ../../reference/expressions.rst:1526 msgid "" "Strings (instances of :class:`str`) compare lexicographically using the " "numerical Unicode code points (the result of the built-in function :func:" "`ord`) of their characters. [#]_" msgstr "" -#: ../../reference/expressions.rst:1529 +#: ../../reference/expressions.rst:1530 msgid "Strings and binary sequences cannot be directly compared." msgstr "" -#: ../../reference/expressions.rst:1531 +#: ../../reference/expressions.rst:1532 msgid "" "Sequences (instances of :class:`tuple`, :class:`list`, or :class:`range`) " "can be compared only within each of their types, with the restriction that " @@ -1589,7 +1589,7 @@ msgid "" "raises :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1537 +#: ../../reference/expressions.rst:1538 msgid "" "Sequences compare lexicographically using comparison of corresponding " "elements. The built-in containers typically assume identical objects are " @@ -1597,19 +1597,19 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" -#: ../../reference/expressions.rst:1542 +#: ../../reference/expressions.rst:1543 msgid "" "Lexicographical comparison between built-in collections works as follows:" msgstr "" -#: ../../reference/expressions.rst:1544 +#: ../../reference/expressions.rst:1545 msgid "" "For two collections to compare equal, they must be of the same type, have " "the same length, and each pair of corresponding elements must compare equal " "(for example, ``[1,2] == (1,2)`` is false because the type is not the same)." msgstr "" -#: ../../reference/expressions.rst:1549 +#: ../../reference/expressions.rst:1550 msgid "" "Collections that support order comparison are ordered the same as their " "first unequal elements (for example, ``[1,2,x] <= [1,2,y]`` has the same " @@ -1618,25 +1618,25 @@ msgid "" "true)." msgstr "" -#: ../../reference/expressions.rst:1555 +#: ../../reference/expressions.rst:1556 msgid "" "Mappings (instances of :class:`dict`) compare equal if and only if they have " "equal ``(key, value)`` pairs. Equality comparison of the keys and values " "enforces reflexivity." msgstr "" -#: ../../reference/expressions.rst:1559 +#: ../../reference/expressions.rst:1560 msgid "" "Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1561 +#: ../../reference/expressions.rst:1562 msgid "" "Sets (instances of :class:`set` or :class:`frozenset`) can be compared " "within and across their types." msgstr "" -#: ../../reference/expressions.rst:1564 +#: ../../reference/expressions.rst:1565 msgid "" "They define order comparison operators to mean subset and superset tests. " "Those relations do not define total orderings (for example, the two sets " @@ -1647,110 +1647,110 @@ msgid "" "sets as inputs)." msgstr "" -#: ../../reference/expressions.rst:1572 +#: ../../reference/expressions.rst:1573 msgid "Comparison of sets enforces reflexivity of its elements." msgstr "" -#: ../../reference/expressions.rst:1574 +#: ../../reference/expressions.rst:1575 msgid "" "Most other built-in types have no comparison methods implemented, so they " "inherit the default comparison behavior." msgstr "" -#: ../../reference/expressions.rst:1577 +#: ../../reference/expressions.rst:1578 msgid "" "User-defined classes that customize their comparison behavior should follow " "some consistency rules, if possible:" msgstr "" -#: ../../reference/expressions.rst:1580 +#: ../../reference/expressions.rst:1581 msgid "" "Equality comparison should be reflexive. In other words, identical objects " "should compare equal:" msgstr "" -#: ../../reference/expressions.rst:1583 +#: ../../reference/expressions.rst:1584 msgid "``x is y`` implies ``x == y``" msgstr "" -#: ../../reference/expressions.rst:1585 +#: ../../reference/expressions.rst:1586 msgid "" "Comparison should be symmetric. In other words, the following expressions " "should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1588 +#: ../../reference/expressions.rst:1589 msgid "``x == y`` and ``y == x``" msgstr "``x == y`` 和 ``y == x``" -#: ../../reference/expressions.rst:1590 +#: ../../reference/expressions.rst:1591 msgid "``x != y`` and ``y != x``" msgstr "``x != y`` 和 ``y != x``" -#: ../../reference/expressions.rst:1592 +#: ../../reference/expressions.rst:1593 msgid "``x < y`` and ``y > x``" msgstr "``x < y`` 和 ``y > x``" -#: ../../reference/expressions.rst:1594 +#: ../../reference/expressions.rst:1595 msgid "``x <= y`` and ``y >= x``" msgstr "``x <= y`` 和 ``y >= x``" -#: ../../reference/expressions.rst:1596 +#: ../../reference/expressions.rst:1597 msgid "" "Comparison should be transitive. The following (non-exhaustive) examples " "illustrate that:" msgstr "" -#: ../../reference/expressions.rst:1599 +#: ../../reference/expressions.rst:1600 msgid "``x > y and y > z`` implies ``x > z``" msgstr "``x > y and y > z`` 暗示了 ``x > z``" -#: ../../reference/expressions.rst:1601 +#: ../../reference/expressions.rst:1602 msgid "``x < y and y <= z`` implies ``x < z``" msgstr "``x < y and y <= z`` 暗示了 ``x < z``" -#: ../../reference/expressions.rst:1603 +#: ../../reference/expressions.rst:1604 msgid "" "Inverse comparison should result in the boolean negation. In other words, " "the following expressions should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1606 +#: ../../reference/expressions.rst:1607 msgid "``x == y`` and ``not x != y``" msgstr "``x == y`` 和 ``not x != y``" -#: ../../reference/expressions.rst:1608 +#: ../../reference/expressions.rst:1609 msgid "``x < y`` and ``not x >= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1610 +#: ../../reference/expressions.rst:1611 msgid "``x > y`` and ``not x <= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1612 +#: ../../reference/expressions.rst:1613 msgid "" "The last two expressions apply to totally ordered collections (e.g. to " "sequences, but not to sets or mappings). See also the :func:`~functools." "total_ordering` decorator." msgstr "" -#: ../../reference/expressions.rst:1616 +#: ../../reference/expressions.rst:1617 msgid "" "The :func:`hash` result should be consistent with equality. Objects that are " "equal should either have the same hash value, or be marked as unhashable." msgstr "" -#: ../../reference/expressions.rst:1620 +#: ../../reference/expressions.rst:1621 msgid "" "Python does not enforce these consistency rules. In fact, the not-a-number " "values are an example for not following these rules." msgstr "" -#: ../../reference/expressions.rst:1629 +#: ../../reference/expressions.rst:1630 msgid "Membership test operations" msgstr "" -#: ../../reference/expressions.rst:1631 +#: ../../reference/expressions.rst:1632 msgid "" "The operators :keyword:`in` and :keyword:`not in` test for membership. ``x " "in s`` evaluates to ``True`` if *x* is a member of *s*, and ``False`` " @@ -1761,7 +1761,7 @@ msgid "" "expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``." msgstr "" -#: ../../reference/expressions.rst:1639 +#: ../../reference/expressions.rst:1640 msgid "" "For the string and bytes types, ``x in y`` is ``True`` if and only if *x* is " "a substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty " @@ -1769,14 +1769,14 @@ msgid "" "``\"\" in \"abc\"`` will return ``True``." msgstr "" -#: ../../reference/expressions.rst:1644 +#: ../../reference/expressions.rst:1645 msgid "" "For user-defined classes which define the :meth:`__contains__` method, ``x " "in y`` returns ``True`` if ``y.__contains__(x)`` returns a true value, and " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1648 +#: ../../reference/expressions.rst:1649 msgid "" "For user-defined classes which do not define :meth:`__contains__` but do " "define :meth:`__iter__`, ``x in y`` is ``True`` if some value ``z``, for " @@ -1785,7 +1785,7 @@ msgid "" "as if :keyword:`in` raised that exception." msgstr "" -#: ../../reference/expressions.rst:1654 +#: ../../reference/expressions.rst:1655 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" "`__getitem__`, ``x in y`` is ``True`` if and only if there is a non-negative " @@ -1794,17 +1794,17 @@ msgid "" "raised, it is as if :keyword:`in` raised that exception)." msgstr "" -#: ../../reference/expressions.rst:1666 +#: ../../reference/expressions.rst:1667 msgid "" "The operator :keyword:`not in` is defined to have the inverse truth value " "of :keyword:`in`." msgstr "" -#: ../../reference/expressions.rst:1679 +#: ../../reference/expressions.rst:1680 msgid "Identity comparisons" msgstr "" -#: ../../reference/expressions.rst:1681 +#: ../../reference/expressions.rst:1682 msgid "" "The operators :keyword:`is` and :keyword:`is not` test for an object's " "identity: ``x is y`` is true if and only if *x* and *y* are the same " @@ -1812,11 +1812,11 @@ msgid "" "``x is not y`` yields the inverse truth value. [#]_" msgstr "" -#: ../../reference/expressions.rst:1693 +#: ../../reference/expressions.rst:1694 msgid "Boolean operations" msgstr "" -#: ../../reference/expressions.rst:1704 +#: ../../reference/expressions.rst:1705 msgid "" "In the context of Boolean operations, and also when expressions are used by " "control flow statements, the following values are interpreted as false: " @@ -1827,25 +1827,25 @@ msgid "" "method." msgstr "" -#: ../../reference/expressions.rst:1713 +#: ../../reference/expressions.rst:1714 msgid "" "The operator :keyword:`not` yields ``True`` if its argument is false, " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1718 +#: ../../reference/expressions.rst:1719 msgid "" "The expression ``x and y`` first evaluates *x*; if *x* is false, its value " "is returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1723 +#: ../../reference/expressions.rst:1724 msgid "" "The expression ``x or y`` first evaluates *x*; if *x* is true, its value is " "returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1726 +#: ../../reference/expressions.rst:1727 msgid "" "Note that neither :keyword:`and` nor :keyword:`or` restrict the value and " "type they return to ``False`` and ``True``, but rather return the last " @@ -1856,11 +1856,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1742 +#: ../../reference/expressions.rst:1743 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1747 +#: ../../reference/expressions.rst:1748 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -1868,15 +1868,15 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1752 +#: ../../reference/expressions.rst:1753 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1759 +#: ../../reference/expressions.rst:1760 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1766 +#: ../../reference/expressions.rst:1767 msgid "" "Assignment expressions must be surrounded by parentheses when used as sub-" "expressions in slicing, conditional, lambda, keyword-argument, and " @@ -1885,36 +1885,36 @@ msgid "" "including in ``if`` and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1773 +#: ../../reference/expressions.rst:1774 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1780 +#: ../../reference/expressions.rst:1781 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1792 +#: ../../reference/expressions.rst:1793 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1795 +#: ../../reference/expressions.rst:1796 msgid "" "The expression ``x if C else y`` first evaluates the condition, *C* rather " "than *x*. If *C* is true, *x* is evaluated and its value is returned; " "otherwise, *y* is evaluated and its value is returned." msgstr "" -#: ../../reference/expressions.rst:1799 +#: ../../reference/expressions.rst:1800 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1806 +#: ../../reference/expressions.rst:1807 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1817 +#: ../../reference/expressions.rst:1818 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -1922,25 +1922,25 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1826 +#: ../../reference/expressions.rst:1827 msgid "" "See section :ref:`function` for the syntax of parameter lists. Note that " "functions created with lambda expressions cannot contain statements or " "annotations." msgstr "" -#: ../../reference/expressions.rst:1834 +#: ../../reference/expressions.rst:1835 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1848 +#: ../../reference/expressions.rst:1849 msgid "" "Except when part of a list or set display, an expression list containing at " "least one comma yields a tuple. The length of the tuple is the number of " "expressions in the list. The expressions are evaluated from left to right." msgstr "" -#: ../../reference/expressions.rst:1857 +#: ../../reference/expressions.rst:1858 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -1948,12 +1948,12 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1862 +#: ../../reference/expressions.rst:1863 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1867 +#: ../../reference/expressions.rst:1868 msgid "" "The trailing comma is required only to create a single tuple (a.k.a. a " "*singleton*); it is optional in all other cases. A single expression " @@ -1962,28 +1962,28 @@ msgid "" "parentheses: ``()``.)" msgstr "" -#: ../../reference/expressions.rst:1877 +#: ../../reference/expressions.rst:1878 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1881 +#: ../../reference/expressions.rst:1882 msgid "" "Python evaluates expressions from left to right. Notice that while " "evaluating an assignment, the right-hand side is evaluated before the left-" "hand side." msgstr "" -#: ../../reference/expressions.rst:1884 +#: ../../reference/expressions.rst:1885 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1898 +#: ../../reference/expressions.rst:1899 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1903 +#: ../../reference/expressions.rst:1904 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -1993,176 +1993,176 @@ msgid "" "group from right to left)." msgstr "" -#: ../../reference/expressions.rst:1909 +#: ../../reference/expressions.rst:1910 msgid "" "Note that comparisons, membership tests, and identity tests, all have the " "same precedence and have a left-to-right chaining feature as described in " "the :ref:`comparisons` section." msgstr "" -#: ../../reference/expressions.rst:1915 +#: ../../reference/expressions.rst:1916 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1915 +#: ../../reference/expressions.rst:1916 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1917 +#: ../../reference/expressions.rst:1918 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1919 +#: ../../reference/expressions.rst:1920 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1917 +#: ../../reference/expressions.rst:1918 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:1923 +#: ../../reference/expressions.rst:1924 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:1923 +#: ../../reference/expressions.rst:1924 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:1926 +#: ../../reference/expressions.rst:1927 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:1928 +#: ../../reference/expressions.rst:1929 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:1928 +#: ../../reference/expressions.rst:1929 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:1930 +#: ../../reference/expressions.rst:1931 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:1930 +#: ../../reference/expressions.rst:1931 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:1932 +#: ../../reference/expressions.rst:1933 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:1932 +#: ../../reference/expressions.rst:1933 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:1936 +#: ../../reference/expressions.rst:1937 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:1936 +#: ../../reference/expressions.rst:1937 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:1938 +#: ../../reference/expressions.rst:1939 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:1938 +#: ../../reference/expressions.rst:1939 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:1940 +#: ../../reference/expressions.rst:1941 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:1940 +#: ../../reference/expressions.rst:1941 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:1942 +#: ../../reference/expressions.rst:1943 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:1942 +#: ../../reference/expressions.rst:1943 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:1944 +#: ../../reference/expressions.rst:1945 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:1944 +#: ../../reference/expressions.rst:1945 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:1946 +#: ../../reference/expressions.rst:1947 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:1946 +#: ../../reference/expressions.rst:1947 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:1950 +#: ../../reference/expressions.rst:1951 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:1950 +#: ../../reference/expressions.rst:1951 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:1952 +#: ../../reference/expressions.rst:1953 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:1952 +#: ../../reference/expressions.rst:1953 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:1954 +#: ../../reference/expressions.rst:1955 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:1954 +#: ../../reference/expressions.rst:1955 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:1956 +#: ../../reference/expressions.rst:1957 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:1956 +#: ../../reference/expressions.rst:1957 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:1959 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:1959 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:1960 +#: ../../reference/expressions.rst:1961 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:1960 +#: ../../reference/expressions.rst:1961 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:1965 +#: ../../reference/expressions.rst:1966 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:1966 +#: ../../reference/expressions.rst:1967 msgid "" "While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be " "true numerically due to roundoff. For example, and assuming a platform on " @@ -2174,7 +2174,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:1975 +#: ../../reference/expressions.rst:1976 msgid "" "If x is very close to an exact integer multiple of y, it's possible for ``x//" "y`` to be one larger than ``(x-x%y)//y`` due to rounding. In such cases, " @@ -2182,7 +2182,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:1980 +#: ../../reference/expressions.rst:1981 msgid "" "The Unicode standard distinguishes between :dfn:`code points` (e.g. U+0041) " "and :dfn:`abstract characters` (e.g. \"LATIN CAPITAL LETTER A\"). While most " @@ -2196,7 +2196,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:1991 +#: ../../reference/expressions.rst:1992 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2204,13 +2204,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:1996 +#: ../../reference/expressions.rst:1997 msgid "" "To compare strings at the level of abstract characters (that is, in a way " "intuitive to humans), use :func:`unicodedata.normalize`." msgstr "" -#: ../../reference/expressions.rst:1999 +#: ../../reference/expressions.rst:2000 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2218,22 +2218,22 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:2004 +#: ../../reference/expressions.rst:2005 msgid "" "The power operator ``**`` binds less tightly than an arithmetic or bitwise " "unary operator on its right, that is, ``2**-1`` is ``0.5``." msgstr "" -#: ../../reference/expressions.rst:2007 +#: ../../reference/expressions.rst:2008 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." msgstr "" #: ../../reference/expressions.rst:8 ../../reference/expressions.rst:362 -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1695 -#: ../../reference/expressions.rst:1782 ../../reference/expressions.rst:1808 -#: ../../reference/expressions.rst:1836 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1696 +#: ../../reference/expressions.rst:1783 ../../reference/expressions.rst:1809 +#: ../../reference/expressions.rst:1837 #, fuzzy msgid "expression" msgstr "``(expressions...)``," @@ -2242,8 +2242,8 @@ msgstr "``(expressions...)``," msgid "BNF" msgstr "" -#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1196 -#: ../../reference/expressions.rst:1244 +#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1197 +#: ../../reference/expressions.rst:1245 msgid "arithmetic" msgstr "" @@ -2265,9 +2265,9 @@ msgstr "" #: ../../reference/expressions.rst:74 ../../reference/expressions.rst:537 #: ../../reference/expressions.rst:587 ../../reference/expressions.rst:709 -#: ../../reference/expressions.rst:755 ../../reference/expressions.rst:801 -#: ../../reference/expressions.rst:1233 ../../reference/expressions.rst:1279 -#: ../../reference/expressions.rst:1369 +#: ../../reference/expressions.rst:756 ../../reference/expressions.rst:802 +#: ../../reference/expressions.rst:1234 ../../reference/expressions.rst:1280 +#: ../../reference/expressions.rst:1370 #, fuzzy msgid "exception" msgstr "描述" @@ -2308,11 +2308,11 @@ msgstr "" #: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 #: ../../reference/expressions.rst:341 ../../reference/expressions.rst:362 #: ../../reference/expressions.rst:525 ../../reference/expressions.rst:699 -#: ../../reference/expressions.rst:801 ../../reference/expressions.rst:824 -#: ../../reference/expressions.rst:897 ../../reference/expressions.rst:941 -#: ../../reference/expressions.rst:1089 ../../reference/expressions.rst:1102 -#: ../../reference/expressions.rst:1116 ../../reference/expressions.rst:1123 -#: ../../reference/expressions.rst:1660 ../../reference/expressions.rst:1846 +#: ../../reference/expressions.rst:802 ../../reference/expressions.rst:825 +#: ../../reference/expressions.rst:898 ../../reference/expressions.rst:942 +#: ../../reference/expressions.rst:1090 ../../reference/expressions.rst:1103 +#: ../../reference/expressions.rst:1117 ../../reference/expressions.rst:1124 +#: ../../reference/expressions.rst:1661 ../../reference/expressions.rst:1847 msgid "object" msgstr "" @@ -2321,7 +2321,7 @@ msgid "parenthesized form" msgstr "" #: ../../reference/expressions.rst:133 ../../reference/expressions.rst:362 -#: ../../reference/expressions.rst:941 +#: ../../reference/expressions.rst:942 msgid "() (parentheses)" msgstr "" @@ -2333,19 +2333,19 @@ msgstr "" msgid "empty" msgstr "" -#: ../../reference/expressions.rst:146 ../../reference/expressions.rst:824 -#: ../../reference/expressions.rst:897 ../../reference/expressions.rst:1846 +#: ../../reference/expressions.rst:146 ../../reference/expressions.rst:825 +#: ../../reference/expressions.rst:898 ../../reference/expressions.rst:1847 msgid "tuple" msgstr "" -#: ../../reference/expressions.rst:152 ../../reference/expressions.rst:1865 +#: ../../reference/expressions.rst:152 ../../reference/expressions.rst:1866 msgid "comma" msgstr "" #: ../../reference/expressions.rst:152 ../../reference/expressions.rst:244 #: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 -#: ../../reference/expressions.rst:891 ../../reference/expressions.rst:941 -#: ../../reference/expressions.rst:1836 +#: ../../reference/expressions.rst:892 ../../reference/expressions.rst:942 +#: ../../reference/expressions.rst:1837 msgid ", (comma)" msgstr "" @@ -2362,7 +2362,7 @@ msgstr "" msgid "in comprehensions" msgstr "" -#: ../../reference/expressions.rst:177 ../../reference/expressions.rst:1782 +#: ../../reference/expressions.rst:177 ../../reference/expressions.rst:1783 msgid "if" msgstr "" @@ -2370,13 +2370,13 @@ msgstr "" msgid "async for" msgstr "" -#: ../../reference/expressions.rst:212 ../../reference/expressions.rst:1141 +#: ../../reference/expressions.rst:212 ../../reference/expressions.rst:1142 msgid "await" msgstr "" -#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:801 -#: ../../reference/expressions.rst:824 ../../reference/expressions.rst:897 -#: ../../reference/expressions.rst:1836 +#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:802 +#: ../../reference/expressions.rst:825 ../../reference/expressions.rst:898 +#: ../../reference/expressions.rst:1837 msgid "list" msgstr "" @@ -2385,7 +2385,7 @@ msgstr "" msgid "display" msgstr "" -#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:820 +#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:821 msgid "[] (square brackets)" msgstr "" @@ -2394,7 +2394,7 @@ msgid "list expression" msgstr "" #: ../../reference/expressions.rst:244 ../../reference/expressions.rst:270 -#: ../../reference/expressions.rst:1836 +#: ../../reference/expressions.rst:1837 #, fuzzy msgid "expression list" msgstr "``(expressions...)``," @@ -2412,7 +2412,7 @@ msgid "set expression" msgstr "" #: ../../reference/expressions.rst:298 ../../reference/expressions.rst:324 -#: ../../reference/expressions.rst:824 +#: ../../reference/expressions.rst:825 msgid "dictionary" msgstr "" @@ -2432,8 +2432,8 @@ msgstr "" msgid "dictionary expression" msgstr "" -#: ../../reference/expressions.rst:298 ../../reference/expressions.rst:891 -#: ../../reference/expressions.rst:1808 +#: ../../reference/expressions.rst:298 ../../reference/expressions.rst:892 +#: ../../reference/expressions.rst:1809 msgid ": (colon)" msgstr "" @@ -2445,13 +2445,13 @@ msgstr "" msgid "in dictionary displays" msgstr "" -#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1024 -#: ../../reference/expressions.rst:1853 +#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1025 +#: ../../reference/expressions.rst:1854 msgid "unpacking" msgstr "" -#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1054 -#: ../../reference/expressions.rst:1161 +#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1055 +#: ../../reference/expressions.rst:1162 msgid "**" msgstr "" @@ -2468,7 +2468,7 @@ msgstr "" msgid "generator expression" msgstr "" -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1141 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1142 #, fuzzy msgid "keyword" msgstr ":keyword:`or`" @@ -2481,8 +2481,8 @@ msgstr "" msgid "from" msgstr "" -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1089 -#: ../../reference/expressions.rst:1102 ../../reference/expressions.rst:1808 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1090 +#: ../../reference/expressions.rst:1103 ../../reference/expressions.rst:1809 msgid "function" msgstr "" @@ -2498,7 +2498,7 @@ msgstr "" msgid "StopIteration" msgstr "" -#: ../../reference/expressions.rst:587 ../../reference/expressions.rst:755 +#: ../../reference/expressions.rst:587 ../../reference/expressions.rst:756 msgid "GeneratorExit" msgstr "" @@ -2515,485 +2515,485 @@ msgstr "" msgid "StopAsyncIteration" msgstr "" -#: ../../reference/expressions.rst:778 +#: ../../reference/expressions.rst:779 msgid "primary" msgstr "" -#: ../../reference/expressions.rst:792 +#: ../../reference/expressions.rst:793 msgid "attribute" msgstr "" -#: ../../reference/expressions.rst:792 +#: ../../reference/expressions.rst:793 msgid "reference" msgstr "" -#: ../../reference/expressions.rst:792 +#: ../../reference/expressions.rst:793 msgid ". (dot)" msgstr "" -#: ../../reference/expressions.rst:792 +#: ../../reference/expressions.rst:793 msgid "attribute reference" msgstr "" -#: ../../reference/expressions.rst:801 +#: ../../reference/expressions.rst:802 msgid "AttributeError" msgstr "" -#: ../../reference/expressions.rst:801 +#: ../../reference/expressions.rst:802 msgid "module" msgstr "" -#: ../../reference/expressions.rst:820 +#: ../../reference/expressions.rst:821 #, fuzzy msgid "subscription" msgstr "描述" -#: ../../reference/expressions.rst:824 ../../reference/expressions.rst:897 -#: ../../reference/expressions.rst:1660 +#: ../../reference/expressions.rst:825 ../../reference/expressions.rst:898 +#: ../../reference/expressions.rst:1661 msgid "sequence" msgstr "" -#: ../../reference/expressions.rst:824 +#: ../../reference/expressions.rst:825 msgid "mapping" msgstr "" -#: ../../reference/expressions.rst:824 ../../reference/expressions.rst:877 -#: ../../reference/expressions.rst:897 +#: ../../reference/expressions.rst:825 ../../reference/expressions.rst:878 +#: ../../reference/expressions.rst:898 msgid "string" msgstr "" -#: ../../reference/expressions.rst:824 ../../reference/expressions.rst:877 +#: ../../reference/expressions.rst:825 ../../reference/expressions.rst:878 msgid "item" msgstr "" -#: ../../reference/expressions.rst:877 +#: ../../reference/expressions.rst:878 msgid "character" msgstr "" -#: ../../reference/expressions.rst:891 +#: ../../reference/expressions.rst:892 msgid "slicing" msgstr "" -#: ../../reference/expressions.rst:891 +#: ../../reference/expressions.rst:892 msgid "slice" msgstr "" -#: ../../reference/expressions.rst:923 +#: ../../reference/expressions.rst:924 msgid "start (slice object attribute)" msgstr "" -#: ../../reference/expressions.rst:923 +#: ../../reference/expressions.rst:924 msgid "stop (slice object attribute)" msgstr "" -#: ../../reference/expressions.rst:923 +#: ../../reference/expressions.rst:924 msgid "step (slice object attribute)" msgstr "" -#: ../../reference/expressions.rst:941 +#: ../../reference/expressions.rst:942 msgid "callable" msgstr "" -#: ../../reference/expressions.rst:941 ../../reference/expressions.rst:1089 -#: ../../reference/expressions.rst:1102 ../../reference/expressions.rst:1116 -#: ../../reference/expressions.rst:1123 ../../reference/expressions.rst:1133 +#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:1090 +#: ../../reference/expressions.rst:1103 ../../reference/expressions.rst:1117 +#: ../../reference/expressions.rst:1124 ../../reference/expressions.rst:1134 msgid "call" msgstr "" -#: ../../reference/expressions.rst:941 +#: ../../reference/expressions.rst:942 msgid "argument" msgstr "" -#: ../../reference/expressions.rst:941 ../../reference/expressions.rst:974 +#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:975 msgid "call semantics" msgstr "" -#: ../../reference/expressions.rst:941 +#: ../../reference/expressions.rst:942 msgid "argument list" msgstr "" -#: ../../reference/expressions.rst:941 +#: ../../reference/expressions.rst:942 msgid "= (equals)" msgstr "" -#: ../../reference/expressions.rst:941 ../../reference/expressions.rst:1024 -#: ../../reference/expressions.rst:1054 +#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:1025 +#: ../../reference/expressions.rst:1055 msgid "in function calls" msgstr "" -#: ../../reference/expressions.rst:974 +#: ../../reference/expressions.rst:975 msgid "parameter" msgstr "" -#: ../../reference/expressions.rst:1024 ../../reference/expressions.rst:1257 -#: ../../reference/expressions.rst:1853 +#: ../../reference/expressions.rst:1025 ../../reference/expressions.rst:1258 +#: ../../reference/expressions.rst:1854 msgid "* (asterisk)" msgstr "" -#: ../../reference/expressions.rst:1089 +#: ../../reference/expressions.rst:1090 msgid "user-defined" msgstr "" -#: ../../reference/expressions.rst:1089 +#: ../../reference/expressions.rst:1090 msgid "user-defined function" msgstr "" -#: ../../reference/expressions.rst:1102 +#: ../../reference/expressions.rst:1103 msgid "built-in function" msgstr "" -#: ../../reference/expressions.rst:1102 +#: ../../reference/expressions.rst:1103 msgid "method" msgstr "" -#: ../../reference/expressions.rst:1102 +#: ../../reference/expressions.rst:1103 msgid "built-in method" msgstr "" -#: ../../reference/expressions.rst:1116 +#: ../../reference/expressions.rst:1117 msgid "class" msgstr "" -#: ../../reference/expressions.rst:1116 +#: ../../reference/expressions.rst:1117 msgid "class object" msgstr "" -#: ../../reference/expressions.rst:1123 +#: ../../reference/expressions.rst:1124 msgid "class instance" msgstr "" -#: ../../reference/expressions.rst:1123 ../../reference/expressions.rst:1133 +#: ../../reference/expressions.rst:1124 ../../reference/expressions.rst:1134 msgid "instance" msgstr "" -#: ../../reference/expressions.rst:1133 +#: ../../reference/expressions.rst:1134 msgid "__call__() (object method)" msgstr "" -#: ../../reference/expressions.rst:1161 +#: ../../reference/expressions.rst:1162 msgid "power" msgstr "" -#: ../../reference/expressions.rst:1161 ../../reference/expressions.rst:1196 -#: ../../reference/expressions.rst:1244 ../../reference/expressions.rst:1353 -#: ../../reference/expressions.rst:1380 ../../reference/expressions.rst:1695 +#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1197 +#: ../../reference/expressions.rst:1245 ../../reference/expressions.rst:1354 +#: ../../reference/expressions.rst:1381 ../../reference/expressions.rst:1696 #, fuzzy msgid "operation" msgstr "描述" -#: ../../reference/expressions.rst:1161 ../../reference/expressions.rst:1205 -#: ../../reference/expressions.rst:1214 ../../reference/expressions.rst:1222 -#: ../../reference/expressions.rst:1257 ../../reference/expressions.rst:1270 -#: ../../reference/expressions.rst:1279 ../../reference/expressions.rst:1295 -#: ../../reference/expressions.rst:1324 ../../reference/expressions.rst:1337 -#: ../../reference/expressions.rst:1353 ../../reference/expressions.rst:1389 -#: ../../reference/expressions.rst:1397 ../../reference/expressions.rst:1406 -#: ../../reference/expressions.rst:1421 ../../reference/expressions.rst:1660 -#: ../../reference/expressions.rst:1669 ../../reference/expressions.rst:1711 -#: ../../reference/expressions.rst:1716 ../../reference/expressions.rst:1721 -#: ../../reference/expressions.rst:1782 ../../reference/expressions.rst:1900 +#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1206 +#: ../../reference/expressions.rst:1215 ../../reference/expressions.rst:1223 +#: ../../reference/expressions.rst:1258 ../../reference/expressions.rst:1271 +#: ../../reference/expressions.rst:1280 ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1325 ../../reference/expressions.rst:1338 +#: ../../reference/expressions.rst:1354 ../../reference/expressions.rst:1390 +#: ../../reference/expressions.rst:1398 ../../reference/expressions.rst:1407 +#: ../../reference/expressions.rst:1422 ../../reference/expressions.rst:1661 +#: ../../reference/expressions.rst:1670 ../../reference/expressions.rst:1712 +#: ../../reference/expressions.rst:1717 ../../reference/expressions.rst:1722 +#: ../../reference/expressions.rst:1783 ../../reference/expressions.rst:1901 msgid "operator" msgstr "" -#: ../../reference/expressions.rst:1196 +#: ../../reference/expressions.rst:1197 msgid "unary" msgstr "" -#: ../../reference/expressions.rst:1196 ../../reference/expressions.rst:1380 -#: ../../reference/expressions.rst:1389 ../../reference/expressions.rst:1397 -#: ../../reference/expressions.rst:1406 +#: ../../reference/expressions.rst:1197 ../../reference/expressions.rst:1381 +#: ../../reference/expressions.rst:1390 ../../reference/expressions.rst:1398 +#: ../../reference/expressions.rst:1407 msgid "bitwise" msgstr "" -#: ../../reference/expressions.rst:1205 +#: ../../reference/expressions.rst:1206 msgid "negation" msgstr "" -#: ../../reference/expressions.rst:1205 +#: ../../reference/expressions.rst:1206 msgid "minus" msgstr "" -#: ../../reference/expressions.rst:1205 ../../reference/expressions.rst:1337 +#: ../../reference/expressions.rst:1206 ../../reference/expressions.rst:1338 msgid "- (minus)" msgstr "" -#: ../../reference/expressions.rst:1205 ../../reference/expressions.rst:1214 +#: ../../reference/expressions.rst:1206 ../../reference/expressions.rst:1215 msgid "unary operator" msgstr "" -#: ../../reference/expressions.rst:1214 +#: ../../reference/expressions.rst:1215 msgid "plus" msgstr "" -#: ../../reference/expressions.rst:1214 ../../reference/expressions.rst:1324 +#: ../../reference/expressions.rst:1215 ../../reference/expressions.rst:1325 msgid "+ (plus)" msgstr "" -#: ../../reference/expressions.rst:1222 +#: ../../reference/expressions.rst:1223 msgid "inversion" msgstr "" -#: ../../reference/expressions.rst:1222 +#: ../../reference/expressions.rst:1223 msgid "~ (tilde)" msgstr "" -#: ../../reference/expressions.rst:1233 +#: ../../reference/expressions.rst:1234 msgid "TypeError" msgstr "" -#: ../../reference/expressions.rst:1244 ../../reference/expressions.rst:1380 +#: ../../reference/expressions.rst:1245 ../../reference/expressions.rst:1381 msgid "binary" msgstr "" -#: ../../reference/expressions.rst:1257 +#: ../../reference/expressions.rst:1258 msgid "multiplication" msgstr "" -#: ../../reference/expressions.rst:1270 +#: ../../reference/expressions.rst:1271 msgid "matrix multiplication" msgstr "" -#: ../../reference/expressions.rst:1270 +#: ../../reference/expressions.rst:1271 msgid "@ (at)" msgstr "" -#: ../../reference/expressions.rst:1279 +#: ../../reference/expressions.rst:1280 msgid "ZeroDivisionError" msgstr "" -#: ../../reference/expressions.rst:1279 +#: ../../reference/expressions.rst:1280 msgid "division" msgstr "" -#: ../../reference/expressions.rst:1279 +#: ../../reference/expressions.rst:1280 msgid "/ (slash)" msgstr "" -#: ../../reference/expressions.rst:1279 +#: ../../reference/expressions.rst:1280 msgid "//" msgstr "" -#: ../../reference/expressions.rst:1295 +#: ../../reference/expressions.rst:1296 msgid "modulo" msgstr "" -#: ../../reference/expressions.rst:1295 +#: ../../reference/expressions.rst:1296 msgid "% (percent)" msgstr "" -#: ../../reference/expressions.rst:1324 +#: ../../reference/expressions.rst:1325 msgid "addition" msgstr "" -#: ../../reference/expressions.rst:1324 ../../reference/expressions.rst:1337 +#: ../../reference/expressions.rst:1325 ../../reference/expressions.rst:1338 msgid "binary operator" msgstr "" -#: ../../reference/expressions.rst:1337 +#: ../../reference/expressions.rst:1338 msgid "subtraction" msgstr "" -#: ../../reference/expressions.rst:1353 +#: ../../reference/expressions.rst:1354 msgid "shifting" msgstr "" -#: ../../reference/expressions.rst:1353 +#: ../../reference/expressions.rst:1354 msgid "<<" msgstr "" -#: ../../reference/expressions.rst:1353 +#: ../../reference/expressions.rst:1354 msgid ">>" msgstr "" -#: ../../reference/expressions.rst:1369 +#: ../../reference/expressions.rst:1370 msgid "ValueError" msgstr "" -#: ../../reference/expressions.rst:1389 ../../reference/expressions.rst:1716 +#: ../../reference/expressions.rst:1390 ../../reference/expressions.rst:1717 msgid "and" msgstr "" -#: ../../reference/expressions.rst:1389 +#: ../../reference/expressions.rst:1390 msgid "& (ampersand)" msgstr "" -#: ../../reference/expressions.rst:1397 +#: ../../reference/expressions.rst:1398 msgid "xor" msgstr "" -#: ../../reference/expressions.rst:1397 +#: ../../reference/expressions.rst:1398 msgid "exclusive" msgstr "" -#: ../../reference/expressions.rst:1397 ../../reference/expressions.rst:1406 -#: ../../reference/expressions.rst:1721 +#: ../../reference/expressions.rst:1398 ../../reference/expressions.rst:1407 +#: ../../reference/expressions.rst:1722 msgid "or" msgstr "" -#: ../../reference/expressions.rst:1397 +#: ../../reference/expressions.rst:1398 msgid "^ (caret)" msgstr "" -#: ../../reference/expressions.rst:1406 +#: ../../reference/expressions.rst:1407 msgid "inclusive" msgstr "" -#: ../../reference/expressions.rst:1406 +#: ../../reference/expressions.rst:1407 msgid "| (vertical bar)" msgstr "" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "comparison" msgstr "" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "C" msgstr "" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "language" msgstr "" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "< (less)" msgstr "" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "> (greater)" msgstr "" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "<=" msgstr "" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid ">=" msgstr "" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "==" msgstr "" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "!=" msgstr "" -#: ../../reference/expressions.rst:1445 +#: ../../reference/expressions.rst:1446 msgid "chaining" msgstr "" -#: ../../reference/expressions.rst:1445 +#: ../../reference/expressions.rst:1446 msgid "comparisons" msgstr "" -#: ../../reference/expressions.rst:1660 +#: ../../reference/expressions.rst:1661 msgid "in" msgstr "" -#: ../../reference/expressions.rst:1660 +#: ../../reference/expressions.rst:1661 msgid "not in" msgstr "" -#: ../../reference/expressions.rst:1660 +#: ../../reference/expressions.rst:1661 msgid "membership" msgstr "" -#: ../../reference/expressions.rst:1660 ../../reference/expressions.rst:1669 +#: ../../reference/expressions.rst:1661 ../../reference/expressions.rst:1670 msgid "test" msgstr "" -#: ../../reference/expressions.rst:1669 +#: ../../reference/expressions.rst:1670 msgid "is" msgstr "" -#: ../../reference/expressions.rst:1669 +#: ../../reference/expressions.rst:1670 msgid "is not" msgstr "" -#: ../../reference/expressions.rst:1669 +#: ../../reference/expressions.rst:1670 msgid "identity" msgstr "" -#: ../../reference/expressions.rst:1695 +#: ../../reference/expressions.rst:1696 msgid "Conditional" msgstr "" -#: ../../reference/expressions.rst:1695 +#: ../../reference/expressions.rst:1696 msgid "Boolean" msgstr "" -#: ../../reference/expressions.rst:1711 +#: ../../reference/expressions.rst:1712 msgid "not" msgstr "" -#: ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1736 msgid ":= (colon equals)" msgstr "" -#: ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1736 msgid "assignment expression" msgstr "" -#: ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1736 msgid "walrus operator" msgstr "" -#: ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1736 msgid "named expression" msgstr "" -#: ../../reference/expressions.rst:1782 +#: ../../reference/expressions.rst:1783 msgid "conditional" msgstr "" -#: ../../reference/expressions.rst:1782 +#: ../../reference/expressions.rst:1783 msgid "ternary" msgstr "" -#: ../../reference/expressions.rst:1782 +#: ../../reference/expressions.rst:1783 msgid "conditional expression" msgstr "" -#: ../../reference/expressions.rst:1782 +#: ../../reference/expressions.rst:1783 msgid "else" msgstr "" -#: ../../reference/expressions.rst:1808 +#: ../../reference/expressions.rst:1809 msgid "lambda" msgstr "" -#: ../../reference/expressions.rst:1808 +#: ../../reference/expressions.rst:1809 msgid "form" msgstr "" -#: ../../reference/expressions.rst:1808 +#: ../../reference/expressions.rst:1809 msgid "anonymous" msgstr "" -#: ../../reference/expressions.rst:1808 +#: ../../reference/expressions.rst:1809 msgid "lambda expression" msgstr "" -#: ../../reference/expressions.rst:1853 +#: ../../reference/expressions.rst:1854 msgid "iterable" msgstr "" -#: ../../reference/expressions.rst:1853 +#: ../../reference/expressions.rst:1854 msgid "in expression lists" msgstr "" -#: ../../reference/expressions.rst:1865 +#: ../../reference/expressions.rst:1866 msgid "trailing" msgstr "" -#: ../../reference/expressions.rst:1879 +#: ../../reference/expressions.rst:1880 msgid "evaluation" msgstr "" -#: ../../reference/expressions.rst:1879 +#: ../../reference/expressions.rst:1880 msgid "order" msgstr "" -#: ../../reference/expressions.rst:1900 +#: ../../reference/expressions.rst:1901 msgid "precedence" msgstr "" From 7d10ab982c0204561f1ba0f03d3d3ccfd93f2709 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 9 Jun 2023 00:40:42 +0000 Subject: [PATCH 103/130] sync with cpython c3b8f9d0 --- library/typing.po | 774 ++++++++++++++++++++++++---------------------- 1 file changed, 402 insertions(+), 372 deletions(-) diff --git a/library/typing.po b/library/typing.po index cf76fb7c28..fe07b58eb7 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-08 00:35+0000\n" +"POT-Creation-Date: 2023-06-09 00:38+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -362,8 +362,7 @@ msgid "" "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:256 ../../library/typing.rst:1241 -#: ../../library/typing.rst:3018 +#: ../../library/typing.rst:256 ../../library/typing.rst:3040 #, fuzzy msgid "For example:" msgstr "" @@ -791,7 +790,7 @@ msgid "" "aliases>`." msgstr "" -#: ../../library/typing.rst:796 ../../library/typing.rst:1287 +#: ../../library/typing.rst:796 ../../library/typing.rst:1309 msgid "For example::" msgstr "" "舉例來說:\n" @@ -991,7 +990,7 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1000 ../../library/typing.rst:1665 +#: ../../library/typing.rst:1000 ../../library/typing.rst:1687 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." @@ -1096,7 +1095,7 @@ msgid "" "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1121 ../../library/typing.rst:2882 +#: ../../library/typing.rst:1121 ../../library/typing.rst:2904 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1113,112 +1112,143 @@ msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" #: ../../library/typing.rst:1139 -msgid "" -"A type, introduced in :pep:`593` (``Flexible function and variable " -"annotations``), to decorate existing types with context-specific metadata " -"(possibly multiple pieces of it, as ``Annotated`` is variadic). " -"Specifically, a type ``T`` can be annotated with metadata ``x`` via the " -"typehint ``Annotated[T, x]``. This metadata can be used for either static " -"analysis or at runtime: at runtime, it is stored in a :attr:`__metadata__` " -"attribute. If a library (or tool) encounters a typehint ``Annotated[T, x]`` " -"and has no special logic for metadata ``x``, it should ignore it and simply " -"treat the type as ``T``. Unlike the ``no_type_check`` functionality that " -"currently exists in the ``typing`` module which completely disables " -"typechecking annotations on a function or a class, the ``Annotated`` type " -"allows for both static typechecking of ``T`` (which can safely ignore ``x``) " -"together with runtime access to ``x`` within a specific application." +msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1154 +#: ../../library/typing.rst:1141 msgid "" -"Ultimately, the responsibility of how to interpret the annotations (if at " -"all) is the responsibility of the tool or library encountering the " -"``Annotated`` type. A tool or library encountering an ``Annotated`` type can " -"scan through the annotations to determine if they are of interest (e.g., " -"using ``isinstance()``)." +"Add metadata ``x`` to a given type ``T`` by using the annotation " +"``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " +"static analysis tools or at runtime. At runtime, the metadata is stored in " +"a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1160 +#: ../../library/typing.rst:1146 msgid "" -"When a tool or a library does not support annotations or encounters an " -"unknown annotation it should just ignore it and treat annotated type as the " -"underlying type." +"If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " +"special logic for the metadata, it should ignore the metadata and simply " +"treat the annotation as ``T``. As such, ``Annotated`` can be useful for code " +"that wants to use annotations for purposes outside Python's static typing " +"system." msgstr "" -#: ../../library/typing.rst:1164 +#: ../../library/typing.rst:1152 msgid "" -"It's up to the tool consuming the annotations to decide whether the client " -"is allowed to have several annotations on one type and how to merge those " -"annotations." +"Using ``Annotated[T, x]`` as an annotation still allows for static " +"typechecking of ``T``, as type checkers will simply ignore the metadata " +"``x``. In this way, ``Annotated`` differs from the :func:`@no_type_check " +"` decorator, which can also be used for adding annotations " +"outside the scope of the typing system, but completely disables typechecking " +"for a function or class." msgstr "" -#: ../../library/typing.rst:1168 +#: ../../library/typing.rst:1159 msgid "" -"Since the ``Annotated`` type allows you to put several annotations of the " -"same (or different) type(s) on any node, the tools or libraries consuming " -"those annotations are in charge of dealing with potential duplicates. For " -"example, if you are doing value range analysis you might allow this:" +"The responsibility of how to interpret the metadata lies with the the tool " +"or library encountering an ``Annotated`` annotation. A tool or library " +"encountering an ``Annotated`` type can scan through the metadata elements to " +"determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1184 +#: ../../library/typing.rst:1167 msgid "" -"Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " -"the extra annotations at runtime." +"Here is an example of how you might use ``Annotated`` to add metadata to " +"type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1187 -msgid "The details of the syntax:" +#: ../../library/typing.rst:1180 +msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1189 +#: ../../library/typing.rst:1182 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1191 +#: ../../library/typing.rst:1184 msgid "" -"Multiple type annotations are supported (``Annotated`` supports variadic " +"Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1200 +#: ../../library/typing.rst:1193 msgid "" -"``Annotated`` must be called with at least two arguments " +"It is up to the tool consuming the annotations to decide whether the client " +"is allowed to add multiple metadata elements to one annotation and how to " +"merge those annotations." +msgstr "" + +#: ../../library/typing.rst:1197 +msgid "" +"``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1203 +#: ../../library/typing.rst:1200 msgid "" -"The order of the annotations is preserved and matters for equality checks::" +"The order of the metadata elements is preserved and matters for equality " +"checks::" msgstr "" -#: ../../library/typing.rst:1210 +#: ../../library/typing.rst:1207 msgid "" -"Nested ``Annotated`` types are flattened, with metadata ordered starting " -"with the innermost annotation::" +"Nested ``Annotated`` types are flattened. The order of the metadata elements " +"starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1217 -msgid "Duplicated annotations are not removed::" +#: ../../library/typing.rst:1214 +msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1223 +#: ../../library/typing.rst:1220 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1238 +#: ../../library/typing.rst:1233 +msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" +msgstr "" + +#: ../../library/typing.rst:1237 +#, fuzzy +msgid "This would be equivalent to::" +msgstr "" +"這等價於:\n" +"\n" +"::" + +#: ../../library/typing.rst:1241 msgid "" -"At runtime, the metadata associated with an ``Annotated`` type can be " -"retrieved via the ``__metadata__`` attribute." +"where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " +"invalid: only one type should be passed to Annotated." +msgstr "" + +#: ../../library/typing.rst:1244 +msgid "" +"By default, :func:`get_type_hints` strips the metadata from annotations. " +"Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" #: ../../library/typing.rst:1257 msgid "" +"At runtime, the metadata associated with an ``Annotated`` type can be " +"retrieved via the :attr:`!__metadata__` attribute:" +msgstr "" + +#: ../../library/typing.rst:1271 +msgid ":pep:`593` - Flexible function and variable annotations" +msgstr "" + +#: ../../library/typing.rst:1272 +msgid "The PEP introducing ``Annotated`` to the standard library." +msgstr "" + +#: ../../library/typing.rst:1279 +msgid "" "Special typing form used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1261 +#: ../../library/typing.rst:1283 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1227,44 +1257,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1276 +#: ../../library/typing.rst:1298 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1280 +#: ../../library/typing.rst:1302 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1283 +#: ../../library/typing.rst:1305 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1284 +#: ../../library/typing.rst:1306 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1301 +#: ../../library/typing.rst:1323 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1305 +#: ../../library/typing.rst:1327 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1311 +#: ../../library/typing.rst:1333 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1273,13 +1303,13 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1317 +#: ../../library/typing.rst:1339 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1324 +#: ../../library/typing.rst:1346 msgid "" "A typing operator that conceptually marks an object as having been unpacked. " "For example, using the unpack operator ``*`` on a :class:`type variable " @@ -1287,7 +1317,7 @@ msgid "" "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1334 +#: ../../library/typing.rst:1356 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1295,44 +1325,44 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1351 +#: ../../library/typing.rst:1373 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1353 +#: ../../library/typing.rst:1375 msgid "" "The following objects are not used directly in annotations. Instead, they " "are building blocks for creating generic types." msgstr "" -#: ../../library/typing.rst:1358 +#: ../../library/typing.rst:1380 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1360 +#: ../../library/typing.rst:1382 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1369 +#: ../../library/typing.rst:1391 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1382 +#: ../../library/typing.rst:1404 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1384 ../../library/typing.rst:1480 -#: ../../library/typing.rst:1590 ../../library/typing.rst:1696 +#: ../../library/typing.rst:1406 ../../library/typing.rst:1502 +#: ../../library/typing.rst:1612 ../../library/typing.rst:1718 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1390 +#: ../../library/typing.rst:1412 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1340,69 +1370,69 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1411 +#: ../../library/typing.rst:1433 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1414 +#: ../../library/typing.rst:1436 msgid "" "Created type variables may be explicitly marked covariant or contravariant " "by passing ``covariant=True`` or ``contravariant=True``. By default, type " "variables are invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1419 +#: ../../library/typing.rst:1441 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1434 +#: ../../library/typing.rst:1456 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1442 +#: ../../library/typing.rst:1464 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1453 +#: ../../library/typing.rst:1475 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1457 +#: ../../library/typing.rst:1479 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1461 +#: ../../library/typing.rst:1483 msgid "Whether the type var has been marked as covariant." msgstr "" -#: ../../library/typing.rst:1465 +#: ../../library/typing.rst:1487 msgid "Whether the type var has been marked as contravariant." msgstr "" -#: ../../library/typing.rst:1469 +#: ../../library/typing.rst:1491 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1473 +#: ../../library/typing.rst:1495 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1477 +#: ../../library/typing.rst:1499 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1488 +#: ../../library/typing.rst:1510 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1410,7 +1440,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1510 +#: ../../library/typing.rst:1532 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1420,36 +1450,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1518 +#: ../../library/typing.rst:1540 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1525 +#: ../../library/typing.rst:1547 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1534 +#: ../../library/typing.rst:1556 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1553 +#: ../../library/typing.rst:1575 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1560 +#: ../../library/typing.rst:1582 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1570 +#: ../../library/typing.rst:1592 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1458,21 +1488,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1577 +#: ../../library/typing.rst:1599 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1603 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1587 +#: ../../library/typing.rst:1609 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1594 +#: ../../library/typing.rst:1616 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1482,7 +1512,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1601 +#: ../../library/typing.rst:1623 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1490,27 +1520,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1625 +#: ../../library/typing.rst:1647 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1629 +#: ../../library/typing.rst:1651 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1631 +#: ../../library/typing.rst:1653 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1638 +#: ../../library/typing.rst:1660 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1523,11 +1553,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1650 +#: ../../library/typing.rst:1672 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1652 +#: ../../library/typing.rst:1674 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1536,17 +1566,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1661 +#: ../../library/typing.rst:1683 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1667 +#: ../../library/typing.rst:1689 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1694 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1554,44 +1584,44 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1677 +#: ../../library/typing.rst:1699 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``::" msgstr "" -#: ../../library/typing.rst:1688 +#: ../../library/typing.rst:1710 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1690 +#: ../../library/typing.rst:1712 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1694 +#: ../../library/typing.rst:1716 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1702 +#: ../../library/typing.rst:1724 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1706 +#: ../../library/typing.rst:1728 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1715 +#: ../../library/typing.rst:1737 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1717 +#: ../../library/typing.rst:1739 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1600,77 +1630,77 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1745 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1733 +#: ../../library/typing.rst:1755 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1739 +#: ../../library/typing.rst:1761 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1743 +#: ../../library/typing.rst:1765 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1746 +#: ../../library/typing.rst:1768 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1749 +#: ../../library/typing.rst:1771 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1753 +#: ../../library/typing.rst:1775 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1757 +#: ../../library/typing.rst:1779 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1762 +#: ../../library/typing.rst:1784 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1772 +#: ../../library/typing.rst:1794 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1776 +#: ../../library/typing.rst:1798 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1780 +#: ../../library/typing.rst:1802 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1784 +#: ../../library/typing.rst:1806 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1789 +#: ../../library/typing.rst:1811 msgid "" "Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1795 +#: ../../library/typing.rst:1817 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1807 +#: ../../library/typing.rst:1829 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1678,15 +1708,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1812 +#: ../../library/typing.rst:1834 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1824 +#: ../../library/typing.rst:1846 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1826 +#: ../../library/typing.rst:1848 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1695,7 +1725,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1846 +#: ../../library/typing.rst:1868 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1706,7 +1736,7 @@ msgid "" "SSLObject`." msgstr "" -#: ../../library/typing.rst:1857 +#: ../../library/typing.rst:1879 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1714,13 +1744,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1868 +#: ../../library/typing.rst:1890 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:1893 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1728,53 +1758,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1887 +#: ../../library/typing.rst:1909 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1891 +#: ../../library/typing.rst:1913 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1895 +#: ../../library/typing.rst:1917 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1902 +#: ../../library/typing.rst:1924 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1903 +#: ../../library/typing.rst:1925 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1915 +#: ../../library/typing.rst:1937 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1926 +#: ../../library/typing.rst:1948 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1929 +#: ../../library/typing.rst:1951 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1939 +#: ../../library/typing.rst:1961 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1782,73 +1812,73 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1944 +#: ../../library/typing.rst:1966 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:1959 +#: ../../library/typing.rst:1981 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1966 +#: ../../library/typing.rst:1988 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1974 +#: ../../library/typing.rst:1996 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:1992 +#: ../../library/typing.rst:2014 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:1996 +#: ../../library/typing.rst:2018 msgid "T = TypeVar(\"T\")" msgstr "" -#: ../../library/typing.rst:2000 +#: ../../library/typing.rst:2022 msgid "class Group(TypedDict, Generic[T]):" msgstr "" -#: ../../library/typing.rst:1999 +#: ../../library/typing.rst:2021 msgid "key: T group: list[T]" msgstr "" -#: ../../library/typing.rst:2002 +#: ../../library/typing.rst:2024 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2008 +#: ../../library/typing.rst:2030 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2030 +#: ../../library/typing.rst:2052 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2033 +#: ../../library/typing.rst:2055 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2036 +#: ../../library/typing.rst:2058 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1857,174 +1887,174 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2059 +#: ../../library/typing.rst:2081 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2063 +#: ../../library/typing.rst:2085 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2067 +#: ../../library/typing.rst:2089 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2071 +#: ../../library/typing.rst:2093 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:2074 +#: ../../library/typing.rst:2096 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:2078 +#: ../../library/typing.rst:2100 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2080 +#: ../../library/typing.rst:2102 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2084 +#: ../../library/typing.rst:2106 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2089 +#: ../../library/typing.rst:2111 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2095 +#: ../../library/typing.rst:2117 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2097 +#: ../../library/typing.rst:2119 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2101 +#: ../../library/typing.rst:2123 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2111 +#: ../../library/typing.rst:2133 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2117 +#: ../../library/typing.rst:2139 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2119 +#: ../../library/typing.rst:2141 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2123 +#: ../../library/typing.rst:2145 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2129 +#: ../../library/typing.rst:2151 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2131 +#: ../../library/typing.rst:2153 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2136 +#: ../../library/typing.rst:2158 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:2139 +#: ../../library/typing.rst:2161 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2143 +#: ../../library/typing.rst:2165 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2147 +#: ../../library/typing.rst:2169 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2153 +#: ../../library/typing.rst:2175 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2157 +#: ../../library/typing.rst:2179 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2163 +#: ../../library/typing.rst:2185 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2168 +#: ../../library/typing.rst:2190 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2174 +#: ../../library/typing.rst:2196 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2179 +#: ../../library/typing.rst:2201 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2185 +#: ../../library/typing.rst:2207 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2190 +#: ../../library/typing.rst:2212 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2195 +#: ../../library/typing.rst:2217 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2201 +#: ../../library/typing.rst:2223 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2208 +#: ../../library/typing.rst:2230 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2213 +#: ../../library/typing.rst:2235 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -2032,457 +2062,457 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2223 +#: ../../library/typing.rst:2245 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2224 +#: ../../library/typing.rst:2246 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2230 +#: ../../library/typing.rst:2252 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:2234 +#: ../../library/typing.rst:2256 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2242 +#: ../../library/typing.rst:2264 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2249 +#: ../../library/typing.rst:2271 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2252 +#: ../../library/typing.rst:2274 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2256 +#: ../../library/typing.rst:2278 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2258 +#: ../../library/typing.rst:2280 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2264 +#: ../../library/typing.rst:2286 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2268 +#: ../../library/typing.rst:2290 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2272 +#: ../../library/typing.rst:2294 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2276 +#: ../../library/typing.rst:2298 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2282 +#: ../../library/typing.rst:2304 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2284 +#: ../../library/typing.rst:2306 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2290 +#: ../../library/typing.rst:2312 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2292 +#: ../../library/typing.rst:2314 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2298 +#: ../../library/typing.rst:2320 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2300 +#: ../../library/typing.rst:2322 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2306 +#: ../../library/typing.rst:2328 msgid "" "Deprecated alias to :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:2312 +#: ../../library/typing.rst:2334 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2318 +#: ../../library/typing.rst:2340 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2320 +#: ../../library/typing.rst:2342 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2326 +#: ../../library/typing.rst:2348 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2328 +#: ../../library/typing.rst:2350 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2335 +#: ../../library/typing.rst:2357 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2337 +#: ../../library/typing.rst:2359 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2344 +#: ../../library/typing.rst:2366 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2346 +#: ../../library/typing.rst:2368 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2352 +#: ../../library/typing.rst:2374 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2354 +#: ../../library/typing.rst:2376 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2360 +#: ../../library/typing.rst:2382 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2362 +#: ../../library/typing.rst:2384 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2367 +#: ../../library/typing.rst:2389 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2371 +#: ../../library/typing.rst:2393 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2373 +#: ../../library/typing.rst:2395 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2379 +#: ../../library/typing.rst:2401 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2381 +#: ../../library/typing.rst:2403 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2387 +#: ../../library/typing.rst:2409 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:2389 +#: ../../library/typing.rst:2411 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2398 +#: ../../library/typing.rst:2420 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2402 +#: ../../library/typing.rst:2424 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2410 +#: ../../library/typing.rst:2432 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2418 +#: ../../library/typing.rst:2440 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2424 -msgid "Deprecated alias to :class:`collections.abc.Hashable`." +#: ../../library/typing.rst:2446 +msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2428 +#: ../../library/typing.rst:2450 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2430 +#: ../../library/typing.rst:2452 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2436 -msgid "Deprecated alias to :class:`collections.abc.Sized`." +#: ../../library/typing.rst:2458 +msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2439 +#: ../../library/typing.rst:2461 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2443 +#: ../../library/typing.rst:2465 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:2445 +#: ../../library/typing.rst:2467 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:2456 +#: ../../library/typing.rst:2478 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2462 +#: ../../library/typing.rst:2484 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:2464 +#: ../../library/typing.rst:2486 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2473 +#: ../../library/typing.rst:2495 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2499 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2485 +#: ../../library/typing.rst:2507 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2495 +#: ../../library/typing.rst:2517 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2502 +#: ../../library/typing.rst:2524 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2506 +#: ../../library/typing.rst:2528 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2512 +#: ../../library/typing.rst:2534 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2516 +#: ../../library/typing.rst:2538 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2522 +#: ../../library/typing.rst:2544 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2526 +#: ../../library/typing.rst:2548 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2532 +#: ../../library/typing.rst:2554 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2536 +#: ../../library/typing.rst:2558 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2541 +#: ../../library/typing.rst:2563 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2548 +#: ../../library/typing.rst:2570 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2553 +#: ../../library/typing.rst:2575 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2559 +#: ../../library/typing.rst:2581 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2561 +#: ../../library/typing.rst:2583 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2565 +#: ../../library/typing.rst:2587 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2570 +#: ../../library/typing.rst:2592 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2574 +#: ../../library/typing.rst:2596 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2578 +#: ../../library/typing.rst:2600 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2582 +#: ../../library/typing.rst:2604 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2588 +#: ../../library/typing.rst:2610 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2592 +#: ../../library/typing.rst:2614 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2596 +#: ../../library/typing.rst:2618 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2600 +#: ../../library/typing.rst:2622 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2602 +#: ../../library/typing.rst:2624 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2609 +#: ../../library/typing.rst:2631 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2611 +#: ../../library/typing.rst:2633 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2614 +#: ../../library/typing.rst:2636 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2621 +#: ../../library/typing.rst:2643 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2635 +#: ../../library/typing.rst:2657 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2637 +#: ../../library/typing.rst:2659 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2648 +#: ../../library/typing.rst:2670 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " @@ -2495,53 +2525,53 @@ msgid "" "bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2682 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2663 +#: ../../library/typing.rst:2685 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2671 +#: ../../library/typing.rst:2693 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2673 +#: ../../library/typing.rst:2695 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2679 +#: ../../library/typing.rst:2701 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2682 +#: ../../library/typing.rst:2704 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2687 +#: ../../library/typing.rst:2709 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2692 +#: ../../library/typing.rst:2714 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2702 +#: ../../library/typing.rst:2724 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -2550,19 +2580,19 @@ msgid "" "`dataclasses.dataclass`-like behaviors." msgstr "" -#: ../../library/typing.rst:2708 +#: ../../library/typing.rst:2730 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2724 +#: ../../library/typing.rst:2746 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2733 +#: ../../library/typing.rst:2755 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2744 +#: ../../library/typing.rst:2766 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*. *func* is the function object for the implementation of the " @@ -2708,25 +2738,25 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2848 +#: ../../library/typing.rst:2870 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2856 +#: ../../library/typing.rst:2878 msgid "" "Clear all registered overloads in the internal registry. This can be used to " "reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2864 +#: ../../library/typing.rst:2886 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2887 +#: ../../library/typing.rst:2909 msgid "" "The decorator will now set the ``__final__`` attribute to ``True`` on the " "decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2736,59 +2766,59 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2898 +#: ../../library/typing.rst:2920 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2900 +#: ../../library/typing.rst:2922 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods and classes defined in that class (but not to " "methods defined in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2926 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2908 +#: ../../library/typing.rst:2930 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2910 +#: ../../library/typing.rst:2932 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2915 +#: ../../library/typing.rst:2937 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2917 +#: ../../library/typing.rst:2939 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2928 +#: ../../library/typing.rst:2950 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2932 +#: ../../library/typing.rst:2954 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2936 +#: ../../library/typing.rst:2958 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2939 +#: ../../library/typing.rst:2961 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2797,32 +2827,32 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2945 +#: ../../library/typing.rst:2967 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example:" msgstr "" -#: ../../library/typing.rst:2962 +#: ../../library/typing.rst:2984 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2967 +#: ../../library/typing.rst:2989 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2970 +#: ../../library/typing.rst:2992 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2977 +#: ../../library/typing.rst:2999 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``. If ``X`` is a generic alias for a builtin or :" @@ -2832,7 +2862,7 @@ msgid "" "Examples:" msgstr "" -#: ../../library/typing.rst:2998 +#: ../../library/typing.rst:3020 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``. If ``X`` is a union or :" @@ -2842,11 +2872,11 @@ msgid "" "Examples:" msgstr "" -#: ../../library/typing.rst:3016 +#: ../../library/typing.rst:3038 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3037 +#: ../../library/typing.rst:3059 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2854,24 +2884,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:3043 +#: ../../library/typing.rst:3065 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:3050 +#: ../../library/typing.rst:3072 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3054 +#: ../../library/typing.rst:3076 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:3063 +#: ../../library/typing.rst:3085 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2879,7 +2909,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:3092 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2887,11 +2917,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3079 +#: ../../library/typing.rst:3101 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3081 +#: ../../library/typing.rst:3103 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2899,76 +2929,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3086 +#: ../../library/typing.rst:3108 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3086 +#: ../../library/typing.rst:3108 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3086 +#: ../../library/typing.rst:3108 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3086 +#: ../../library/typing.rst:3108 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3088 +#: ../../library/typing.rst:3110 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3088 +#: ../../library/typing.rst:3110 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3088 +#: ../../library/typing.rst:3110 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3088 +#: ../../library/typing.rst:3110 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3091 +#: ../../library/typing.rst:3113 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3091 ../../library/typing.rst:3094 +#: ../../library/typing.rst:3113 ../../library/typing.rst:3116 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3091 ../../library/typing.rst:3096 +#: ../../library/typing.rst:3113 ../../library/typing.rst:3118 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3091 +#: ../../library/typing.rst:3113 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3094 +#: ../../library/typing.rst:3116 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3094 +#: ../../library/typing.rst:3116 msgid "3.14" msgstr "" -#: ../../library/typing.rst:3094 +#: ../../library/typing.rst:3116 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3096 +#: ../../library/typing.rst:3118 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3096 +#: ../../library/typing.rst:3118 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3096 +#: ../../library/typing.rst:3118 msgid ":gh:`92332`" msgstr ":gh:`92332`" From d9c6ce30f4b5059c9745ab7a928ff10bb6ee6c69 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 10 Jun 2023 00:35:32 +0000 Subject: [PATCH 104/130] sync with cpython 4ceb5c49 --- howto/enum.po | 319 +++++------ library/tokenize.po | 89 +-- library/typing.po | 1271 +++++++++++++++++++++++-------------------- 3 files changed, 893 insertions(+), 786 deletions(-) diff --git a/howto/enum.po b/howto/enum.po index ccf34e293c..fcca6d2ae3 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-14 00:29+0000\n" +"POT-Creation-Date: 2023-06-10 00:32+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -379,25 +379,32 @@ msgstr "" #: ../../howto/enum.rst:486 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" -"meth:`__reduce_ex__` in the enumeration class." +"meth:`__reduce_ex__` in the enumeration class. The default method is by-" +"value, but enums with complicated values may want to use by-name::" msgstr "" -#: ../../howto/enum.rst:491 +#: ../../howto/enum.rst:495 +msgid "" +"Using by-name for flags is not recommended, as unnamed aliases will not " +"unpickle." +msgstr "" + +#: ../../howto/enum.rst:500 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:493 +#: ../../howto/enum.rst:502 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:503 +#: ../../howto/enum.rst:512 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: ../../howto/enum.rst:506 +#: ../../howto/enum.rst:515 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -409,14 +416,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:522 +#: ../../howto/enum.rst:531 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -#: ../../howto/enum.rst:526 +#: ../../howto/enum.rst:535 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -425,14 +432,14 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:536 +#: ../../howto/enum.rst:545 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: ../../howto/enum.rst:540 +#: ../../howto/enum.rst:549 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -440,7 +447,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:547 +#: ../../howto/enum.rst:556 msgid "The complete signature is::" msgstr "" @@ -448,7 +455,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../howto/enum.rst:559 +#: ../../howto/enum.rst:568 msgid "What the new enum class will record as its name." msgstr "" @@ -456,21 +463,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../howto/enum.rst:561 +#: ../../howto/enum.rst:570 msgid "" "The enum members. This can be a whitespace- or comma-separated string " "(values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../howto/enum.rst:566 +#: ../../howto/enum.rst:575 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:570 +#: ../../howto/enum.rst:579 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:574 +#: ../../howto/enum.rst:583 msgid "or a mapping::" msgstr "" @@ -478,7 +485,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../howto/enum.rst:578 +#: ../../howto/enum.rst:587 msgid "name of module where new enum class can be found." msgstr "" @@ -486,7 +493,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../howto/enum.rst:580 +#: ../../howto/enum.rst:589 msgid "where in module new enum class can be found." msgstr "" @@ -494,7 +501,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../howto/enum.rst:582 +#: ../../howto/enum.rst:591 msgid "type to mix in to new enum class." msgstr "" @@ -502,23 +509,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../howto/enum.rst:584 +#: ../../howto/enum.rst:593 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:586 +#: ../../howto/enum.rst:595 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:591 +#: ../../howto/enum.rst:600 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:594 +#: ../../howto/enum.rst:603 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:596 +#: ../../howto/enum.rst:605 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -526,22 +533,22 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:617 +#: ../../howto/enum.rst:626 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:630 +#: ../../howto/enum.rst:639 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:641 +#: ../../howto/enum.rst:650 msgid "StrEnum" msgstr "" -#: ../../howto/enum.rst:643 +#: ../../howto/enum.rst:652 msgid "" "The second variation of :class:`Enum` that is provided is also a subclass " "of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " @@ -549,11 +556,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:652 +#: ../../howto/enum.rst:661 msgid "IntFlag" msgstr "" -#: ../../howto/enum.rst:654 +#: ../../howto/enum.rst:663 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -563,60 +570,60 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:662 +#: ../../howto/enum.rst:671 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:665 +#: ../../howto/enum.rst:674 msgid "" "Bit-wise operations that result in invalid :class:`IntFlag` values will lose " "the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" -#: ../../howto/enum.rst:672 +#: ../../howto/enum.rst:681 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:688 +#: ../../howto/enum.rst:697 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:704 +#: ../../howto/enum.rst:713 msgid "" "Named combinations are considered aliases. Aliases do not show up during " "iteration, but can be returned from by-value lookups." msgstr "" -#: ../../howto/enum.rst:709 +#: ../../howto/enum.rst:718 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: ../../howto/enum.rst:717 +#: ../../howto/enum.rst:726 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" -#: ../../howto/enum.rst:728 +#: ../../howto/enum.rst:737 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:734 +#: ../../howto/enum.rst:743 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:743 +#: ../../howto/enum.rst:752 msgid "Flag" msgstr "" -#: ../../howto/enum.rst:745 +#: ../../howto/enum.rst:754 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -626,29 +633,29 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:754 +#: ../../howto/enum.rst:763 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: ../../howto/enum.rst:768 +#: ../../howto/enum.rst:777 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags will not::" msgstr "" -#: ../../howto/enum.rst:780 +#: ../../howto/enum.rst:789 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:794 +#: ../../howto/enum.rst:803 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:804 +#: ../../howto/enum.rst:813 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -659,42 +666,42 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:814 +#: ../../howto/enum.rst:823 msgid "Others" msgstr "" -#: ../../howto/enum.rst:816 +#: ../../howto/enum.rst:825 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:822 +#: ../../howto/enum.rst:831 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: ../../howto/enum.rst:825 +#: ../../howto/enum.rst:834 msgid "Some rules:" msgstr "" -#: ../../howto/enum.rst:827 +#: ../../howto/enum.rst:836 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before :class:" "`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " "above." msgstr "" -#: ../../howto/enum.rst:830 +#: ../../howto/enum.rst:839 msgid "" "Mix-in types must be subclassable. For example, :class:`bool` and :class:" "`range` are not subclassable and will throw an error during Enum creation if " "used as the mix-in type." msgstr "" -#: ../../howto/enum.rst:833 +#: ../../howto/enum.rst:842 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -702,161 +709,161 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:837 +#: ../../howto/enum.rst:846 msgid "" "When another data type is mixed in, the :attr:`value` attribute is *not the " "same* as the enum member itself, although it is equivalent and will compare " "equal." msgstr "" -#: ../../howto/enum.rst:840 +#: ../../howto/enum.rst:849 msgid "A ``data type`` is a mixin that defines :meth:`__new__`." msgstr "" -#: ../../howto/enum.rst:841 +#: ../../howto/enum.rst:850 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " "``%h`` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../howto/enum.rst:844 +#: ../../howto/enum.rst:853 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:849 +#: ../../howto/enum.rst:858 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" "`__str__` method has been reset to their data types' :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:855 +#: ../../howto/enum.rst:864 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:857 +#: ../../howto/enum.rst:866 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:861 +#: ../../howto/enum.rst:870 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:888 +#: ../../howto/enum.rst:897 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:891 +#: ../../howto/enum.rst:900 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:893 +#: ../../howto/enum.rst:902 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:896 +#: ../../howto/enum.rst:905 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../howto/enum.rst:902 +#: ../../howto/enum.rst:911 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:904 +#: ../../howto/enum.rst:913 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:905 +#: ../../howto/enum.rst:914 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:907 +#: ../../howto/enum.rst:916 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:909 +#: ../../howto/enum.rst:918 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../howto/enum.rst:912 +#: ../../howto/enum.rst:921 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:914 +#: ../../howto/enum.rst:923 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:920 +#: ../../howto/enum.rst:929 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:923 +#: ../../howto/enum.rst:932 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../howto/enum.rst:926 +#: ../../howto/enum.rst:935 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:927 +#: ../../howto/enum.rst:936 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:929 +#: ../../howto/enum.rst:938 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:947 +#: ../../howto/enum.rst:956 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:952 +#: ../../howto/enum.rst:961 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:954 +#: ../../howto/enum.rst:963 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:961 +#: ../../howto/enum.rst:970 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:963 +#: ../../howto/enum.rst:972 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -864,22 +871,22 @@ msgid "" "and is supported." msgstr "" -#: ../../howto/enum.rst:972 +#: ../../howto/enum.rst:981 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:974 +#: ../../howto/enum.rst:983 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:986 +#: ../../howto/enum.rst:995 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:988 +#: ../../howto/enum.rst:997 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -888,137 +895,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:997 +#: ../../howto/enum.rst:1006 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1001 +#: ../../howto/enum.rst:1010 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1003 +#: ../../howto/enum.rst:1012 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1014 +#: ../../howto/enum.rst:1023 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1016 +#: ../../howto/enum.rst:1025 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1034 +#: ../../howto/enum.rst:1043 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1036 +#: ../../howto/enum.rst:1045 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1047 +#: ../../howto/enum.rst:1056 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1049 +#: ../../howto/enum.rst:1058 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1050 +#: ../../howto/enum.rst:1059 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1051 +#: ../../howto/enum.rst:1060 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1056 +#: ../../howto/enum.rst:1065 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1065 +#: ../../howto/enum.rst:1074 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1070 +#: ../../howto/enum.rst:1079 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1081 +#: ../../howto/enum.rst:1090 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1087 +#: ../../howto/enum.rst:1096 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1096 +#: ../../howto/enum.rst:1105 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1099 +#: ../../howto/enum.rst:1108 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1100 +#: ../../howto/enum.rst:1109 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1101 +#: ../../howto/enum.rst:1110 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1105 +#: ../../howto/enum.rst:1114 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1103 +#: ../../howto/enum.rst:1112 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1104 +#: ../../howto/enum.rst:1113 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1105 +#: ../../howto/enum.rst:1114 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1107 +#: ../../howto/enum.rst:1116 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1115 +#: ../../howto/enum.rst:1124 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1117 +#: ../../howto/enum.rst:1126 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1122 +#: ../../howto/enum.rst:1131 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1124 +#: ../../howto/enum.rst:1133 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1029,11 +1036,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1133 +#: ../../howto/enum.rst:1142 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1135 +#: ../../howto/enum.rst:1144 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1042,11 +1049,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1141 +#: ../../howto/enum.rst:1150 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1143 +#: ../../howto/enum.rst:1152 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1055,37 +1062,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1149 +#: ../../howto/enum.rst:1158 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1151 +#: ../../howto/enum.rst:1160 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1157 +#: ../../howto/enum.rst:1166 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1159 +#: ../../howto/enum.rst:1168 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1174 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1175 +#: ../../howto/enum.rst:1184 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1178 +#: ../../howto/enum.rst:1187 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1093,149 +1100,149 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1185 +#: ../../howto/enum.rst:1194 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1187 +#: ../../howto/enum.rst:1196 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1190 +#: ../../howto/enum.rst:1199 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1191 +#: ../../howto/enum.rst:1200 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1192 +#: ../../howto/enum.rst:1201 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1193 +#: ../../howto/enum.rst:1202 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1196 +#: ../../howto/enum.rst:1205 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1202 +#: ../../howto/enum.rst:1211 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1204 +#: ../../howto/enum.rst:1213 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1216 +#: ../../howto/enum.rst:1225 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1218 +#: ../../howto/enum.rst:1227 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1228 +#: ../../howto/enum.rst:1237 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1244 +#: ../../howto/enum.rst:1253 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1246 +#: ../../howto/enum.rst:1255 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1258 +#: ../../howto/enum.rst:1267 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1260 +#: ../../howto/enum.rst:1269 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1277 +#: ../../howto/enum.rst:1286 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1287 +#: ../../howto/enum.rst:1296 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1306 +#: ../../howto/enum.rst:1315 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1312 +#: ../../howto/enum.rst:1321 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1314 +#: ../../howto/enum.rst:1323 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1348 +#: ../../howto/enum.rst:1357 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1350 +#: ../../howto/enum.rst:1359 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1375 +#: ../../howto/enum.rst:1384 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1381 +#: ../../howto/enum.rst:1390 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1383 +#: ../../howto/enum.rst:1392 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1412 +#: ../../howto/enum.rst:1421 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1414 +#: ../../howto/enum.rst:1423 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1433 +#: ../../howto/enum.rst:1442 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1435 +#: ../../howto/enum.rst:1444 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/library/tokenize.po b/library/tokenize.po index 6147606e0e..7d251930ce 100644 --- a/library/tokenize.po +++ b/library/tokenize.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-06-10 00:32+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,15 +43,24 @@ msgid "" "from :func:`tokenize.tokenize`." msgstr "" -#: ../../library/tokenize.rst:26 +#: ../../library/tokenize.rst:28 +msgid "" +"Note that the functions in this module are only designed to parse " +"syntactically valid Python code (code that does not raise when parsed using :" +"func:`ast.parse`). The behavior of the functions in this module is " +"**undefined** when providing invalid Python code and it can change at any " +"point." +msgstr "" + +#: ../../library/tokenize.rst:35 msgid "Tokenizing Input" msgstr "" -#: ../../library/tokenize.rst:28 +#: ../../library/tokenize.rst:37 msgid "The primary entry point is a :term:`generator`:" msgstr "" -#: ../../library/tokenize.rst:32 +#: ../../library/tokenize.rst:41 msgid "" "The :func:`.tokenize` generator requires one argument, *readline*, which " "must be a callable object which provides the same interface as the :meth:`io." @@ -59,7 +68,7 @@ msgid "" "return one line of input as bytes." msgstr "" -#: ../../library/tokenize.rst:37 +#: ../../library/tokenize.rst:46 msgid "" "The generator produces 5-tuples with these members: the token type; the " "token string; a 2-tuple ``(srow, scol)`` of ints specifying the row and " @@ -70,7 +79,7 @@ msgid "" "with the field names: ``type string start end line``." msgstr "" -#: ../../library/tokenize.rst:46 +#: ../../library/tokenize.rst:55 msgid "" "The returned :term:`named tuple` has an additional property named " "``exact_type`` that contains the exact operator type for :data:`~token.OP` " @@ -78,58 +87,58 @@ msgid "" "``type`` field." msgstr "" -#: ../../library/tokenize.rst:51 +#: ../../library/tokenize.rst:60 msgid "Added support for named tuples." msgstr "" -#: ../../library/tokenize.rst:54 +#: ../../library/tokenize.rst:63 msgid "Added support for ``exact_type``." msgstr "" -#: ../../library/tokenize.rst:57 +#: ../../library/tokenize.rst:66 msgid "" ":func:`.tokenize` determines the source encoding of the file by looking for " "a UTF-8 BOM or encoding cookie, according to :pep:`263`." msgstr "" -#: ../../library/tokenize.rst:62 +#: ../../library/tokenize.rst:71 msgid "Tokenize a source reading unicode strings instead of bytes." msgstr "" -#: ../../library/tokenize.rst:64 +#: ../../library/tokenize.rst:73 msgid "" "Like :func:`.tokenize`, the *readline* argument is a callable returning a " "single line of input. However, :func:`generate_tokens` expects *readline* to " "return a str object rather than bytes." msgstr "" -#: ../../library/tokenize.rst:68 +#: ../../library/tokenize.rst:77 msgid "" "The result is an iterator yielding named tuples, exactly like :func:`." "tokenize`. It does not yield an :data:`~token.ENCODING` token." msgstr "" -#: ../../library/tokenize.rst:71 +#: ../../library/tokenize.rst:80 msgid "" "All constants from the :mod:`token` module are also exported from :mod:" "`tokenize`." msgstr "" -#: ../../library/tokenize.rst:74 +#: ../../library/tokenize.rst:83 msgid "" "Another function is provided to reverse the tokenization process. This is " "useful for creating tools that tokenize a script, modify the token stream, " "and write back the modified script." msgstr "" -#: ../../library/tokenize.rst:81 +#: ../../library/tokenize.rst:90 msgid "" "Converts tokens back into Python source code. The *iterable* must return " "sequences with at least two elements, the token type and the token string. " "Any additional sequence elements are ignored." msgstr "" -#: ../../library/tokenize.rst:85 +#: ../../library/tokenize.rst:94 msgid "" "The reconstructed script is returned as a single string. The result is " "guaranteed to tokenize back to match the input so that the conversion is " @@ -138,33 +147,33 @@ msgid "" "may change." msgstr "" -#: ../../library/tokenize.rst:91 +#: ../../library/tokenize.rst:100 msgid "" "It returns bytes, encoded using the :data:`~token.ENCODING` token, which is " "the first token sequence output by :func:`.tokenize`. If there is no " "encoding token in the input, it returns a str instead." msgstr "" -#: ../../library/tokenize.rst:96 +#: ../../library/tokenize.rst:105 msgid "" ":func:`.tokenize` needs to detect the encoding of source files it tokenizes. " "The function it uses to do this is available:" msgstr "" -#: ../../library/tokenize.rst:101 +#: ../../library/tokenize.rst:110 msgid "" "The :func:`detect_encoding` function is used to detect the encoding that " "should be used to decode a Python source file. It requires one argument, " "readline, in the same way as the :func:`.tokenize` generator." msgstr "" -#: ../../library/tokenize.rst:105 +#: ../../library/tokenize.rst:114 msgid "" "It will call readline a maximum of twice, and return the encoding used (as a " "string) and a list of any lines (not decoded from bytes) it has read in." msgstr "" -#: ../../library/tokenize.rst:109 +#: ../../library/tokenize.rst:118 msgid "" "It detects the encoding from the presence of a UTF-8 BOM or an encoding " "cookie as specified in :pep:`263`. If both a BOM and a cookie are present, " @@ -172,87 +181,87 @@ msgid "" "found, ``'utf-8-sig'`` will be returned as an encoding." msgstr "" -#: ../../library/tokenize.rst:114 +#: ../../library/tokenize.rst:123 msgid "" "If no encoding is specified, then the default of ``'utf-8'`` will be " "returned." msgstr "" -#: ../../library/tokenize.rst:117 +#: ../../library/tokenize.rst:126 msgid "" "Use :func:`.open` to open Python source files: it uses :func:" "`detect_encoding` to detect the file encoding." msgstr "" -#: ../../library/tokenize.rst:123 +#: ../../library/tokenize.rst:132 msgid "" "Open a file in read only mode using the encoding detected by :func:" "`detect_encoding`." msgstr "" -#: ../../library/tokenize.rst:130 +#: ../../library/tokenize.rst:139 msgid "" "Raised when either a docstring or expression that may be split over several " "lines is not completed anywhere in the file, for example::" msgstr "" -#: ../../library/tokenize.rst:136 +#: ../../library/tokenize.rst:145 msgid "or::" msgstr "" "或是:\n" "\n" "::" -#: ../../library/tokenize.rst:142 +#: ../../library/tokenize.rst:151 msgid "" "Note that unclosed single-quoted strings do not cause an error to be raised. " "They are tokenized as :data:`~token.ERRORTOKEN`, followed by the " "tokenization of their contents." msgstr "" -#: ../../library/tokenize.rst:150 +#: ../../library/tokenize.rst:159 msgid "Command-Line Usage" msgstr "" -#: ../../library/tokenize.rst:154 +#: ../../library/tokenize.rst:163 msgid "" "The :mod:`tokenize` module can be executed as a script from the command " "line. It is as simple as:" msgstr "" -#: ../../library/tokenize.rst:161 +#: ../../library/tokenize.rst:170 msgid "The following options are accepted:" msgstr "" -#: ../../library/tokenize.rst:167 +#: ../../library/tokenize.rst:176 msgid "show this help message and exit" msgstr "" -#: ../../library/tokenize.rst:171 +#: ../../library/tokenize.rst:180 msgid "display token names using the exact type" msgstr "" -#: ../../library/tokenize.rst:173 +#: ../../library/tokenize.rst:182 msgid "" "If :file:`filename.py` is specified its contents are tokenized to stdout. " "Otherwise, tokenization is performed on stdin." msgstr "" -#: ../../library/tokenize.rst:177 +#: ../../library/tokenize.rst:186 msgid "Examples" msgstr "範例" -#: ../../library/tokenize.rst:179 +#: ../../library/tokenize.rst:188 msgid "" "Example of a script rewriter that transforms float literals into Decimal " "objects::" msgstr "" -#: ../../library/tokenize.rst:221 +#: ../../library/tokenize.rst:230 msgid "Example of tokenizing from the command line. The script::" msgstr "" -#: ../../library/tokenize.rst:228 +#: ../../library/tokenize.rst:237 msgid "" "will be tokenized to the following output where the first column is the " "range of the line/column coordinates where the token is found, the second " @@ -260,17 +269,17 @@ msgid "" "token (if any)" msgstr "" -#: ../../library/tokenize.rst:256 +#: ../../library/tokenize.rst:265 msgid "" "The exact token type names can be displayed using the :option:`-e` option:" msgstr "" -#: ../../library/tokenize.rst:282 +#: ../../library/tokenize.rst:291 msgid "" "Example of tokenizing a file programmatically, reading unicode strings " "instead of bytes with :func:`generate_tokens`::" msgstr "" -#: ../../library/tokenize.rst:292 +#: ../../library/tokenize.rst:301 msgid "Or reading bytes directly with :func:`.tokenize`::" msgstr "" diff --git a/library/typing.po b/library/typing.po index fe07b58eb7..638e87130a 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-09 00:38+0000\n" +"POT-Creation-Date: 2023-06-10 00:32+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -256,31 +256,25 @@ msgstr "" #: ../../library/typing.rst:152 msgid "" -"Note that ``None`` as a type hint is a special case and is replaced by " -"``type(None)``." -msgstr "" - -#: ../../library/typing.rst:155 -msgid "" "Type aliases may be marked with :data:`TypeAlias` to make it explicit that " "the statement is a type alias declaration, not a normal variable assignment::" msgstr "" -#: ../../library/typing.rst:165 +#: ../../library/typing.rst:162 msgid "NewType" msgstr "NewType" -#: ../../library/typing.rst:167 +#: ../../library/typing.rst:164 msgid "Use the :class:`NewType` helper to create distinct types::" msgstr "" -#: ../../library/typing.rst:174 +#: ../../library/typing.rst:171 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. This is useful in helping catch logical errors::" msgstr "" -#: ../../library/typing.rst:186 +#: ../../library/typing.rst:183 msgid "" "You may still perform all ``int`` operations on a variable of type " "``UserId``, but the result will always be of type ``int``. This lets you " @@ -288,7 +282,7 @@ msgid "" "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" -#: ../../library/typing.rst:194 +#: ../../library/typing.rst:191 msgid "" "Note that these checks are enforced only by the static type checker. At " "runtime, the statement ``Derived = NewType('Derived', Base)`` will make " @@ -297,31 +291,31 @@ msgid "" "class or introduce much overhead beyond that of a regular function call." msgstr "" -#: ../../library/typing.rst:200 +#: ../../library/typing.rst:197 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" -#: ../../library/typing.rst:203 +#: ../../library/typing.rst:200 msgid "It is invalid to create a subtype of ``Derived``::" msgstr "" -#: ../../library/typing.rst:212 +#: ../../library/typing.rst:209 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" -#: ../../library/typing.rst:220 +#: ../../library/typing.rst:217 msgid "and typechecking for ``ProUserId`` will work as expected." msgstr "" -#: ../../library/typing.rst:222 +#: ../../library/typing.rst:219 msgid "See :pep:`484` for more details." msgstr "更多細節請見 :pep:`484`\\ 。" -#: ../../library/typing.rst:226 +#: ../../library/typing.rst:223 msgid "" "Recall that the use of a type alias declares two types to be *equivalent* to " "one another. Doing ``Alias = Original`` will make the static type checker " @@ -329,7 +323,7 @@ msgid "" "This is useful when you want to simplify complex type signatures." msgstr "" -#: ../../library/typing.rst:231 +#: ../../library/typing.rst:228 msgid "" "In contrast, ``NewType`` declares one type to be a *subtype* of another. " "Doing ``Derived = NewType('Derived', Original)`` will make the static type " @@ -339,30 +333,30 @@ msgid "" "errors with minimal runtime cost." msgstr "" -#: ../../library/typing.rst:240 +#: ../../library/typing.rst:237 msgid "" "``NewType`` is now a class rather than a function. As a result, there is " "some additional runtime cost when calling ``NewType`` over a regular " "function." msgstr "" -#: ../../library/typing.rst:245 +#: ../../library/typing.rst:242 msgid "" "The performance of calling ``NewType`` has been restored to its level in " "Python 3.9." msgstr "" -#: ../../library/typing.rst:251 +#: ../../library/typing.rst:248 msgid "Callable" msgstr "" -#: ../../library/typing.rst:253 +#: ../../library/typing.rst:250 msgid "" "Frameworks expecting callback functions of specific signatures might be type " "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:256 ../../library/typing.rst:3040 +#: ../../library/typing.rst:253 ../../library/typing.rst:3103 #, fuzzy msgid "For example:" msgstr "" @@ -370,14 +364,14 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:274 +#: ../../library/typing.rst:271 msgid "" "It is possible to declare the return type of a callable without specifying " "the call signature by substituting a literal ellipsis for the list of " "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:278 ../../library/typing.rst:931 +#: ../../library/typing.rst:275 ../../library/typing.rst:935 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -388,97 +382,97 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:286 ../../library/typing.rst:943 +#: ../../library/typing.rst:283 ../../library/typing.rst:947 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:291 +#: ../../library/typing.rst:288 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:297 +#: ../../library/typing.rst:294 msgid "Generics" msgstr "" -#: ../../library/typing.rst:299 +#: ../../library/typing.rst:296 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, many container classes in the standard library " "support subscription to denote the expected types of container elements." msgstr "" -#: ../../library/typing.rst:316 +#: ../../library/typing.rst:313 msgid "" "Generics can be parameterized by using a factory available in typing called :" "class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:332 +#: ../../library/typing.rst:329 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:334 +#: ../../library/typing.rst:331 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:360 +#: ../../library/typing.rst:357 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:364 +#: ../../library/typing.rst:361 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[T]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:373 +#: ../../library/typing.rst:370 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:385 +#: ../../library/typing.rst:382 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:396 +#: ../../library/typing.rst:393 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:406 +#: ../../library/typing.rst:403 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:416 +#: ../../library/typing.rst:413 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:418 +#: ../../library/typing.rst:415 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``:" msgstr "" -#: ../../library/typing.rst:429 +#: ../../library/typing.rst:426 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:446 +#: ../../library/typing.rst:443 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:449 +#: ../../library/typing.rst:446 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -488,7 +482,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:465 +#: ../../library/typing.rst:462 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -496,20 +490,20 @@ msgid "" "converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:477 +#: ../../library/typing.rst:474 msgid "" "Note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:481 +#: ../../library/typing.rst:478 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:485 +#: ../../library/typing.rst:482 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -517,24 +511,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:492 +#: ../../library/typing.rst:489 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:494 +#: ../../library/typing.rst:491 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:498 +#: ../../library/typing.rst:495 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:516 +#: ../../library/typing.rst:513 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -543,19 +537,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:522 +#: ../../library/typing.rst:519 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:535 +#: ../../library/typing.rst:532 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:538 +#: ../../library/typing.rst:535 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -563,7 +557,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:543 +#: ../../library/typing.rst:540 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -571,24 +565,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:565 +#: ../../library/typing.rst:562 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:570 +#: ../../library/typing.rst:567 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:572 +#: ../../library/typing.rst:569 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:576 +#: ../../library/typing.rst:573 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -597,7 +591,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:589 +#: ../../library/typing.rst:586 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -606,22 +600,22 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:605 +#: ../../library/typing.rst:602 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:610 +#: ../../library/typing.rst:607 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:612 +#: ../../library/typing.rst:609 msgid "The module defines the following classes, functions and decorators." msgstr "" -#: ../../library/typing.rst:616 +#: ../../library/typing.rst:613 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -630,7 +624,7 @@ msgid "" "existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:622 +#: ../../library/typing.rst:619 msgid "" "The redundant types are deprecated as of Python 3.9 but no deprecation " "warnings are issued by the interpreter. It is expected that type checkers " @@ -638,7 +632,7 @@ msgid "" "or newer." msgstr "" -#: ../../library/typing.rst:627 +#: ../../library/typing.rst:624 msgid "" "The deprecated types will be removed from the :mod:`typing` module no sooner " "than the first Python version released 5 years after the release of Python " @@ -646,58 +640,74 @@ msgid "" "Collections*." msgstr "" -#: ../../library/typing.rst:633 +#: ../../library/typing.rst:630 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:636 +#: ../../library/typing.rst:633 msgid "Special types" msgstr "" -#: ../../library/typing.rst:638 +#: ../../library/typing.rst:635 msgid "These can be used as types in annotations and do not support ``[]``." msgstr "" -#: ../../library/typing.rst:642 +#: ../../library/typing.rst:639 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:644 +#: ../../library/typing.rst:641 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:645 +#: ../../library/typing.rst:642 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:647 +#: ../../library/typing.rst:644 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:654 -msgid "" -"``AnyStr`` is a :ref:`constrained type variable ` defined as ``AnyStr = TypeVar('AnyStr', str, bytes)``." +#: ../../library/typing.rst:651 +msgid "A :ref:`constrained type variable `." +msgstr "" + +#: ../../library/typing.rst:653 +msgid "Definition::" msgstr "" #: ../../library/typing.rst:657 msgid "" -"It is meant to be used for functions that may accept any kind of string " -"without allowing different kinds of strings to mix. For example::" +"``AnyStr`` is meant to be used for functions that may accept :class:`str` " +"or :class:`bytes` arguments but cannot allow the two to mix." msgstr "" -#: ../../library/typing.rst:669 +#: ../../library/typing.rst:660 ../../library/typing.rst:736 +#: ../../library/typing.rst:756 ../../library/typing.rst:802 +#: ../../library/typing.rst:1068 ../../library/typing.rst:1125 +#: ../../library/typing.rst:1333 ../../library/typing.rst:2943 +msgid "For example::" +msgstr "" +"舉例來說:\n" +"\n" +"::" + +#: ../../library/typing.rst:671 +msgid "Special type that includes only literal strings." +msgstr "" + +#: ../../library/typing.rst:673 msgid "" -"Special type that includes only literal strings. A string literal is " -"compatible with ``LiteralString``, as is another ``LiteralString``, but an " -"object typed as just ``str`` is not. A string created by composing " -"``LiteralString``-typed objects is also acceptable as a ``LiteralString``." +"Any string literal is compatible with ``LiteralString``, as is another " +"``LiteralString``. However, an object typed as just ``str`` is not. A string " +"created by composing ``LiteralString``-typed objects is also acceptable as a " +"``LiteralString``." msgstr "" -#: ../../library/typing.rst:675 +#: ../../library/typing.rst:679 #, fuzzy msgid "Example:" msgstr "" @@ -705,40 +715,41 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:691 +#: ../../library/typing.rst:695 msgid "" -"This is useful for sensitive APIs where arbitrary user-generated strings " -"could generate problems. For example, the two cases above that generate type " -"checker errors could be vulnerable to an SQL injection attack." +"``LiteralString`` is useful for sensitive APIs where arbitrary user-" +"generated strings could generate problems. For example, the two cases above " +"that generate type checker errors could be vulnerable to an SQL injection " +"attack." msgstr "" -#: ../../library/typing.rst:696 +#: ../../library/typing.rst:700 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:702 +#: ../../library/typing.rst:706 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:705 +#: ../../library/typing.rst:709 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:725 +#: ../../library/typing.rst:729 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:730 -msgid "Special type indicating that a function never returns. For example::" +#: ../../library/typing.rst:734 +msgid "Special type indicating that a function never returns." msgstr "" -#: ../../library/typing.rst:738 +#: ../../library/typing.rst:743 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -746,169 +757,158 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:749 -msgid "Special type to represent the current enclosed class. For example::" +#: ../../library/typing.rst:754 +msgid "Special type to represent the current enclosed class." msgstr "" -#: ../../library/typing.rst:760 +#: ../../library/typing.rst:766 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:772 +#: ../../library/typing.rst:778 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:779 +#: ../../library/typing.rst:785 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:782 +#: ../../library/typing.rst:788 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:784 +#: ../../library/typing.rst:790 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:786 +#: ../../library/typing.rst:792 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:788 +#: ../../library/typing.rst:794 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:794 +#: ../../library/typing.rst:800 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: ../../library/typing.rst:796 ../../library/typing.rst:1309 -msgid "For example::" -msgstr "" -"舉例來說:\n" -"\n" -"::" - -#: ../../library/typing.rst:802 +#: ../../library/typing.rst:808 msgid "" "``TypeAlias`` is particularly useful for annotating aliases that make use of " "forward references, as it can be hard for type checkers to distinguish these " "from normal variable assignments:" msgstr "" -#: ../../library/typing.rst:822 +#: ../../library/typing.rst:828 #, fuzzy msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:827 +#: ../../library/typing.rst:833 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:829 +#: ../../library/typing.rst:835 msgid "" "These can be used as types in annotations using ``[]``, each having a unique " "syntax." msgstr "" -#: ../../library/typing.rst:833 +#: ../../library/typing.rst:839 msgid "Deprecated alias for :class:`tuple`." msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:841 msgid "" "``Tuple[X, Y]`` is the type of a tuple of two items with the first item of " "type X and the second of type Y. The type of the empty tuple can be written " "as ``Tuple[()]``." msgstr "" -#: ../../library/typing.rst:839 +#: ../../library/typing.rst:845 msgid "" "Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " "variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " "float and a string." msgstr "" -#: ../../library/typing.rst:843 +#: ../../library/typing.rst:849 msgid "" "To specify a variable-length tuple of homogeneous type, use literal " "ellipsis, e.g. ``Tuple[int, ...]``. A plain ``Tuple`` annotation is " "equivalent to ``tuple``, ``Tuple[Any, ...]``, or ``tuple[Any, ...]``." msgstr "" -#: ../../library/typing.rst:847 +#: ../../library/typing.rst:853 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:853 +#: ../../library/typing.rst:859 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:855 +#: ../../library/typing.rst:861 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:857 +#: ../../library/typing.rst:863 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:859 +#: ../../library/typing.rst:865 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:863 +#: ../../library/typing.rst:869 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:867 +#: ../../library/typing.rst:873 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:871 +#: ../../library/typing.rst:877 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:875 +#: ../../library/typing.rst:881 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:877 +#: ../../library/typing.rst:883 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:879 +#: ../../library/typing.rst:885 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:882 +#: ../../library/typing.rst:888 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:888 -msgid "Optional type." -msgstr "" - -#: ../../library/typing.rst:890 +#: ../../library/typing.rst:894 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:892 +#: ../../library/typing.rst:896 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -916,30 +916,30 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:900 +#: ../../library/typing.rst:904 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:907 +#: ../../library/typing.rst:911 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:913 +#: ../../library/typing.rst:917 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "" -#: ../../library/typing.rst:915 +#: ../../library/typing.rst:919 msgid "" "``Callable[[int], str]`` signifies a function that takes a single parameter " "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:918 +#: ../../library/typing.rst:922 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " @@ -947,7 +947,7 @@ msgid "" "type must be a single type." msgstr "" -#: ../../library/typing.rst:923 +#: ../../library/typing.rst:927 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -957,29 +957,34 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:939 +#: ../../library/typing.rst:943 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:948 +#: ../../library/typing.rst:952 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:953 +#: ../../library/typing.rst:957 +msgid "Special form for annotating higher-order functions." +msgstr "" + +#: ../../library/typing.rst:959 msgid "" -"Used with :data:`Callable` and :class:`ParamSpec` to type annotate a higher " -"order callable which adds, removes, or transforms parameters of another " -"callable. Usage is in the form ``Concatenate[Arg1Type, Arg2Type, ..., " -"ParamSpecVariable]``. ``Concatenate`` is currently only valid when used as " -"the first argument to a :data:`Callable`. The last parameter to " -"``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." +"``Concatenate`` can be used in conjunction with :data:`Callable` and :class:" +"`ParamSpec` to annotate a higher-order callable which adds, removes, or " +"transforms parameters of another callable. Usage is in the form " +"``Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable]``. ``Concatenate`` " +"is currently only valid when used as the first argument to a :data:" +"`Callable`. The last parameter to ``Concatenate`` must be a :class:" +"`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:961 +#: ../../library/typing.rst:968 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -990,21 +995,21 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1000 ../../library/typing.rst:1687 +#: ../../library/typing.rst:1007 ../../library/typing.rst:1712 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:1002 +#: ../../library/typing.rst:1009 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:1007 +#: ../../library/typing.rst:1014 msgid "Deprecated alias to :class:`type`." msgstr "" -#: ../../library/typing.rst:1009 +#: ../../library/typing.rst:1016 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``type[C]`` or ``Type[C]`` may accept " @@ -1012,11 +1017,11 @@ msgid "" "*class object* of ``C``. For example::" msgstr "" -#: ../../library/typing.rst:1018 +#: ../../library/typing.rst:1025 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:1030 +#: ../../library/typing.rst:1037 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -1026,39 +1031,42 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:1038 +#: ../../library/typing.rst:1045 msgid "" "The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:1044 +#: ../../library/typing.rst:1051 msgid "" "``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " "``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:1049 +#: ../../library/typing.rst:1056 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1055 +#: ../../library/typing.rst:1062 +msgid "Special typing form to define \"literal types\"." +msgstr "" + +#: ../../library/typing.rst:1064 msgid "" -"A type that can be used to indicate to type checkers that the corresponding " -"variable or function parameter has a value equivalent to the provided " -"literal (or one of several literals). For example::" +"``Literal`` can be used to indicate to type checkers that the annotated " +"object has a value equivalent to one of the provided literals." msgstr "" -#: ../../library/typing.rst:1069 +#: ../../library/typing.rst:1080 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:1075 +#: ../../library/typing.rst:1086 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1066,22 +1074,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1083 +#: ../../library/typing.rst:1094 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1085 +#: ../../library/typing.rst:1096 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1093 +#: ../../library/typing.rst:1104 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1095 +#: ../../library/typing.rst:1106 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1089,33 +1097,48 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1109 +#: ../../library/typing.rst:1120 +msgid "Special typing construct to indicate final names to type checkers." +msgstr "" + +#: ../../library/typing.rst:1122 msgid "" -"A special typing construct to indicate to type checkers that a name cannot " -"be re-assigned or overridden in a subclass. For example::" +"Final names cannot be reassigned in any scope. Final names declared in class " +"scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1121 ../../library/typing.rst:2904 +#: ../../library/typing.rst:1136 ../../library/typing.rst:2959 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1130 +#: ../../library/typing.rst:1143 +msgid "Special typing construct to mark a :class:`TypedDict` key as required." +msgstr "" + +#: ../../library/typing.rst:1145 +#, fuzzy msgid "" -"Special typing constructs that mark individual keys of a :class:`TypedDict` " -"as either required or non-required respectively." +"This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " +"and :pep:`655` for more details." +msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" + +#: ../../library/typing.rst:1152 +msgid "" +"Special typing construct to mark a :class:`TypedDict` key as potentially " +"missing." msgstr "" -#: ../../library/typing.rst:1133 +#: ../../library/typing.rst:1155 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1139 +#: ../../library/typing.rst:1161 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1141 +#: ../../library/typing.rst:1163 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1123,7 +1146,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1146 +#: ../../library/typing.rst:1168 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1132,7 +1155,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1152 +#: ../../library/typing.rst:1174 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1142,7 +1165,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1159 +#: ../../library/typing.rst:1181 msgid "" "The responsibility of how to interpret the metadata lies with the the tool " "or library encountering an ``Annotated`` annotation. A tool or library " @@ -1150,64 +1173,64 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1167 +#: ../../library/typing.rst:1189 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1180 +#: ../../library/typing.rst:1202 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1182 +#: ../../library/typing.rst:1204 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1184 +#: ../../library/typing.rst:1206 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1193 +#: ../../library/typing.rst:1215 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1197 +#: ../../library/typing.rst:1219 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1200 +#: ../../library/typing.rst:1222 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1207 +#: ../../library/typing.rst:1229 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1214 +#: ../../library/typing.rst:1236 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1220 +#: ../../library/typing.rst:1242 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1233 +#: ../../library/typing.rst:1255 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1237 +#: ../../library/typing.rst:1259 #, fuzzy msgid "This would be equivalent to::" msgstr "" @@ -1215,40 +1238,44 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:1241 +#: ../../library/typing.rst:1263 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1244 +#: ../../library/typing.rst:1266 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1257 +#: ../../library/typing.rst:1279 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1271 +#: ../../library/typing.rst:1293 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1272 +#: ../../library/typing.rst:1294 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1279 +#: ../../library/typing.rst:1301 +msgid "Special typing construct for marking user-defined type guard functions." +msgstr "" + +#: ../../library/typing.rst:1303 msgid "" -"Special typing form used to annotate the return type of a user-defined type " +"``TypeGuard`` can be used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1283 +#: ../../library/typing.rst:1307 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1257,44 +1284,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1298 +#: ../../library/typing.rst:1322 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1302 +#: ../../library/typing.rst:1326 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1305 +#: ../../library/typing.rst:1329 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1306 +#: ../../library/typing.rst:1330 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1323 +#: ../../library/typing.rst:1347 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1327 +#: ../../library/typing.rst:1351 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1333 +#: ../../library/typing.rst:1357 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1303,21 +1330,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1339 +#: ../../library/typing.rst:1363 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1346 +#: ../../library/typing.rst:1370 +msgid "Typing operator to conceptually mark an object as having been unpacked." +msgstr "" + +#: ../../library/typing.rst:1372 msgid "" -"A typing operator that conceptually marks an object as having been unpacked. " "For example, using the unpack operator ``*`` on a :class:`type variable " "tuple ` is equivalent to using ``Unpack`` to mark the type " "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1356 +#: ../../library/typing.rst:1381 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1325,44 +1355,45 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1373 +#: ../../library/typing.rst:1398 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1375 +#: ../../library/typing.rst:1400 msgid "" "The following objects are not used directly in annotations. Instead, they " "are building blocks for creating generic types." msgstr "" -#: ../../library/typing.rst:1380 +#: ../../library/typing.rst:1405 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1382 +#: ../../library/typing.rst:1407 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1391 +#: ../../library/typing.rst:1416 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1404 +#: ../../library/typing.rst:1429 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1406 ../../library/typing.rst:1502 -#: ../../library/typing.rst:1612 ../../library/typing.rst:1718 +#: ../../library/typing.rst:1431 ../../library/typing.rst:1527 +#: ../../library/typing.rst:1637 ../../library/typing.rst:1748 +#: ../../library/typing.rst:1819 ../../library/typing.rst:3143 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1412 +#: ../../library/typing.rst:1437 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1370,69 +1401,69 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1433 +#: ../../library/typing.rst:1458 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1436 +#: ../../library/typing.rst:1461 msgid "" "Created type variables may be explicitly marked covariant or contravariant " "by passing ``covariant=True`` or ``contravariant=True``. By default, type " "variables are invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1441 +#: ../../library/typing.rst:1466 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1456 +#: ../../library/typing.rst:1481 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1464 +#: ../../library/typing.rst:1489 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1475 +#: ../../library/typing.rst:1500 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1479 +#: ../../library/typing.rst:1504 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1483 +#: ../../library/typing.rst:1508 msgid "Whether the type var has been marked as covariant." msgstr "" -#: ../../library/typing.rst:1487 +#: ../../library/typing.rst:1512 msgid "Whether the type var has been marked as contravariant." msgstr "" -#: ../../library/typing.rst:1491 +#: ../../library/typing.rst:1516 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1495 +#: ../../library/typing.rst:1520 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1499 +#: ../../library/typing.rst:1524 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1510 +#: ../../library/typing.rst:1535 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1440,7 +1471,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1532 +#: ../../library/typing.rst:1557 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1450,36 +1481,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1540 +#: ../../library/typing.rst:1565 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1547 +#: ../../library/typing.rst:1572 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1556 +#: ../../library/typing.rst:1581 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1575 +#: ../../library/typing.rst:1600 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1582 +#: ../../library/typing.rst:1607 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1592 +#: ../../library/typing.rst:1617 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1488,21 +1519,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1599 +#: ../../library/typing.rst:1624 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1603 +#: ../../library/typing.rst:1628 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1609 +#: ../../library/typing.rst:1634 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1616 +#: ../../library/typing.rst:1641 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1512,7 +1543,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1623 +#: ../../library/typing.rst:1648 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1520,27 +1551,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1647 +#: ../../library/typing.rst:1672 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1651 +#: ../../library/typing.rst:1676 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1653 +#: ../../library/typing.rst:1678 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1660 +#: ../../library/typing.rst:1685 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1553,11 +1584,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1697 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1674 +#: ../../library/typing.rst:1699 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1566,17 +1597,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1683 +#: ../../library/typing.rst:1708 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1689 +#: ../../library/typing.rst:1714 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1694 +#: ../../library/typing.rst:1719 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1584,44 +1615,44 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1699 +#: ../../library/typing.rst:1724 msgid "" "Calling :func:`get_origin` on either of these objects will return the " -"original ``ParamSpec``::" +"original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1710 +#: ../../library/typing.rst:1740 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1712 +#: ../../library/typing.rst:1742 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1716 +#: ../../library/typing.rst:1746 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1724 +#: ../../library/typing.rst:1754 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1728 +#: ../../library/typing.rst:1758 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1737 +#: ../../library/typing.rst:1767 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1739 +#: ../../library/typing.rst:1769 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1630,77 +1661,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1745 +#: ../../library/typing.rst:1775 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1755 +#: ../../library/typing.rst:1785 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1761 +#: ../../library/typing.rst:1791 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1765 +#: ../../library/typing.rst:1795 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1768 +#: ../../library/typing.rst:1798 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1771 +#: ../../library/typing.rst:1801 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1775 +#: ../../library/typing.rst:1805 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1779 +#: ../../library/typing.rst:1809 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1784 +#: ../../library/typing.rst:1814 +msgid "Helper class to create low-overhead :ref:`distinct types `." +msgstr "" + +#: ../../library/typing.rst:1816 msgid "" -"A helper class to indicate a distinct type to a typechecker, see :ref:" -"`distinct`. At runtime it returns an object that returns its argument when " -"called. Usage::" +"A ``NewType`` is considered a distinct type by a typechecker. At runtime, " +"however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:1794 +#: ../../library/typing.rst:1826 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1798 +#: ../../library/typing.rst:1830 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1802 +#: ../../library/typing.rst:1834 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1806 +#: ../../library/typing.rst:1838 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1811 -msgid "" -"Base class for protocol classes. Protocol classes are defined like this::" +#: ../../library/typing.rst:1843 +msgid "Base class for protocol classes." +msgstr "" + +#: ../../library/typing.rst:1845 +msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1817 +#: ../../library/typing.rst:1851 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1829 +#: ../../library/typing.rst:1863 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1708,15 +1745,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1834 +#: ../../library/typing.rst:1868 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1846 +#: ../../library/typing.rst:1880 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1848 +#: ../../library/typing.rst:1882 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1725,7 +1762,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1868 +#: ../../library/typing.rst:1902 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1736,7 +1773,7 @@ msgid "" "SSLObject`." msgstr "" -#: ../../library/typing.rst:1879 +#: ../../library/typing.rst:1913 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1744,13 +1781,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1890 +#: ../../library/typing.rst:1924 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1893 +#: ../../library/typing.rst:1927 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1758,53 +1795,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1909 +#: ../../library/typing.rst:1943 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1913 +#: ../../library/typing.rst:1947 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1917 +#: ../../library/typing.rst:1951 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1924 +#: ../../library/typing.rst:1958 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1925 +#: ../../library/typing.rst:1959 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1937 +#: ../../library/typing.rst:1971 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1948 +#: ../../library/typing.rst:1982 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1951 +#: ../../library/typing.rst:1985 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1961 +#: ../../library/typing.rst:1995 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1812,73 +1849,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1966 +#: ../../library/typing.rst:2000 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:1981 +#: ../../library/typing.rst:2015 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1988 +#: ../../library/typing.rst:2022 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1996 +#: ../../library/typing.rst:2030 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2014 -msgid "A ``TypedDict`` can be generic::" +#: ../../library/typing.rst:2048 +msgid "A ``TypedDict`` can be generic:" msgstr "" -#: ../../library/typing.rst:2018 -msgid "T = TypeVar(\"T\")" -msgstr "" - -#: ../../library/typing.rst:2022 -msgid "class Group(TypedDict, Generic[T]):" -msgstr "" - -#: ../../library/typing.rst:2021 -msgid "key: T group: list[T]" -msgstr "" - -#: ../../library/typing.rst:2024 +#: ../../library/typing.rst:2058 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2030 +#: ../../library/typing.rst:2064 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2052 +#: ../../library/typing.rst:2086 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2055 +#: ../../library/typing.rst:2089 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2058 +#: ../../library/typing.rst:2092 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1887,712 +1912,729 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2081 +#: ../../library/typing.rst:2115 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2085 +#: ../../library/typing.rst:2119 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2089 +#: ../../library/typing.rst:2123 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2093 +#: ../../library/typing.rst:2127 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:2096 +#: ../../library/typing.rst:2130 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:2100 +#: ../../library/typing.rst:2134 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2102 +#: ../../library/typing.rst:2136 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2106 +#: ../../library/typing.rst:2140 ../../library/typing.rst:2367 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2111 +#: ../../library/typing.rst:2145 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2117 +#: ../../library/typing.rst:2151 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2119 +#: ../../library/typing.rst:2153 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2123 +#: ../../library/typing.rst:2157 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2133 +#: ../../library/typing.rst:2167 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2139 +#: ../../library/typing.rst:2173 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2141 +#: ../../library/typing.rst:2175 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2145 +#: ../../library/typing.rst:2179 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2151 +#: ../../library/typing.rst:2185 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2153 +#: ../../library/typing.rst:2187 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2158 +#: ../../library/typing.rst:2192 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:2161 +#: ../../library/typing.rst:2195 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2165 +#: ../../library/typing.rst:2199 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2169 +#: ../../library/typing.rst:2203 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2175 +#: ../../library/typing.rst:2209 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2179 +#: ../../library/typing.rst:2213 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2185 +#: ../../library/typing.rst:2219 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2190 +#: ../../library/typing.rst:2224 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2196 +#: ../../library/typing.rst:2230 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2201 +#: ../../library/typing.rst:2235 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2241 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2212 +#: ../../library/typing.rst:2246 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2217 +#: ../../library/typing.rst:2251 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2223 +#: ../../library/typing.rst:2257 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2230 +#: ../../library/typing.rst:2264 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2235 +#: ../../library/typing.rst:2269 msgid "" -"These type aliases correspond to the return types from :func:`re.compile` " -"and :func:`re.match`. These types (and the corresponding functions) are " -"generic in ``AnyStr`` and can be made specific by writing ``Pattern[str]``, " -"``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." +"Deprecated aliases corresponding to the return types from :func:`re.compile` " +"and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2245 +#: ../../library/typing.rst:2272 +msgid "" +"These types (and the corresponding functions) are generic over :data:" +"`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " +"``Pattern[bytes]``; ``Match`` can be specialised as ``Match[str]`` or " +"``Match[bytes]``." +msgstr "" + +#: ../../library/typing.rst:2280 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2246 +#: ../../library/typing.rst:2281 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2252 +#: ../../library/typing.rst:2287 +msgid "Deprecated alias for :class:`str`." +msgstr "" + +#: ../../library/typing.rst:2289 msgid "" -"``Text`` is an alias for ``str``. It is provided to supply a forward " -"compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " -"``unicode``." +"``Text`` is provided to supply a forward compatible path for Python 2 code: " +"in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:2256 +#: ../../library/typing.rst:2293 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2264 +#: ../../library/typing.rst:2301 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2308 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2274 +#: ../../library/typing.rst:2311 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2278 +#: ../../library/typing.rst:2315 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2280 +#: ../../library/typing.rst:2317 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2286 +#: ../../library/typing.rst:2323 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2290 +#: ../../library/typing.rst:2327 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2294 +#: ../../library/typing.rst:2331 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2298 +#: ../../library/typing.rst:2335 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2304 +#: ../../library/typing.rst:2341 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2306 +#: ../../library/typing.rst:2343 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2312 +#: ../../library/typing.rst:2349 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2314 +#: ../../library/typing.rst:2351 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2320 +#: ../../library/typing.rst:2357 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2322 +#: ../../library/typing.rst:2359 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2328 -msgid "" -"Deprecated alias to :class:`collections.abc.Mapping`. This type can be used " -"as follows::" +#: ../../library/typing.rst:2365 +msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:2334 +#: ../../library/typing.rst:2372 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2340 +#: ../../library/typing.rst:2378 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2342 +#: ../../library/typing.rst:2380 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2348 +#: ../../library/typing.rst:2386 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2350 +#: ../../library/typing.rst:2388 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2357 +#: ../../library/typing.rst:2395 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2359 +#: ../../library/typing.rst:2397 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2366 +#: ../../library/typing.rst:2404 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2368 +#: ../../library/typing.rst:2406 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2374 +#: ../../library/typing.rst:2412 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2376 +#: ../../library/typing.rst:2414 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2382 +#: ../../library/typing.rst:2420 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2384 +#: ../../library/typing.rst:2422 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2389 +#: ../../library/typing.rst:2427 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2393 +#: ../../library/typing.rst:2431 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2395 +#: ../../library/typing.rst:2433 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2401 +#: ../../library/typing.rst:2439 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2403 +#: ../../library/typing.rst:2441 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2409 +#: ../../library/typing.rst:2447 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:2411 +#: ../../library/typing.rst:2449 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2420 +#: ../../library/typing.rst:2458 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2424 +#: ../../library/typing.rst:2462 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2432 +#: ../../library/typing.rst:2470 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2440 +#: ../../library/typing.rst:2478 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2446 +#: ../../library/typing.rst:2484 msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2450 +#: ../../library/typing.rst:2488 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2452 +#: ../../library/typing.rst:2490 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2458 +#: ../../library/typing.rst:2496 msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2461 +#: ../../library/typing.rst:2499 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2465 +#: ../../library/typing.rst:2503 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:2467 +#: ../../library/typing.rst:2505 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:2478 +#: ../../library/typing.rst:2516 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2484 +#: ../../library/typing.rst:2522 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:2486 +#: ../../library/typing.rst:2524 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2495 +#: ../../library/typing.rst:2533 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2499 +#: ../../library/typing.rst:2537 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2507 +#: ../../library/typing.rst:2545 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2517 +#: ../../library/typing.rst:2555 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2524 +#: ../../library/typing.rst:2562 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2528 +#: ../../library/typing.rst:2566 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2534 +#: ../../library/typing.rst:2572 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2538 +#: ../../library/typing.rst:2576 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2544 +#: ../../library/typing.rst:2582 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2548 +#: ../../library/typing.rst:2586 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2554 +#: ../../library/typing.rst:2592 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2558 +#: ../../library/typing.rst:2596 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2563 +#: ../../library/typing.rst:2601 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2570 +#: ../../library/typing.rst:2608 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2575 +#: ../../library/typing.rst:2613 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2581 +#: ../../library/typing.rst:2619 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2583 +#: ../../library/typing.rst:2621 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2587 +#: ../../library/typing.rst:2625 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2592 +#: ../../library/typing.rst:2630 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2596 +#: ../../library/typing.rst:2634 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2600 +#: ../../library/typing.rst:2638 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2604 +#: ../../library/typing.rst:2642 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2610 +#: ../../library/typing.rst:2648 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2614 +#: ../../library/typing.rst:2652 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2618 +#: ../../library/typing.rst:2656 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2622 +#: ../../library/typing.rst:2660 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2624 +#: ../../library/typing.rst:2662 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2631 +#: ../../library/typing.rst:2669 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2633 +#: ../../library/typing.rst:2671 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2636 +#: ../../library/typing.rst:2674 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2643 +#: ../../library/typing.rst:2681 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2657 +#: ../../library/typing.rst:2695 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2659 +#: ../../library/typing.rst:2697 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2670 +#: ../../library/typing.rst:2708 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " -"and both options are covered by earlier cases. If a type checker finds that " -"a call to ``assert_never()`` is reachable, it will emit an error. For " -"example, if the type annotation for ``arg`` was instead ``int | str | " -"float``, the type checker would emit an error pointing out that " -"``unreachable`` is of type :class:`float`. For a call to ``assert_never`` to " -"pass type checking, the inferred type of the argument passed in must be the " -"bottom type, :data:`Never`, and nothing else." +"and both options are covered by earlier cases." +msgstr "" + +#: ../../library/typing.rst:2713 +msgid "" +"If a type checker finds that a call to ``assert_never()`` is reachable, it " +"will emit an error. For example, if the type annotation for ``arg`` was " +"instead ``int | str | float``, the type checker would emit an error pointing " +"out that ``unreachable`` is of type :class:`float`. For a call to " +"``assert_never`` to pass type checking, the inferred type of the argument " +"passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2682 +#: ../../library/typing.rst:2721 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2685 +#: ../../library/typing.rst:2724 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2693 +#: ../../library/typing.rst:2732 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2695 +#: ../../library/typing.rst:2734 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2701 +#: ../../library/typing.rst:2740 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2704 +#: ../../library/typing.rst:2743 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2709 +#: ../../library/typing.rst:2748 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2714 +#: ../../library/typing.rst:2753 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2724 +#: ../../library/typing.rst:2763 msgid "" -":data:`~typing.dataclass_transform` may be used to decorate a class, " -"metaclass, or a function that is itself a decorator. The presence of " +"Decorator to mark an object as providing :func:`~dataclasses.dataclass`-like " +"behavior." +msgstr "" + +#: ../../library/typing.rst:2766 +msgid "" +"``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:" -"`dataclasses.dataclass`-like behaviors." +"object performs runtime \"magic\" that transforms a class in a similar way " +"to :func:`dataclasses.dataclass`." msgstr "" -#: ../../library/typing.rst:2730 +#: ../../library/typing.rst:2772 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2746 +#: ../../library/typing.rst:2788 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2755 +#: ../../library/typing.rst:2797 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2766 +#: ../../library/typing.rst:2808 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " -"*func*. *func* is the function object for the implementation of the " -"overloaded function. For example, given the definition of ``process`` in the " +"*func*." +msgstr "" + +#: ../../library/typing.rst:2913 +msgid "" +"*func* is the function object for the implementation of the overloaded " +"function. For example, given the definition of ``process`` in the " "documentation for :func:`@overload `, ``get_overloads(process)`` " "will return a sequence of three function objects for the three defined " "overloads. If called on a function with no overloads, ``get_overloads()`` " "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2870 +#: ../../library/typing.rst:2920 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2878 -msgid "" -"Clear all registered overloads in the internal registry. This can be used to " -"reclaim the memory used by the registry." +#: ../../library/typing.rst:2928 +msgid "Clear all registered overloads in the internal registry." +msgstr "" + +#: ../../library/typing.rst:2930 +msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2886 +#: ../../library/typing.rst:2937 +msgid "Decorator to indicate final methods and final classes." +msgstr "" + +#: ../../library/typing.rst:2939 msgid "" -"A decorator to indicate to type checkers that the decorated method cannot be " -"overridden, and the decorated class cannot be subclassed. For example::" +"Decorating a method with ``@final`` indicates to a type checker that the " +"method cannot be overridden in a subclass. Decorating a class with " +"``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2909 +#: ../../library/typing.rst:2964 msgid "" -"The decorator will now set the ``__final__`` attribute to ``True`` on the " -"decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " +"The decorator will now attempt to set a ``__final__`` attribute to ``True`` " +"on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " "False)`` can be used at runtime to determine whether an object ``obj`` has " "been marked as final. If the decorated object does not support setting " "attributes, the decorator returns the object unchanged without raising an " "exception." msgstr "" -#: ../../library/typing.rst:2920 +#: ../../library/typing.rst:2975 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2922 +#: ../../library/typing.rst:2977 msgid "" -"This works as class or function :term:`decorator`. With a class, it applies " -"recursively to all methods and classes defined in that class (but not to " -"methods defined in its superclasses or subclasses)." +"This works as a class or function :term:`decorator`. With a class, it " +"applies recursively to all methods and classes defined in that class (but " +"not to methods defined in its superclasses or subclasses). Type checkers " +"will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2926 -msgid "This mutates the function(s) in place." +#: ../../library/typing.rst:2983 +msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2930 +#: ../../library/typing.rst:2987 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2932 +#: ../../library/typing.rst:2989 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2937 -msgid "Decorator to mark a class or function to be unavailable at runtime." +#: ../../library/typing.rst:2994 +msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2939 +#: ../../library/typing.rst:2996 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2950 +#: ../../library/typing.rst:3007 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2954 +#: ../../library/typing.rst:3011 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2958 +#: ../../library/typing.rst:3015 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2961 +#: ../../library/typing.rst:3018 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2827,81 +2895,104 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2967 +#: ../../library/typing.rst:3024 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example:" msgstr "" -#: ../../library/typing.rst:2984 +#: ../../library/typing.rst:3041 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2989 -msgid "Added ``include_extras`` parameter as part of :pep:`593`." +#: ../../library/typing.rst:3046 +#, fuzzy +msgid "" +"Added ``include_extras`` parameter as part of :pep:`593`. See the " +"documentation on :data:`Annotated` for more information." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2992 +#: ../../library/typing.rst:3050 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2999 +#: ../../library/typing.rst:3057 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " -"``X[Y, Z, ...]`` return ``X``. If ``X`` is a generic alias for a builtin or :" -"mod:`collections` class, it gets normalized to the original class. If ``X`` " -"is an instance of :class:`ParamSpecArgs` or :class:`ParamSpecKwargs`, return " -"the underlying :class:`ParamSpec`. Return ``None`` for unsupported objects. " -"Examples:" +"``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:3020 +#: ../../library/typing.rst:3060 +msgid "" +"If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " +"it will be normalized to the original class. If ``X`` is an instance of :" +"class:`ParamSpecArgs` or :class:`ParamSpecKwargs`, return the underlying :" +"class:`ParamSpec`. Return ``None`` for unsupported objects." +msgstr "" + +#: ../../library/typing.rst:3066 ../../library/typing.rst:3089 +#, fuzzy +msgid "Examples:" +msgstr "" +"舉例來說:\n" +"\n" +"::" + +#: ../../library/typing.rst:3081 msgid "" "Get type arguments with all substitutions performed: for a typing object of " -"the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``. If ``X`` is a union or :" -"class:`Literal` contained in another generic type, the order of ``(Y, " -"Z, ...)`` may be different from the order of the original arguments ``[Y, " -"Z, ...]`` due to type caching. Return ``()`` for unsupported objects. " -"Examples:" +"the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." +msgstr "" + +#: ../../library/typing.rst:3084 +msgid "" +"If ``X`` is a union or :class:`Literal` contained in another generic type, " +"the order of ``(Y, Z, ...)`` may be different from the order of the original " +"arguments ``[Y, Z, ...]`` due to type caching. Return ``()`` for unsupported " +"objects." msgstr "" -#: ../../library/typing.rst:3038 +#: ../../library/typing.rst:3101 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3059 +#: ../../library/typing.rst:3122 msgid "" -"A class used for internal typing representation of string forward " -"references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " -"into ``List[ForwardRef(\"SomeClass\")]``. This class should not be " +"Class used for internal typing representation of string forward references." +msgstr "" + +#: ../../library/typing.rst:3124 +msgid "" +"For example, ``List[\"SomeClass\"]`` is implicitly transformed into " +"``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:3065 +#: ../../library/typing.rst:3129 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:3072 +#: ../../library/typing.rst:3136 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3076 +#: ../../library/typing.rst:3140 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " -"checkers. It is ``False`` at runtime. Usage::" +"checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:3085 +#: ../../library/typing.rst:3151 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2909,7 +3000,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3092 +#: ../../library/typing.rst:3158 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2917,11 +3008,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3101 +#: ../../library/typing.rst:3167 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3103 +#: ../../library/typing.rst:3169 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2929,76 +3020,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3108 +#: ../../library/typing.rst:3174 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3108 +#: ../../library/typing.rst:3174 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3108 +#: ../../library/typing.rst:3174 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3108 +#: ../../library/typing.rst:3174 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3110 +#: ../../library/typing.rst:3176 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3110 +#: ../../library/typing.rst:3176 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3110 +#: ../../library/typing.rst:3176 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3110 +#: ../../library/typing.rst:3176 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3113 +#: ../../library/typing.rst:3179 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3113 ../../library/typing.rst:3116 +#: ../../library/typing.rst:3179 ../../library/typing.rst:3182 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3113 ../../library/typing.rst:3118 +#: ../../library/typing.rst:3179 ../../library/typing.rst:3184 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3113 +#: ../../library/typing.rst:3179 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3116 +#: ../../library/typing.rst:3182 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3116 +#: ../../library/typing.rst:3182 msgid "3.14" msgstr "" -#: ../../library/typing.rst:3116 +#: ../../library/typing.rst:3182 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3118 +#: ../../library/typing.rst:3184 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3118 +#: ../../library/typing.rst:3184 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3118 +#: ../../library/typing.rst:3184 msgid ":gh:`92332`" msgstr ":gh:`92332`" From 82cca7c96b704a25a47434c3c58e76846f7a1b86 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 11 Jun 2023 00:41:22 +0000 Subject: [PATCH 105/130] sync with cpython aaa8a493 --- library/hashlib.po | 441 +++++++++++++++++++++++++-------------------- 1 file changed, 246 insertions(+), 195 deletions(-) diff --git a/library/hashlib.po b/library/hashlib.po index cb935f138b..215d08343c 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-11 00:29+0000\n" +"POT-Creation-Date: 2023-06-11 00:38+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,75 +30,80 @@ msgstr "**原始碼:**\\ :source:`Lib/hashlib.py`" msgid "" "This module implements a common interface to many different secure hash and " "message digest algorithms. Included are the FIPS secure hash algorithms " -"SHA1, SHA224, SHA256, SHA384, and SHA512 (defined in FIPS 180-2) as well as " -"RSA's MD5 algorithm (defined in internet :rfc:`1321`). The terms \"secure " -"hash\" and \"message digest\" are interchangeable. Older algorithms were " -"called message digests. The modern term is secure hash." +"SHA1, SHA224, SHA256, SHA384, SHA512, (defined in `the FIPS 180-4 " +"standard`_), the SHA-3 series (defined in `the FIPS 202 standard`_) as well " +"as RSA's MD5 algorithm (defined in internet :rfc:`1321`). The terms " +"\"secure hash\" and \"message digest\" are interchangeable. Older " +"algorithms were called message digests. The modern term is secure hash." msgstr "" -#: ../../library/hashlib.rst:32 +#: ../../library/hashlib.rst:33 msgid "" "If you want the adler32 or crc32 hash functions, they are available in the :" "mod:`zlib` module." msgstr "" -#: ../../library/hashlib.rst:37 -msgid "" -"Some algorithms have known hash collision weaknesses, refer to the \"See " -"also\" section at the end." -msgstr "" - -#: ../../library/hashlib.rst:44 +#: ../../library/hashlib.rst:40 msgid "Hash algorithms" msgstr "" -#: ../../library/hashlib.rst:46 +#: ../../library/hashlib.rst:42 msgid "" "There is one constructor method named for each type of :dfn:`hash`. All " "return a hash object with the same simple interface. For example: use :func:" "`sha256` to create a SHA-256 hash object. You can now feed this object with :" "term:`bytes-like objects ` (normally :class:`bytes`) " -"using the :meth:`update` method. At any point you can ask it for the :dfn:" -"`digest` of the concatenation of the data fed to it so far using the :meth:" -"`digest` or :meth:`hexdigest` methods." +"using the :meth:`update` method. At any point you can ask it " +"for the :dfn:`digest` of the concatenation of the data fed to it so far " +"using the :meth:`digest()` or :meth:`hexdigest()` methods." msgstr "" -#: ../../library/hashlib.rst:56 +#: ../../library/hashlib.rst:50 msgid "" -"For better multithreading performance, the Python :term:`GIL` is released " -"for data larger than 2047 bytes at object creation or on update." +"To allow multithreading, the Python :term:`GIL` is released while computing " +"a hash supplied more than 2047 bytes of data at once in its constructor or :" +"meth:`.update` method." msgstr "" -#: ../../library/hashlib.rst:61 +#: ../../library/hashlib.rst:57 msgid "" -"Feeding string objects into :meth:`update` is not supported, as hashes work " -"on bytes, not on characters." +"Constructors for hash algorithms that are always present in this module are :" +"func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:" +"`sha512`, :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:" +"`sha3_512`, :func:`shake_128`, :func:`shake_256`, :func:`blake2b`, and :func:" +"`blake2s`. :func:`md5` is normally available as well, though it may be " +"missing or blocked if you are using a rare \"FIPS compliant\" build of " +"Python. These correspond to :data:`algorithms_guaranteed`." msgstr "" -#: ../../library/hashlib.rst:66 +#: ../../library/hashlib.rst:65 msgid "" -"Constructors for hash algorithms that are always present in this module are :" -"func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:" -"`sha512`, :func:`blake2b`, and :func:`blake2s`. :func:`md5` is normally " -"available as well, though it may be missing or blocked if you are using a " -"rare \"FIPS compliant\" build of Python. Additional algorithms may also be " -"available depending upon the OpenSSL library that Python uses on your " -"platform. On most platforms the :func:`sha3_224`, :func:`sha3_256`, :func:" -"`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` are also " -"available." +"Additional algorithms may also be available if your Python distribution's :" +"mod:`hashlib` was linked against a build of OpenSSL that provides others. " +"Others *are not guaranteed available* on all installations and will only be " +"accessible by name via :func:`new`. See :data:`algorithms_available`." +msgstr "" + +#: ../../library/hashlib.rst:72 +msgid "" +"Some algorithms have known hash collision weaknesses (including MD5 and " +"SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the `hashlib-" +"seealso`_ section at the end of this document." msgstr "" #: ../../library/hashlib.rst:76 msgid "" "SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`, :" -"func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256`." +"func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` were " +"added." msgstr "" -#: ../../library/hashlib.rst:80 +#: ../../library/hashlib.rst:81 msgid ":func:`blake2b` and :func:`blake2s` were added." msgstr "加入 :func:`blake2b` 和 :func:`blake2s`\\ 。" -#: ../../library/hashlib.rst:85 +#: ../../library/hashlib.rst:86 msgid "" "All hashlib constructors take a keyword-only argument *usedforsecurity* with " "default value ``True``. A false value allows the use of insecure and blocked " @@ -107,38 +112,56 @@ msgid "" "cryptographic one-way compression function." msgstr "" -#: ../../library/hashlib.rst:92 -msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL 1.1.1 and newer." +#: ../../library/hashlib.rst:93 +msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it." msgstr "" -#: ../../library/hashlib.rst:94 +#: ../../library/hashlib.rst:97 +msgid "Usage" +msgstr "" + +#: ../../library/hashlib.rst:99 msgid "" -"For example, to obtain the digest of the byte string ``b\"Nobody inspects " -"the spammish repetition\"``::" +"To obtain the digest of the byte string ``b\"Nobody inspects the spammish " +"repetition\"``::" msgstr "" -#: ../../library/hashlib.rst:106 +#: ../../library/hashlib.rst:111 msgid "More condensed:" msgstr "" -#: ../../library/hashlib.rst:113 +#: ../../library/hashlib.rst:117 +#, fuzzy +msgid "Constructors" +msgstr "常數" + +#: ../../library/hashlib.rst:121 msgid "" "Is a generic constructor that takes the string *name* of the desired " "algorithm as its first parameter. It also exists to allow access to the " "above listed hashes as well as any other algorithms that your OpenSSL " -"library may offer. The named constructors are much faster than :func:`new` " -"and should be preferred." +"library may offer." msgstr "" -#: ../../library/hashlib.rst:119 -msgid "Using :func:`new` with an algorithm provided by OpenSSL:" +#: ../../library/hashlib.rst:126 +msgid "Using :func:`new` with an algorithm name:" msgstr "" -#: ../../library/hashlib.rst:126 -msgid "Hashlib provides the following constant attributes:" +#: ../../library/hashlib.rst:145 +msgid "" +"Named constructors such as these are faster than passing an algorithm name " +"to :func:`new`." +msgstr "" + +#: ../../library/hashlib.rst:149 +msgid "Attributes" msgstr "" -#: ../../library/hashlib.rst:130 +#: ../../library/hashlib.rst:151 +msgid "Hashlib provides the following constant module attributes:" +msgstr "" + +#: ../../library/hashlib.rst:155 msgid "" "A set containing the names of the hash algorithms guaranteed to be supported " "by this module on all platforms. Note that 'md5' is in this list despite " @@ -146,7 +169,7 @@ msgid "" "excludes it." msgstr "" -#: ../../library/hashlib.rst:139 +#: ../../library/hashlib.rst:164 msgid "" "A set containing the names of the hash algorithms that are available in the " "running Python interpreter. These names will be recognized when passed to :" @@ -155,80 +178,84 @@ msgid "" "(thanks to OpenSSL)." msgstr "" -#: ../../library/hashlib.rst:147 +#: ../../library/hashlib.rst:173 +msgid "Hash Objects" +msgstr "" + +#: ../../library/hashlib.rst:175 msgid "" "The following values are provided as constant attributes of the hash objects " "returned by the constructors:" msgstr "" -#: ../../library/hashlib.rst:153 +#: ../../library/hashlib.rst:180 msgid "The size of the resulting hash in bytes." msgstr "" -#: ../../library/hashlib.rst:157 +#: ../../library/hashlib.rst:184 msgid "The internal block size of the hash algorithm in bytes." msgstr "" -#: ../../library/hashlib.rst:159 +#: ../../library/hashlib.rst:186 msgid "A hash object has the following attributes:" msgstr "" -#: ../../library/hashlib.rst:163 +#: ../../library/hashlib.rst:190 msgid "" "The canonical name of this hash, always lowercase and always suitable as a " "parameter to :func:`new` to create another hash of this type." msgstr "" -#: ../../library/hashlib.rst:166 +#: ../../library/hashlib.rst:193 msgid "" "The name attribute has been present in CPython since its inception, but " "until Python 3.4 was not formally specified, so may not exist on some " "platforms." msgstr "" -#: ../../library/hashlib.rst:171 +#: ../../library/hashlib.rst:198 msgid "A hash object has the following methods:" msgstr "" -#: ../../library/hashlib.rst:176 +#: ../../library/hashlib.rst:203 msgid "" "Update the hash object with the :term:`bytes-like object`. Repeated calls " "are equivalent to a single call with the concatenation of all the arguments: " "``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``." msgstr "" -#: ../../library/hashlib.rst:181 +#: ../../library/hashlib.rst:208 msgid "" "The Python GIL is released to allow other threads to run while hash updates " "on data larger than 2047 bytes is taking place when using hash algorithms " "supplied by OpenSSL." msgstr "" -#: ../../library/hashlib.rst:189 +#: ../../library/hashlib.rst:216 msgid "" "Return the digest of the data passed to the :meth:`update` method so far. " "This is a bytes object of size :attr:`digest_size` which may contain bytes " "in the whole range from 0 to 255." msgstr "" -#: ../../library/hashlib.rst:196 ../../library/hashlib.rst:224 +#: ../../library/hashlib.rst:223 msgid "" "Like :meth:`digest` except the digest is returned as a string object of " "double length, containing only hexadecimal digits. This may be used to " "exchange the value safely in email or other non-binary environments." msgstr "" -#: ../../library/hashlib.rst:203 +#: ../../library/hashlib.rst:230 msgid "" "Return a copy (\"clone\") of the hash object. This can be used to " "efficiently compute the digests of data sharing a common initial substring." msgstr "" -#: ../../library/hashlib.rst:208 +#: ../../library/hashlib.rst:235 msgid "SHAKE variable length digests" msgstr "" -#: ../../library/hashlib.rst:210 +#: ../../library/hashlib.rst:240 msgid "" "The :func:`shake_128` and :func:`shake_256` algorithms provide variable " "length digests with length_in_bits//2 up to 128 or 256 bits of security. As " @@ -236,29 +263,41 @@ msgid "" "by the SHAKE algorithm." msgstr "" -#: ../../library/hashlib.rst:217 +#: ../../library/hashlib.rst:247 msgid "" "Return the digest of the data passed to the :meth:`update` method so far. " "This is a bytes object of size *length* which may contain bytes in the whole " "range from 0 to 255." msgstr "" -#: ../../library/hashlib.rst:230 +#: ../../library/hashlib.rst:254 +msgid "" +"Like :meth:`digest` except the digest is returned as a string object of " +"double length, containing only hexadecimal digits. This may be used to " +"exchange the value in email or other non-binary environments." +msgstr "" + +#: ../../library/hashlib.rst:258 +#, fuzzy +msgid "Example use:" +msgstr "範例:" + +#: ../../library/hashlib.rst:265 msgid "File hashing" msgstr "" -#: ../../library/hashlib.rst:232 +#: ../../library/hashlib.rst:267 msgid "" "The hashlib module provides a helper function for efficient hashing of a " "file or file-like object." msgstr "" -#: ../../library/hashlib.rst:237 +#: ../../library/hashlib.rst:272 msgid "" "Return a digest object that has been updated with contents of file object." msgstr "" -#: ../../library/hashlib.rst:239 +#: ../../library/hashlib.rst:274 msgid "" "*fileobj* must be a file-like object opened for reading in binary mode. It " "accepts file objects from builtin :func:`open`, :class:`~io.BytesIO` " @@ -269,21 +308,21 @@ msgid "" "caller to close *fileobj*." msgstr "" -#: ../../library/hashlib.rst:247 +#: ../../library/hashlib.rst:282 msgid "" "*digest* must either be a hash algorithm name as a *str*, a hash " "constructor, or a callable that returns a hash object." msgstr "" -#: ../../library/hashlib.rst:250 +#: ../../library/hashlib.rst:285 msgid "Example:" msgstr "範例:" -#: ../../library/hashlib.rst:273 +#: ../../library/hashlib.rst:308 msgid "Key derivation" msgstr "" -#: ../../library/hashlib.rst:275 +#: ../../library/hashlib.rst:310 msgid "" "Key derivation and key stretching algorithms are designed for secure " "password hashing. Naive algorithms such as ``sha1(password)`` are not " @@ -292,13 +331,13 @@ msgid "" "Salt_%28cryptography%29>`_." msgstr "" -#: ../../library/hashlib.rst:283 +#: ../../library/hashlib.rst:318 msgid "" "The function provides PKCS#5 password-based key derivation function 2. It " "uses HMAC as pseudorandom function." msgstr "" -#: ../../library/hashlib.rst:286 +#: ../../library/hashlib.rst:321 msgid "" "The string *hash_name* is the desired name of the hash digest algorithm for " "HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as " @@ -307,7 +346,7 @@ msgid "" "proper source, e.g. :func:`os.urandom`." msgstr "" -#: ../../library/hashlib.rst:292 +#: ../../library/hashlib.rst:327 msgid "" "The number of *iterations* should be chosen based on the hash algorithm and " "computing power. As of 2022, hundreds of thousands of iterations of SHA-256 " @@ -316,32 +355,32 @@ msgid "" "the `stackexchange pbkdf2 iterations question`_ explain in detail." msgstr "" -#: ../../library/hashlib.rst:298 +#: ../../library/hashlib.rst:333 msgid "" "*dklen* is the length of the derived key. If *dklen* is ``None`` then the " "digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512." msgstr "" -#: ../../library/hashlib.rst:311 +#: ../../library/hashlib.rst:346 msgid "" "A fast implementation of *pbkdf2_hmac* is available with OpenSSL. The " "Python implementation uses an inline version of :mod:`hmac`. It is about " "three times slower and doesn't release the GIL." msgstr "" -#: ../../library/hashlib.rst:317 +#: ../../library/hashlib.rst:352 msgid "" "Slow Python implementation of *pbkdf2_hmac* is deprecated. In the future the " "function will only be available when Python is compiled with OpenSSL." msgstr "" -#: ../../library/hashlib.rst:323 +#: ../../library/hashlib.rst:358 msgid "" "The function provides scrypt password-based key derivation function as " "defined in :rfc:`7914`." msgstr "" -#: ../../library/hashlib.rst:326 +#: ../../library/hashlib.rst:361 msgid "" "*password* and *salt* must be :term:`bytes-like objects `. Applications and libraries should limit *password* to a sensible " @@ -349,138 +388,138 @@ msgid "" "source, e.g. :func:`os.urandom`." msgstr "" -#: ../../library/hashlib.rst:331 +#: ../../library/hashlib.rst:366 msgid "" "*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization " "factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). " "*dklen* is the length of the derived key." msgstr "" -#: ../../library/hashlib.rst:339 +#: ../../library/hashlib.rst:374 msgid "BLAKE2" msgstr "BLAKE2" -#: ../../library/hashlib.rst:346 +#: ../../library/hashlib.rst:381 msgid "" "BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes " "in two flavors:" msgstr "" -#: ../../library/hashlib.rst:349 +#: ../../library/hashlib.rst:384 msgid "" "**BLAKE2b**, optimized for 64-bit platforms and produces digests of any size " "between 1 and 64 bytes," msgstr "" -#: ../../library/hashlib.rst:352 +#: ../../library/hashlib.rst:387 msgid "" "**BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of " "any size between 1 and 32 bytes." msgstr "" -#: ../../library/hashlib.rst:355 +#: ../../library/hashlib.rst:390 msgid "" "BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), " "**salted hashing**, **personalization**, and **tree hashing**." msgstr "" -#: ../../library/hashlib.rst:358 +#: ../../library/hashlib.rst:393 msgid "" "Hash objects from this module follow the API of standard library's :mod:" "`hashlib` objects." msgstr "" -#: ../../library/hashlib.rst:363 +#: ../../library/hashlib.rst:398 msgid "Creating hash objects" msgstr "" -#: ../../library/hashlib.rst:365 +#: ../../library/hashlib.rst:400 msgid "New hash objects are created by calling constructor functions:" msgstr "" -#: ../../library/hashlib.rst:379 +#: ../../library/hashlib.rst:414 msgid "" "These functions return the corresponding hash objects for calculating " "BLAKE2b or BLAKE2s. They optionally take these general parameters:" msgstr "" -#: ../../library/hashlib.rst:382 +#: ../../library/hashlib.rst:417 msgid "" "*data*: initial chunk of data to hash, which must be :term:`bytes-like " "object`. It can be passed only as positional argument." msgstr "" -#: ../../library/hashlib.rst:385 +#: ../../library/hashlib.rst:420 msgid "*digest_size*: size of output digest in bytes." msgstr "" -#: ../../library/hashlib.rst:387 +#: ../../library/hashlib.rst:422 msgid "" "*key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for " "BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:390 +#: ../../library/hashlib.rst:425 msgid "" "*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 " "bytes for BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:393 +#: ../../library/hashlib.rst:428 msgid "" "*person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes " "for BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:396 +#: ../../library/hashlib.rst:431 msgid "The following table shows limits for general parameters (in bytes):" msgstr "" -#: ../../library/hashlib.rst:399 +#: ../../library/hashlib.rst:434 msgid "Hash" msgstr "" -#: ../../library/hashlib.rst:399 +#: ../../library/hashlib.rst:434 msgid "digest_size" msgstr "digest_size" -#: ../../library/hashlib.rst:399 +#: ../../library/hashlib.rst:434 msgid "len(key)" msgstr "len(key)" -#: ../../library/hashlib.rst:399 +#: ../../library/hashlib.rst:434 msgid "len(salt)" msgstr "len(salt)" -#: ../../library/hashlib.rst:399 +#: ../../library/hashlib.rst:434 msgid "len(person)" msgstr "len(person)" -#: ../../library/hashlib.rst:401 +#: ../../library/hashlib.rst:436 msgid "BLAKE2b" msgstr "BLAKE2b" -#: ../../library/hashlib.rst:401 +#: ../../library/hashlib.rst:436 msgid "64" msgstr "64" -#: ../../library/hashlib.rst:401 +#: ../../library/hashlib.rst:436 msgid "16" msgstr "16" -#: ../../library/hashlib.rst:402 +#: ../../library/hashlib.rst:437 msgid "BLAKE2s" msgstr "BLAKE2s" -#: ../../library/hashlib.rst:402 +#: ../../library/hashlib.rst:437 msgid "32" msgstr "32" -#: ../../library/hashlib.rst:402 +#: ../../library/hashlib.rst:437 msgid "8" msgstr "8" -#: ../../library/hashlib.rst:407 +#: ../../library/hashlib.rst:442 msgid "" "BLAKE2 specification defines constant lengths for salt and personalization " "parameters, however, for convenience, this implementation accepts byte " @@ -490,49 +529,49 @@ msgid "" "the case for *key*.)" msgstr "" -#: ../../library/hashlib.rst:414 +#: ../../library/hashlib.rst:449 msgid "These sizes are available as module `constants`_ described below." msgstr "" -#: ../../library/hashlib.rst:416 +#: ../../library/hashlib.rst:451 msgid "" "Constructor functions also accept the following tree hashing parameters:" msgstr "" -#: ../../library/hashlib.rst:418 +#: ../../library/hashlib.rst:453 msgid "*fanout*: fanout (0 to 255, 0 if unlimited, 1 in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:420 +#: ../../library/hashlib.rst:455 msgid "" "*depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential " "mode)." msgstr "" -#: ../../library/hashlib.rst:423 +#: ../../library/hashlib.rst:458 msgid "" "*leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited " "or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:426 +#: ../../library/hashlib.rst:461 msgid "" "*node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` " "for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:429 +#: ../../library/hashlib.rst:464 msgid "" "*node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:431 +#: ../../library/hashlib.rst:466 msgid "" "*inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 " "in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:434 +#: ../../library/hashlib.rst:469 msgid "" "*last_node*: boolean indicating whether the processed node is the last one " "(``False`` for sequential mode)." @@ -542,42 +581,42 @@ msgstr "" msgid "Explanation of tree mode parameters." msgstr "" -#: ../../library/hashlib.rst:441 +#: ../../library/hashlib.rst:476 msgid "" "See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." msgstr "" -#: ../../library/hashlib.rst:447 +#: ../../library/hashlib.rst:482 msgid "Constants" msgstr "常數" -#: ../../library/hashlib.rst:452 +#: ../../library/hashlib.rst:487 msgid "Salt length (maximum length accepted by constructors)." msgstr "" -#: ../../library/hashlib.rst:458 +#: ../../library/hashlib.rst:493 msgid "" "Personalization string length (maximum length accepted by constructors)." msgstr "" -#: ../../library/hashlib.rst:464 +#: ../../library/hashlib.rst:499 msgid "Maximum key size." msgstr "" -#: ../../library/hashlib.rst:470 +#: ../../library/hashlib.rst:505 msgid "Maximum digest size that the hash function can output." msgstr "" -#: ../../library/hashlib.rst:474 +#: ../../library/hashlib.rst:509 msgid "Examples" msgstr "範例" -#: ../../library/hashlib.rst:477 +#: ../../library/hashlib.rst:512 msgid "Simple hashing" msgstr "" -#: ../../library/hashlib.rst:479 +#: ../../library/hashlib.rst:514 msgid "" "To calculate hash of some data, you should first construct a hash object by " "calling the appropriate constructor function (:func:`blake2b` or :func:" @@ -586,41 +625,41 @@ msgid "" "`digest` (or :meth:`hexdigest` for hex-encoded string)." msgstr "" -#: ../../library/hashlib.rst:492 +#: ../../library/hashlib.rst:527 msgid "" "As a shortcut, you can pass the first chunk of data to update directly to " "the constructor as the positional argument:" msgstr "" -#: ../../library/hashlib.rst:499 +#: ../../library/hashlib.rst:534 msgid "" "You can call :meth:`hash.update` as many times as you need to iteratively " "update the hash:" msgstr "" -#: ../../library/hashlib.rst:512 +#: ../../library/hashlib.rst:547 msgid "Using different digest sizes" msgstr "" -#: ../../library/hashlib.rst:514 +#: ../../library/hashlib.rst:549 msgid "" "BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to " "32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without " "changing the size of output, we can tell BLAKE2b to produce 20-byte digests:" msgstr "" -#: ../../library/hashlib.rst:528 +#: ../../library/hashlib.rst:563 msgid "" "Hash objects with different digest sizes have completely different outputs " "(shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s " "produce different outputs even if the output length is the same:" msgstr "" -#: ../../library/hashlib.rst:544 +#: ../../library/hashlib.rst:579 msgid "Keyed hashing" msgstr "" -#: ../../library/hashlib.rst:546 +#: ../../library/hashlib.rst:581 msgid "" "Keyed hashing can be used for authentication as a faster and simpler " "replacement for `Hash-based message authentication code `_)" msgstr "" -#: ../../library/hashlib.rst:630 +#: ../../library/hashlib.rst:665 msgid "" "In BLAKE2 the salt is processed as a one-time input to the hash function " "during initialization, rather than as an input to each compression function." msgstr "" -#: ../../library/hashlib.rst:635 +#: ../../library/hashlib.rst:670 msgid "" "*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose " "cryptographic hash function, such as SHA-256, is not suitable for hashing " @@ -698,18 +737,18 @@ msgid "" "information." msgstr "" -#: ../../library/hashlib.rst:658 +#: ../../library/hashlib.rst:693 msgid "Personalization" msgstr "" -#: ../../library/hashlib.rst:660 +#: ../../library/hashlib.rst:695 msgid "" "Sometimes it is useful to force hash function to produce different digests " "for the same input for different purposes. Quoting the authors of the Skein " "hash function:" msgstr "" -#: ../../library/hashlib.rst:664 +#: ../../library/hashlib.rst:699 msgid "" "We recommend that all application designers seriously consider doing this; " "we have seen many protocols where a hash that is computed in one part of the " @@ -719,41 +758,41 @@ msgid "" "hash function used in the protocol summarily stops this type of attack." msgstr "" -#: ../../library/hashlib.rst:671 +#: ../../library/hashlib.rst:706 msgid "" "(`The Skein Hash Function Family `_, p. 21)" msgstr "" -#: ../../library/hashlib.rst:675 +#: ../../library/hashlib.rst:710 msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" msgstr "" -#: ../../library/hashlib.rst:689 +#: ../../library/hashlib.rst:724 msgid "" "Personalization together with the keyed mode can also be used to derive " "different keys from a single one." msgstr "" -#: ../../library/hashlib.rst:703 +#: ../../library/hashlib.rst:738 msgid "Tree mode" msgstr "" -#: ../../library/hashlib.rst:705 +#: ../../library/hashlib.rst:740 msgid "Here's an example of hashing a minimal tree with two leaf nodes::" msgstr "" -#: ../../library/hashlib.rst:711 +#: ../../library/hashlib.rst:746 msgid "" "This example uses 64-byte internal digests, and returns the 32-byte final " "digest::" msgstr "" -#: ../../library/hashlib.rst:741 +#: ../../library/hashlib.rst:776 msgid "Credits" msgstr "" -#: ../../library/hashlib.rst:743 +#: ../../library/hashlib.rst:778 msgid "" "BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko " "Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ " @@ -761,119 +800,122 @@ msgid "" "*Raphael C.-W. Phan*." msgstr "" -#: ../../library/hashlib.rst:748 +#: ../../library/hashlib.rst:783 msgid "" "It uses core algorithm from ChaCha_ cipher designed by *Daniel J. " "Bernstein*." msgstr "" -#: ../../library/hashlib.rst:750 +#: ../../library/hashlib.rst:785 msgid "" "The stdlib implementation is based on pyblake2_ module. It was written by " "*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The " "documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*." msgstr "" -#: ../../library/hashlib.rst:754 +#: ../../library/hashlib.rst:789 msgid "The C code was partly rewritten for Python by *Christian Heimes*." msgstr "" -#: ../../library/hashlib.rst:756 +#: ../../library/hashlib.rst:791 msgid "" "The following public domain dedication applies for both C hash function " "implementation, extension code, and this documentation:" msgstr "" -#: ../../library/hashlib.rst:759 +#: ../../library/hashlib.rst:794 msgid "" "To the extent possible under law, the author(s) have dedicated all copyright " "and related and neighboring rights to this software to the public domain " "worldwide. This software is distributed without any warranty." msgstr "" -#: ../../library/hashlib.rst:763 +#: ../../library/hashlib.rst:798 msgid "" "You should have received a copy of the CC0 Public Domain Dedication along " "with this software. If not, see https://creativecommons.org/publicdomain/" "zero/1.0/." msgstr "" -#: ../../library/hashlib.rst:767 +#: ../../library/hashlib.rst:802 msgid "" "The following people have helped with development or contributed their " "changes to the project and the public domain according to the Creative " "Commons Public Domain Dedication 1.0 Universal:" msgstr "" -#: ../../library/hashlib.rst:771 +#: ../../library/hashlib.rst:806 msgid "*Alexandr Sokolovskiy*" msgstr "" -#: ../../library/hashlib.rst:786 +#: ../../library/hashlib.rst:826 msgid "Module :mod:`hmac`" msgstr ":mod:`hmac` 模組" -#: ../../library/hashlib.rst:786 +#: ../../library/hashlib.rst:826 msgid "A module to generate message authentication codes using hashes." msgstr "" -#: ../../library/hashlib.rst:789 +#: ../../library/hashlib.rst:829 msgid "Module :mod:`base64`" msgstr ":mod:`base64` 模組" -#: ../../library/hashlib.rst:789 +#: ../../library/hashlib.rst:829 msgid "Another way to encode binary hashes for non-binary environments." msgstr "" -#: ../../library/hashlib.rst:792 -#, fuzzy -msgid "https://www.blake2.net" -msgstr "https://blake2.net" +#: ../../library/hashlib.rst:832 +msgid "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" +msgstr "" -#: ../../library/hashlib.rst:792 -msgid "Official BLAKE2 website." -msgstr "BLAKE2 官方網站。" +#: ../../library/hashlib.rst:832 +msgid "The FIPS 180-4 publication on Secure Hash Algorithms." +msgstr "" -#: ../../library/hashlib.rst:795 -msgid "" -"https://csrc.nist.gov/csrc/media/publications/fips/180/2/archive/2002-08-01/" -"documents/fips180-2.pdf" +#: ../../library/hashlib.rst:835 +msgid "https://csrc.nist.gov/publications/detail/fips/202/final" msgstr "" -"https://csrc.nist.gov/csrc/media/publications/fips/180/2/archive/2002-08-01/" -"documents/fips180-2.pdf" -#: ../../library/hashlib.rst:795 -msgid "The FIPS 180-2 publication on Secure Hash Algorithms." +#: ../../library/hashlib.rst:835 +msgid "The FIPS 202 publication on the SHA-3 Standard." msgstr "" -#: ../../library/hashlib.rst:799 -msgid "" -"https://en.wikipedia.org/wiki/" -"Cryptographic_hash_function#Cryptographic_hash_algorithms" +#: ../../library/hashlib.rst:838 +#, fuzzy +msgid "https://www.blake2.net/" +msgstr "https://blake2.net" + +#: ../../library/hashlib.rst:838 +msgid "Official BLAKE2 website." +msgstr "BLAKE2 官方網站。" + +#: ../../library/hashlib.rst:842 +#, fuzzy +msgid "https://en.wikipedia.org/wiki/Cryptographic_hash_function" msgstr "" "https://en.wikipedia.org/wiki/" "Cryptographic_hash_function#Cryptographic_hash_algorithms" -#: ../../library/hashlib.rst:798 +#: ../../library/hashlib.rst:841 msgid "" "Wikipedia article with information on which algorithms have known issues and " "what that means regarding their use." msgstr "" -#: ../../library/hashlib.rst:802 +#: ../../library/hashlib.rst:845 msgid "https://www.ietf.org/rfc/rfc8018.txt" msgstr "https://www.ietf.org/rfc/rfc8018.txt" -#: ../../library/hashlib.rst:802 +#: ../../library/hashlib.rst:845 msgid "PKCS #5: Password-Based Cryptography Specification Version 2.1" msgstr "" -#: ../../library/hashlib.rst:804 +#: ../../library/hashlib.rst:847 msgid "" "https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" msgstr "" -#: ../../library/hashlib.rst:805 +#: ../../library/hashlib.rst:848 msgid "NIST Recommendation for Password-Based Key Derivation." msgstr "" @@ -882,17 +924,26 @@ msgid "message digest, MD5" msgstr "" #: ../../library/hashlib.rst:12 -msgid "secure hash algorithm, SHA1, SHA224, SHA256, SHA384, SHA512" +msgid "" +"secure hash algorithm, SHA1, SHA2, SHA224, SHA256, SHA384, SHA512, SHA3, " +"Shake, Blake2" msgstr "" -#: ../../library/hashlib.rst:64 +#: ../../library/hashlib.rst:55 msgid "OpenSSL" msgstr "" -#: ../../library/hashlib.rst:64 +#: ../../library/hashlib.rst:55 msgid "(use in module hashlib)" msgstr "" -#: ../../library/hashlib.rst:343 +#: ../../library/hashlib.rst:378 msgid "blake2b, blake2s" msgstr "" + +#~ msgid "" +#~ "https://csrc.nist.gov/csrc/media/publications/fips/180/2/" +#~ "archive/2002-08-01/documents/fips180-2.pdf" +#~ msgstr "" +#~ "https://csrc.nist.gov/csrc/media/publications/fips/180/2/" +#~ "archive/2002-08-01/documents/fips180-2.pdf" From 914656b6539ee3e629b9edd66210fe2c71c2e689 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 12 Jun 2023 00:39:01 +0000 Subject: [PATCH 106/130] sync with cpython e5fe0171 --- library/typing.po | 624 +++++++++++++++++++++++----------------------- 1 file changed, 312 insertions(+), 312 deletions(-) diff --git a/library/typing.po b/library/typing.po index 638e87130a..56eee2e7a7 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-10 00:32+0000\n" +"POT-Creation-Date: 2023-06-12 00:37+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -356,7 +356,7 @@ msgid "" "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:253 ../../library/typing.rst:3103 +#: ../../library/typing.rst:253 ../../library/typing.rst:3102 #, fuzzy msgid "For example:" msgstr "" @@ -688,7 +688,7 @@ msgstr "" #: ../../library/typing.rst:660 ../../library/typing.rst:736 #: ../../library/typing.rst:756 ../../library/typing.rst:802 #: ../../library/typing.rst:1068 ../../library/typing.rst:1125 -#: ../../library/typing.rst:1333 ../../library/typing.rst:2943 +#: ../../library/typing.rst:1333 ../../library/typing.rst:2942 msgid "For example::" msgstr "" "舉例來說:\n" @@ -995,7 +995,7 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1007 ../../library/typing.rst:1712 +#: ../../library/typing.rst:1007 ../../library/typing.rst:1711 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." @@ -1107,7 +1107,7 @@ msgid "" "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1136 ../../library/typing.rst:2959 +#: ../../library/typing.rst:1136 ../../library/typing.rst:2958 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1384,9 +1384,9 @@ msgstr "" msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1431 ../../library/typing.rst:1527 -#: ../../library/typing.rst:1637 ../../library/typing.rst:1748 -#: ../../library/typing.rst:1819 ../../library/typing.rst:3143 +#: ../../library/typing.rst:1431 ../../library/typing.rst:1526 +#: ../../library/typing.rst:1636 ../../library/typing.rst:1747 +#: ../../library/typing.rst:1818 ../../library/typing.rst:3142 msgid "Usage::" msgstr "" "用法:\n" @@ -1409,61 +1409,61 @@ msgstr "" #: ../../library/typing.rst:1461 msgid "" -"Created type variables may be explicitly marked covariant or contravariant " -"by passing ``covariant=True`` or ``contravariant=True``. By default, type " -"variables are invariant. See :pep:`484` and :pep:`695` for more details." +"Type variables may be marked covariant or contravariant by passing " +"``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " +"details. By default, type variables are invariant." msgstr "" -#: ../../library/typing.rst:1466 +#: ../../library/typing.rst:1465 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1481 +#: ../../library/typing.rst:1480 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1489 +#: ../../library/typing.rst:1488 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1500 +#: ../../library/typing.rst:1499 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1504 +#: ../../library/typing.rst:1503 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1508 +#: ../../library/typing.rst:1507 msgid "Whether the type var has been marked as covariant." msgstr "" -#: ../../library/typing.rst:1512 +#: ../../library/typing.rst:1511 msgid "Whether the type var has been marked as contravariant." msgstr "" -#: ../../library/typing.rst:1516 +#: ../../library/typing.rst:1515 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1520 +#: ../../library/typing.rst:1519 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1524 +#: ../../library/typing.rst:1523 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1535 +#: ../../library/typing.rst:1534 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1471,7 +1471,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1557 +#: ../../library/typing.rst:1556 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1481,36 +1481,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1565 +#: ../../library/typing.rst:1564 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1572 +#: ../../library/typing.rst:1571 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1580 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1600 +#: ../../library/typing.rst:1599 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1607 +#: ../../library/typing.rst:1606 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1617 +#: ../../library/typing.rst:1616 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1519,21 +1519,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1624 +#: ../../library/typing.rst:1623 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1628 +#: ../../library/typing.rst:1627 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1634 +#: ../../library/typing.rst:1633 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1641 +#: ../../library/typing.rst:1640 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1543,7 +1543,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1648 +#: ../../library/typing.rst:1647 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1551,27 +1551,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1671 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1676 +#: ../../library/typing.rst:1675 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1678 +#: ../../library/typing.rst:1677 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1685 +#: ../../library/typing.rst:1684 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1584,11 +1584,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1697 +#: ../../library/typing.rst:1696 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1699 +#: ../../library/typing.rst:1698 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1597,17 +1597,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1708 +#: ../../library/typing.rst:1707 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1714 +#: ../../library/typing.rst:1713 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1719 +#: ../../library/typing.rst:1718 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1615,44 +1615,44 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1724 +#: ../../library/typing.rst:1723 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1740 +#: ../../library/typing.rst:1739 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1742 +#: ../../library/typing.rst:1741 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1746 +#: ../../library/typing.rst:1745 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1754 +#: ../../library/typing.rst:1753 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1758 +#: ../../library/typing.rst:1757 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1767 +#: ../../library/typing.rst:1766 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1769 +#: ../../library/typing.rst:1768 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1661,83 +1661,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1775 +#: ../../library/typing.rst:1774 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1785 +#: ../../library/typing.rst:1784 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1791 +#: ../../library/typing.rst:1790 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1795 +#: ../../library/typing.rst:1794 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1798 +#: ../../library/typing.rst:1797 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:1800 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1805 +#: ../../library/typing.rst:1804 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1809 +#: ../../library/typing.rst:1808 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1814 +#: ../../library/typing.rst:1813 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:1816 +#: ../../library/typing.rst:1815 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:1826 +#: ../../library/typing.rst:1825 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1830 +#: ../../library/typing.rst:1829 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1834 +#: ../../library/typing.rst:1833 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1838 +#: ../../library/typing.rst:1837 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1843 +#: ../../library/typing.rst:1842 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:1845 +#: ../../library/typing.rst:1844 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1851 +#: ../../library/typing.rst:1850 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1863 +#: ../../library/typing.rst:1862 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1745,15 +1745,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1868 +#: ../../library/typing.rst:1867 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1880 +#: ../../library/typing.rst:1879 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1882 +#: ../../library/typing.rst:1881 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1762,7 +1762,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1902 +#: ../../library/typing.rst:1901 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1773,7 +1773,7 @@ msgid "" "SSLObject`." msgstr "" -#: ../../library/typing.rst:1913 +#: ../../library/typing.rst:1912 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1781,13 +1781,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1924 +#: ../../library/typing.rst:1923 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1927 +#: ../../library/typing.rst:1926 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1795,53 +1795,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1943 +#: ../../library/typing.rst:1942 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1947 +#: ../../library/typing.rst:1946 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1951 +#: ../../library/typing.rst:1950 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1958 +#: ../../library/typing.rst:1957 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1959 +#: ../../library/typing.rst:1958 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1971 +#: ../../library/typing.rst:1970 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1982 +#: ../../library/typing.rst:1981 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1985 +#: ../../library/typing.rst:1984 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1995 +#: ../../library/typing.rst:1994 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1849,61 +1849,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2000 +#: ../../library/typing.rst:1999 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2015 +#: ../../library/typing.rst:2014 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:2022 +#: ../../library/typing.rst:2021 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2030 +#: ../../library/typing.rst:2029 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2048 +#: ../../library/typing.rst:2047 msgid "A ``TypedDict`` can be generic:" msgstr "" -#: ../../library/typing.rst:2058 +#: ../../library/typing.rst:2057 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2064 +#: ../../library/typing.rst:2063 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2086 +#: ../../library/typing.rst:2085 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2089 +#: ../../library/typing.rst:2088 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2092 +#: ../../library/typing.rst:2091 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1912,180 +1912,180 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2115 +#: ../../library/typing.rst:2114 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2119 +#: ../../library/typing.rst:2118 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2123 +#: ../../library/typing.rst:2122 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2127 +#: ../../library/typing.rst:2126 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:2130 +#: ../../library/typing.rst:2129 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:2134 +#: ../../library/typing.rst:2133 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2136 +#: ../../library/typing.rst:2135 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2140 ../../library/typing.rst:2367 +#: ../../library/typing.rst:2139 ../../library/typing.rst:2366 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2145 +#: ../../library/typing.rst:2144 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2151 +#: ../../library/typing.rst:2150 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2153 +#: ../../library/typing.rst:2152 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2157 +#: ../../library/typing.rst:2156 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2167 +#: ../../library/typing.rst:2166 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2173 +#: ../../library/typing.rst:2172 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2175 +#: ../../library/typing.rst:2174 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2179 +#: ../../library/typing.rst:2178 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2185 +#: ../../library/typing.rst:2184 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2187 +#: ../../library/typing.rst:2186 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2192 +#: ../../library/typing.rst:2191 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:2195 +#: ../../library/typing.rst:2194 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2199 +#: ../../library/typing.rst:2198 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2203 +#: ../../library/typing.rst:2202 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2209 +#: ../../library/typing.rst:2208 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2213 +#: ../../library/typing.rst:2212 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2219 +#: ../../library/typing.rst:2218 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2224 +#: ../../library/typing.rst:2223 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2230 +#: ../../library/typing.rst:2229 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2235 +#: ../../library/typing.rst:2234 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2241 +#: ../../library/typing.rst:2240 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2246 +#: ../../library/typing.rst:2245 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2251 +#: ../../library/typing.rst:2250 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2257 +#: ../../library/typing.rst:2256 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2264 +#: ../../library/typing.rst:2263 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2269 +#: ../../library/typing.rst:2268 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2272 +#: ../../library/typing.rst:2271 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2093,465 +2093,465 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2280 +#: ../../library/typing.rst:2279 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2281 +#: ../../library/typing.rst:2280 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2287 +#: ../../library/typing.rst:2286 msgid "Deprecated alias for :class:`str`." msgstr "" -#: ../../library/typing.rst:2289 +#: ../../library/typing.rst:2288 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:2293 +#: ../../library/typing.rst:2292 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2301 +#: ../../library/typing.rst:2300 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2308 +#: ../../library/typing.rst:2307 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2311 +#: ../../library/typing.rst:2310 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2315 +#: ../../library/typing.rst:2314 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2317 +#: ../../library/typing.rst:2316 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2323 +#: ../../library/typing.rst:2322 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2327 +#: ../../library/typing.rst:2326 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2331 +#: ../../library/typing.rst:2330 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2335 +#: ../../library/typing.rst:2334 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2341 +#: ../../library/typing.rst:2340 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2343 +#: ../../library/typing.rst:2342 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2349 +#: ../../library/typing.rst:2348 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2351 +#: ../../library/typing.rst:2350 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2357 +#: ../../library/typing.rst:2356 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2359 +#: ../../library/typing.rst:2358 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2365 +#: ../../library/typing.rst:2364 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:2372 +#: ../../library/typing.rst:2371 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2378 +#: ../../library/typing.rst:2377 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2380 +#: ../../library/typing.rst:2379 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2386 +#: ../../library/typing.rst:2385 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2388 +#: ../../library/typing.rst:2387 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2395 +#: ../../library/typing.rst:2394 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2397 +#: ../../library/typing.rst:2396 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2404 +#: ../../library/typing.rst:2403 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2406 +#: ../../library/typing.rst:2405 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2412 +#: ../../library/typing.rst:2411 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2414 +#: ../../library/typing.rst:2413 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2420 +#: ../../library/typing.rst:2419 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2422 +#: ../../library/typing.rst:2421 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2427 +#: ../../library/typing.rst:2426 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2431 +#: ../../library/typing.rst:2430 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2433 +#: ../../library/typing.rst:2432 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2439 +#: ../../library/typing.rst:2438 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2441 +#: ../../library/typing.rst:2440 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2447 +#: ../../library/typing.rst:2446 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:2449 +#: ../../library/typing.rst:2448 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2458 +#: ../../library/typing.rst:2457 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2462 +#: ../../library/typing.rst:2461 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2470 +#: ../../library/typing.rst:2469 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2478 +#: ../../library/typing.rst:2477 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2484 +#: ../../library/typing.rst:2483 msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2488 +#: ../../library/typing.rst:2487 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2490 +#: ../../library/typing.rst:2489 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2496 +#: ../../library/typing.rst:2495 msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2499 +#: ../../library/typing.rst:2498 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2503 +#: ../../library/typing.rst:2502 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:2505 +#: ../../library/typing.rst:2504 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:2516 +#: ../../library/typing.rst:2515 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2522 +#: ../../library/typing.rst:2521 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:2524 +#: ../../library/typing.rst:2523 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2533 +#: ../../library/typing.rst:2532 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2537 +#: ../../library/typing.rst:2536 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2545 +#: ../../library/typing.rst:2544 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2555 +#: ../../library/typing.rst:2554 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2562 +#: ../../library/typing.rst:2561 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2566 +#: ../../library/typing.rst:2565 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2571 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2576 +#: ../../library/typing.rst:2575 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2582 +#: ../../library/typing.rst:2581 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2586 +#: ../../library/typing.rst:2585 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2592 +#: ../../library/typing.rst:2591 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2596 +#: ../../library/typing.rst:2595 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2601 +#: ../../library/typing.rst:2600 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2608 +#: ../../library/typing.rst:2607 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2613 +#: ../../library/typing.rst:2612 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2619 +#: ../../library/typing.rst:2618 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2621 +#: ../../library/typing.rst:2620 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2625 +#: ../../library/typing.rst:2624 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2630 +#: ../../library/typing.rst:2629 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2634 +#: ../../library/typing.rst:2633 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2638 +#: ../../library/typing.rst:2637 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2642 +#: ../../library/typing.rst:2641 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2648 +#: ../../library/typing.rst:2647 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2652 +#: ../../library/typing.rst:2651 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2656 +#: ../../library/typing.rst:2655 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2659 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2662 +#: ../../library/typing.rst:2661 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2669 +#: ../../library/typing.rst:2668 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2671 +#: ../../library/typing.rst:2670 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2674 +#: ../../library/typing.rst:2673 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2681 +#: ../../library/typing.rst:2680 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2695 +#: ../../library/typing.rst:2694 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2697 +#: ../../library/typing.rst:2696 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2708 +#: ../../library/typing.rst:2707 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2713 +#: ../../library/typing.rst:2712 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2561,59 +2561,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2721 +#: ../../library/typing.rst:2720 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2724 +#: ../../library/typing.rst:2723 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2732 +#: ../../library/typing.rst:2731 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2734 +#: ../../library/typing.rst:2733 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2740 +#: ../../library/typing.rst:2739 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2743 +#: ../../library/typing.rst:2742 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2748 +#: ../../library/typing.rst:2747 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2753 +#: ../../library/typing.rst:2752 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2763 +#: ../../library/typing.rst:2762 msgid "" "Decorator to mark an object as providing :func:`~dataclasses.dataclass`-like " "behavior." msgstr "" -#: ../../library/typing.rst:2766 +#: ../../library/typing.rst:2765 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2622,19 +2622,19 @@ msgid "" "to :func:`dataclasses.dataclass`." msgstr "" -#: ../../library/typing.rst:2772 +#: ../../library/typing.rst:2771 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2788 +#: ../../library/typing.rst:2787 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2797 +#: ../../library/typing.rst:2796 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2808 +#: ../../library/typing.rst:2807 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2913 +#: ../../library/typing.rst:2912 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2798,32 +2798,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2920 +#: ../../library/typing.rst:2919 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2928 +#: ../../library/typing.rst:2927 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2930 +#: ../../library/typing.rst:2929 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2937 +#: ../../library/typing.rst:2936 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2939 +#: ../../library/typing.rst:2938 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2964 +#: ../../library/typing.rst:2963 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2833,11 +2833,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2975 +#: ../../library/typing.rst:2974 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2977 +#: ../../library/typing.rst:2976 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2845,48 +2845,48 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2983 +#: ../../library/typing.rst:2982 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2987 +#: ../../library/typing.rst:2986 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2989 +#: ../../library/typing.rst:2988 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2994 +#: ../../library/typing.rst:2993 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2996 +#: ../../library/typing.rst:2995 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:3007 +#: ../../library/typing.rst:3006 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:3011 +#: ../../library/typing.rst:3010 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:3015 +#: ../../library/typing.rst:3014 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:3018 +#: ../../library/typing.rst:3017 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2895,41 +2895,41 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:3024 +#: ../../library/typing.rst:3023 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example:" msgstr "" -#: ../../library/typing.rst:3041 +#: ../../library/typing.rst:3040 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:3046 +#: ../../library/typing.rst:3045 #, fuzzy msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:3050 +#: ../../library/typing.rst:3049 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:3057 +#: ../../library/typing.rst:3056 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:3060 +#: ../../library/typing.rst:3059 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2937,7 +2937,7 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:3066 ../../library/typing.rst:3089 +#: ../../library/typing.rst:3065 ../../library/typing.rst:3088 #, fuzzy msgid "Examples:" msgstr "" @@ -2945,13 +2945,13 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:3081 +#: ../../library/typing.rst:3080 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:3084 +#: ../../library/typing.rst:3083 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2959,40 +2959,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:3101 +#: ../../library/typing.rst:3100 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3122 +#: ../../library/typing.rst:3121 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:3124 +#: ../../library/typing.rst:3123 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:3129 +#: ../../library/typing.rst:3128 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:3136 +#: ../../library/typing.rst:3135 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3140 +#: ../../library/typing.rst:3139 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:3151 +#: ../../library/typing.rst:3150 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -3000,7 +3000,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3158 +#: ../../library/typing.rst:3157 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -3008,11 +3008,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3167 +#: ../../library/typing.rst:3166 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3169 +#: ../../library/typing.rst:3168 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3020,76 +3020,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3174 +#: ../../library/typing.rst:3173 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3174 +#: ../../library/typing.rst:3173 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3174 +#: ../../library/typing.rst:3173 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3174 +#: ../../library/typing.rst:3173 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3176 +#: ../../library/typing.rst:3175 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3176 +#: ../../library/typing.rst:3175 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3176 +#: ../../library/typing.rst:3175 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3176 +#: ../../library/typing.rst:3175 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3179 +#: ../../library/typing.rst:3178 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3179 ../../library/typing.rst:3182 +#: ../../library/typing.rst:3178 ../../library/typing.rst:3181 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3179 ../../library/typing.rst:3184 +#: ../../library/typing.rst:3178 ../../library/typing.rst:3183 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3179 +#: ../../library/typing.rst:3178 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3182 +#: ../../library/typing.rst:3181 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3182 +#: ../../library/typing.rst:3181 msgid "3.14" msgstr "" -#: ../../library/typing.rst:3182 +#: ../../library/typing.rst:3181 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3184 +#: ../../library/typing.rst:3183 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3184 +#: ../../library/typing.rst:3183 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3184 +#: ../../library/typing.rst:3183 msgid ":gh:`92332`" msgstr ":gh:`92332`" From c964d0d4d6dd7b4166b9a2f1b932dab4d2c63254 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 15 Jun 2023 00:36:27 +0000 Subject: [PATCH 107/130] sync with cpython ab054688 --- library/typing.po | 1274 ++++++++++++++++++++++----------------------- 1 file changed, 637 insertions(+), 637 deletions(-) diff --git a/library/typing.po b/library/typing.po index 56eee2e7a7..13e8dc4ef5 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-12 00:37+0000\n" +"POT-Creation-Date: 2023-06-15 00:34+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -356,7 +356,7 @@ msgid "" "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:253 ../../library/typing.rst:3102 +#: ../../library/typing.rst:253 ../../library/typing.rst:2610 #, fuzzy msgid "For example:" msgstr "" @@ -688,7 +688,7 @@ msgstr "" #: ../../library/typing.rst:660 ../../library/typing.rst:736 #: ../../library/typing.rst:756 ../../library/typing.rst:802 #: ../../library/typing.rst:1068 ../../library/typing.rst:1125 -#: ../../library/typing.rst:1333 ../../library/typing.rst:2942 +#: ../../library/typing.rst:1333 ../../library/typing.rst:2450 msgid "For example::" msgstr "" "舉例來說:\n" @@ -1107,7 +1107,7 @@ msgid "" "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1136 ../../library/typing.rst:2958 +#: ../../library/typing.rst:1136 ../../library/typing.rst:2466 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1386,7 +1386,7 @@ msgstr "" #: ../../library/typing.rst:1431 ../../library/typing.rst:1526 #: ../../library/typing.rst:1636 ../../library/typing.rst:1747 -#: ../../library/typing.rst:1818 ../../library/typing.rst:3142 +#: ../../library/typing.rst:1818 ../../library/typing.rst:2650 msgid "Usage::" msgstr "" "用法:\n" @@ -1928,1084 +1928,1084 @@ msgid "Added support for generic ``TypedDict``\\ s." msgstr "" #: ../../library/typing.rst:2126 -msgid "Generic concrete collections" -msgstr "" - -#: ../../library/typing.rst:2129 -msgid "Corresponding to built-in types" -msgstr "" +msgid "Protocols" +msgstr "協定" -#: ../../library/typing.rst:2133 -msgid "Deprecated alias to :class:`dict`." +#: ../../library/typing.rst:2128 +msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2135 +#: ../../library/typing.rst:2132 msgid "" -"Note that to annotate arguments, it is preferred to use an abstract " -"collection type such as :class:`Mapping` rather than to use :class:`dict` " -"or :class:`!typing.Dict`." +"An ABC with one abstract method ``__abs__`` that is covariant in its return " +"type." msgstr "" -#: ../../library/typing.rst:2139 ../../library/typing.rst:2366 -msgid "This type can be used as follows::" -msgstr "" +#: ../../library/typing.rst:2137 +msgid "An ABC with one abstract method ``__bytes__``." +msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" + +#: ../../library/typing.rst:2141 +msgid "An ABC with one abstract method ``__complex__``." +msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" + +#: ../../library/typing.rst:2145 +msgid "An ABC with one abstract method ``__float__``." +msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2144 +#: ../../library/typing.rst:2149 +msgid "An ABC with one abstract method ``__index__``." +msgstr "一個有抽象方法 ``__index__`` 的 ABC。" + +#: ../../library/typing.rst:2155 +msgid "An ABC with one abstract method ``__int__``." +msgstr "一個有抽象方法 ``__int__`` 的 ABC。" + +#: ../../library/typing.rst:2159 msgid "" -":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" -"`585` and :ref:`types-genericalias`." +"An ABC with one abstract method ``__round__`` that is covariant in its " +"return type." msgstr "" -#: ../../library/typing.rst:2150 -msgid "Deprecated alias to :class:`list`." +#: ../../library/typing.rst:2163 +msgid "Functions and decorators" +msgstr "函式與裝飾器" + +#: ../../library/typing.rst:2167 +msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2152 +#: ../../library/typing.rst:2169 msgid "" -"Note that to annotate arguments, it is preferred to use an abstract " -"collection type such as :class:`Sequence` or :class:`Iterable` rather than " -"to use :class:`list` or :class:`!typing.List`." +"This returns the value unchanged. To the type checker this signals that the " +"return value has the designated type, but at runtime we intentionally don't " +"check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2156 -msgid "This type may be used as follows::" +#: ../../library/typing.rst:2176 +msgid "" +"Ask a static type checker to confirm that *val* has an inferred type of " +"*typ*." msgstr "" -#: ../../library/typing.rst:2166 +#: ../../library/typing.rst:2178 msgid "" -":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" -"`585` and :ref:`types-genericalias`." +"At runtime this does nothing: it returns the first argument unchanged with " +"no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2172 -msgid "Deprecated alias to :class:`builtins.set `." +#: ../../library/typing.rst:2181 +msgid "" +"When a static type checker encounters a call to ``assert_type()``, it emits " +"an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2174 +#: ../../library/typing.rst:2188 msgid "" -"Note that to annotate arguments, it is preferred to use an abstract " -"collection type such as :class:`AbstractSet` rather than to use :class:`set` " -"or :class:`!typing.Set`." +"This function is useful for ensuring the type checker's understanding of a " +"script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2178 +#: ../../library/typing.rst:2202 msgid "" -":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" -"`585` and :ref:`types-genericalias`." +"Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2184 -msgid "Deprecated alias to :class:`builtins.frozenset `." +#: ../../library/typing.rst:2204 +msgid "Example::" msgstr "" +"舉例來說:\n" +"\n" +"::" -#: ../../library/typing.rst:2186 +#: ../../library/typing.rst:2215 msgid "" -":class:`builtins.frozenset ` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +"Here, the annotations allow the type checker to infer that the last case can " +"never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " +"and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2191 -msgid ":data:`Tuple` is a special form." +#: ../../library/typing.rst:2220 +msgid "" +"If a type checker finds that a call to ``assert_never()`` is reachable, it " +"will emit an error. For example, if the type annotation for ``arg`` was " +"instead ``int | str | float``, the type checker would emit an error pointing " +"out that ``unreachable`` is of type :class:`float`. For a call to " +"``assert_never`` to pass type checking, the inferred type of the argument " +"passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2194 -msgid "Corresponding to types in :mod:`collections`" +#: ../../library/typing.rst:2228 +msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2198 -msgid "Deprecated alias to :class:`collections.defaultdict`." +#: ../../library/typing.rst:2231 +msgid "" +"`Unreachable Code and Exhaustiveness Checking `__ has more information about " +"exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2202 +#: ../../library/typing.rst:2239 +msgid "Reveal the inferred static type of an expression." +msgstr "" + +#: ../../library/typing.rst:2241 msgid "" -":class:`collections.defaultdict` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +"When a static type checker encounters a call to this function, it emits a " +"diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2208 -msgid "Deprecated alias to :class:`collections.OrderedDict`." +#: ../../library/typing.rst:2247 +msgid "" +"This can be useful when you want to debug how your type checker handles a " +"particular piece of code." msgstr "" -#: ../../library/typing.rst:2212 +#: ../../library/typing.rst:2250 msgid "" -":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +"The function returns its argument unchanged, which allows using it within an " +"expression::" msgstr "" -#: ../../library/typing.rst:2218 -msgid "Deprecated alias to :class:`collections.ChainMap`." +#: ../../library/typing.rst:2255 +msgid "" +"Most type checkers support ``reveal_type()`` anywhere, even if the name is " +"not imported from ``typing``. Importing the name from ``typing`` allows your " +"code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2223 +#: ../../library/typing.rst:2260 msgid "" -":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" -"`585` and :ref:`types-genericalias`." +"At runtime, this function prints the runtime type of its argument to stderr " +"and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2229 -msgid "Deprecated alias to :class:`collections.Counter`." +#: ../../library/typing.rst:2270 +msgid "" +"Decorator to mark an object as providing :func:`~dataclasses.dataclass`-like " +"behavior." msgstr "" -#: ../../library/typing.rst:2234 +#: ../../library/typing.rst:2273 msgid "" -":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" -"`585` and :ref:`types-genericalias`." +"``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 in a similar way " +"to :func:`dataclasses.dataclass`." msgstr "" -#: ../../library/typing.rst:2240 -msgid "Deprecated alias to :class:`collections.deque`." +#: ../../library/typing.rst:2279 +msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2245 -msgid "" -":class:`collections.deque` now supports subscripting (``[]``). See :pep:" -"`585` and :ref:`types-genericalias`." +#: ../../library/typing.rst:2295 +msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2250 -msgid "Other concrete types" +#: ../../library/typing.rst:2304 +msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2256 +#: ../../library/typing.rst:2315 msgid "" -"Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " -"``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " -"by :func:`open`." +"The ``CustomerModel`` classes defined above will be treated by type checkers " +"similarly to classes created with :func:`@dataclasses.dataclass `. For example, type checkers will assume these classes have " +"``__init__`` methods that accept ``id`` and ``name``." msgstr "" -#: ../../library/typing.rst:2263 +#: ../../library/typing.rst:2321 msgid "" -"The ``typing.io`` namespace is deprecated and will be removed. These types " -"should be directly imported from ``typing`` instead." +"The decorated class, metaclass, or function may accept the following bool " +"arguments which type checkers will assume have the same effect as they would " +"have on the :func:`@dataclasses.dataclass` decorator: " +"``init``, ``eq``, ``order``, ``unsafe_hash``, ``frozen``, ``match_args``, " +"``kw_only``, and ``slots``. It must be possible for the value of these " +"arguments (``True`` or ``False``) to be statically evaluated." msgstr "" -#: ../../library/typing.rst:2268 +#: ../../library/typing.rst:2329 msgid "" -"Deprecated aliases corresponding to the return types from :func:`re.compile` " -"and :func:`re.match`." +"The arguments to the ``dataclass_transform`` decorator can be used to " +"customize the default behaviors of the decorated class, metaclass, or " +"function:" msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2333 msgid "" -"These types (and the corresponding functions) are generic over :data:" -"`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " -"``Pattern[bytes]``; ``Match`` can be specialised as ``Match[str]`` or " -"``Match[bytes]``." +"``eq_default`` indicates whether the ``eq`` parameter is assumed to be " +"``True`` or ``False`` if it is omitted by the caller." msgstr "" -#: ../../library/typing.rst:2279 +#: ../../library/typing.rst:2335 msgid "" -"The ``typing.re`` namespace is deprecated and will be removed. These types " -"should be directly imported from ``typing`` instead." +"``order_default`` indicates whether the ``order`` parameter is assumed to be " +"True or False if it is omitted by the caller." msgstr "" -#: ../../library/typing.rst:2280 +#: ../../library/typing.rst:2337 msgid "" -"Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" -"pep:`585` and :ref:`types-genericalias`." +"``kw_only_default`` indicates whether the ``kw_only`` parameter is assumed " +"to be True or False if it is omitted by the caller." msgstr "" -#: ../../library/typing.rst:2286 -msgid "Deprecated alias for :class:`str`." +#: ../../library/typing.rst:2339 +msgid "" +"``field_specifiers`` specifies a static list of supported classes or " +"functions that describe fields, similar to ``dataclasses.field()``." msgstr "" -#: ../../library/typing.rst:2288 +#: ../../library/typing.rst:2341 msgid "" -"``Text`` is provided to supply a forward compatible path for Python 2 code: " -"in Python 2, ``Text`` is an alias for ``unicode``." +"Arbitrary other keyword arguments are accepted in order to allow for " +"possible future extensions." msgstr "" -#: ../../library/typing.rst:2292 +#: ../../library/typing.rst:2344 msgid "" -"Use ``Text`` to indicate that a value must contain a unicode string in a " -"manner that is compatible with both Python 2 and Python 3::" +"Type checkers recognize the following optional arguments on field specifiers:" msgstr "" -#: ../../library/typing.rst:2300 +#: ../../library/typing.rst:2347 msgid "" -"Python 2 is no longer supported, and most type checkers also no longer " -"support type checking Python 2 code. Removal of the alias is not currently " -"planned, but users are encouraged to use :class:`str` instead of ``Text``." +"``init`` indicates whether the field should be included in the synthesized " +"``__init__`` method. If unspecified, ``init`` defaults to ``True``." msgstr "" -#: ../../library/typing.rst:2307 -msgid "Abstract Base Classes" +#: ../../library/typing.rst:2350 +msgid "``default`` provides the default value for the field." msgstr "" -#: ../../library/typing.rst:2310 -msgid "Corresponding to collections in :mod:`collections.abc`" +#: ../../library/typing.rst:2351 +msgid "" +"``default_factory`` provides a runtime callback that returns the default " +"value for the field. If neither ``default`` nor ``default_factory`` are " +"specified, the field is assumed to have no default value and must be " +"provided a value when the class is instantiated." msgstr "" -#: ../../library/typing.rst:2314 -msgid "Deprecated alias to :class:`collections.abc.Set`." +#: ../../library/typing.rst:2356 +msgid "``factory`` is an alias for ``default_factory``." msgstr "" -#: ../../library/typing.rst:2316 +#: ../../library/typing.rst:2357 msgid "" -":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" -"`585` and :ref:`types-genericalias`." +"``kw_only`` indicates whether the field should be marked as keyword-only. If " +"``True``, the field will be keyword-only. If ``False``, it will not be " +"keyword-only. If unspecified, the value of the ``kw_only`` parameter on the " +"object decorated with ``dataclass_transform`` will be used, or if that is " +"unspecified, the value of ``kw_only_default`` on ``dataclass_transform`` " +"will be used." msgstr "" -#: ../../library/typing.rst:2322 +#: ../../library/typing.rst:2363 msgid "" -"This type represents the types :class:`bytes`, :class:`bytearray`, and :" -"class:`memoryview` of byte sequences." +"``alias`` provides an alternative name for the field. This alternative name " +"is used in the synthesized ``__init__`` method." msgstr "" -#: ../../library/typing.rst:2326 +#: ../../library/typing.rst:2366 msgid "" -"Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " -"memoryview``." +"At runtime, this decorator records its arguments in the " +"``__dataclass_transform__`` attribute on the decorated object. It has no " +"other runtime effect." msgstr "" -#: ../../library/typing.rst:2330 -msgid "Deprecated alias to :class:`collections.abc.Collection`." +#: ../../library/typing.rst:2370 +msgid "See :pep:`681` for more details." +msgstr "更多細節請見 :pep:`681`。" + +#: ../../library/typing.rst:2376 +msgid "Decorator for creating overloaded functions and methods." msgstr "" -#: ../../library/typing.rst:2334 +#: ../../library/typing.rst:2378 msgid "" -":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +"The ``@overload`` decorator allows describing functions and methods that " +"support multiple different combinations of argument types. A series of " +"``@overload``-decorated definitions must be followed by exactly one non-" +"``@overload``-decorated definition (for the same function/method)." msgstr "" -#: ../../library/typing.rst:2340 -msgid "Deprecated alias to :class:`collections.abc.Container`." +#: ../../library/typing.rst:2383 +msgid "" +"``@overload``-decorated definitions are for the benefit of the type checker " +"only, since they will be overwritten by the non-``@overload``-decorated " +"definition. The non-``@overload``-decorated definition, meanwhile, will be " +"used at runtime but should be ignored by a type checker. At runtime, " +"calling an ``@overload``-decorated function directly will raise :exc:" +"`NotImplementedError`." msgstr "" -#: ../../library/typing.rst:2342 +#: ../../library/typing.rst:2391 msgid "" -":class:`collections.abc.Container` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +"An example of overload that gives a more precise type than can be expressed " +"using a union or a type variable:" msgstr "" -#: ../../library/typing.rst:2348 -msgid "Deprecated alias to :class:`collections.abc.ItemsView`." +#: ../../library/typing.rst:2408 +msgid "" +"See :pep:`484` for more details and comparison with other typing semantics." msgstr "" -#: ../../library/typing.rst:2350 +#: ../../library/typing.rst:2410 msgid "" -":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +"Overloaded functions can now be introspected at runtime using :func:" +"`get_overloads`." msgstr "" -#: ../../library/typing.rst:2356 -msgid "Deprecated alias to :class:`collections.abc.KeysView`." +#: ../../library/typing.rst:2417 +msgid "" +"Return a sequence of :func:`@overload `-decorated definitions for " +"*func*." msgstr "" -#: ../../library/typing.rst:2358 +#: ../../library/typing.rst:2420 msgid "" -":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +"*func* is the function object for the implementation of the overloaded " +"function. For example, given the definition of ``process`` in the " +"documentation for :func:`@overload `, ``get_overloads(process)`` " +"will return a sequence of three function objects for the three defined " +"overloads. If called on a function with no overloads, ``get_overloads()`` " +"returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2364 -msgid "Deprecated alias to :class:`collections.abc.Mapping`." +#: ../../library/typing.rst:2427 +msgid "" +"``get_overloads()`` can be used for introspecting an overloaded function at " +"runtime." msgstr "" -#: ../../library/typing.rst:2371 -msgid "" -":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +#: ../../library/typing.rst:2435 +msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2377 -msgid "Deprecated alias to :class:`collections.abc.MappingView`." +#: ../../library/typing.rst:2437 +msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2379 -msgid "" -":class:`collections.abc.MappingView` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +#: ../../library/typing.rst:2444 +msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2385 -msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." +#: ../../library/typing.rst:2446 +msgid "" +"Decorating a method with ``@final`` indicates to a type checker that the " +"method cannot be overridden in a subclass. Decorating a class with " +"``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2387 +#: ../../library/typing.rst:2471 msgid "" -":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +"The decorator will now attempt to set a ``__final__`` attribute to ``True`` " +"on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " +"False)`` can be used at runtime to determine whether an object ``obj`` has " +"been marked as final. If the decorated object does not support setting " +"attributes, the decorator returns the object unchanged without raising an " +"exception." msgstr "" -#: ../../library/typing.rst:2394 -msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." +#: ../../library/typing.rst:2482 +msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2396 +#: ../../library/typing.rst:2484 msgid "" -":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +"This works as a class or function :term:`decorator`. With a class, it " +"applies recursively to all methods and classes defined in that class (but " +"not to methods defined in its superclasses or subclasses). Type checkers " +"will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2403 -msgid "Deprecated alias to :class:`collections.abc.MutableSet`." +#: ../../library/typing.rst:2490 +msgid "``@no_type_check`` mutates the decorated object in place." +msgstr "" + +#: ../../library/typing.rst:2494 +msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2405 +#: ../../library/typing.rst:2496 msgid "" -":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +"This wraps the decorator with something that wraps the decorated function " +"in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2411 -msgid "Deprecated alias to :class:`collections.abc.Sequence`." +#: ../../library/typing.rst:2501 +msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2413 +#: ../../library/typing.rst:2503 msgid "" -":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +"This decorator is itself not available at runtime. It is mainly intended to " +"mark classes that are defined in type stub files if an implementation " +"returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2419 -msgid "Deprecated alias to :class:`collections.abc.ValuesView`." +#: ../../library/typing.rst:2514 +msgid "" +"Note that returning instances of private classes is not recommended. It is " +"usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2421 +#: ../../library/typing.rst:2518 +msgid "Introspection helpers" +msgstr "" + +#: ../../library/typing.rst:2522 msgid "" -":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +"Return a dictionary containing type hints for a function, method, module or " +"class object." msgstr "" -#: ../../library/typing.rst:2426 -msgid "Corresponding to other types in :mod:`collections.abc`" +#: ../../library/typing.rst:2525 +msgid "" +"This is often the same as ``obj.__annotations__``. In addition, forward " +"references encoded as string literals are handled by evaluating them in " +"``globals`` and ``locals`` namespaces. For a class ``C``, return a " +"dictionary constructed by merging all the ``__annotations__`` along ``C." +"__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2430 -msgid "Deprecated alias to :class:`collections.abc.Iterable`." +#: ../../library/typing.rst:2531 +msgid "" +"The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " +"unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " +"more information). For example:" msgstr "" -#: ../../library/typing.rst:2432 +#: ../../library/typing.rst:2548 msgid "" -":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " +"annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2438 -msgid "Deprecated alias to :class:`collections.abc.Iterator`." +#: ../../library/typing.rst:2553 +#, fuzzy +msgid "" +"Added ``include_extras`` parameter as part of :pep:`593`. See the " +"documentation on :data:`Annotated` for more information." +msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" + +#: ../../library/typing.rst:2557 +msgid "" +"Previously, ``Optional[t]`` was added for function and method annotations if " +"a default value equal to ``None`` was set. Now the annotation is returned " +"unchanged." msgstr "" -#: ../../library/typing.rst:2440 +#: ../../library/typing.rst:2564 msgid "" -":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +"Get the unsubscripted version of a type: for a typing object of the form " +"``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2446 -msgid "Deprecated alias to :class:`collections.abc.Generator`." +#: ../../library/typing.rst:2567 +msgid "" +"If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " +"it will be normalized to the original class. If ``X`` is an instance of :" +"class:`ParamSpecArgs` or :class:`ParamSpecKwargs`, return the underlying :" +"class:`ParamSpec`. Return ``None`` for unsupported objects." +msgstr "" + +#: ../../library/typing.rst:2573 ../../library/typing.rst:2596 +#, fuzzy +msgid "Examples:" msgstr "" +"舉例來說:\n" +"\n" +"::" -#: ../../library/typing.rst:2448 +#: ../../library/typing.rst:2588 msgid "" -"A generator can be annotated by the generic type ``Generator[YieldType, " -"SendType, ReturnType]``. For example::" +"Get type arguments with all substitutions performed: for a typing object of " +"the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2457 +#: ../../library/typing.rst:2591 msgid "" -"Note that unlike many other generics in the typing module, the ``SendType`` " -"of :class:`Generator` behaves contravariantly, not covariantly or " -"invariantly." +"If ``X`` is a union or :class:`Literal` contained in another generic type, " +"the order of ``(Y, Z, ...)`` may be different from the order of the original " +"arguments ``[Y, Z, ...]`` due to type caching. Return ``()`` for unsupported " +"objects." +msgstr "" + +#: ../../library/typing.rst:2608 +msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2461 +#: ../../library/typing.rst:2629 msgid "" -"If your generator will only yield values, set the ``SendType`` and " -"``ReturnType`` to ``None``::" +"Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:2469 +#: ../../library/typing.rst:2631 msgid "" -"Alternatively, annotate your generator as having a return type of either " -"``Iterable[YieldType]`` or ``Iterator[YieldType]``::" +"For example, ``List[\"SomeClass\"]`` is implicitly transformed into " +"``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " +"instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2636 msgid "" -":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " +"implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " +"will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2483 -msgid "Alias to :class:`collections.abc.Hashable`." +#: ../../library/typing.rst:2643 +msgid "Constant" +msgstr "常數" + +#: ../../library/typing.rst:2647 +msgid "" +"A special constant that is assumed to be ``True`` by 3rd party static type " +"checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:2487 -msgid "Deprecated alias to :class:`collections.abc.Reversible`." +#: ../../library/typing.rst:2658 +msgid "" +"The first type annotation must be enclosed in quotes, making it a \"forward " +"reference\", to hide the ``expensive_mod`` reference from the interpreter " +"runtime. Type annotations for local variables are not evaluated, so the " +"second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2489 +#: ../../library/typing.rst:2665 msgid "" -":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +"If ``from __future__ import annotations`` is used, annotations are not " +"evaluated at function definition time. Instead, they are stored as strings " +"in ``__annotations__``. This makes it unnecessary to use quotes around the " +"annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2495 -msgid "Alias to :class:`collections.abc.Sized`." +#: ../../library/typing.rst:2674 +msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:2498 -msgid "Asynchronous programming" +#: ../../library/typing.rst:2677 +msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:2502 -msgid "Deprecated alias to :class:`collections.abc.Coroutine`." +#: ../../library/typing.rst:2681 +msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2504 +#: ../../library/typing.rst:2683 msgid "" -"The variance and order of type variables correspond to those of :class:" -"`Generator`, for example::" +"Note that to annotate arguments, it is preferred to use an abstract " +"collection type such as :class:`Mapping` rather than to use :class:`dict` " +"or :class:`!typing.Dict`." +msgstr "" + +#: ../../library/typing.rst:2687 ../../library/typing.rst:2914 +msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2515 +#: ../../library/typing.rst:2692 msgid "" -":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2521 -msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." +#: ../../library/typing.rst:2698 +msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2523 +#: ../../library/typing.rst:2700 msgid "" -"An async generator can be annotated by the generic type " -"``AsyncGenerator[YieldType, SendType]``. For example::" +"Note that to annotate arguments, it is preferred to use an abstract " +"collection type such as :class:`Sequence` or :class:`Iterable` rather than " +"to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2532 -msgid "" -"Unlike normal generators, async generators cannot return a value, so there " -"is no ``ReturnType`` type parameter. As with :class:`Generator`, the " -"``SendType`` behaves contravariantly." +#: ../../library/typing.rst:2704 +msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2536 +#: ../../library/typing.rst:2714 msgid "" -"If your generator will only yield values, set the ``SendType`` to ``None``::" +":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." +msgstr "" + +#: ../../library/typing.rst:2720 +msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2544 +#: ../../library/typing.rst:2722 msgid "" -"Alternatively, annotate your generator as having a return type of either " -"``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" +"Note that to annotate arguments, it is preferred to use an abstract " +"collection type such as :class:`AbstractSet` rather than to use :class:`set` " +"or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2554 +#: ../../library/typing.rst:2726 msgid "" -":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2561 -msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." +#: ../../library/typing.rst:2732 +msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2565 +#: ../../library/typing.rst:2734 msgid "" -":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " +":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2571 -msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." +#: ../../library/typing.rst:2739 +msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:2575 -msgid "" -":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +#: ../../library/typing.rst:2742 +msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2581 -msgid "Deprecated alias to :class:`collections.abc.Awaitable`." +#: ../../library/typing.rst:2746 +msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2585 +#: ../../library/typing.rst:2750 msgid "" -":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" +":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2591 -msgid "Context manager types" -msgstr "" - -#: ../../library/typing.rst:2595 -msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." +#: ../../library/typing.rst:2756 +msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2600 +#: ../../library/typing.rst:2760 msgid "" -":class:`contextlib.AbstractContextManager` now supports subscripting " -"(``[]``). See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2607 -msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." +#: ../../library/typing.rst:2766 +msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2612 +#: ../../library/typing.rst:2771 msgid "" -":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " -"(``[]``). See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2618 -msgid "Protocols" -msgstr "協定" - -#: ../../library/typing.rst:2620 -msgid "These protocols are decorated with :func:`runtime_checkable`." +#: ../../library/typing.rst:2777 +msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2624 +#: ../../library/typing.rst:2782 msgid "" -"An ABC with one abstract method ``__abs__`` that is covariant in its return " -"type." +":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2629 -msgid "An ABC with one abstract method ``__bytes__``." -msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" - -#: ../../library/typing.rst:2633 -msgid "An ABC with one abstract method ``__complex__``." -msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" - -#: ../../library/typing.rst:2637 -msgid "An ABC with one abstract method ``__float__``." -msgstr "一個有抽象方法 ``__float__`` 的 ABC。" - -#: ../../library/typing.rst:2641 -msgid "An ABC with one abstract method ``__index__``." -msgstr "一個有抽象方法 ``__index__`` 的 ABC。" - -#: ../../library/typing.rst:2647 -msgid "An ABC with one abstract method ``__int__``." -msgstr "一個有抽象方法 ``__int__`` 的 ABC。" +#: ../../library/typing.rst:2788 +msgid "Deprecated alias to :class:`collections.deque`." +msgstr "" -#: ../../library/typing.rst:2651 +#: ../../library/typing.rst:2793 msgid "" -"An ABC with one abstract method ``__round__`` that is covariant in its " -"return type." +":class:`collections.deque` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2655 -msgid "Functions and decorators" -msgstr "函式與裝飾器" - -#: ../../library/typing.rst:2659 -msgid "Cast a value to a type." +#: ../../library/typing.rst:2798 +msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2661 +#: ../../library/typing.rst:2804 msgid "" -"This returns the value unchanged. To the type checker this signals that the " -"return value has the designated type, but at runtime we intentionally don't " -"check anything (we want this to be as fast as possible)." +"Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " +"``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " +"by :func:`open`." msgstr "" -#: ../../library/typing.rst:2668 +#: ../../library/typing.rst:2811 msgid "" -"Ask a static type checker to confirm that *val* has an inferred type of " -"*typ*." +"The ``typing.io`` namespace is deprecated and will be removed. These types " +"should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2670 +#: ../../library/typing.rst:2816 msgid "" -"At runtime this does nothing: it returns the first argument unchanged with " -"no checks or side effects, no matter the actual type of the argument." +"Deprecated aliases corresponding to the return types from :func:`re.compile` " +"and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2673 +#: ../../library/typing.rst:2819 msgid "" -"When a static type checker encounters a call to ``assert_type()``, it emits " -"an error if the value is not of the specified type::" +"These types (and the corresponding functions) are generic over :data:" +"`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " +"``Pattern[bytes]``; ``Match`` can be specialised as ``Match[str]`` or " +"``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2680 +#: ../../library/typing.rst:2827 msgid "" -"This function is useful for ensuring the type checker's understanding of a " -"script is in line with the developer's intentions::" +"The ``typing.re`` namespace is deprecated and will be removed. These types " +"should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2694 +#: ../../library/typing.rst:2828 msgid "" -"Ask a static type checker to confirm that a line of code is unreachable." +"Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2696 -msgid "Example::" +#: ../../library/typing.rst:2834 +msgid "Deprecated alias for :class:`str`." msgstr "" -"舉例來說:\n" -"\n" -"::" -#: ../../library/typing.rst:2707 +#: ../../library/typing.rst:2836 msgid "" -"Here, the annotations allow the type checker to infer that the last case can " -"never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " -"and both options are covered by earlier cases." +"``Text`` is provided to supply a forward compatible path for Python 2 code: " +"in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:2712 +#: ../../library/typing.rst:2840 msgid "" -"If a type checker finds that a call to ``assert_never()`` is reachable, it " -"will emit an error. For example, if the type annotation for ``arg`` was " -"instead ``int | str | float``, the type checker would emit an error pointing " -"out that ``unreachable`` is of type :class:`float`. For a call to " -"``assert_never`` to pass type checking, the inferred type of the argument " -"passed in must be the bottom type, :data:`Never`, and nothing else." -msgstr "" - -#: ../../library/typing.rst:2720 -msgid "At runtime, this throws an exception when called." +"Use ``Text`` to indicate that a value must contain a unicode string in a " +"manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2723 +#: ../../library/typing.rst:2848 msgid "" -"`Unreachable Code and Exhaustiveness Checking `__ has more information about " -"exhaustiveness checking with static typing." +"Python 2 is no longer supported, and most type checkers also no longer " +"support type checking Python 2 code. Removal of the alias is not currently " +"planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2731 -msgid "Reveal the inferred static type of an expression." +#: ../../library/typing.rst:2855 +msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2733 -msgid "" -"When a static type checker encounters a call to this function, it emits a " -"diagnostic with the type of the argument. For example::" +#: ../../library/typing.rst:2858 +msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2739 -msgid "" -"This can be useful when you want to debug how your type checker handles a " -"particular piece of code." +#: ../../library/typing.rst:2862 +msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2742 +#: ../../library/typing.rst:2864 msgid "" -"The function returns its argument unchanged, which allows using it within an " -"expression::" +":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2747 +#: ../../library/typing.rst:2870 msgid "" -"Most type checkers support ``reveal_type()`` anywhere, even if the name is " -"not imported from ``typing``. Importing the name from ``typing`` allows your " -"code to run without runtime errors and communicates intent more clearly." +"This type represents the types :class:`bytes`, :class:`bytearray`, and :" +"class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2752 +#: ../../library/typing.rst:2874 msgid "" -"At runtime, this function prints the runtime type of its argument to stderr " -"and returns it unchanged::" +"Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " +"memoryview``." msgstr "" -#: ../../library/typing.rst:2762 -msgid "" -"Decorator to mark an object as providing :func:`~dataclasses.dataclass`-like " -"behavior." +#: ../../library/typing.rst:2878 +msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2765 +#: ../../library/typing.rst:2882 msgid "" -"``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 in a similar way " -"to :func:`dataclasses.dataclass`." -msgstr "" - -#: ../../library/typing.rst:2771 -msgid "Example usage with a decorator function:" +":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2787 -msgid "On a base class::" +#: ../../library/typing.rst:2888 +msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2796 -msgid "On a metaclass::" +#: ../../library/typing.rst:2890 +msgid "" +":class:`collections.abc.Container` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2807 -msgid "" -"The ``CustomerModel`` classes defined above will be treated by type checkers " -"similarly to classes created with :func:`@dataclasses.dataclass `. For example, type checkers will assume these classes have " -"``__init__`` methods that accept ``id`` and ``name``." +#: ../../library/typing.rst:2896 +msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2813 +#: ../../library/typing.rst:2898 msgid "" -"The decorated class, metaclass, or function may accept the following bool " -"arguments which type checkers will assume have the same effect as they would " -"have on the :func:`@dataclasses.dataclass` decorator: " -"``init``, ``eq``, ``order``, ``unsafe_hash``, ``frozen``, ``match_args``, " -"``kw_only``, and ``slots``. It must be possible for the value of these " -"arguments (``True`` or ``False``) to be statically evaluated." +":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2821 -msgid "" -"The arguments to the ``dataclass_transform`` decorator can be used to " -"customize the default behaviors of the decorated class, metaclass, or " -"function:" +#: ../../library/typing.rst:2904 +msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2825 +#: ../../library/typing.rst:2906 msgid "" -"``eq_default`` indicates whether the ``eq`` parameter is assumed to be " -"``True`` or ``False`` if it is omitted by the caller." +":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2827 -msgid "" -"``order_default`` indicates whether the ``order`` parameter is assumed to be " -"True or False if it is omitted by the caller." +#: ../../library/typing.rst:2912 +msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:2829 +#: ../../library/typing.rst:2919 msgid "" -"``kw_only_default`` indicates whether the ``kw_only`` parameter is assumed " -"to be True or False if it is omitted by the caller." +":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2831 -msgid "" -"``field_specifiers`` specifies a static list of supported classes or " -"functions that describe fields, similar to ``dataclasses.field()``." +#: ../../library/typing.rst:2925 +msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2833 +#: ../../library/typing.rst:2927 msgid "" -"Arbitrary other keyword arguments are accepted in order to allow for " -"possible future extensions." +":class:`collections.abc.MappingView` now supports subscripting (``[]``). " +"See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2836 -msgid "" -"Type checkers recognize the following optional arguments on field specifiers:" +#: ../../library/typing.rst:2933 +msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2839 +#: ../../library/typing.rst:2935 msgid "" -"``init`` indicates whether the field should be included in the synthesized " -"``__init__`` method. If unspecified, ``init`` defaults to ``True``." +":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " +"See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2842 -msgid "``default`` provides the default value for the field." +#: ../../library/typing.rst:2942 +msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2843 +#: ../../library/typing.rst:2944 msgid "" -"``default_factory`` provides a runtime callback that returns the default " -"value for the field. If neither ``default`` nor ``default_factory`` are " -"specified, the field is assumed to have no default value and must be " -"provided a value when the class is instantiated." +":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " +"See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2848 -msgid "``factory`` is an alias for ``default_factory``." +#: ../../library/typing.rst:2951 +msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2849 +#: ../../library/typing.rst:2953 msgid "" -"``kw_only`` indicates whether the field should be marked as keyword-only. If " -"``True``, the field will be keyword-only. If ``False``, it will not be " -"keyword-only. If unspecified, the value of the ``kw_only`` parameter on the " -"object decorated with ``dataclass_transform`` will be used, or if that is " -"unspecified, the value of ``kw_only_default`` on ``dataclass_transform`` " -"will be used." +":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2855 -msgid "" -"``alias`` provides an alternative name for the field. This alternative name " -"is used in the synthesized ``__init__`` method." +#: ../../library/typing.rst:2959 +msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:2961 msgid "" -"At runtime, this decorator records its arguments in the " -"``__dataclass_transform__`` attribute on the decorated object. It has no " -"other runtime effect." +":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2862 -msgid "See :pep:`681` for more details." -msgstr "更多細節請見 :pep:`681`。" - -#: ../../library/typing.rst:2868 -msgid "Decorator for creating overloaded functions and methods." +#: ../../library/typing.rst:2967 +msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2870 +#: ../../library/typing.rst:2969 msgid "" -"The ``@overload`` decorator allows describing functions and methods that " -"support multiple different combinations of argument types. A series of " -"``@overload``-decorated definitions must be followed by exactly one non-" -"``@overload``-decorated definition (for the same function/method)." +":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2875 -msgid "" -"``@overload``-decorated definitions are for the benefit of the type checker " -"only, since they will be overwritten by the non-``@overload``-decorated " -"definition. The non-``@overload``-decorated definition, meanwhile, will be " -"used at runtime but should be ignored by a type checker. At runtime, " -"calling an ``@overload``-decorated function directly will raise :exc:" -"`NotImplementedError`." +#: ../../library/typing.rst:2974 +msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2883 -msgid "" -"An example of overload that gives a more precise type than can be expressed " -"using a union or a type variable:" +#: ../../library/typing.rst:2978 +msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2900 +#: ../../library/typing.rst:2980 msgid "" -"See :pep:`484` for more details and comparison with other typing semantics." +":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2902 -msgid "" -"Overloaded functions can now be introspected at runtime using :func:" -"`get_overloads`." +#: ../../library/typing.rst:2986 +msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2909 +#: ../../library/typing.rst:2988 msgid "" -"Return a sequence of :func:`@overload `-decorated definitions for " -"*func*." +":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2912 -msgid "" -"*func* is the function object for the implementation of the overloaded " -"function. For example, given the definition of ``process`` in the " -"documentation for :func:`@overload `, ``get_overloads(process)`` " -"will return a sequence of three function objects for the three defined " -"overloads. If called on a function with no overloads, ``get_overloads()`` " -"returns an empty sequence." +#: ../../library/typing.rst:2994 +msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:2919 +#: ../../library/typing.rst:2996 msgid "" -"``get_overloads()`` can be used for introspecting an overloaded function at " -"runtime." -msgstr "" - -#: ../../library/typing.rst:2927 -msgid "Clear all registered overloads in the internal registry." +"A generator can be annotated by the generic type ``Generator[YieldType, " +"SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2929 -msgid "This can be used to reclaim the memory used by the registry." +#: ../../library/typing.rst:3005 +msgid "" +"Note that unlike many other generics in the typing module, the ``SendType`` " +"of :class:`Generator` behaves contravariantly, not covariantly or " +"invariantly." msgstr "" -#: ../../library/typing.rst:2936 -msgid "Decorator to indicate final methods and final classes." +#: ../../library/typing.rst:3009 +msgid "" +"If your generator will only yield values, set the ``SendType`` and " +"``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2938 +#: ../../library/typing.rst:3017 msgid "" -"Decorating a method with ``@final`` indicates to a type checker that the " -"method cannot be overridden in a subclass. Decorating a class with " -"``@final`` indicates that it cannot be subclassed." +"Alternatively, annotate your generator as having a return type of either " +"``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2963 +#: ../../library/typing.rst:3025 msgid "" -"The decorator will now attempt to set a ``__final__`` attribute to ``True`` " -"on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " -"False)`` can be used at runtime to determine whether an object ``obj`` has " -"been marked as final. If the decorated object does not support setting " -"attributes, the decorator returns the object unchanged without raising an " -"exception." +":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2974 -msgid "Decorator to indicate that annotations are not type hints." +#: ../../library/typing.rst:3031 +msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2976 -msgid "" -"This works as a class or function :term:`decorator`. With a class, it " -"applies recursively to all methods and classes defined in that class (but " -"not to methods defined in its superclasses or subclasses). Type checkers " -"will ignore all annotations in a function or class with this decorator." +#: ../../library/typing.rst:3035 +msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2982 -msgid "``@no_type_check`` mutates the decorated object in place." +#: ../../library/typing.rst:3037 +msgid "" +":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2986 -msgid "Decorator to give another decorator the :func:`no_type_check` effect." +#: ../../library/typing.rst:3043 +msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2988 -msgid "" -"This wraps the decorator with something that wraps the decorated function " -"in :func:`no_type_check`." +#: ../../library/typing.rst:3046 +msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2993 -msgid "Decorator to mark a class or function as unavailable at runtime." +#: ../../library/typing.rst:3050 +msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:2995 +#: ../../library/typing.rst:3052 msgid "" -"This decorator is itself not available at runtime. It is mainly intended to " -"mark classes that are defined in type stub files if an implementation " -"returns an instance of a private class::" +"The variance and order of type variables correspond to those of :class:" +"`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3006 +#: ../../library/typing.rst:3063 msgid "" -"Note that returning instances of private classes is not recommended. It is " -"usually preferable to make such classes public." +":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3010 -msgid "Introspection helpers" +#: ../../library/typing.rst:3069 +msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:3014 +#: ../../library/typing.rst:3071 msgid "" -"Return a dictionary containing type hints for a function, method, module or " -"class object." +"An async generator can be annotated by the generic type " +"``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3017 +#: ../../library/typing.rst:3080 msgid "" -"This is often the same as ``obj.__annotations__``. In addition, forward " -"references encoded as string literals are handled by evaluating them in " -"``globals`` and ``locals`` namespaces. For a class ``C``, return a " -"dictionary constructed by merging all the ``__annotations__`` along ``C." -"__mro__`` in reverse order." +"Unlike normal generators, async generators cannot return a value, so there " +"is no ``ReturnType`` type parameter. As with :class:`Generator`, the " +"``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:3023 +#: ../../library/typing.rst:3084 msgid "" -"The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " -"unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " -"more information). For example:" +"If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3040 +#: ../../library/typing.rst:3092 msgid "" -":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " -"annotations (:pep:`563`) may remove the need for most forward references." +"Alternatively, annotate your generator as having a return type of either " +"``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3045 -#, fuzzy -msgid "" -"Added ``include_extras`` parameter as part of :pep:`593`. See the " -"documentation on :data:`Annotated` for more information." -msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" - -#: ../../library/typing.rst:3049 +#: ../../library/typing.rst:3102 msgid "" -"Previously, ``Optional[t]`` was added for function and method annotations if " -"a default value equal to ``None`` was set. Now the annotation is returned " -"unchanged." +":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " +"See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3056 -msgid "" -"Get the unsubscripted version of a type: for a typing object of the form " -"``X[Y, Z, ...]`` return ``X``." +#: ../../library/typing.rst:3109 +msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:3059 +#: ../../library/typing.rst:3113 msgid "" -"If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " -"it will be normalized to the original class. If ``X`` is an instance of :" -"class:`ParamSpecArgs` or :class:`ParamSpecKwargs`, return the underlying :" -"class:`ParamSpec`. Return ``None`` for unsupported objects." -msgstr "" - -#: ../../library/typing.rst:3065 ../../library/typing.rst:3088 -#, fuzzy -msgid "Examples:" +":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " +"See :pep:`585` and :ref:`types-genericalias`." msgstr "" -"舉例來說:\n" -"\n" -"::" -#: ../../library/typing.rst:3080 -msgid "" -"Get type arguments with all substitutions performed: for a typing object of " -"the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." +#: ../../library/typing.rst:3119 +msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:3083 +#: ../../library/typing.rst:3123 msgid "" -"If ``X`` is a union or :class:`Literal` contained in another generic type, " -"the order of ``(Y, Z, ...)`` may be different from the order of the original " -"arguments ``[Y, Z, ...]`` due to type caching. Return ``()`` for unsupported " -"objects." +":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " +"See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3100 -msgid "Check if a type is a :class:`TypedDict`." +#: ../../library/typing.rst:3129 +msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:3121 +#: ../../library/typing.rst:3133 msgid "" -"Class used for internal typing representation of string forward references." +":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3123 -msgid "" -"For example, ``List[\"SomeClass\"]`` is implicitly transformed into " -"``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " -"instantiated by a user, but may be used by introspection tools." +#: ../../library/typing.rst:3139 +msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:3128 -msgid "" -":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " -"implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " -"will not automatically resolve to ``list[SomeClass]``." +#: ../../library/typing.rst:3143 +msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3135 -msgid "Constant" -msgstr "常數" - -#: ../../library/typing.rst:3139 +#: ../../library/typing.rst:3148 msgid "" -"A special constant that is assumed to be ``True`` by 3rd party static type " -"checkers. It is ``False`` at runtime." +":class:`contextlib.AbstractContextManager` now supports subscripting " +"(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3150 -msgid "" -"The first type annotation must be enclosed in quotes, making it a \"forward " -"reference\", to hide the ``expensive_mod`` reference from the interpreter " -"runtime. Type annotations for local variables are not evaluated, so the " -"second annotation does not need to be enclosed in quotes." +#: ../../library/typing.rst:3155 +msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3157 +#: ../../library/typing.rst:3160 msgid "" -"If ``from __future__ import annotations`` is used, annotations are not " -"evaluated at function definition time. Instead, they are stored as strings " -"in ``__annotations__``. This makes it unnecessary to use quotes around the " -"annotation (see :pep:`563`)." +":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " +"(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" #: ../../library/typing.rst:3166 From 0d623f7a9903aa291626c6d8548cbfb40f3d7b5e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 16 Jun 2023 00:39:37 +0000 Subject: [PATCH 108/130] sync with cpython c0c41868 --- library/typing.po | 652 ++++++++++++++++++++++++---------------------- 1 file changed, 344 insertions(+), 308 deletions(-) diff --git a/library/typing.po b/library/typing.po index 13e8dc4ef5..75d72703f3 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-15 00:34+0000\n" +"POT-Creation-Date: 2023-06-16 00:37+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -356,7 +356,7 @@ msgid "" "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:253 ../../library/typing.rst:2610 +#: ../../library/typing.rst:253 ../../library/typing.rst:2651 #, fuzzy msgid "For example:" msgstr "" @@ -688,7 +688,7 @@ msgstr "" #: ../../library/typing.rst:660 ../../library/typing.rst:736 #: ../../library/typing.rst:756 ../../library/typing.rst:802 #: ../../library/typing.rst:1068 ../../library/typing.rst:1125 -#: ../../library/typing.rst:1333 ../../library/typing.rst:2450 +#: ../../library/typing.rst:1333 ../../library/typing.rst:2491 msgid "For example::" msgstr "" "舉例來說:\n" @@ -1107,7 +1107,7 @@ msgid "" "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1136 ../../library/typing.rst:2466 +#: ../../library/typing.rst:1136 ../../library/typing.rst:2507 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1386,7 +1386,7 @@ msgstr "" #: ../../library/typing.rst:1431 ../../library/typing.rst:1526 #: ../../library/typing.rst:1636 ../../library/typing.rst:1747 -#: ../../library/typing.rst:1818 ../../library/typing.rst:2650 +#: ../../library/typing.rst:1818 ../../library/typing.rst:2691 msgid "Usage::" msgstr "" "用法:\n" @@ -1968,64 +1968,75 @@ msgid "" msgstr "" #: ../../library/typing.rst:2163 +msgid "ABCs for working with IO" +msgstr "" + +#: ../../library/typing.rst:2169 +msgid "" +"Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " +"``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " +"by :func:`open`." +msgstr "" + +#: ../../library/typing.rst:2175 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2167 +#: ../../library/typing.rst:2179 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2169 +#: ../../library/typing.rst:2181 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2176 +#: ../../library/typing.rst:2188 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2178 +#: ../../library/typing.rst:2190 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2181 +#: ../../library/typing.rst:2193 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2188 +#: ../../library/typing.rst:2200 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2202 +#: ../../library/typing.rst:2214 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2204 +#: ../../library/typing.rst:2216 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2215 +#: ../../library/typing.rst:2227 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2220 +#: ../../library/typing.rst:2232 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2035,80 +2046,80 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2228 +#: ../../library/typing.rst:2240 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2231 +#: ../../library/typing.rst:2243 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2239 +#: ../../library/typing.rst:2251 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2241 +#: ../../library/typing.rst:2253 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2247 +#: ../../library/typing.rst:2259 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2250 +#: ../../library/typing.rst:2262 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2255 +#: ../../library/typing.rst:2267 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2260 +#: ../../library/typing.rst:2272 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2270 +#: ../../library/typing.rst:2284 msgid "" -"Decorator to mark an object as providing :func:`~dataclasses.dataclass`-like " -"behavior." +"Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2273 +#: ../../library/typing.rst:2287 msgid "" "``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 in a similar way " -"to :func:`dataclasses.dataclass`." +"to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2279 +#: ../../library/typing.rst:2294 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2295 +#: ../../library/typing.rst:2310 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2304 +#: ../../library/typing.rst:2319 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2315 +#: ../../library/typing.rst:2330 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2420 +#: ../../library/typing.rst:2461 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2272,32 +2324,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2427 +#: ../../library/typing.rst:2468 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2435 +#: ../../library/typing.rst:2476 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2437 +#: ../../library/typing.rst:2478 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2444 +#: ../../library/typing.rst:2485 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2446 +#: ../../library/typing.rst:2487 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2471 +#: ../../library/typing.rst:2512 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2307,11 +2359,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2482 +#: ../../library/typing.rst:2523 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2484 +#: ../../library/typing.rst:2525 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2319,48 +2371,48 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2490 +#: ../../library/typing.rst:2531 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2494 +#: ../../library/typing.rst:2535 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2496 +#: ../../library/typing.rst:2537 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2501 +#: ../../library/typing.rst:2542 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2503 +#: ../../library/typing.rst:2544 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2514 +#: ../../library/typing.rst:2555 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2518 +#: ../../library/typing.rst:2559 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2522 +#: ../../library/typing.rst:2563 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2525 +#: ../../library/typing.rst:2566 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2369,41 +2421,41 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2531 +#: ../../library/typing.rst:2572 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example:" msgstr "" -#: ../../library/typing.rst:2548 +#: ../../library/typing.rst:2589 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2553 +#: ../../library/typing.rst:2594 #, fuzzy msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2557 +#: ../../library/typing.rst:2598 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2564 +#: ../../library/typing.rst:2605 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2567 +#: ../../library/typing.rst:2608 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2411,7 +2463,7 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2573 ../../library/typing.rst:2596 +#: ../../library/typing.rst:2614 ../../library/typing.rst:2637 #, fuzzy msgid "Examples:" msgstr "" @@ -2419,13 +2471,13 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:2588 +#: ../../library/typing.rst:2629 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2591 +#: ../../library/typing.rst:2632 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2433,40 +2485,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:2608 +#: ../../library/typing.rst:2649 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2629 +#: ../../library/typing.rst:2670 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:2631 +#: ../../library/typing.rst:2672 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2636 +#: ../../library/typing.rst:2677 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2643 +#: ../../library/typing.rst:2684 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2647 +#: ../../library/typing.rst:2688 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:2658 +#: ../../library/typing.rst:2699 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2474,7 +2526,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2665 +#: ../../library/typing.rst:2706 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2482,165 +2534,153 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2674 -msgid "Generic concrete collections" -msgstr "" +#: ../../library/typing.rst:2717 +#, fuzzy +msgid "Deprecated aliases" +msgstr "棄用於" -#: ../../library/typing.rst:2677 -msgid "Corresponding to built-in types" +#: ../../library/typing.rst:2722 +msgid "Aliases to built-in types" msgstr "" -#: ../../library/typing.rst:2681 +#: ../../library/typing.rst:2726 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2683 +#: ../../library/typing.rst:2728 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2687 ../../library/typing.rst:2914 +#: ../../library/typing.rst:2732 ../../library/typing.rst:2950 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2692 +#: ../../library/typing.rst:2737 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2698 +#: ../../library/typing.rst:2743 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2700 +#: ../../library/typing.rst:2745 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2704 +#: ../../library/typing.rst:2749 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2714 +#: ../../library/typing.rst:2759 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2720 +#: ../../library/typing.rst:2765 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2722 +#: ../../library/typing.rst:2767 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2726 +#: ../../library/typing.rst:2771 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2732 +#: ../../library/typing.rst:2777 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2734 +#: ../../library/typing.rst:2779 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2739 +#: ../../library/typing.rst:2784 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:2742 -msgid "Corresponding to types in :mod:`collections`" +#: ../../library/typing.rst:2789 +msgid "Aliases to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2746 +#: ../../library/typing.rst:2793 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2750 +#: ../../library/typing.rst:2797 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2756 +#: ../../library/typing.rst:2803 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2760 +#: ../../library/typing.rst:2807 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2766 +#: ../../library/typing.rst:2813 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2771 +#: ../../library/typing.rst:2818 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2777 +#: ../../library/typing.rst:2824 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2782 +#: ../../library/typing.rst:2829 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2788 +#: ../../library/typing.rst:2835 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2793 +#: ../../library/typing.rst:2840 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2798 -msgid "Other concrete types" +#: ../../library/typing.rst:2847 +msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:2804 -msgid "" -"Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " -"``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " -"by :func:`open`." -msgstr "" - -#: ../../library/typing.rst:2811 -msgid "" -"The ``typing.io`` namespace is deprecated and will be removed. These types " -"should be directly imported from ``typing`` instead." -msgstr "" - -#: ../../library/typing.rst:2816 +#: ../../library/typing.rst:2852 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2819 +#: ../../library/typing.rst:2855 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2648,371 +2688,367 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2827 +#: ../../library/typing.rst:2863 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2828 +#: ../../library/typing.rst:2864 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2834 +#: ../../library/typing.rst:2870 msgid "Deprecated alias for :class:`str`." msgstr "" -#: ../../library/typing.rst:2836 +#: ../../library/typing.rst:2872 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:2840 +#: ../../library/typing.rst:2876 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2848 +#: ../../library/typing.rst:2884 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2855 -msgid "Abstract Base Classes" -msgstr "" - -#: ../../library/typing.rst:2858 -msgid "Corresponding to collections in :mod:`collections.abc`" +#: ../../library/typing.rst:2894 +msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:2898 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2864 +#: ../../library/typing.rst:2900 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2870 +#: ../../library/typing.rst:2906 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2874 +#: ../../library/typing.rst:2910 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2878 +#: ../../library/typing.rst:2914 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2882 +#: ../../library/typing.rst:2918 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2888 +#: ../../library/typing.rst:2924 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2890 +#: ../../library/typing.rst:2926 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2896 +#: ../../library/typing.rst:2932 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2898 +#: ../../library/typing.rst:2934 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2940 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2906 +#: ../../library/typing.rst:2942 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2912 +#: ../../library/typing.rst:2948 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:2919 +#: ../../library/typing.rst:2955 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2925 +#: ../../library/typing.rst:2961 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2927 +#: ../../library/typing.rst:2963 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2933 +#: ../../library/typing.rst:2969 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2935 +#: ../../library/typing.rst:2971 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2942 +#: ../../library/typing.rst:2978 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2944 +#: ../../library/typing.rst:2980 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2951 +#: ../../library/typing.rst:2987 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2953 +#: ../../library/typing.rst:2989 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2959 +#: ../../library/typing.rst:2995 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2961 +#: ../../library/typing.rst:2997 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2967 +#: ../../library/typing.rst:3003 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2969 +#: ../../library/typing.rst:3005 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2974 -msgid "Corresponding to other types in :mod:`collections.abc`" +#: ../../library/typing.rst:3012 +msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2978 -msgid "Deprecated alias to :class:`collections.abc.Iterable`." +#: ../../library/typing.rst:3016 +msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:2980 +#: ../../library/typing.rst:3018 msgid "" -":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:2986 -msgid "Deprecated alias to :class:`collections.abc.Iterator`." +"The variance and order of type variables correspond to those of :class:" +"`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:2988 +#: ../../library/typing.rst:3029 msgid "" -":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" +":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2994 -msgid "Deprecated alias to :class:`collections.abc.Generator`." +#: ../../library/typing.rst:3035 +msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:2996 +#: ../../library/typing.rst:3037 msgid "" -"A generator can be annotated by the generic type ``Generator[YieldType, " -"SendType, ReturnType]``. For example::" +"An async generator can be annotated by the generic type " +"``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3005 +#: ../../library/typing.rst:3046 msgid "" -"Note that unlike many other generics in the typing module, the ``SendType`` " -"of :class:`Generator` behaves contravariantly, not covariantly or " -"invariantly." +"Unlike normal generators, async generators cannot return a value, so there " +"is no ``ReturnType`` type parameter. As with :class:`Generator`, the " +"``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:3009 +#: ../../library/typing.rst:3050 msgid "" -"If your generator will only yield values, set the ``SendType`` and " -"``ReturnType`` to ``None``::" +"If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3017 +#: ../../library/typing.rst:3058 msgid "" "Alternatively, annotate your generator as having a return type of either " -"``Iterable[YieldType]`` or ``Iterator[YieldType]``::" +"``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3025 +#: ../../library/typing.rst:3068 msgid "" -":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " +"See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3031 -msgid "Alias to :class:`collections.abc.Hashable`." +#: ../../library/typing.rst:3075 +msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:3035 -msgid "Deprecated alias to :class:`collections.abc.Reversible`." +#: ../../library/typing.rst:3079 +msgid "" +":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " +"See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3037 +#: ../../library/typing.rst:3085 +msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." +msgstr "" + +#: ../../library/typing.rst:3089 msgid "" -":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " +"See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3043 -msgid "Alias to :class:`collections.abc.Sized`." +#: ../../library/typing.rst:3095 +msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:3046 -msgid "Asynchronous programming" +#: ../../library/typing.rst:3099 +msgid "" +":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3050 -msgid "Deprecated alias to :class:`collections.abc.Coroutine`." +#: ../../library/typing.rst:3106 +msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3052 -msgid "" -"The variance and order of type variables correspond to those of :class:" -"`Generator`, for example::" +#: ../../library/typing.rst:3110 +msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:3063 +#: ../../library/typing.rst:3112 msgid "" -":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" +":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3069 -msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." +#: ../../library/typing.rst:3118 +msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:3071 +#: ../../library/typing.rst:3120 msgid "" -"An async generator can be annotated by the generic type " -"``AsyncGenerator[YieldType, SendType]``. For example::" +":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3080 -msgid "" -"Unlike normal generators, async generators cannot return a value, so there " -"is no ``ReturnType`` type parameter. As with :class:`Generator`, the " -"``SendType`` behaves contravariantly." +#: ../../library/typing.rst:3126 +msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:3084 +#: ../../library/typing.rst:3128 msgid "" -"If your generator will only yield values, set the ``SendType`` to ``None``::" +"A generator can be annotated by the generic type ``Generator[YieldType, " +"SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3092 +#: ../../library/typing.rst:3137 msgid "" -"Alternatively, annotate your generator as having a return type of either " -"``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" +"Note that unlike many other generics in the typing module, the ``SendType`` " +"of :class:`Generator` behaves contravariantly, not covariantly or " +"invariantly." msgstr "" -#: ../../library/typing.rst:3102 +#: ../../library/typing.rst:3141 msgid "" -":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:3109 -msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." +"If your generator will only yield values, set the ``SendType`` and " +"``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3113 +#: ../../library/typing.rst:3149 msgid "" -":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +"Alternatively, annotate your generator as having a return type of either " +"``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3119 -msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." +#: ../../library/typing.rst:3157 +msgid "" +":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3123 -msgid "" -":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +#: ../../library/typing.rst:3163 +msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:3129 -msgid "Deprecated alias to :class:`collections.abc.Awaitable`." +#: ../../library/typing.rst:3167 +msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:3133 +#: ../../library/typing.rst:3169 msgid "" -":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" +":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3139 -msgid "Context manager types" +#: ../../library/typing.rst:3175 +msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:3143 +#: ../../library/typing.rst:3180 +msgid "Aliases to :mod:`contextlib` ABCs" +msgstr "" + +#: ../../library/typing.rst:3184 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3148 +#: ../../library/typing.rst:3189 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3155 +#: ../../library/typing.rst:3196 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3160 +#: ../../library/typing.rst:3201 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3166 +#: ../../library/typing.rst:3207 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3168 +#: ../../library/typing.rst:3209 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3020,76 +3056,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3173 +#: ../../library/typing.rst:3214 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3173 +#: ../../library/typing.rst:3214 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3173 +#: ../../library/typing.rst:3214 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3173 +#: ../../library/typing.rst:3214 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3216 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3216 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3216 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3216 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3178 +#: ../../library/typing.rst:3219 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3178 ../../library/typing.rst:3181 +#: ../../library/typing.rst:3219 ../../library/typing.rst:3222 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3178 ../../library/typing.rst:3183 +#: ../../library/typing.rst:3219 ../../library/typing.rst:3224 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3178 +#: ../../library/typing.rst:3219 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3181 +#: ../../library/typing.rst:3222 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3181 +#: ../../library/typing.rst:3222 msgid "3.14" msgstr "" -#: ../../library/typing.rst:3181 +#: ../../library/typing.rst:3222 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3183 +#: ../../library/typing.rst:3224 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3183 +#: ../../library/typing.rst:3224 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3183 +#: ../../library/typing.rst:3224 msgid ":gh:`92332`" msgstr ":gh:`92332`" From 8122d5ed5b19790b8f0b876ca734a1d8d2f00897 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 17 Jun 2023 00:35:42 +0000 Subject: [PATCH 109/130] sync with cpython 69e2da02 --- faq/general.po | 8 +++-- install/index.po | 14 ++++---- library/dis.po | 86 ++++++++++++++++++++++++------------------------ 3 files changed, 55 insertions(+), 53 deletions(-) diff --git a/faq/general.po b/faq/general.po index 68705b58fb..4c34f3b198 100644 --- a/faq/general.po +++ b/faq/general.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-06-17 00:33+0000\n" "PO-Revision-Date: 2022-10-16 06:51+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -277,8 +277,9 @@ msgid "See :pep:`6` for more information about bugfix releases." msgstr "更多關於錯誤修正發布的資訊請見 :pep:`6`。" #: ../../faq/general.rst:138 +#, fuzzy msgid "" -"Not all releases are bugfix releases. In the run-up to a new major release, " +"Not all releases are bugfix releases. In the run-up to a new minor release, " "a series of development releases are made, denoted as alpha, beta, or " "release candidate. Alphas are early releases in which interfaces aren't yet " "finalized; it's not unexpected to see an interface change between two alpha " @@ -591,10 +592,11 @@ msgid "How stable is Python?" msgstr "Python 的穩定性如何?" #: ../../faq/general.rst:298 +#, fuzzy msgid "" "Very stable. New, stable releases have been coming out roughly every 6 to " "18 months since 1991, and this seems likely to continue. As of version 3.9, " -"Python will have a major new release every 12 months (:pep:`602`)." +"Python will have a minor new release every 12 months (:pep:`602`)." msgstr "" "非常穩定。自從 1991 年開始,大約每隔 6 到 18 個月都會發布新的穩定版本,而且這" "看起來會繼續進行。從 3.9 版開始,Python 每隔 12 個月將會釋出一個主要的發行版" diff --git a/install/index.po b/install/index.po index d2bee54fb5..31244bacf6 100644 --- a/install/index.po +++ b/install/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-06-17 00:33+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -345,8 +345,8 @@ msgstr "" #: ../../install/index.rst:234 msgid "" -"The default installation directory on Windows was :file:`C:\\\\Program Files" -"\\\\Python` under Python 1.6a1, 1.5.2, and earlier." +"The default installation directory on Windows was :file:`C:\\\\Program " +"Files\\\\Python` under Python 1.6a1, 1.5.2, and earlier." msgstr "" #: ../../install/index.rst:237 @@ -950,7 +950,7 @@ msgstr "" #: ../../install/index.rst:695 msgid "" -"However, if you reinstall the same major version of Python (perhaps when " +"However, if you reinstall the same minor version of Python (perhaps when " "upgrading from 2.2 to 2.2.2, for example) :file:`site.py` will be " "overwritten by the stock version. You'd have to remember that it was " "modified and save a copy before doing the installation." @@ -1276,9 +1276,9 @@ msgid "" "appended to the proper command line, so in the above example the compiler " "will be passed the :option:`!-o32` option, and the linker will be passed :" "option:`!-shared`. If a compiler option requires an argument, you'll have " -"to supply multiple :option:`!-Xcompiler` options; for example, to pass ``-x c" -"++`` the :file:`Setup` file would have to contain ``-Xcompiler -x -Xcompiler " -"c++``." +"to supply multiple :option:`!-Xcompiler` options; for example, to pass ``-x " +"c++`` the :file:`Setup` file would have to contain ``-Xcompiler -x -" +"Xcompiler c++``." msgstr "" #: ../../install/index.rst:936 diff --git a/library/dis.po b/library/dis.po index fd7773aabe..7c305b94bf 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-17 00:33+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -791,7 +791,7 @@ msgid "" "corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:775 ../../library/dis.rst:1320 +#: ../../library/dis.rst:775 ../../library/dis.rst:1323 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." @@ -1245,25 +1245,25 @@ msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" #: ../../library/dis.rst:1263 -msgid "the code associated with the function (at TOS1)" +msgid "the code associated with the function (at TOS)" msgstr "" -#: ../../library/dis.rst:1264 -msgid "the :term:`qualified name` of the function (at TOS)" +#: ../../library/dis.rst:1265 +msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1266 -msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" +#: ../../library/dis.rst:1268 +msgid "Qualified name at TOS was removed." msgstr "" -#: ../../library/dis.rst:1273 +#: ../../library/dis.rst:1276 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "``slice(TOS1, TOS)`` is pushed; if it is 3, ``slice(TOS2, TOS1, TOS)`` is " "pushed. See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1280 +#: ../../library/dis.rst:1283 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1271,142 +1271,142 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1288 +#: ../../library/dis.rst:1291 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1292 +#: ../../library/dis.rst:1295 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1293 +#: ../../library/dis.rst:1296 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1295 +#: ../../library/dis.rst:1298 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1297 +#: ../../library/dis.rst:1300 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1299 +#: ../../library/dis.rst:1302 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1302 +#: ../../library/dis.rst:1305 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1310 +#: ../../library/dis.rst:1313 msgid "" "TOS is a tuple of keyword attribute names, TOS1 is the class being matched " "against, and TOS2 is the match subject. *count* is the number of positional " "sub-patterns." msgstr "" -#: ../../library/dis.rst:1314 +#: ../../library/dis.rst:1317 msgid "" "Pop TOS, TOS1, and TOS2. If TOS2 is an instance of TOS1 and has the " "positional and keyword attributes required by *count* and TOS, push a tuple " "of extracted attributes. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1327 +#: ../../library/dis.rst:1330 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1329 +#: ../../library/dis.rst:1332 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1331 +#: ../../library/dis.rst:1334 msgid "``0`` The start of a function" msgstr "" -#: ../../library/dis.rst:1332 +#: ../../library/dis.rst:1335 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1333 +#: ../../library/dis.rst:1336 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1334 +#: ../../library/dis.rst:1337 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1341 +#: ../../library/dis.rst:1344 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1349 +#: ../../library/dis.rst:1352 msgid "" "Sends ``None`` to the sub-generator of this generator. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1357 +#: ../../library/dis.rst:1360 msgid "" "Wraps the value on top of the stack in an ``async_generator_wrapped_value``. " "Used to yield in async generators." msgstr "" -#: ../../library/dis.rst:1365 +#: ../../library/dis.rst:1368 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes which don't use their argument and those that do (``< " "HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1369 +#: ../../library/dis.rst:1372 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1377 +#: ../../library/dis.rst:1380 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1379 +#: ../../library/dis.rst:1382 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1384 +#: ../../library/dis.rst:1387 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1389 +#: ../../library/dis.rst:1392 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1394 +#: ../../library/dis.rst:1397 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1399 +#: ../../library/dis.rst:1402 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1404 +#: ../../library/dis.rst:1407 msgid "" "Sequence of bytecodes that access a free variable (note that 'free' in this " "context refers to names in the current scope that are referenced by inner " @@ -1414,30 +1414,30 @@ msgid "" "does *not* include references to global or builtin scopes)." msgstr "" -#: ../../library/dis.rst:1412 +#: ../../library/dis.rst:1415 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1417 +#: ../../library/dis.rst:1420 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1422 +#: ../../library/dis.rst:1425 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1427 +#: ../../library/dis.rst:1430 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1432 +#: ../../library/dis.rst:1435 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1271 +#: ../../library/dis.rst:1274 msgid "built-in function" msgstr "" -#: ../../library/dis.rst:1271 +#: ../../library/dis.rst:1274 msgid "slice" msgstr "" From e7e4e68e05ffeb7333104541d61362d54792228b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 19 Jun 2023 00:36:33 +0000 Subject: [PATCH 110/130] sync with cpython 8bb16f66 --- faq/general.po | 25 +- library/typing.po | 1203 +++++++++++++++++++++++---------------------- 2 files changed, 624 insertions(+), 604 deletions(-) diff --git a/faq/general.po b/faq/general.po index 4c34f3b198..da248c2d1f 100644 --- a/faq/general.po +++ b/faq/general.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-17 00:33+0000\n" +"POT-Creation-Date: 2023-06-19 00:34+0000\n" "PO-Revision-Date: 2022-10-16 06:51+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -279,13 +279,13 @@ msgstr "更多關於錯誤修正發布的資訊請見 :pep:`6`。" #: ../../faq/general.rst:138 #, fuzzy msgid "" -"Not all releases are bugfix releases. In the run-up to a new minor release, " -"a series of development releases are made, denoted as alpha, beta, or " -"release candidate. Alphas are early releases in which interfaces aren't yet " -"finalized; it's not unexpected to see an interface change between two alpha " -"releases. Betas are more stable, preserving existing interfaces but possibly " -"adding new modules, and release candidates are frozen, making no changes " -"except as needed to fix critical bugs." +"Not all releases are bugfix releases. In the run-up to a new feature " +"release, a series of development releases are made, denoted as alpha, beta, " +"or release candidate. Alphas are early releases in which interfaces aren't " +"yet finalized; it's not unexpected to see an interface change between two " +"alpha releases. Betas are more stable, preserving existing interfaces but " +"possibly adding new modules, and release candidates are frozen, making no " +"changes except as needed to fix critical bugs." msgstr "" "並非所有的發布版本都是錯誤修正發布版本。在一個新的主要發布版本的準備階段,會" "發布一系列開發版本,標示為 alpha、beta 或候選發布版本 (release candidate)。" @@ -596,17 +596,18 @@ msgstr "Python 的穩定性如何?" msgid "" "Very stable. New, stable releases have been coming out roughly every 6 to " "18 months since 1991, and this seems likely to continue. As of version 3.9, " -"Python will have a minor new release every 12 months (:pep:`602`)." +"Python will have a new feature release every 12 months (:pep:`602`)." msgstr "" "非常穩定。自從 1991 年開始,大約每隔 6 到 18 個月都會發布新的穩定版本,而且這" "看起來會繼續進行。從 3.9 版開始,Python 每隔 12 個月將會釋出一個主要的發行版" "本 (:pep:`602`)。" #: ../../faq/general.rst:302 +#, fuzzy msgid "" -"The developers issue \"bugfix\" releases of older versions, so the stability " -"of existing releases gradually improves. Bugfix releases, indicated by a " -"third component of the version number (e.g. 3.5.3, 3.6.2), are managed for " +"The developers issue bugfix releases of older versions, so the stability of " +"existing releases gradually improves. Bugfix releases, indicated by a third " +"component of the version number (e.g. 3.5.3, 3.6.2), are managed for " "stability; only fixes for known problems are included in a bugfix release, " "and it's guaranteed that interfaces will remain the same throughout a series " "of bugfix releases." diff --git a/library/typing.po b/library/typing.po index 75d72703f3..4d0f4b7938 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-16 00:37+0000\n" +"POT-Creation-Date: 2023-06-19 00:34+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,32 +35,31 @@ msgstr "" #: ../../library/typing.rst:26 msgid "" -"This module provides runtime support for type hints. The most fundamental " -"support consists of the types :data:`Any`, :data:`Union`, :data:`Callable`, :" -"class:`TypeVar`, and :class:`Generic`. For a specification, please see :pep:" -"`484`. For a simplified introduction to type hints, see :pep:`483`." +"This module provides runtime support for type hints. For the original " +"specification of the typing system, see :pep:`484`. For a simplified " +"introduction to type hints, see :pep:`483`." msgstr "" -#: ../../library/typing.rst:32 +#: ../../library/typing.rst:31 msgid "" "The function below takes and returns a string and is annotated as follows::" msgstr "" -#: ../../library/typing.rst:37 +#: ../../library/typing.rst:36 msgid "" "In the function ``greeting``, the argument ``name`` is expected to be of " "type :class:`str` and the return type :class:`str`. Subtypes are accepted as " "arguments." msgstr "" -#: ../../library/typing.rst:41 +#: ../../library/typing.rst:40 msgid "" "New features are frequently added to the ``typing`` module. The " "`typing_extensions `_ package " "provides backports of these new features to older versions of Python." msgstr "" -#: ../../library/typing.rst:45 +#: ../../library/typing.rst:44 msgid "" "For a summary of deprecated features and a deprecation timeline, please see " "`Deprecation Timeline of Major Features`_." @@ -68,213 +67,226 @@ msgstr "" #: ../../library/typing.rst:50 msgid "" -"For a quick overview of type hints, refer to `this cheat sheet `_." +"`\"Typing cheat sheet\" `_" +msgstr "" + +#: ../../library/typing.rst:50 +msgid "A quick overview of type hints (hosted at the mypy docs)" +msgstr "" + +#: ../../library/typing.rst:55 +msgid "" +"\"Type System Reference\" section of `the mypy docs `_" msgstr "" #: ../../library/typing.rst:53 msgid "" -"The \"Type System Reference\" section of https://mypy.readthedocs.io/ -- " -"since the Python typing system is standardised via PEPs, this reference " -"should broadly apply to most Python type checkers, although some parts may " -"still be specific to mypy." +"The Python typing system is standardised via PEPs, so this reference should " +"broadly apply to most Python type checkers. (Some parts may still be " +"specific to mypy.)" +msgstr "" + +#: ../../library/typing.rst:59 +msgid "" +"`\"Static Typing with Python\" `_" msgstr "" #: ../../library/typing.rst:58 msgid "" -"The documentation at https://typing.readthedocs.io/ serves as useful " -"reference for type system features, useful typing related tools and typing " -"best practices." +"Type-checker-agnostic documentation written by the community detailing type " +"system features, useful typing related tools and typing best practices." msgstr "" -#: ../../library/typing.rst:64 +#: ../../library/typing.rst:65 msgid "Relevant PEPs" msgstr "" -#: ../../library/typing.rst:66 +#: ../../library/typing.rst:67 msgid "" "Since the initial introduction of type hints in :pep:`484` and :pep:`483`, a " "number of PEPs have modified and enhanced Python's framework for type " "annotations:" msgstr "" -#: ../../library/typing.rst:76 +#: ../../library/typing.rst:77 msgid ":pep:`526`: Syntax for Variable Annotations" msgstr "" -#: ../../library/typing.rst:76 +#: ../../library/typing.rst:77 msgid "" "*Introducing* syntax for annotating variables outside of function " "definitions, and :data:`ClassVar`" msgstr "" -#: ../../library/typing.rst:79 +#: ../../library/typing.rst:80 msgid ":pep:`544`: Protocols: Structural subtyping (static duck typing)" msgstr "" -#: ../../library/typing.rst:79 +#: ../../library/typing.rst:80 msgid "" "*Introducing* :class:`Protocol` and the :func:" "`@runtime_checkable` decorator" msgstr "" -#: ../../library/typing.rst:82 +#: ../../library/typing.rst:83 msgid ":pep:`585`: Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/typing.rst:82 +#: ../../library/typing.rst:83 msgid "" "*Introducing* :class:`types.GenericAlias` and the ability to use standard " "library classes as :ref:`generic types`" msgstr "" -#: ../../library/typing.rst:84 +#: ../../library/typing.rst:85 msgid ":pep:`586`: Literal Types" msgstr "" -#: ../../library/typing.rst:85 +#: ../../library/typing.rst:86 msgid "*Introducing* :data:`Literal`" msgstr "" -#: ../../library/typing.rst:86 +#: ../../library/typing.rst:87 msgid "" ":pep:`589`: TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys" msgstr "" -#: ../../library/typing.rst:87 +#: ../../library/typing.rst:88 msgid "*Introducing* :class:`TypedDict`" msgstr "" -#: ../../library/typing.rst:88 +#: ../../library/typing.rst:89 msgid ":pep:`591`: Adding a final qualifier to typing" msgstr "" -#: ../../library/typing.rst:89 +#: ../../library/typing.rst:90 msgid "*Introducing* :data:`Final` and the :func:`@final` decorator" msgstr "" -#: ../../library/typing.rst:90 +#: ../../library/typing.rst:91 msgid ":pep:`593`: Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:91 +#: ../../library/typing.rst:92 msgid "*Introducing* :data:`Annotated`" msgstr "" -#: ../../library/typing.rst:94 +#: ../../library/typing.rst:95 msgid ":pep:`604`: Allow writing union types as ``X | Y``" msgstr "" -#: ../../library/typing.rst:93 +#: ../../library/typing.rst:94 msgid "" "*Introducing* :data:`types.UnionType` and the ability to use the binary-or " "operator ``|`` to signify a :ref:`union of types`" msgstr "" -#: ../../library/typing.rst:96 +#: ../../library/typing.rst:97 msgid ":pep:`612`: Parameter Specification Variables" msgstr "" -#: ../../library/typing.rst:97 +#: ../../library/typing.rst:98 msgid "*Introducing* :class:`ParamSpec` and :data:`Concatenate`" msgstr "" -#: ../../library/typing.rst:98 +#: ../../library/typing.rst:99 msgid ":pep:`613`: Explicit Type Aliases" msgstr "" -#: ../../library/typing.rst:99 +#: ../../library/typing.rst:100 msgid "*Introducing* :data:`TypeAlias`" msgstr "*引入* :data:`TypeAlias`" -#: ../../library/typing.rst:100 +#: ../../library/typing.rst:101 msgid ":pep:`646`: Variadic Generics" msgstr "" -#: ../../library/typing.rst:101 +#: ../../library/typing.rst:102 msgid "*Introducing* :data:`TypeVarTuple`" msgstr "*引入* :data:`TypeVarTuple`" -#: ../../library/typing.rst:102 +#: ../../library/typing.rst:103 msgid ":pep:`647`: User-Defined Type Guards" msgstr "" -#: ../../library/typing.rst:103 +#: ../../library/typing.rst:104 msgid "*Introducing* :data:`TypeGuard`" msgstr "*引入* :data:`TypeGuard`" -#: ../../library/typing.rst:104 +#: ../../library/typing.rst:105 msgid "" ":pep:`655`: Marking individual TypedDict items as required or potentially " "missing" msgstr "" -#: ../../library/typing.rst:105 +#: ../../library/typing.rst:106 msgid "*Introducing* :data:`Required` and :data:`NotRequired`" msgstr "*引入* :data:`Required` 和 :data:`NotRequired`" -#: ../../library/typing.rst:106 +#: ../../library/typing.rst:107 msgid ":pep:`673`: Self type" msgstr "" -#: ../../library/typing.rst:107 +#: ../../library/typing.rst:108 msgid "*Introducing* :data:`Self`" msgstr "*引入* :data:`Self`" -#: ../../library/typing.rst:108 +#: ../../library/typing.rst:109 msgid ":pep:`675`: Arbitrary Literal String Type" msgstr "" -#: ../../library/typing.rst:109 +#: ../../library/typing.rst:110 msgid "*Introducing* :data:`LiteralString`" msgstr "*引入* :data:`LiteralString`" -#: ../../library/typing.rst:111 +#: ../../library/typing.rst:112 msgid ":pep:`681`: Data Class Transforms" msgstr "" -#: ../../library/typing.rst:111 +#: ../../library/typing.rst:112 msgid "" "*Introducing* the :func:`@dataclass_transform` decorator" msgstr "*引入* :func:`@dataclass_transform` 裝飾器" -#: ../../library/typing.rst:121 +#: ../../library/typing.rst:122 msgid "Type aliases" msgstr "" -#: ../../library/typing.rst:123 +#: ../../library/typing.rst:124 msgid "" "A type alias is defined by assigning the type to the alias. In this example, " "``Vector`` and ``list[float]`` will be treated as interchangeable synonyms::" msgstr "" -#: ../../library/typing.rst:134 +#: ../../library/typing.rst:135 msgid "" "Type aliases are useful for simplifying complex type signatures. For " "example::" msgstr "" -#: ../../library/typing.rst:152 +#: ../../library/typing.rst:153 msgid "" "Type aliases may be marked with :data:`TypeAlias` to make it explicit that " "the statement is a type alias declaration, not a normal variable assignment::" msgstr "" -#: ../../library/typing.rst:162 +#: ../../library/typing.rst:163 msgid "NewType" msgstr "NewType" -#: ../../library/typing.rst:164 +#: ../../library/typing.rst:165 msgid "Use the :class:`NewType` helper to create distinct types::" msgstr "" -#: ../../library/typing.rst:171 +#: ../../library/typing.rst:172 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. This is useful in helping catch logical errors::" msgstr "" -#: ../../library/typing.rst:183 +#: ../../library/typing.rst:184 msgid "" "You may still perform all ``int`` operations on a variable of type " "``UserId``, but the result will always be of type ``int``. This lets you " @@ -282,7 +294,7 @@ msgid "" "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" -#: ../../library/typing.rst:191 +#: ../../library/typing.rst:192 msgid "" "Note that these checks are enforced only by the static type checker. At " "runtime, the statement ``Derived = NewType('Derived', Base)`` will make " @@ -291,31 +303,31 @@ msgid "" "class or introduce much overhead beyond that of a regular function call." msgstr "" -#: ../../library/typing.rst:197 +#: ../../library/typing.rst:198 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" -#: ../../library/typing.rst:200 +#: ../../library/typing.rst:201 msgid "It is invalid to create a subtype of ``Derived``::" msgstr "" -#: ../../library/typing.rst:209 +#: ../../library/typing.rst:210 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" -#: ../../library/typing.rst:217 +#: ../../library/typing.rst:218 msgid "and typechecking for ``ProUserId`` will work as expected." msgstr "" -#: ../../library/typing.rst:219 +#: ../../library/typing.rst:220 msgid "See :pep:`484` for more details." msgstr "更多細節請見 :pep:`484`\\ 。" -#: ../../library/typing.rst:223 +#: ../../library/typing.rst:224 msgid "" "Recall that the use of a type alias declares two types to be *equivalent* to " "one another. Doing ``Alias = Original`` will make the static type checker " @@ -323,7 +335,7 @@ msgid "" "This is useful when you want to simplify complex type signatures." msgstr "" -#: ../../library/typing.rst:228 +#: ../../library/typing.rst:229 msgid "" "In contrast, ``NewType`` declares one type to be a *subtype* of another. " "Doing ``Derived = NewType('Derived', Original)`` will make the static type " @@ -333,30 +345,30 @@ msgid "" "errors with minimal runtime cost." msgstr "" -#: ../../library/typing.rst:237 +#: ../../library/typing.rst:238 msgid "" "``NewType`` is now a class rather than a function. As a result, there is " "some additional runtime cost when calling ``NewType`` over a regular " "function." msgstr "" -#: ../../library/typing.rst:242 +#: ../../library/typing.rst:243 msgid "" "The performance of calling ``NewType`` has been restored to its level in " "Python 3.9." msgstr "" -#: ../../library/typing.rst:248 +#: ../../library/typing.rst:249 msgid "Callable" msgstr "" -#: ../../library/typing.rst:250 +#: ../../library/typing.rst:251 msgid "" "Frameworks expecting callback functions of specific signatures might be type " "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:253 ../../library/typing.rst:2651 +#: ../../library/typing.rst:254 ../../library/typing.rst:2640 #, fuzzy msgid "For example:" msgstr "" @@ -364,14 +376,14 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:271 +#: ../../library/typing.rst:272 msgid "" "It is possible to declare the return type of a callable without specifying " "the call signature by substituting a literal ellipsis for the list of " "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:275 ../../library/typing.rst:935 +#: ../../library/typing.rst:276 ../../library/typing.rst:920 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -382,97 +394,97 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:283 ../../library/typing.rst:947 +#: ../../library/typing.rst:284 ../../library/typing.rst:932 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:288 +#: ../../library/typing.rst:289 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:294 +#: ../../library/typing.rst:295 msgid "Generics" msgstr "" -#: ../../library/typing.rst:296 +#: ../../library/typing.rst:297 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, many container classes in the standard library " "support subscription to denote the expected types of container elements." msgstr "" -#: ../../library/typing.rst:313 +#: ../../library/typing.rst:314 msgid "" "Generics can be parameterized by using a factory available in typing called :" "class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:329 +#: ../../library/typing.rst:330 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:331 +#: ../../library/typing.rst:332 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:357 +#: ../../library/typing.rst:358 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:361 +#: ../../library/typing.rst:362 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[T]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:370 +#: ../../library/typing.rst:371 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:382 +#: ../../library/typing.rst:383 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:393 +#: ../../library/typing.rst:394 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:403 +#: ../../library/typing.rst:404 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:413 +#: ../../library/typing.rst:414 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:415 +#: ../../library/typing.rst:416 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``:" msgstr "" -#: ../../library/typing.rst:426 +#: ../../library/typing.rst:427 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:443 +#: ../../library/typing.rst:444 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:446 +#: ../../library/typing.rst:447 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -482,7 +494,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:462 +#: ../../library/typing.rst:463 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -490,20 +502,20 @@ msgid "" "converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:474 +#: ../../library/typing.rst:475 msgid "" "Note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:478 +#: ../../library/typing.rst:479 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:482 +#: ../../library/typing.rst:483 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -511,24 +523,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:489 +#: ../../library/typing.rst:490 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:491 +#: ../../library/typing.rst:492 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:495 +#: ../../library/typing.rst:496 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:513 +#: ../../library/typing.rst:514 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -537,19 +549,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:519 +#: ../../library/typing.rst:520 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:532 +#: ../../library/typing.rst:533 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:535 +#: ../../library/typing.rst:536 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -557,7 +569,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:540 +#: ../../library/typing.rst:541 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -565,24 +577,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:562 +#: ../../library/typing.rst:563 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:567 +#: ../../library/typing.rst:568 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:569 +#: ../../library/typing.rst:570 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:573 +#: ../../library/typing.rst:574 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -591,7 +603,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:586 +#: ../../library/typing.rst:587 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -600,106 +612,85 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:602 +#: ../../library/typing.rst:603 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:607 +#: ../../library/typing.rst:608 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:609 -msgid "The module defines the following classes, functions and decorators." -msgstr "" - -#: ../../library/typing.rst:613 -msgid "" -"This module defines several deprecated aliases to pre-existing standard " -"library classes. These were originally included in the typing module in " -"order to support parameterizing these generic classes using ``[]``. However, " -"the aliases became redundant in Python 3.9 when the corresponding pre-" -"existing classes were enhanced to support ``[]``." -msgstr "" - -#: ../../library/typing.rst:619 +#: ../../library/typing.rst:610 msgid "" -"The redundant types are deprecated as of Python 3.9 but no deprecation " -"warnings are issued by the interpreter. It is expected that type checkers " -"will flag the deprecated types when the checked program targets Python 3.9 " -"or newer." +"The ``typing`` module defines the following classes, functions and " +"decorators." msgstr "" -#: ../../library/typing.rst:624 -msgid "" -"The deprecated types will be removed from the :mod:`typing` module no sooner " -"than the first Python version released 5 years after the release of Python " -"3.9.0. See details in :pep:`585`—*Type Hinting Generics In Standard " -"Collections*." -msgstr "" - -#: ../../library/typing.rst:630 +#: ../../library/typing.rst:613 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:633 +#: ../../library/typing.rst:616 msgid "Special types" msgstr "" -#: ../../library/typing.rst:635 -msgid "These can be used as types in annotations and do not support ``[]``." +#: ../../library/typing.rst:618 +msgid "" +"These can be used as types in annotations. They do not support subscription " +"using ``[]``." msgstr "" -#: ../../library/typing.rst:639 +#: ../../library/typing.rst:623 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:641 +#: ../../library/typing.rst:625 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:642 +#: ../../library/typing.rst:626 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:644 +#: ../../library/typing.rst:628 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:651 +#: ../../library/typing.rst:635 msgid "A :ref:`constrained type variable `." msgstr "" -#: ../../library/typing.rst:653 +#: ../../library/typing.rst:637 msgid "Definition::" msgstr "" -#: ../../library/typing.rst:657 +#: ../../library/typing.rst:641 msgid "" "``AnyStr`` is meant to be used for functions that may accept :class:`str` " "or :class:`bytes` arguments but cannot allow the two to mix." msgstr "" -#: ../../library/typing.rst:660 ../../library/typing.rst:736 -#: ../../library/typing.rst:756 ../../library/typing.rst:802 -#: ../../library/typing.rst:1068 ../../library/typing.rst:1125 -#: ../../library/typing.rst:1333 ../../library/typing.rst:2491 +#: ../../library/typing.rst:644 ../../library/typing.rst:720 +#: ../../library/typing.rst:740 ../../library/typing.rst:786 +#: ../../library/typing.rst:1053 ../../library/typing.rst:1110 +#: ../../library/typing.rst:1318 ../../library/typing.rst:2480 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:671 +#: ../../library/typing.rst:655 msgid "Special type that includes only literal strings." msgstr "" -#: ../../library/typing.rst:673 +#: ../../library/typing.rst:657 msgid "" "Any string literal is compatible with ``LiteralString``, as is another " "``LiteralString``. However, an object typed as just ``str`` is not. A string " @@ -707,7 +698,7 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:679 +#: ../../library/typing.rst:663 #, fuzzy msgid "Example:" msgstr "" @@ -715,7 +706,7 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:695 +#: ../../library/typing.rst:679 msgid "" "``LiteralString`` is useful for sensitive APIs where arbitrary user-" "generated strings could generate problems. For example, the two cases above " @@ -723,33 +714,33 @@ msgid "" "attack." msgstr "" -#: ../../library/typing.rst:700 +#: ../../library/typing.rst:684 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:706 +#: ../../library/typing.rst:690 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:709 +#: ../../library/typing.rst:693 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:729 +#: ../../library/typing.rst:713 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:734 +#: ../../library/typing.rst:718 msgid "Special type indicating that a function never returns." msgstr "" -#: ../../library/typing.rst:743 +#: ../../library/typing.rst:727 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -757,158 +748,158 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:754 +#: ../../library/typing.rst:738 msgid "Special type to represent the current enclosed class." msgstr "" -#: ../../library/typing.rst:766 +#: ../../library/typing.rst:750 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:778 +#: ../../library/typing.rst:762 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:785 +#: ../../library/typing.rst:769 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:788 +#: ../../library/typing.rst:772 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:790 +#: ../../library/typing.rst:774 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:776 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:794 +#: ../../library/typing.rst:778 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:800 +#: ../../library/typing.rst:784 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: ../../library/typing.rst:808 +#: ../../library/typing.rst:792 msgid "" "``TypeAlias`` is particularly useful for annotating aliases that make use of " "forward references, as it can be hard for type checkers to distinguish these " "from normal variable assignments:" msgstr "" -#: ../../library/typing.rst:828 +#: ../../library/typing.rst:812 #, fuzzy msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:833 +#: ../../library/typing.rst:817 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:819 msgid "" -"These can be used as types in annotations using ``[]``, each having a unique " -"syntax." +"These can be used as types in annotations. They all support subscription " +"using ``[]``, but each has a unique syntax." msgstr "" -#: ../../library/typing.rst:839 +#: ../../library/typing.rst:824 msgid "Deprecated alias for :class:`tuple`." msgstr "" -#: ../../library/typing.rst:841 +#: ../../library/typing.rst:826 msgid "" "``Tuple[X, Y]`` is the type of a tuple of two items with the first item of " "type X and the second of type Y. The type of the empty tuple can be written " "as ``Tuple[()]``." msgstr "" -#: ../../library/typing.rst:845 +#: ../../library/typing.rst:830 msgid "" "Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " "variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " "float and a string." msgstr "" -#: ../../library/typing.rst:849 +#: ../../library/typing.rst:834 msgid "" "To specify a variable-length tuple of homogeneous type, use literal " "ellipsis, e.g. ``Tuple[int, ...]``. A plain ``Tuple`` annotation is " "equivalent to ``tuple``, ``Tuple[Any, ...]``, or ``tuple[Any, ...]``." msgstr "" -#: ../../library/typing.rst:853 +#: ../../library/typing.rst:838 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:859 +#: ../../library/typing.rst:844 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:861 +#: ../../library/typing.rst:846 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:863 +#: ../../library/typing.rst:848 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:865 +#: ../../library/typing.rst:850 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:869 +#: ../../library/typing.rst:854 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:873 +#: ../../library/typing.rst:858 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:877 +#: ../../library/typing.rst:862 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:881 +#: ../../library/typing.rst:866 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:883 +#: ../../library/typing.rst:868 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:885 +#: ../../library/typing.rst:870 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:888 +#: ../../library/typing.rst:873 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:894 +#: ../../library/typing.rst:879 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:896 +#: ../../library/typing.rst:881 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -916,30 +907,30 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:904 +#: ../../library/typing.rst:889 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:911 +#: ../../library/typing.rst:896 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:917 +#: ../../library/typing.rst:902 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "" -#: ../../library/typing.rst:919 +#: ../../library/typing.rst:904 msgid "" "``Callable[[int], str]`` signifies a function that takes a single parameter " "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:922 +#: ../../library/typing.rst:907 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " @@ -947,7 +938,7 @@ msgid "" "type must be a single type." msgstr "" -#: ../../library/typing.rst:927 +#: ../../library/typing.rst:912 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -957,23 +948,23 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:943 +#: ../../library/typing.rst:928 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:952 +#: ../../library/typing.rst:937 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:957 +#: ../../library/typing.rst:942 msgid "Special form for annotating higher-order functions." msgstr "" -#: ../../library/typing.rst:959 +#: ../../library/typing.rst:944 msgid "" "``Concatenate`` can be used in conjunction with :data:`Callable` and :class:" "`ParamSpec` to annotate a higher-order callable which adds, removes, or " @@ -984,7 +975,7 @@ msgid "" "`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:968 +#: ../../library/typing.rst:953 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -995,21 +986,21 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1007 ../../library/typing.rst:1711 +#: ../../library/typing.rst:992 ../../library/typing.rst:1697 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:1009 +#: ../../library/typing.rst:994 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:1014 +#: ../../library/typing.rst:999 msgid "Deprecated alias to :class:`type`." msgstr "" -#: ../../library/typing.rst:1016 +#: ../../library/typing.rst:1001 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``type[C]`` or ``Type[C]`` may accept " @@ -1017,11 +1008,11 @@ msgid "" "*class object* of ``C``. For example::" msgstr "" -#: ../../library/typing.rst:1025 +#: ../../library/typing.rst:1010 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:1037 +#: ../../library/typing.rst:1022 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -1031,42 +1022,42 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:1045 +#: ../../library/typing.rst:1030 msgid "" "The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:1051 +#: ../../library/typing.rst:1036 msgid "" "``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " "``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:1056 +#: ../../library/typing.rst:1041 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1062 +#: ../../library/typing.rst:1047 msgid "Special typing form to define \"literal types\"." msgstr "" -#: ../../library/typing.rst:1064 +#: ../../library/typing.rst:1049 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" -#: ../../library/typing.rst:1080 +#: ../../library/typing.rst:1065 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:1086 +#: ../../library/typing.rst:1071 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1074,22 +1065,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1094 +#: ../../library/typing.rst:1079 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1096 +#: ../../library/typing.rst:1081 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1104 +#: ../../library/typing.rst:1089 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1106 +#: ../../library/typing.rst:1091 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1097,48 +1088,48 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1120 +#: ../../library/typing.rst:1105 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: ../../library/typing.rst:1122 +#: ../../library/typing.rst:1107 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1136 ../../library/typing.rst:2507 +#: ../../library/typing.rst:1121 ../../library/typing.rst:2496 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1143 +#: ../../library/typing.rst:1128 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: ../../library/typing.rst:1145 +#: ../../library/typing.rst:1130 #, fuzzy msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1152 +#: ../../library/typing.rst:1137 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: ../../library/typing.rst:1155 +#: ../../library/typing.rst:1140 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1161 +#: ../../library/typing.rst:1146 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1163 +#: ../../library/typing.rst:1148 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1146,7 +1137,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1168 +#: ../../library/typing.rst:1153 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1155,7 +1146,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1174 +#: ../../library/typing.rst:1159 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1165,7 +1156,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1181 +#: ../../library/typing.rst:1166 msgid "" "The responsibility of how to interpret the metadata lies with the the tool " "or library encountering an ``Annotated`` annotation. A tool or library " @@ -1173,64 +1164,64 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1189 +#: ../../library/typing.rst:1174 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1202 +#: ../../library/typing.rst:1187 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1204 +#: ../../library/typing.rst:1189 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1206 +#: ../../library/typing.rst:1191 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1215 +#: ../../library/typing.rst:1200 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1219 +#: ../../library/typing.rst:1204 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1222 +#: ../../library/typing.rst:1207 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1229 +#: ../../library/typing.rst:1214 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1236 +#: ../../library/typing.rst:1221 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1242 +#: ../../library/typing.rst:1227 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1255 +#: ../../library/typing.rst:1240 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1259 +#: ../../library/typing.rst:1244 #, fuzzy msgid "This would be equivalent to::" msgstr "" @@ -1238,44 +1229,44 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:1263 +#: ../../library/typing.rst:1248 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1266 +#: ../../library/typing.rst:1251 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1279 +#: ../../library/typing.rst:1264 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1293 +#: ../../library/typing.rst:1278 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1294 +#: ../../library/typing.rst:1279 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1301 +#: ../../library/typing.rst:1286 msgid "Special typing construct for marking user-defined type guard functions." msgstr "" -#: ../../library/typing.rst:1303 +#: ../../library/typing.rst:1288 msgid "" "``TypeGuard`` can be used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1307 +#: ../../library/typing.rst:1292 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1284,44 +1275,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1322 +#: ../../library/typing.rst:1307 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1326 +#: ../../library/typing.rst:1311 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1329 +#: ../../library/typing.rst:1314 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1330 +#: ../../library/typing.rst:1315 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1347 +#: ../../library/typing.rst:1332 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1351 +#: ../../library/typing.rst:1336 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1357 +#: ../../library/typing.rst:1342 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1330,24 +1321,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1363 +#: ../../library/typing.rst:1348 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1370 +#: ../../library/typing.rst:1355 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1372 +#: ../../library/typing.rst:1357 msgid "" "For example, using the unpack operator ``*`` on a :class:`type variable " "tuple ` is equivalent to using ``Unpack`` to mark the type " "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1381 +#: ../../library/typing.rst:1366 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1355,45 +1346,45 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1398 +#: ../../library/typing.rst:1383 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1400 +#: ../../library/typing.rst:1385 msgid "" -"The following objects are not used directly in annotations. Instead, they " -"are building blocks for creating generic types." +"The following classes should not be used directly as annotations. Their " +"intended purpose is to be building blocks for creating generic types." msgstr "" -#: ../../library/typing.rst:1405 +#: ../../library/typing.rst:1391 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1407 +#: ../../library/typing.rst:1393 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1416 +#: ../../library/typing.rst:1402 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1429 +#: ../../library/typing.rst:1415 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1431 ../../library/typing.rst:1526 -#: ../../library/typing.rst:1636 ../../library/typing.rst:1747 -#: ../../library/typing.rst:1818 ../../library/typing.rst:2691 +#: ../../library/typing.rst:1417 ../../library/typing.rst:1512 +#: ../../library/typing.rst:1622 ../../library/typing.rst:1735 +#: ../../library/typing.rst:1806 ../../library/typing.rst:2680 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1437 +#: ../../library/typing.rst:1423 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1401,69 +1392,69 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1458 +#: ../../library/typing.rst:1444 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1461 +#: ../../library/typing.rst:1447 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " "details. By default, type variables are invariant." msgstr "" -#: ../../library/typing.rst:1465 +#: ../../library/typing.rst:1451 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1480 +#: ../../library/typing.rst:1466 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1488 +#: ../../library/typing.rst:1474 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1499 +#: ../../library/typing.rst:1485 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1503 +#: ../../library/typing.rst:1489 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1507 +#: ../../library/typing.rst:1493 msgid "Whether the type var has been marked as covariant." msgstr "" -#: ../../library/typing.rst:1511 +#: ../../library/typing.rst:1497 msgid "Whether the type var has been marked as contravariant." msgstr "" -#: ../../library/typing.rst:1515 +#: ../../library/typing.rst:1501 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1519 +#: ../../library/typing.rst:1505 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1523 +#: ../../library/typing.rst:1509 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1534 +#: ../../library/typing.rst:1520 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1471,7 +1462,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1556 +#: ../../library/typing.rst:1542 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1481,36 +1472,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1564 +#: ../../library/typing.rst:1550 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1571 +#: ../../library/typing.rst:1557 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1580 +#: ../../library/typing.rst:1566 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1599 +#: ../../library/typing.rst:1585 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1606 +#: ../../library/typing.rst:1592 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1616 +#: ../../library/typing.rst:1602 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1519,21 +1510,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1623 +#: ../../library/typing.rst:1609 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1627 +#: ../../library/typing.rst:1613 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1633 +#: ../../library/typing.rst:1619 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1640 +#: ../../library/typing.rst:1626 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1543,7 +1534,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1647 +#: ../../library/typing.rst:1633 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1551,27 +1542,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1671 +#: ../../library/typing.rst:1657 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1675 +#: ../../library/typing.rst:1661 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1677 +#: ../../library/typing.rst:1663 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1684 +#: ../../library/typing.rst:1670 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1584,11 +1575,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1696 +#: ../../library/typing.rst:1682 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1698 +#: ../../library/typing.rst:1684 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1597,17 +1588,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1707 +#: ../../library/typing.rst:1693 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1713 +#: ../../library/typing.rst:1699 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1718 +#: ../../library/typing.rst:1704 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1615,44 +1606,45 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1709 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1739 +#: ../../library/typing.rst:1725 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1741 +#: ../../library/typing.rst:1727 msgid "" -"These are not used in annotations. They are building blocks for declaring " +"These functions and classes should not be used directly as annotations. " +"Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:1745 +#: ../../library/typing.rst:1733 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1753 +#: ../../library/typing.rst:1741 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1757 +#: ../../library/typing.rst:1745 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1766 +#: ../../library/typing.rst:1754 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1768 +#: ../../library/typing.rst:1756 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1661,83 +1653,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1774 +#: ../../library/typing.rst:1762 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1784 +#: ../../library/typing.rst:1772 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1790 +#: ../../library/typing.rst:1778 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1794 +#: ../../library/typing.rst:1782 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1797 +#: ../../library/typing.rst:1785 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1800 +#: ../../library/typing.rst:1788 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1804 +#: ../../library/typing.rst:1792 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1808 +#: ../../library/typing.rst:1796 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1813 +#: ../../library/typing.rst:1801 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:1815 +#: ../../library/typing.rst:1803 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:1825 +#: ../../library/typing.rst:1813 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1829 +#: ../../library/typing.rst:1817 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1833 +#: ../../library/typing.rst:1821 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1837 +#: ../../library/typing.rst:1825 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1842 +#: ../../library/typing.rst:1830 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:1844 +#: ../../library/typing.rst:1832 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1850 +#: ../../library/typing.rst:1838 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1862 +#: ../../library/typing.rst:1850 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1745,15 +1737,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1867 +#: ../../library/typing.rst:1855 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1879 +#: ../../library/typing.rst:1867 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1881 +#: ../../library/typing.rst:1869 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1762,7 +1754,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1901 +#: ../../library/typing.rst:1889 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1773,7 +1765,7 @@ msgid "" "SSLObject`." msgstr "" -#: ../../library/typing.rst:1912 +#: ../../library/typing.rst:1900 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1781,13 +1773,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1923 +#: ../../library/typing.rst:1911 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1926 +#: ../../library/typing.rst:1914 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1795,53 +1787,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1942 +#: ../../library/typing.rst:1930 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1946 +#: ../../library/typing.rst:1934 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1950 +#: ../../library/typing.rst:1938 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1957 +#: ../../library/typing.rst:1945 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1958 +#: ../../library/typing.rst:1946 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1970 +#: ../../library/typing.rst:1958 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1981 +#: ../../library/typing.rst:1969 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1984 +#: ../../library/typing.rst:1972 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1994 +#: ../../library/typing.rst:1982 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1849,61 +1841,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1999 +#: ../../library/typing.rst:1987 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2014 +#: ../../library/typing.rst:2002 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2009 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2029 +#: ../../library/typing.rst:2017 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2047 +#: ../../library/typing.rst:2035 msgid "A ``TypedDict`` can be generic:" msgstr "" -#: ../../library/typing.rst:2057 +#: ../../library/typing.rst:2045 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2063 +#: ../../library/typing.rst:2051 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2085 +#: ../../library/typing.rst:2073 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2088 +#: ../../library/typing.rst:2076 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2091 +#: ../../library/typing.rst:2079 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1912,131 +1904,133 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2114 +#: ../../library/typing.rst:2102 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2106 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2122 +#: ../../library/typing.rst:2110 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2126 +#: ../../library/typing.rst:2114 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2128 -msgid "These protocols are decorated with :func:`runtime_checkable`." +#: ../../library/typing.rst:2116 +msgid "" +"The following protocols are provided by the typing module. All are decorated " +"with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2132 +#: ../../library/typing.rst:2121 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2137 +#: ../../library/typing.rst:2126 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2141 +#: ../../library/typing.rst:2130 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2145 +#: ../../library/typing.rst:2134 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2138 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2144 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2159 +#: ../../library/typing.rst:2148 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2163 +#: ../../library/typing.rst:2152 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2169 +#: ../../library/typing.rst:2158 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2175 +#: ../../library/typing.rst:2164 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2179 +#: ../../library/typing.rst:2168 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2181 +#: ../../library/typing.rst:2170 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2188 +#: ../../library/typing.rst:2177 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2190 +#: ../../library/typing.rst:2179 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2193 +#: ../../library/typing.rst:2182 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2200 +#: ../../library/typing.rst:2189 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2214 +#: ../../library/typing.rst:2203 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2216 +#: ../../library/typing.rst:2205 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2227 +#: ../../library/typing.rst:2216 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2232 +#: ../../library/typing.rst:2221 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2046,59 +2040,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2240 +#: ../../library/typing.rst:2229 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2243 +#: ../../library/typing.rst:2232 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2251 +#: ../../library/typing.rst:2240 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2253 +#: ../../library/typing.rst:2242 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2259 +#: ../../library/typing.rst:2248 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2262 +#: ../../library/typing.rst:2251 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2267 +#: ../../library/typing.rst:2256 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2272 +#: ../../library/typing.rst:2261 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2284 +#: ../../library/typing.rst:2273 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2287 +#: ../../library/typing.rst:2276 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2107,19 +2101,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2294 +#: ../../library/typing.rst:2283 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2310 +#: ../../library/typing.rst:2299 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2319 +#: ../../library/typing.rst:2308 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2330 +#: ../../library/typing.rst:2319 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2461 +#: ../../library/typing.rst:2450 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2324,32 +2318,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2468 +#: ../../library/typing.rst:2457 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2476 +#: ../../library/typing.rst:2465 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2478 +#: ../../library/typing.rst:2467 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2485 +#: ../../library/typing.rst:2474 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2487 +#: ../../library/typing.rst:2476 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2512 +#: ../../library/typing.rst:2501 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2359,11 +2353,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2523 +#: ../../library/typing.rst:2512 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2525 +#: ../../library/typing.rst:2514 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2371,48 +2365,48 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2531 +#: ../../library/typing.rst:2520 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2535 +#: ../../library/typing.rst:2524 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2537 +#: ../../library/typing.rst:2526 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2542 +#: ../../library/typing.rst:2531 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2544 +#: ../../library/typing.rst:2533 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2555 +#: ../../library/typing.rst:2544 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2559 +#: ../../library/typing.rst:2548 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2563 +#: ../../library/typing.rst:2552 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2566 +#: ../../library/typing.rst:2555 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2421,41 +2415,41 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2561 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example:" msgstr "" -#: ../../library/typing.rst:2589 +#: ../../library/typing.rst:2578 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2594 +#: ../../library/typing.rst:2583 #, fuzzy msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2598 +#: ../../library/typing.rst:2587 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2605 +#: ../../library/typing.rst:2594 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2608 +#: ../../library/typing.rst:2597 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2463,7 +2457,7 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2614 ../../library/typing.rst:2637 +#: ../../library/typing.rst:2603 ../../library/typing.rst:2626 #, fuzzy msgid "Examples:" msgstr "" @@ -2471,13 +2465,13 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:2629 +#: ../../library/typing.rst:2618 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2632 +#: ../../library/typing.rst:2621 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2485,40 +2479,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:2649 +#: ../../library/typing.rst:2638 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2670 +#: ../../library/typing.rst:2659 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:2672 +#: ../../library/typing.rst:2661 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2677 +#: ../../library/typing.rst:2666 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2684 +#: ../../library/typing.rst:2673 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2688 +#: ../../library/typing.rst:2677 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:2699 +#: ../../library/typing.rst:2688 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2526,7 +2520,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2706 +#: ../../library/typing.rst:2695 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2534,153 +2528,178 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2717 +#: ../../library/typing.rst:2706 #, fuzzy msgid "Deprecated aliases" msgstr "棄用於" -#: ../../library/typing.rst:2722 -msgid "Aliases to built-in types" +#: ../../library/typing.rst:2708 +msgid "" +"This module defines several deprecated aliases to pre-existing standard " +"library classes. These were originally included in the typing module in " +"order to support parameterizing these generic classes using ``[]``. However, " +"the aliases became redundant in Python 3.9 when the corresponding pre-" +"existing classes were enhanced to support ``[]``." +msgstr "" + +#: ../../library/typing.rst:2714 +msgid "" +"The redundant types are deprecated as of Python 3.9 but no deprecation " +"warnings are issued by the interpreter. It is expected that type checkers " +"will flag the deprecated types when the checked program targets Python 3.9 " +"or newer." +msgstr "" + +#: ../../library/typing.rst:2719 +msgid "" +"The deprecated types will be removed from the :mod:`typing` module no sooner " +"than the first Python version released 5 years after the release of Python " +"3.9.0. See details in :pep:`585`—*Type Hinting Generics In Standard " +"Collections*." msgstr "" #: ../../library/typing.rst:2726 +msgid "Aliases to built-in types" +msgstr "" + +#: ../../library/typing.rst:2730 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2728 +#: ../../library/typing.rst:2732 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2732 ../../library/typing.rst:2950 +#: ../../library/typing.rst:2736 ../../library/typing.rst:2954 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2737 +#: ../../library/typing.rst:2741 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2743 +#: ../../library/typing.rst:2747 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2745 +#: ../../library/typing.rst:2749 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2749 +#: ../../library/typing.rst:2753 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2759 +#: ../../library/typing.rst:2763 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2765 +#: ../../library/typing.rst:2769 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2767 +#: ../../library/typing.rst:2771 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2771 +#: ../../library/typing.rst:2775 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2777 +#: ../../library/typing.rst:2781 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2779 +#: ../../library/typing.rst:2783 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2784 +#: ../../library/typing.rst:2788 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:2789 +#: ../../library/typing.rst:2793 msgid "Aliases to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2793 +#: ../../library/typing.rst:2797 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2797 +#: ../../library/typing.rst:2801 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2803 +#: ../../library/typing.rst:2807 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2807 +#: ../../library/typing.rst:2811 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2813 +#: ../../library/typing.rst:2817 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2818 +#: ../../library/typing.rst:2822 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2824 +#: ../../library/typing.rst:2828 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2829 +#: ../../library/typing.rst:2833 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2835 +#: ../../library/typing.rst:2839 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2840 +#: ../../library/typing.rst:2844 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2851 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:2852 +#: ../../library/typing.rst:2856 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2855 +#: ../../library/typing.rst:2859 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2688,367 +2707,367 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2867 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2864 +#: ../../library/typing.rst:2868 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2870 +#: ../../library/typing.rst:2874 msgid "Deprecated alias for :class:`str`." msgstr "" -#: ../../library/typing.rst:2872 +#: ../../library/typing.rst:2876 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:2876 +#: ../../library/typing.rst:2880 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2884 +#: ../../library/typing.rst:2888 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2898 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2898 +#: ../../library/typing.rst:2902 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2900 +#: ../../library/typing.rst:2904 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2906 +#: ../../library/typing.rst:2910 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2910 +#: ../../library/typing.rst:2914 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2914 +#: ../../library/typing.rst:2918 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2918 +#: ../../library/typing.rst:2922 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2924 +#: ../../library/typing.rst:2928 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2926 +#: ../../library/typing.rst:2930 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2932 +#: ../../library/typing.rst:2936 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2934 +#: ../../library/typing.rst:2938 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2940 +#: ../../library/typing.rst:2944 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2942 +#: ../../library/typing.rst:2946 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2948 +#: ../../library/typing.rst:2952 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:2955 +#: ../../library/typing.rst:2959 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2961 +#: ../../library/typing.rst:2965 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2963 +#: ../../library/typing.rst:2967 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2969 +#: ../../library/typing.rst:2973 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2971 +#: ../../library/typing.rst:2975 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2978 +#: ../../library/typing.rst:2982 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2980 +#: ../../library/typing.rst:2984 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2987 +#: ../../library/typing.rst:2991 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2989 +#: ../../library/typing.rst:2993 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2995 +#: ../../library/typing.rst:2999 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2997 +#: ../../library/typing.rst:3001 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3003 +#: ../../library/typing.rst:3007 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:3005 +#: ../../library/typing.rst:3009 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3012 +#: ../../library/typing.rst:3016 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3016 +#: ../../library/typing.rst:3020 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:3018 +#: ../../library/typing.rst:3022 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3029 +#: ../../library/typing.rst:3033 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3035 +#: ../../library/typing.rst:3039 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:3037 +#: ../../library/typing.rst:3041 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3046 +#: ../../library/typing.rst:3050 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:3050 +#: ../../library/typing.rst:3054 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3058 +#: ../../library/typing.rst:3062 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3068 +#: ../../library/typing.rst:3072 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3075 +#: ../../library/typing.rst:3079 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:3079 +#: ../../library/typing.rst:3083 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3085 +#: ../../library/typing.rst:3089 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:3089 +#: ../../library/typing.rst:3093 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3095 +#: ../../library/typing.rst:3099 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:3099 +#: ../../library/typing.rst:3103 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3106 +#: ../../library/typing.rst:3110 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3110 +#: ../../library/typing.rst:3114 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:3112 +#: ../../library/typing.rst:3116 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3118 +#: ../../library/typing.rst:3122 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:3120 +#: ../../library/typing.rst:3124 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3126 +#: ../../library/typing.rst:3130 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:3128 +#: ../../library/typing.rst:3132 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3137 +#: ../../library/typing.rst:3141 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:3141 +#: ../../library/typing.rst:3145 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3149 +#: ../../library/typing.rst:3153 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3157 +#: ../../library/typing.rst:3161 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3163 +#: ../../library/typing.rst:3167 msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:3167 +#: ../../library/typing.rst:3171 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:3169 +#: ../../library/typing.rst:3173 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3179 msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:3180 +#: ../../library/typing.rst:3184 msgid "Aliases to :mod:`contextlib` ABCs" msgstr "" -#: ../../library/typing.rst:3184 +#: ../../library/typing.rst:3188 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3189 +#: ../../library/typing.rst:3193 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3196 +#: ../../library/typing.rst:3200 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3201 +#: ../../library/typing.rst:3205 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3207 +#: ../../library/typing.rst:3211 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3209 +#: ../../library/typing.rst:3213 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3056,76 +3075,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3214 +#: ../../library/typing.rst:3218 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3214 +#: ../../library/typing.rst:3218 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3214 +#: ../../library/typing.rst:3218 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3214 +#: ../../library/typing.rst:3218 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3216 +#: ../../library/typing.rst:3220 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3216 +#: ../../library/typing.rst:3220 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3216 +#: ../../library/typing.rst:3220 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3216 +#: ../../library/typing.rst:3220 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3219 +#: ../../library/typing.rst:3223 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3219 ../../library/typing.rst:3222 +#: ../../library/typing.rst:3223 ../../library/typing.rst:3226 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3219 ../../library/typing.rst:3224 +#: ../../library/typing.rst:3223 ../../library/typing.rst:3228 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3219 +#: ../../library/typing.rst:3223 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3222 +#: ../../library/typing.rst:3226 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3222 +#: ../../library/typing.rst:3226 msgid "3.14" msgstr "" -#: ../../library/typing.rst:3222 +#: ../../library/typing.rst:3226 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3224 +#: ../../library/typing.rst:3228 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3224 +#: ../../library/typing.rst:3228 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3224 +#: ../../library/typing.rst:3228 msgid ":gh:`92332`" msgstr ":gh:`92332`" From e728155d0167b3e732f498dba55d4036e197cd86 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 22 Jun 2023 00:37:37 +0000 Subject: [PATCH 111/130] sync with cpython 6d232ba2 --- library/stdtypes.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/stdtypes.po b/library/stdtypes.po index f57df71d61..c8fb2bdc0f 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-08 00:35+0000\n" +"POT-Creation-Date: 2023-06-22 00:35+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -84,7 +84,8 @@ msgstr "" "列出了大部分會被視為 false 的內建物件:" #: ../../library/stdtypes.rst:55 -msgid "constants defined to be false: ``None`` and ``False``." +#, fuzzy +msgid "constants defined to be false: ``None`` and ``False``" msgstr "定義為 false 之常數:``None`` 與 ``False``。" #: ../../library/stdtypes.rst:57 From 716fb325907e927eb1c7e1975edc0ea74efac1f9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 24 Jun 2023 00:41:18 +0000 Subject: [PATCH 112/130] sync with cpython 05d06e58 --- library/typing.po | 1041 +++++++++++++++++++++++---------------------- 1 file changed, 528 insertions(+), 513 deletions(-) diff --git a/library/typing.po b/library/typing.po index 4d0f4b7938..b33d5e2cbb 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-19 00:34+0000\n" +"POT-Creation-Date: 2023-06-24 00:39+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -368,7 +368,7 @@ msgid "" "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:254 ../../library/typing.rst:2640 +#: ../../library/typing.rst:254 ../../library/typing.rst:2682 #, fuzzy msgid "For example:" msgstr "" @@ -383,7 +383,7 @@ msgid "" "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:276 ../../library/typing.rst:920 +#: ../../library/typing.rst:276 ../../library/typing.rst:962 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -394,7 +394,7 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:284 ../../library/typing.rst:932 +#: ../../library/typing.rst:284 ../../library/typing.rst:974 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -424,67 +424,101 @@ msgid "" msgstr "" #: ../../library/typing.rst:330 -msgid "User-defined generic types" +msgid "Annotating tuples" msgstr "" #: ../../library/typing.rst:332 +msgid "" +"For most containers in Python, the typing system assumes that all elements " +"in the container will be of the same type. For example::" +msgstr "" + +#: ../../library/typing.rst:347 +msgid "" +":class:`list` only accepts one type argument, so a type checker would emit " +"an error on the ``y`` assignment above. Similarly, :class:`~collections.abc." +"Mapping` only accepts two type arguments: the first indicates the type of " +"the keys, and the second indicates the type of the values." +msgstr "" + +#: ../../library/typing.rst:353 +msgid "" +"Unlike most other Python containers, however, it is common in idiomatic " +"Python code for tuples to have elements which are not all of the same type. " +"For this reason, tuples are special-cased in Python's typing system. :class:" +"`tuple` accepts *any number* of type arguments::" +msgstr "" + +#: ../../library/typing.rst:369 +msgid "" +"To denote a tuple which could be of *any* length, and in which all elements " +"are of the same type ``T``, use ``tuple[T, ...]``. To denote an empty tuple, " +"use ``tuple[()]``. Using plain ``tuple`` as an annotation is equivalent to " +"using ``tuple[Any, ...]``::" +msgstr "" + +#: ../../library/typing.rst:392 +msgid "User-defined generic types" +msgstr "" + +#: ../../library/typing.rst:394 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:358 +#: ../../library/typing.rst:420 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:362 +#: ../../library/typing.rst:424 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[T]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:371 +#: ../../library/typing.rst:433 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:383 +#: ../../library/typing.rst:445 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:394 +#: ../../library/typing.rst:456 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:404 +#: ../../library/typing.rst:466 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:414 +#: ../../library/typing.rst:476 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:416 +#: ../../library/typing.rst:478 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``:" msgstr "" -#: ../../library/typing.rst:427 +#: ../../library/typing.rst:489 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:444 +#: ../../library/typing.rst:506 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:447 +#: ../../library/typing.rst:509 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -494,7 +528,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:463 +#: ../../library/typing.rst:525 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -502,20 +536,20 @@ msgid "" "converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:475 +#: ../../library/typing.rst:537 msgid "" "Note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:479 +#: ../../library/typing.rst:541 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:483 +#: ../../library/typing.rst:545 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -523,24 +557,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:490 +#: ../../library/typing.rst:552 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:492 +#: ../../library/typing.rst:554 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:496 +#: ../../library/typing.rst:558 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:514 +#: ../../library/typing.rst:576 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -549,19 +583,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:520 +#: ../../library/typing.rst:582 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:533 +#: ../../library/typing.rst:595 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:536 +#: ../../library/typing.rst:598 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -569,7 +603,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:541 +#: ../../library/typing.rst:603 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -577,24 +611,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:563 +#: ../../library/typing.rst:625 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:568 +#: ../../library/typing.rst:630 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:570 +#: ../../library/typing.rst:632 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:574 +#: ../../library/typing.rst:636 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -603,7 +637,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:587 +#: ../../library/typing.rst:649 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -612,85 +646,85 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:603 +#: ../../library/typing.rst:665 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:608 +#: ../../library/typing.rst:670 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:610 +#: ../../library/typing.rst:672 msgid "" "The ``typing`` module defines the following classes, functions and " "decorators." msgstr "" -#: ../../library/typing.rst:613 +#: ../../library/typing.rst:675 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:616 +#: ../../library/typing.rst:678 msgid "Special types" msgstr "" -#: ../../library/typing.rst:618 +#: ../../library/typing.rst:680 msgid "" "These can be used as types in annotations. They do not support subscription " "using ``[]``." msgstr "" -#: ../../library/typing.rst:623 +#: ../../library/typing.rst:685 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:625 +#: ../../library/typing.rst:687 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:626 +#: ../../library/typing.rst:688 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:628 +#: ../../library/typing.rst:690 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:635 +#: ../../library/typing.rst:697 msgid "A :ref:`constrained type variable `." msgstr "" -#: ../../library/typing.rst:637 +#: ../../library/typing.rst:699 msgid "Definition::" msgstr "" -#: ../../library/typing.rst:641 +#: ../../library/typing.rst:703 msgid "" "``AnyStr`` is meant to be used for functions that may accept :class:`str` " "or :class:`bytes` arguments but cannot allow the two to mix." msgstr "" -#: ../../library/typing.rst:644 ../../library/typing.rst:720 -#: ../../library/typing.rst:740 ../../library/typing.rst:786 -#: ../../library/typing.rst:1053 ../../library/typing.rst:1110 -#: ../../library/typing.rst:1318 ../../library/typing.rst:2480 +#: ../../library/typing.rst:706 ../../library/typing.rst:782 +#: ../../library/typing.rst:802 ../../library/typing.rst:848 +#: ../../library/typing.rst:1095 ../../library/typing.rst:1152 +#: ../../library/typing.rst:1360 ../../library/typing.rst:2522 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:655 +#: ../../library/typing.rst:717 msgid "Special type that includes only literal strings." msgstr "" -#: ../../library/typing.rst:657 +#: ../../library/typing.rst:719 msgid "" "Any string literal is compatible with ``LiteralString``, as is another " "``LiteralString``. However, an object typed as just ``str`` is not. A string " @@ -698,7 +732,7 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:663 +#: ../../library/typing.rst:725 #, fuzzy msgid "Example:" msgstr "" @@ -706,7 +740,7 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:679 +#: ../../library/typing.rst:741 msgid "" "``LiteralString`` is useful for sensitive APIs where arbitrary user-" "generated strings could generate problems. For example, the two cases above " @@ -714,33 +748,33 @@ msgid "" "attack." msgstr "" -#: ../../library/typing.rst:684 +#: ../../library/typing.rst:746 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:690 +#: ../../library/typing.rst:752 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:693 +#: ../../library/typing.rst:755 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:713 +#: ../../library/typing.rst:775 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:718 +#: ../../library/typing.rst:780 msgid "Special type indicating that a function never returns." msgstr "" -#: ../../library/typing.rst:727 +#: ../../library/typing.rst:789 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -748,158 +782,127 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:738 +#: ../../library/typing.rst:800 msgid "Special type to represent the current enclosed class." msgstr "" -#: ../../library/typing.rst:750 +#: ../../library/typing.rst:812 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:762 +#: ../../library/typing.rst:824 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:769 +#: ../../library/typing.rst:831 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:772 +#: ../../library/typing.rst:834 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:774 +#: ../../library/typing.rst:836 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:776 +#: ../../library/typing.rst:838 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:778 +#: ../../library/typing.rst:840 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:784 +#: ../../library/typing.rst:846 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:854 msgid "" "``TypeAlias`` is particularly useful for annotating aliases that make use of " "forward references, as it can be hard for type checkers to distinguish these " "from normal variable assignments:" msgstr "" -#: ../../library/typing.rst:812 +#: ../../library/typing.rst:874 #, fuzzy msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:817 +#: ../../library/typing.rst:879 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:819 +#: ../../library/typing.rst:881 msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." msgstr "" -#: ../../library/typing.rst:824 -msgid "Deprecated alias for :class:`tuple`." -msgstr "" - -#: ../../library/typing.rst:826 -msgid "" -"``Tuple[X, Y]`` is the type of a tuple of two items with the first item of " -"type X and the second of type Y. The type of the empty tuple can be written " -"as ``Tuple[()]``." -msgstr "" - -#: ../../library/typing.rst:830 -msgid "" -"Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " -"variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " -"float and a string." -msgstr "" - -#: ../../library/typing.rst:834 -msgid "" -"To specify a variable-length tuple of homogeneous type, use literal " -"ellipsis, e.g. ``Tuple[int, ...]``. A plain ``Tuple`` annotation is " -"equivalent to ``tuple``, ``Tuple[Any, ...]``, or ``tuple[Any, ...]``." -msgstr "" - -#: ../../library/typing.rst:838 -msgid "" -":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" -"`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:844 +#: ../../library/typing.rst:886 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:846 +#: ../../library/typing.rst:888 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:848 +#: ../../library/typing.rst:890 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:850 +#: ../../library/typing.rst:892 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:854 +#: ../../library/typing.rst:896 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:858 +#: ../../library/typing.rst:900 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:862 +#: ../../library/typing.rst:904 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:866 +#: ../../library/typing.rst:908 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:868 +#: ../../library/typing.rst:910 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:870 +#: ../../library/typing.rst:912 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:873 +#: ../../library/typing.rst:915 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:879 +#: ../../library/typing.rst:921 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:881 +#: ../../library/typing.rst:923 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -907,30 +910,30 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:889 +#: ../../library/typing.rst:931 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:896 +#: ../../library/typing.rst:938 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:902 +#: ../../library/typing.rst:944 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "" -#: ../../library/typing.rst:904 +#: ../../library/typing.rst:946 msgid "" "``Callable[[int], str]`` signifies a function that takes a single parameter " "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:907 +#: ../../library/typing.rst:949 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " @@ -938,7 +941,7 @@ msgid "" "type must be a single type." msgstr "" -#: ../../library/typing.rst:912 +#: ../../library/typing.rst:954 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -948,23 +951,23 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:928 +#: ../../library/typing.rst:970 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:937 +#: ../../library/typing.rst:979 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:942 +#: ../../library/typing.rst:984 msgid "Special form for annotating higher-order functions." msgstr "" -#: ../../library/typing.rst:944 +#: ../../library/typing.rst:986 msgid "" "``Concatenate`` can be used in conjunction with :data:`Callable` and :class:" "`ParamSpec` to annotate a higher-order callable which adds, removes, or " @@ -975,7 +978,7 @@ msgid "" "`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:953 +#: ../../library/typing.rst:995 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -986,21 +989,21 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:992 ../../library/typing.rst:1697 +#: ../../library/typing.rst:1034 ../../library/typing.rst:1739 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:994 +#: ../../library/typing.rst:1036 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:999 +#: ../../library/typing.rst:1041 msgid "Deprecated alias to :class:`type`." msgstr "" -#: ../../library/typing.rst:1001 +#: ../../library/typing.rst:1043 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``type[C]`` or ``Type[C]`` may accept " @@ -1008,11 +1011,11 @@ msgid "" "*class object* of ``C``. For example::" msgstr "" -#: ../../library/typing.rst:1010 +#: ../../library/typing.rst:1052 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:1022 +#: ../../library/typing.rst:1064 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -1022,42 +1025,42 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:1030 +#: ../../library/typing.rst:1072 msgid "" "The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:1036 +#: ../../library/typing.rst:1078 msgid "" "``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " "``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:1041 +#: ../../library/typing.rst:1083 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1047 +#: ../../library/typing.rst:1089 msgid "Special typing form to define \"literal types\"." msgstr "" -#: ../../library/typing.rst:1049 +#: ../../library/typing.rst:1091 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" -#: ../../library/typing.rst:1065 +#: ../../library/typing.rst:1107 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:1071 +#: ../../library/typing.rst:1113 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1065,22 +1068,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1079 +#: ../../library/typing.rst:1121 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1081 +#: ../../library/typing.rst:1123 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1089 +#: ../../library/typing.rst:1131 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1091 +#: ../../library/typing.rst:1133 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1088,48 +1091,48 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1105 +#: ../../library/typing.rst:1147 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: ../../library/typing.rst:1107 +#: ../../library/typing.rst:1149 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1121 ../../library/typing.rst:2496 +#: ../../library/typing.rst:1163 ../../library/typing.rst:2538 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1128 +#: ../../library/typing.rst:1170 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: ../../library/typing.rst:1130 +#: ../../library/typing.rst:1172 #, fuzzy msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1137 +#: ../../library/typing.rst:1179 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: ../../library/typing.rst:1140 +#: ../../library/typing.rst:1182 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1146 +#: ../../library/typing.rst:1188 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1148 +#: ../../library/typing.rst:1190 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1137,7 +1140,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1153 +#: ../../library/typing.rst:1195 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1146,7 +1149,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1159 +#: ../../library/typing.rst:1201 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1156,7 +1159,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1166 +#: ../../library/typing.rst:1208 msgid "" "The responsibility of how to interpret the metadata lies with the the tool " "or library encountering an ``Annotated`` annotation. A tool or library " @@ -1164,64 +1167,64 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1174 +#: ../../library/typing.rst:1216 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1187 +#: ../../library/typing.rst:1229 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1189 +#: ../../library/typing.rst:1231 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1191 +#: ../../library/typing.rst:1233 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1200 +#: ../../library/typing.rst:1242 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1204 +#: ../../library/typing.rst:1246 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1207 +#: ../../library/typing.rst:1249 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1214 +#: ../../library/typing.rst:1256 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1221 +#: ../../library/typing.rst:1263 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1227 +#: ../../library/typing.rst:1269 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1240 +#: ../../library/typing.rst:1282 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1244 +#: ../../library/typing.rst:1286 #, fuzzy msgid "This would be equivalent to::" msgstr "" @@ -1229,44 +1232,44 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:1248 +#: ../../library/typing.rst:1290 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1251 +#: ../../library/typing.rst:1293 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1264 +#: ../../library/typing.rst:1306 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1278 +#: ../../library/typing.rst:1320 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1279 +#: ../../library/typing.rst:1321 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1286 +#: ../../library/typing.rst:1328 msgid "Special typing construct for marking user-defined type guard functions." msgstr "" -#: ../../library/typing.rst:1288 +#: ../../library/typing.rst:1330 msgid "" "``TypeGuard`` can be used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1292 +#: ../../library/typing.rst:1334 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1275,44 +1278,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1307 +#: ../../library/typing.rst:1349 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1311 +#: ../../library/typing.rst:1353 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1314 +#: ../../library/typing.rst:1356 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1315 +#: ../../library/typing.rst:1357 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1332 +#: ../../library/typing.rst:1374 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1336 +#: ../../library/typing.rst:1378 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1342 +#: ../../library/typing.rst:1384 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1321,24 +1324,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1348 +#: ../../library/typing.rst:1390 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1355 +#: ../../library/typing.rst:1397 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1357 +#: ../../library/typing.rst:1399 msgid "" "For example, using the unpack operator ``*`` on a :class:`type variable " "tuple ` is equivalent to using ``Unpack`` to mark the type " "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1366 +#: ../../library/typing.rst:1408 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1346,45 +1349,45 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1383 +#: ../../library/typing.rst:1425 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1385 +#: ../../library/typing.rst:1427 msgid "" "The following classes should not be used directly as annotations. Their " "intended purpose is to be building blocks for creating generic types." msgstr "" -#: ../../library/typing.rst:1391 +#: ../../library/typing.rst:1433 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1393 +#: ../../library/typing.rst:1435 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1402 +#: ../../library/typing.rst:1444 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1415 +#: ../../library/typing.rst:1457 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1417 ../../library/typing.rst:1512 -#: ../../library/typing.rst:1622 ../../library/typing.rst:1735 -#: ../../library/typing.rst:1806 ../../library/typing.rst:2680 +#: ../../library/typing.rst:1459 ../../library/typing.rst:1554 +#: ../../library/typing.rst:1664 ../../library/typing.rst:1777 +#: ../../library/typing.rst:1848 ../../library/typing.rst:2722 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1423 +#: ../../library/typing.rst:1465 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1392,69 +1395,69 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1444 +#: ../../library/typing.rst:1486 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1447 +#: ../../library/typing.rst:1489 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " "details. By default, type variables are invariant." msgstr "" -#: ../../library/typing.rst:1451 +#: ../../library/typing.rst:1493 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1466 +#: ../../library/typing.rst:1508 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1474 +#: ../../library/typing.rst:1516 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1485 +#: ../../library/typing.rst:1527 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1489 +#: ../../library/typing.rst:1531 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1493 +#: ../../library/typing.rst:1535 msgid "Whether the type var has been marked as covariant." msgstr "" -#: ../../library/typing.rst:1497 +#: ../../library/typing.rst:1539 msgid "Whether the type var has been marked as contravariant." msgstr "" -#: ../../library/typing.rst:1501 +#: ../../library/typing.rst:1543 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1505 +#: ../../library/typing.rst:1547 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1509 +#: ../../library/typing.rst:1551 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1520 +#: ../../library/typing.rst:1562 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1462,7 +1465,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1542 +#: ../../library/typing.rst:1584 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1472,36 +1475,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1550 +#: ../../library/typing.rst:1592 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1557 +#: ../../library/typing.rst:1599 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1566 +#: ../../library/typing.rst:1608 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1585 +#: ../../library/typing.rst:1627 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1592 +#: ../../library/typing.rst:1634 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1602 +#: ../../library/typing.rst:1644 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1510,21 +1513,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1609 +#: ../../library/typing.rst:1651 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1613 +#: ../../library/typing.rst:1655 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1619 +#: ../../library/typing.rst:1661 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1626 +#: ../../library/typing.rst:1668 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1534,7 +1537,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1633 +#: ../../library/typing.rst:1675 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1542,27 +1545,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1657 +#: ../../library/typing.rst:1699 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1661 +#: ../../library/typing.rst:1703 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1663 +#: ../../library/typing.rst:1705 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1670 +#: ../../library/typing.rst:1712 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1575,11 +1578,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1682 +#: ../../library/typing.rst:1724 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1684 +#: ../../library/typing.rst:1726 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1588,17 +1591,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1693 +#: ../../library/typing.rst:1735 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1699 +#: ../../library/typing.rst:1741 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1704 +#: ../../library/typing.rst:1746 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1606,45 +1609,45 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1709 +#: ../../library/typing.rst:1751 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1725 +#: ../../library/typing.rst:1767 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1727 +#: ../../library/typing.rst:1769 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:1733 +#: ../../library/typing.rst:1775 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1741 +#: ../../library/typing.rst:1783 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1745 +#: ../../library/typing.rst:1787 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1754 +#: ../../library/typing.rst:1796 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1756 +#: ../../library/typing.rst:1798 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1653,83 +1656,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1762 +#: ../../library/typing.rst:1804 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1772 +#: ../../library/typing.rst:1814 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1778 +#: ../../library/typing.rst:1820 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1782 +#: ../../library/typing.rst:1824 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1785 +#: ../../library/typing.rst:1827 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1788 +#: ../../library/typing.rst:1830 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1792 +#: ../../library/typing.rst:1834 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1796 +#: ../../library/typing.rst:1838 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:1843 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:1803 +#: ../../library/typing.rst:1845 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:1813 +#: ../../library/typing.rst:1855 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1817 +#: ../../library/typing.rst:1859 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1821 +#: ../../library/typing.rst:1863 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1825 +#: ../../library/typing.rst:1867 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1830 +#: ../../library/typing.rst:1872 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:1832 +#: ../../library/typing.rst:1874 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1838 +#: ../../library/typing.rst:1880 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1850 +#: ../../library/typing.rst:1892 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1737,15 +1740,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1855 +#: ../../library/typing.rst:1897 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1867 +#: ../../library/typing.rst:1909 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1869 +#: ../../library/typing.rst:1911 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1754,7 +1757,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1889 +#: ../../library/typing.rst:1931 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1765,7 +1768,7 @@ msgid "" "SSLObject`." msgstr "" -#: ../../library/typing.rst:1900 +#: ../../library/typing.rst:1942 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1773,13 +1776,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1911 +#: ../../library/typing.rst:1953 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1914 +#: ../../library/typing.rst:1956 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1787,53 +1790,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1930 +#: ../../library/typing.rst:1972 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1934 +#: ../../library/typing.rst:1976 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1938 +#: ../../library/typing.rst:1980 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1945 +#: ../../library/typing.rst:1987 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1946 +#: ../../library/typing.rst:1988 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1958 +#: ../../library/typing.rst:2000 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:2011 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1972 +#: ../../library/typing.rst:2014 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1982 +#: ../../library/typing.rst:2024 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1841,61 +1844,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1987 +#: ../../library/typing.rst:2029 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2002 +#: ../../library/typing.rst:2044 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:2009 +#: ../../library/typing.rst:2051 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2017 +#: ../../library/typing.rst:2059 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2035 +#: ../../library/typing.rst:2077 msgid "A ``TypedDict`` can be generic:" msgstr "" -#: ../../library/typing.rst:2045 +#: ../../library/typing.rst:2087 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2051 +#: ../../library/typing.rst:2093 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2073 +#: ../../library/typing.rst:2115 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2076 +#: ../../library/typing.rst:2118 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2079 +#: ../../library/typing.rst:2121 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1904,133 +1907,133 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2102 +#: ../../library/typing.rst:2144 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2106 +#: ../../library/typing.rst:2148 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2110 +#: ../../library/typing.rst:2152 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2114 +#: ../../library/typing.rst:2156 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2116 +#: ../../library/typing.rst:2158 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2121 +#: ../../library/typing.rst:2163 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2126 +#: ../../library/typing.rst:2168 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2130 +#: ../../library/typing.rst:2172 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2134 +#: ../../library/typing.rst:2176 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2138 +#: ../../library/typing.rst:2180 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2144 +#: ../../library/typing.rst:2186 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2148 +#: ../../library/typing.rst:2190 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2152 +#: ../../library/typing.rst:2194 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2158 +#: ../../library/typing.rst:2200 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2164 +#: ../../library/typing.rst:2206 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2168 +#: ../../library/typing.rst:2210 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2170 +#: ../../library/typing.rst:2212 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2177 +#: ../../library/typing.rst:2219 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2179 +#: ../../library/typing.rst:2221 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2182 +#: ../../library/typing.rst:2224 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2189 +#: ../../library/typing.rst:2231 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2203 +#: ../../library/typing.rst:2245 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2205 +#: ../../library/typing.rst:2247 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2216 +#: ../../library/typing.rst:2258 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2221 +#: ../../library/typing.rst:2263 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2040,59 +2043,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2229 +#: ../../library/typing.rst:2271 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2232 +#: ../../library/typing.rst:2274 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2240 +#: ../../library/typing.rst:2282 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2242 +#: ../../library/typing.rst:2284 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2248 +#: ../../library/typing.rst:2290 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2251 +#: ../../library/typing.rst:2293 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2256 +#: ../../library/typing.rst:2298 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2261 +#: ../../library/typing.rst:2303 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2273 +#: ../../library/typing.rst:2315 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2276 +#: ../../library/typing.rst:2318 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2101,19 +2104,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2283 +#: ../../library/typing.rst:2325 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2299 +#: ../../library/typing.rst:2341 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2308 +#: ../../library/typing.rst:2350 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2319 +#: ../../library/typing.rst:2361 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2450 +#: ../../library/typing.rst:2492 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2318,32 +2321,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2457 +#: ../../library/typing.rst:2499 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2465 +#: ../../library/typing.rst:2507 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2467 +#: ../../library/typing.rst:2509 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2474 +#: ../../library/typing.rst:2516 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2476 +#: ../../library/typing.rst:2518 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2501 +#: ../../library/typing.rst:2543 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2353,11 +2356,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2512 +#: ../../library/typing.rst:2554 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2514 +#: ../../library/typing.rst:2556 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2365,48 +2368,48 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2520 +#: ../../library/typing.rst:2562 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2524 +#: ../../library/typing.rst:2566 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2526 +#: ../../library/typing.rst:2568 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2531 +#: ../../library/typing.rst:2573 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2533 +#: ../../library/typing.rst:2575 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2544 +#: ../../library/typing.rst:2586 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2548 +#: ../../library/typing.rst:2590 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2552 +#: ../../library/typing.rst:2594 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2555 +#: ../../library/typing.rst:2597 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2415,41 +2418,41 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2561 +#: ../../library/typing.rst:2603 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example:" msgstr "" -#: ../../library/typing.rst:2578 +#: ../../library/typing.rst:2620 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2583 +#: ../../library/typing.rst:2625 #, fuzzy msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2587 +#: ../../library/typing.rst:2629 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2594 +#: ../../library/typing.rst:2636 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2597 +#: ../../library/typing.rst:2639 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2457,7 +2460,7 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2603 ../../library/typing.rst:2626 +#: ../../library/typing.rst:2645 ../../library/typing.rst:2668 #, fuzzy msgid "Examples:" msgstr "" @@ -2465,13 +2468,13 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:2618 +#: ../../library/typing.rst:2660 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2621 +#: ../../library/typing.rst:2663 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2479,40 +2482,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:2638 +#: ../../library/typing.rst:2680 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2659 +#: ../../library/typing.rst:2701 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:2661 +#: ../../library/typing.rst:2703 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2666 +#: ../../library/typing.rst:2708 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2673 +#: ../../library/typing.rst:2715 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2677 +#: ../../library/typing.rst:2719 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:2688 +#: ../../library/typing.rst:2730 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2520,7 +2523,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2695 +#: ../../library/typing.rst:2737 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2528,12 +2531,12 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2706 +#: ../../library/typing.rst:2748 #, fuzzy msgid "Deprecated aliases" msgstr "棄用於" -#: ../../library/typing.rst:2708 +#: ../../library/typing.rst:2750 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2542,7 +2545,7 @@ msgid "" "existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:2714 +#: ../../library/typing.rst:2756 msgid "" "The redundant types are deprecated as of Python 3.9 but no deprecation " "warnings are issued by the interpreter. It is expected that type checkers " @@ -2550,7 +2553,7 @@ msgid "" "or newer." msgstr "" -#: ../../library/typing.rst:2719 +#: ../../library/typing.rst:2761 msgid "" "The deprecated types will be removed from the :mod:`typing` module no sooner " "than the first Python version released 5 years after the release of Python " @@ -2558,148 +2561,160 @@ msgid "" "Collections*." msgstr "" -#: ../../library/typing.rst:2726 +#: ../../library/typing.rst:2768 msgid "Aliases to built-in types" msgstr "" -#: ../../library/typing.rst:2730 +#: ../../library/typing.rst:2772 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2732 +#: ../../library/typing.rst:2774 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2736 ../../library/typing.rst:2954 +#: ../../library/typing.rst:2778 ../../library/typing.rst:3005 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2741 +#: ../../library/typing.rst:2783 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2747 +#: ../../library/typing.rst:2789 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2749 +#: ../../library/typing.rst:2791 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2753 +#: ../../library/typing.rst:2795 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2763 +#: ../../library/typing.rst:2805 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2769 +#: ../../library/typing.rst:2811 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2771 +#: ../../library/typing.rst:2813 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2775 +#: ../../library/typing.rst:2817 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2781 +#: ../../library/typing.rst:2823 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2783 +#: ../../library/typing.rst:2825 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2788 -msgid ":data:`Tuple` is a special form." +#: ../../library/typing.rst:2832 +msgid "Deprecated alias for :class:`tuple`." msgstr "" -#: ../../library/typing.rst:2793 +#: ../../library/typing.rst:2834 +msgid "" +":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" +"`annotating-tuples` for more details." +msgstr "" + +#: ../../library/typing.rst:2837 +msgid "" +":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." +msgstr "" + +#: ../../library/typing.rst:2844 msgid "Aliases to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2797 +#: ../../library/typing.rst:2848 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2801 +#: ../../library/typing.rst:2852 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2807 +#: ../../library/typing.rst:2858 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2811 +#: ../../library/typing.rst:2862 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2817 +#: ../../library/typing.rst:2868 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2822 +#: ../../library/typing.rst:2873 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2828 +#: ../../library/typing.rst:2879 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2833 +#: ../../library/typing.rst:2884 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2839 +#: ../../library/typing.rst:2890 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2844 +#: ../../library/typing.rst:2895 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2851 +#: ../../library/typing.rst:2902 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:2856 +#: ../../library/typing.rst:2907 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2859 +#: ../../library/typing.rst:2910 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2707,367 +2722,367 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2867 +#: ../../library/typing.rst:2918 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2919 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2874 +#: ../../library/typing.rst:2925 msgid "Deprecated alias for :class:`str`." msgstr "" -#: ../../library/typing.rst:2876 +#: ../../library/typing.rst:2927 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:2880 +#: ../../library/typing.rst:2931 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2888 +#: ../../library/typing.rst:2939 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2898 +#: ../../library/typing.rst:2949 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2902 +#: ../../library/typing.rst:2953 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2904 +#: ../../library/typing.rst:2955 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2910 +#: ../../library/typing.rst:2961 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2914 +#: ../../library/typing.rst:2965 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2918 +#: ../../library/typing.rst:2969 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2922 +#: ../../library/typing.rst:2973 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2928 +#: ../../library/typing.rst:2979 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2930 +#: ../../library/typing.rst:2981 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2936 +#: ../../library/typing.rst:2987 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2938 +#: ../../library/typing.rst:2989 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2944 +#: ../../library/typing.rst:2995 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2946 +#: ../../library/typing.rst:2997 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2952 +#: ../../library/typing.rst:3003 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:2959 +#: ../../library/typing.rst:3010 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2965 +#: ../../library/typing.rst:3016 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2967 +#: ../../library/typing.rst:3018 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2973 +#: ../../library/typing.rst:3024 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2975 +#: ../../library/typing.rst:3026 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2982 +#: ../../library/typing.rst:3033 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2984 +#: ../../library/typing.rst:3035 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2991 +#: ../../library/typing.rst:3042 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2993 +#: ../../library/typing.rst:3044 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2999 +#: ../../library/typing.rst:3050 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:3001 +#: ../../library/typing.rst:3052 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3007 +#: ../../library/typing.rst:3058 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:3009 +#: ../../library/typing.rst:3060 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3016 +#: ../../library/typing.rst:3067 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3020 +#: ../../library/typing.rst:3071 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:3022 +#: ../../library/typing.rst:3073 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3033 +#: ../../library/typing.rst:3084 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3039 +#: ../../library/typing.rst:3090 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:3041 +#: ../../library/typing.rst:3092 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3050 +#: ../../library/typing.rst:3101 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:3054 +#: ../../library/typing.rst:3105 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3062 +#: ../../library/typing.rst:3113 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3072 +#: ../../library/typing.rst:3123 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3079 +#: ../../library/typing.rst:3130 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:3083 +#: ../../library/typing.rst:3134 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3089 +#: ../../library/typing.rst:3140 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:3093 +#: ../../library/typing.rst:3144 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3099 +#: ../../library/typing.rst:3150 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:3103 +#: ../../library/typing.rst:3154 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3110 +#: ../../library/typing.rst:3161 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3114 +#: ../../library/typing.rst:3165 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:3116 +#: ../../library/typing.rst:3167 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3122 +#: ../../library/typing.rst:3173 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:3124 +#: ../../library/typing.rst:3175 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3130 +#: ../../library/typing.rst:3181 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:3132 +#: ../../library/typing.rst:3183 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3141 +#: ../../library/typing.rst:3192 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:3145 +#: ../../library/typing.rst:3196 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3153 +#: ../../library/typing.rst:3204 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3161 +#: ../../library/typing.rst:3212 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3167 +#: ../../library/typing.rst:3218 msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3222 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:3173 +#: ../../library/typing.rst:3224 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3179 +#: ../../library/typing.rst:3230 msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:3184 +#: ../../library/typing.rst:3235 msgid "Aliases to :mod:`contextlib` ABCs" msgstr "" -#: ../../library/typing.rst:3188 +#: ../../library/typing.rst:3239 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3193 +#: ../../library/typing.rst:3244 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3200 +#: ../../library/typing.rst:3251 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3205 +#: ../../library/typing.rst:3256 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3211 +#: ../../library/typing.rst:3262 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3213 +#: ../../library/typing.rst:3264 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3075,76 +3090,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3218 +#: ../../library/typing.rst:3269 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3218 +#: ../../library/typing.rst:3269 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3218 +#: ../../library/typing.rst:3269 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3218 +#: ../../library/typing.rst:3269 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3220 +#: ../../library/typing.rst:3271 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3220 +#: ../../library/typing.rst:3271 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3220 +#: ../../library/typing.rst:3271 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3220 +#: ../../library/typing.rst:3271 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3223 +#: ../../library/typing.rst:3274 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3223 ../../library/typing.rst:3226 +#: ../../library/typing.rst:3274 ../../library/typing.rst:3277 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3223 ../../library/typing.rst:3228 +#: ../../library/typing.rst:3274 ../../library/typing.rst:3279 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3223 +#: ../../library/typing.rst:3274 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3226 +#: ../../library/typing.rst:3277 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3226 +#: ../../library/typing.rst:3277 msgid "3.14" msgstr "" -#: ../../library/typing.rst:3226 +#: ../../library/typing.rst:3277 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3228 +#: ../../library/typing.rst:3279 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3228 +#: ../../library/typing.rst:3279 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3228 +#: ../../library/typing.rst:3279 msgid ":gh:`92332`" msgstr ":gh:`92332`" From c722d21b91e9bb1490ba68b6b73f7c9362521f2e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 25 Jun 2023 00:44:53 +0000 Subject: [PATCH 113/130] sync with cpython dbe416b8 --- c-api/dict.po | 51 +++++++++--------- c-api/object.po | 138 ++++++++++++++++++++++++------------------------ 2 files changed, 95 insertions(+), 94 deletions(-) diff --git a/c-api/dict.po b/c-api/dict.po index 43356ce73f..ae81241d38 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-25 00:42+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -117,40 +117,41 @@ msgid "" "``NULL`` if the key *key* is not present, but *without* setting an exception." msgstr "" -#: ../../c-api/dict.rst:101 +#: ../../c-api/dict.rst:103 msgid "" -"Note that exceptions which occur while calling :meth:`__hash__` and :meth:" -"`__eq__` methods will get suppressed. To get error reporting use :c:func:" -"`PyDict_GetItemWithError()` instead." +"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" +"`~object.__eq__` methods are silently ignored. Prefer the :c:func:" +"`PyDict_GetItemWithError` function instead." msgstr "" -#: ../../c-api/dict.rst:105 +#: ../../c-api/dict.rst:107 msgid "" "Calling this API without :term:`GIL` held had been allowed for historical " "reason. It is no longer allowed." msgstr "" -#: ../../c-api/dict.rst:112 +#: ../../c-api/dict.rst:114 msgid "" "Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " "Return ``NULL`` **with** an exception set if an exception occurred. Return " "``NULL`` **without** an exception set if the key wasn't present." msgstr "" -#: ../../c-api/dict.rst:120 +#: ../../c-api/dict.rst:122 msgid "" "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" "expr:`const char*`, rather than a :c:expr:`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:123 +#: ../../c-api/dict.rst:127 msgid "" -"Note that exceptions which occur while calling :meth:`__hash__` and :meth:" -"`__eq__` methods and creating a temporary string object will get suppressed. " -"To get error reporting use :c:func:`PyDict_GetItemWithError()` instead." +"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" +"`~object.__eq__` methods or while creating the temporary :class:`str` object " +"are silently ignored. Prefer using the :c:func:`PyDict_GetItemWithError` " +"function with your own :c:func:`PyUnicode_FromString` *key* instead." msgstr "" -#: ../../c-api/dict.rst:131 +#: ../../c-api/dict.rst:136 msgid "" "This is the same as the Python-level :meth:`dict.setdefault`. If present, " "it returns the value corresponding to *key* from the dictionary *p*. If the " @@ -160,29 +161,29 @@ msgid "" "the insertion." msgstr "" -#: ../../c-api/dict.rst:141 +#: ../../c-api/dict.rst:146 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "" -#: ../../c-api/dict.rst:146 +#: ../../c-api/dict.rst:151 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "" -#: ../../c-api/dict.rst:151 +#: ../../c-api/dict.rst:156 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." msgstr "" -#: ../../c-api/dict.rst:159 +#: ../../c-api/dict.rst:164 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." msgstr "" -#: ../../c-api/dict.rst:165 +#: ../../c-api/dict.rst:170 msgid "" "Iterate over all key-value pairs in the dictionary *p*. The :c:type:" "`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the " @@ -196,21 +197,21 @@ msgid "" "structure is sparse, the offsets are not consecutive." msgstr "" -#: ../../c-api/dict.rst:176 +#: ../../c-api/dict.rst:181 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../c-api/dict.rst:186 +#: ../../c-api/dict.rst:191 msgid "" "The dictionary *p* should not be mutated during iteration. It is safe to " "modify the values of the keys as you iterate over the dictionary, but only " "so long as the set of keys does not change. For example::" msgstr "" -#: ../../c-api/dict.rst:211 +#: ../../c-api/dict.rst:216 msgid "" "Iterate over mapping object *b* adding key-value pairs to dictionary *a*. " "*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` " @@ -220,7 +221,7 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" -#: ../../c-api/dict.rst:221 +#: ../../c-api/dict.rst:226 msgid "" "This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a." "update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back " @@ -229,7 +230,7 @@ msgid "" "exception was raised." msgstr "" -#: ../../c-api/dict.rst:230 +#: ../../c-api/dict.rst:235 msgid "" "Update or merge into dictionary *a*, from the key-value pairs in *seq2*. " "*seq2* must be an iterable object producing iterable objects of length 2, " @@ -251,10 +252,10 @@ msgstr "字典物件" msgid "PyUnicode_FromString()" msgstr "" -#: ../../c-api/dict.rst:157 +#: ../../c-api/dict.rst:162 msgid "built-in function" msgstr "" -#: ../../c-api/dict.rst:157 +#: ../../c-api/dict.rst:162 msgid "len" msgstr "" diff --git a/c-api/object.po b/c-api/object.po index 989c9ca760..fc39593f95 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-25 00:42+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,43 +43,43 @@ msgid "" "the object is written instead of the :func:`repr`." msgstr "" -#: ../../c-api/object.rst:32 ../../c-api/object.rst:43 +#: ../../c-api/object.rst:32 ../../c-api/object.rst:45 msgid "" "Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " "This is equivalent to the Python expression ``hasattr(o, attr_name)``. This " "function always succeeds." msgstr "" -#: ../../c-api/object.rst:36 +#: ../../c-api/object.rst:38 msgid "" -"Note that exceptions which occur while calling :meth:`__getattr__` and :meth:" -"`__getattribute__` methods will get suppressed. To get error reporting use :" -"c:func:`PyObject_GetAttr()` instead." +"Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" +"`~object.__getattribute__` methods are silently ignored. For proper error " +"handling, use :c:func:`PyObject_GetAttr` instead." msgstr "" -#: ../../c-api/object.rst:47 +#: ../../c-api/object.rst:51 msgid "" -"Note that exceptions which occur while calling :meth:`__getattr__` and :meth:" -"`__getattribute__` methods and creating a temporary string object will get " -"suppressed. To get error reporting use :c:func:`PyObject_GetAttrString()` " -"instead." +"Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" +"`~object.__getattribute__` methods or while creating the temporary :class:" +"`str` object are silently ignored. For proper error handling, use :c:func:" +"`PyObject_GetAttrString` instead." msgstr "" -#: ../../c-api/object.rst:55 +#: ../../c-api/object.rst:59 msgid "" "Retrieve an attribute named *attr_name* from object *o*. Returns the " "attribute value on success, or ``NULL`` on failure. This is the equivalent " "of the Python expression ``o.attr_name``." msgstr "" -#: ../../c-api/object.rst:62 +#: ../../c-api/object.rst:66 msgid "" "Retrieve an attribute named *attr_name* from object *o*. Returns the " "attribute value on success, or ``NULL`` on failure. This is the equivalent " "of the Python expression ``o.attr_name``." msgstr "" -#: ../../c-api/object.rst:69 +#: ../../c-api/object.rst:73 msgid "" "Generic attribute getter function that is meant to be put into a type " "object's ``tp_getattro`` slot. It looks for a descriptor in the dictionary " @@ -89,27 +89,27 @@ msgid "" "descriptors don't. Otherwise, an :exc:`AttributeError` is raised." msgstr "" -#: ../../c-api/object.rst:79 ../../c-api/object.rst:91 +#: ../../c-api/object.rst:83 ../../c-api/object.rst:95 msgid "" "Set the value of the attribute named *attr_name*, for object *o*, to the " "value *v*. Raise an exception and return ``-1`` on failure; return ``0`` on " "success. This is the equivalent of the Python statement ``o.attr_name = v``." msgstr "" -#: ../../c-api/object.rst:84 +#: ../../c-api/object.rst:88 msgid "" "If *v* is ``NULL``, the attribute is deleted. This behaviour is deprecated " "in favour of using :c:func:`PyObject_DelAttr`, but there are currently no " "plans to remove it." msgstr "" -#: ../../c-api/object.rst:96 +#: ../../c-api/object.rst:100 msgid "" "If *v* is ``NULL``, the attribute is deleted, but this feature is deprecated " "in favour of using :c:func:`PyObject_DelAttrString`." msgstr "" -#: ../../c-api/object.rst:102 +#: ../../c-api/object.rst:106 msgid "" "Generic attribute setter and deleter function that is meant to be put into a " "type object's :c:member:`~PyTypeObject.tp_setattro` slot. It looks for a " @@ -121,19 +121,19 @@ msgid "" "returned." msgstr "" -#: ../../c-api/object.rst:114 ../../c-api/object.rst:120 +#: ../../c-api/object.rst:118 ../../c-api/object.rst:124 msgid "" "Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on " "failure. This is the equivalent of the Python statement ``del o.attr_name``." msgstr "" -#: ../../c-api/object.rst:126 +#: ../../c-api/object.rst:130 msgid "" "A generic implementation for the getter of a ``__dict__`` descriptor. It " "creates the dictionary if necessary." msgstr "" -#: ../../c-api/object.rst:129 +#: ../../c-api/object.rst:133 msgid "" "This function may also be called to get the :py:attr:`~object.__dict__` of " "the object *o*. Pass ``NULL`` for *context* when calling it. Since this " @@ -142,30 +142,30 @@ msgid "" "the object." msgstr "" -#: ../../c-api/object.rst:135 +#: ../../c-api/object.rst:139 msgid "On failure, returns ``NULL`` with an exception set." msgstr "" -#: ../../c-api/object.rst:142 +#: ../../c-api/object.rst:146 msgid "" "A generic implementation for the setter of a ``__dict__`` descriptor. This " "implementation does not allow the dictionary to be deleted." msgstr "" -#: ../../c-api/object.rst:150 +#: ../../c-api/object.rst:154 msgid "" "Return a pointer to :py:attr:`~object.__dict__` of the object *obj*. If " "there is no ``__dict__``, return ``NULL`` without setting an exception." msgstr "" -#: ../../c-api/object.rst:153 +#: ../../c-api/object.rst:157 msgid "" "This function may need to allocate memory for the dictionary, so it may be " "more efficient to call :c:func:`PyObject_GetAttr` when accessing an " "attribute on the object." msgstr "" -#: ../../c-api/object.rst:160 +#: ../../c-api/object.rst:164 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " "which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:" @@ -176,7 +176,7 @@ msgid "" "failure." msgstr "" -#: ../../c-api/object.rst:170 +#: ../../c-api/object.rst:174 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " "which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:" @@ -187,26 +187,26 @@ msgid "" "to *opid*." msgstr "" -#: ../../c-api/object.rst:179 +#: ../../c-api/object.rst:183 msgid "" "If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` " "will always return ``1`` for :const:`Py_EQ` and ``0`` for :const:`Py_NE`." msgstr "" -#: ../../c-api/object.rst:184 +#: ../../c-api/object.rst:188 msgid "" "Format *obj* using *format_spec*. This is equivalent to the Python " "expression ``format(obj, format_spec)``." msgstr "" -#: ../../c-api/object.rst:187 +#: ../../c-api/object.rst:191 msgid "" "*format_spec* may be ``NULL``. In this case the call is equivalent to " "``format(obj)``. Returns the formatted string on success, ``NULL`` on " "failure." msgstr "" -#: ../../c-api/object.rst:195 +#: ../../c-api/object.rst:199 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -214,13 +214,13 @@ msgid "" "function." msgstr "" -#: ../../c-api/object.rst:199 ../../c-api/object.rst:223 +#: ../../c-api/object.rst:203 ../../c-api/object.rst:227 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." msgstr "" -#: ../../c-api/object.rst:207 +#: ../../c-api/object.rst:211 msgid "" "As :c:func:`PyObject_Repr`, compute a string representation of object *o*, " "but escape the non-ASCII characters in the string returned by :c:func:" @@ -229,7 +229,7 @@ msgid "" "Called by the :func:`ascii` built-in function." msgstr "" -#: ../../c-api/object.rst:218 +#: ../../c-api/object.rst:222 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -237,7 +237,7 @@ msgid "" "function and, therefore, by the :func:`print` function." msgstr "" -#: ../../c-api/object.rst:232 +#: ../../c-api/object.rst:236 msgid "" "Compute a bytes representation of object *o*. ``NULL`` is returned on " "failure and a bytes object on success. This is equivalent to the Python " @@ -246,20 +246,20 @@ msgid "" "bytes object." msgstr "" -#: ../../c-api/object.rst:241 +#: ../../c-api/object.rst:245 msgid "" "Return ``1`` if the class *derived* is identical to or derived from the " "class *cls*, otherwise return ``0``. In case of an error, return ``-1``." msgstr "" -#: ../../c-api/object.rst:244 ../../c-api/object.rst:263 +#: ../../c-api/object.rst:248 ../../c-api/object.rst:267 msgid "" "If *cls* is a tuple, the check will be done against every entry in *cls*. " "The result will be ``1`` when at least one of the checks returns ``1``, " "otherwise it will be ``0``." msgstr "" -#: ../../c-api/object.rst:248 +#: ../../c-api/object.rst:252 msgid "" "If *cls* has a :meth:`~class.__subclasscheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " @@ -267,52 +267,52 @@ msgid "" "e. contained in ``cls.__mro__``." msgstr "" -#: ../../c-api/object.rst:253 +#: ../../c-api/object.rst:257 msgid "" "Normally only class objects, i.e. instances of :class:`type` or a derived " "class, are considered classes. However, objects can override this by having " "a :attr:`__bases__` attribute (which must be a tuple of base classes)." msgstr "" -#: ../../c-api/object.rst:260 +#: ../../c-api/object.rst:264 msgid "" "Return ``1`` if *inst* is an instance of the class *cls* or a subclass of " "*cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception." msgstr "" -#: ../../c-api/object.rst:267 +#: ../../c-api/object.rst:271 msgid "" "If *cls* has a :meth:`~class.__instancecheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " "*inst* is an instance of *cls* if its class is a subclass of *cls*." msgstr "" -#: ../../c-api/object.rst:271 +#: ../../c-api/object.rst:275 msgid "" "An instance *inst* can override what is considered its class by having a :" "attr:`__class__` attribute." msgstr "" -#: ../../c-api/object.rst:274 +#: ../../c-api/object.rst:278 msgid "" "An object *cls* can override if it is considered a class, and what its base " "classes are, by having a :attr:`__bases__` attribute (which must be a tuple " "of base classes)." msgstr "" -#: ../../c-api/object.rst:283 +#: ../../c-api/object.rst:287 msgid "" "Compute and return the hash value of an object *o*. On failure, return " "``-1``. This is the equivalent of the Python expression ``hash(o)``." msgstr "" -#: ../../c-api/object.rst:286 +#: ../../c-api/object.rst:290 msgid "" "The return type is now Py_hash_t. This is a signed integer the same size " "as :c:type:`Py_ssize_t`." msgstr "" -#: ../../c-api/object.rst:293 +#: ../../c-api/object.rst:297 msgid "" "Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` " "and return ``-1``. This function receives special treatment when stored in a " @@ -320,21 +320,21 @@ msgid "" "that it is not hashable." msgstr "" -#: ../../c-api/object.rst:301 +#: ../../c-api/object.rst:305 msgid "" "Returns ``1`` if the object *o* is considered to be true, and ``0`` " "otherwise. This is equivalent to the Python expression ``not not o``. On " "failure, return ``-1``." msgstr "" -#: ../../c-api/object.rst:308 +#: ../../c-api/object.rst:312 msgid "" "Returns ``0`` if the object *o* is considered to be true, and ``1`` " "otherwise. This is equivalent to the Python expression ``not o``. On " "failure, return ``-1``." msgstr "" -#: ../../c-api/object.rst:317 +#: ../../c-api/object.rst:321 msgid "" "When *o* is non-``NULL``, returns a type object corresponding to the object " "type of object *o*. On failure, raises :exc:`SystemError` and returns " @@ -345,13 +345,13 @@ msgid "" "incremented reference count is needed." msgstr "" -#: ../../c-api/object.rst:328 +#: ../../c-api/object.rst:332 msgid "" "Return non-zero if the object *o* is of type *type* or a subtype of *type*, " "and ``0`` otherwise. Both parameters must be non-``NULL``." msgstr "" -#: ../../c-api/object.rst:337 +#: ../../c-api/object.rst:341 msgid "" "Return the length of object *o*. If the object *o* provides either the " "sequence and mapping protocols, the sequence length is returned. On error, " @@ -359,7 +359,7 @@ msgid "" "``len(o)``." msgstr "" -#: ../../c-api/object.rst:344 +#: ../../c-api/object.rst:348 msgid "" "Return an estimated length for the object *o*. First try to return its " "actual length, then an estimate using :meth:`~object.__length_hint__`, and " @@ -368,26 +368,26 @@ msgid "" "defaultvalue)``." msgstr "" -#: ../../c-api/object.rst:354 +#: ../../c-api/object.rst:358 msgid "" "Return element of *o* corresponding to the object *key* or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o[key]``." msgstr "" -#: ../../c-api/object.rst:360 +#: ../../c-api/object.rst:364 msgid "" "Map the object *key* to the value *v*. Raise an exception and return ``-1`` " "on failure; return ``0`` on success. This is the equivalent of the Python " "statement ``o[key] = v``. This function *does not* steal a reference to *v*." msgstr "" -#: ../../c-api/object.rst:368 +#: ../../c-api/object.rst:372 msgid "" "Remove the mapping for the object *key* from the object *o*. Return ``-1`` " "on failure. This is equivalent to the Python statement ``del o[key]``." msgstr "" -#: ../../c-api/object.rst:374 +#: ../../c-api/object.rst:378 msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " @@ -397,7 +397,7 @@ msgid "" "`PyErr_Occurred` will return false." msgstr "" -#: ../../c-api/object.rst:383 +#: ../../c-api/object.rst:387 msgid "" "This is equivalent to the Python expression ``iter(o)``. It returns a new " "iterator for the object argument, or the object itself if the object is " @@ -405,7 +405,7 @@ msgid "" "object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:391 +#: ../../c-api/object.rst:395 msgid "" "This is the equivalent to the Python expression ``aiter(o)``. Takes an :" "class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " @@ -414,40 +414,40 @@ msgid "" "``NULL`` if the object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:193 ../../c-api/object.rst:205 -#: ../../c-api/object.rst:230 ../../c-api/object.rst:281 -#: ../../c-api/object.rst:315 ../../c-api/object.rst:335 +#: ../../c-api/object.rst:197 ../../c-api/object.rst:209 +#: ../../c-api/object.rst:234 ../../c-api/object.rst:285 +#: ../../c-api/object.rst:319 ../../c-api/object.rst:339 msgid "built-in function" msgstr "" -#: ../../c-api/object.rst:193 +#: ../../c-api/object.rst:197 msgid "repr" msgstr "" -#: ../../c-api/object.rst:205 +#: ../../c-api/object.rst:209 msgid "ascii" msgstr "" -#: ../../c-api/object.rst:213 +#: ../../c-api/object.rst:217 msgid "string" msgstr "" -#: ../../c-api/object.rst:213 +#: ../../c-api/object.rst:217 msgid "PyObject_Str (C function)" msgstr "" -#: ../../c-api/object.rst:230 +#: ../../c-api/object.rst:234 msgid "bytes" msgstr "" -#: ../../c-api/object.rst:281 +#: ../../c-api/object.rst:285 msgid "hash" msgstr "" -#: ../../c-api/object.rst:315 +#: ../../c-api/object.rst:319 msgid "type" msgstr "" -#: ../../c-api/object.rst:335 +#: ../../c-api/object.rst:339 msgid "len" msgstr "" From 5c8fb21255e9b6ac962d69da973141abae657a7e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 25 Jun 2023 19:58:32 +0000 Subject: [PATCH 114/130] sync with cpython 1bbf60dc --- library/sqlite3.po | 468 ++++++++++++++++++++++----------------------- 1 file changed, 234 insertions(+), 234 deletions(-) diff --git a/library/sqlite3.po b/library/sqlite3.po index db8e02eaa8..c00d11c3b2 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-12 00:29+0000\n" +"POT-Creation-Date: 2023-06-25 19:55+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-" @@ -396,15 +396,15 @@ msgstr "" #: ../../library/sqlite3.rst:397 msgid "" -"Register an *adapter* callable to adapt the Python type *type* into an " -"SQLite type. The adapter is called with a Python object of type *type* as " +"Register an *adapter* :term:`callable` to adapt the Python type *type* into " +"an SQLite type. The adapter is called with a Python object of type *type* as " "its sole argument, and must return a value of a :ref:`type that SQLite " "natively understands `." msgstr "" #: ../../library/sqlite3.rst:405 msgid "" -"Register the *converter* callable to convert SQLite objects of type " +"Register the *converter* :term:`callable` to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " "for all SQLite values of type *typename*; it is passed a :class:`bytes` " "object and should return an object of the desired Python type. Consult the " @@ -453,8 +453,8 @@ msgstr "" #: ../../library/sqlite3.rst:462 msgid "" -"Flags that should be returned by the *authorizer_callback* callable passed " -"to :meth:`Connection.set_authorizer`, to indicate whether:" +"Flags that should be returned by the *authorizer_callback* :term:`callable` " +"passed to :meth:`Connection.set_authorizer`, to indicate whether:" msgstr "" #: ../../library/sqlite3.rst:465 @@ -626,8 +626,8 @@ msgstr "" #: ../../library/sqlite3.rst:563 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " -"single optional parameter *factory*. If supplied, this must be a 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:570 @@ -726,9 +726,9 @@ msgstr "" #: ../../library/sqlite3.rst:649 msgid "" -"A callable that is called when the SQL function is invoked. The callable " -"must return :ref:`a type natively supported by SQLite `. Set " -"to ``None`` to remove an existing SQL function." +"A :term:`callable` that is called when the SQL function is invoked. The " +"callable must return :ref:`a type natively supported by SQLite `. Set to ``None`` to remove an existing SQL function." msgstr "" #: ../../library/sqlite3.rst:656 @@ -747,9 +747,9 @@ msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" #: ../../library/sqlite3.rst:667 ../../library/sqlite3.rst:705 -#: ../../library/sqlite3.rst:768 ../../library/sqlite3.rst:1019 -#: ../../library/sqlite3.rst:1256 ../../library/sqlite3.rst:1383 -#: ../../library/sqlite3.rst:1411 +#: ../../library/sqlite3.rst:768 ../../library/sqlite3.rst:1020 +#: ../../library/sqlite3.rst:1257 ../../library/sqlite3.rst:1384 +#: ../../library/sqlite3.rst:1412 msgid "Example:" msgstr "範例:" @@ -900,14 +900,14 @@ msgstr "" #: ../../library/sqlite3.rst:875 msgid "" -"Register 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." +"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." msgstr "" -#: ../../library/sqlite3.rst:881 +#: ../../library/sqlite3.rst:882 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or ``None`` " @@ -917,7 +917,7 @@ msgid "" "attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" -#: ../../library/sqlite3.rst:888 +#: ../../library/sqlite3.rst:889 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -925,42 +925,42 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:892 +#: ../../library/sqlite3.rst:893 msgid "Passing ``None`` as *authorizer_callback* will disable the authorizer." msgstr "" -#: ../../library/sqlite3.rst:894 +#: ../../library/sqlite3.rst:895 msgid "Added support for disabling the authorizer using ``None``." msgstr "" -#: ../../library/sqlite3.rst:900 +#: ../../library/sqlite3.rst:901 msgid "" -"Register callable *progress_handler* to be invoked for every *n* " +"Register :term:`callable` *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " "get called from SQLite during long-running operations, for example to update " "a GUI." msgstr "" -#: ../../library/sqlite3.rst:905 +#: ../../library/sqlite3.rst:906 msgid "" "If you want to clear any previously installed progress handler, call the " "method with ``None`` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:908 +#: ../../library/sqlite3.rst:909 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise an :exc:`OperationalError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:915 +#: ../../library/sqlite3.rst:916 msgid "" -"Register callable *trace_callback* to be invoked for each SQL statement that " -"is actually executed by the SQLite backend." +"Register :term:`callable` *trace_callback* to be invoked for each SQL " +"statement that is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:918 +#: ../../library/sqlite3.rst:919 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 " @@ -970,18 +970,18 @@ msgid "" "execution of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:926 +#: ../../library/sqlite3.rst:927 msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:929 +#: ../../library/sqlite3.rst:930 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: ../../library/sqlite3.rst:939 +#: ../../library/sqlite3.rst:940 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite " @@ -990,7 +990,7 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:948 +#: ../../library/sqlite3.rst:949 msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " @@ -999,108 +999,108 @@ msgid "" "program:`configure`." msgstr "" -#: ../../library/sqlite3.rst:955 +#: ../../library/sqlite3.rst:956 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:959 +#: ../../library/sqlite3.rst:960 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:1002 +#: ../../library/sqlite3.rst:1003 msgid "" "Load an SQLite extension from a shared library located at *path*. Enable " "extension loading with :meth:`enable_load_extension` before calling this " "method." msgstr "" -#: ../../library/sqlite3.rst:1006 +#: ../../library/sqlite3.rst:1007 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:1010 +#: ../../library/sqlite3.rst:1011 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:1015 +#: ../../library/sqlite3.rst:1016 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." msgstr "" -#: ../../library/sqlite3.rst:1033 +#: ../../library/sqlite3.rst:1034 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1035 +#: ../../library/sqlite3.rst:1036 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:1038 +#: ../../library/sqlite3.rst:1039 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:1041 +#: ../../library/sqlite3.rst:1042 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:1047 +#: ../../library/sqlite3.rst:1048 msgid "" -"If set to a callable, it is invoked with three integer arguments for every " -"backup iteration: the *status* of the last iteration, the *remaining* number " -"of pages still to be copied, and the *total* number of pages. Defaults to " -"``None``." +"If set to a :term:`callable`, it is invoked with three integer arguments for " +"every backup iteration: the *status* of the last iteration, the *remaining* " +"number of pages still to be copied, and the *total* number of pages. " +"Defaults to ``None``." msgstr "" -#: ../../library/sqlite3.rst:1056 +#: ../../library/sqlite3.rst:1057 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1063 +#: ../../library/sqlite3.rst:1064 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:1067 +#: ../../library/sqlite3.rst:1068 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1086 +#: ../../library/sqlite3.rst:1087 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1098 +#: ../../library/sqlite3.rst:1099 msgid "Get a connection runtime limit." msgstr "" -#: ../../library/sqlite3.rst:1100 +#: ../../library/sqlite3.rst:1101 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: ../../library/sqlite3.rst:1105 ../../library/sqlite3.rst:1142 +#: ../../library/sqlite3.rst:1106 ../../library/sqlite3.rst:1143 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:1108 +#: ../../library/sqlite3.rst:1109 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: ../../library/sqlite3.rst:1128 +#: ../../library/sqlite3.rst:1129 msgid "" "Set a connection runtime limit. Attempts to increase a limit above its hard " "upper bound are silently truncated to the hard upper bound. Regardless of " @@ -1108,22 +1108,22 @@ msgid "" "returned." msgstr "" -#: ../../library/sqlite3.rst:1133 +#: ../../library/sqlite3.rst:1134 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: ../../library/sqlite3.rst:1136 +#: ../../library/sqlite3.rst:1137 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: ../../library/sqlite3.rst:1145 +#: ../../library/sqlite3.rst:1146 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: ../../library/sqlite3.rst:1162 +#: ../../library/sqlite3.rst:1163 msgid "" "Serialize a database into a :class:`bytes` object. For an ordinary on-disk " "database file, the serialization is just a copy of the disk file. For an in-" @@ -1132,17 +1132,17 @@ msgid "" "backed up to disk." msgstr "" -#: ../../library/sqlite3.rst:1168 +#: ../../library/sqlite3.rst:1169 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1176 +#: ../../library/sqlite3.rst:1177 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: ../../library/sqlite3.rst:1184 +#: ../../library/sqlite3.rst:1185 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1150,47 +1150,47 @@ msgid "" "serialization contained in *data*." msgstr "" -#: ../../library/sqlite3.rst:1190 +#: ../../library/sqlite3.rst:1191 msgid "A serialized database." msgstr "" -#: ../../library/sqlite3.rst:1193 +#: ../../library/sqlite3.rst:1194 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1197 +#: ../../library/sqlite3.rst:1198 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: ../../library/sqlite3.rst:1201 +#: ../../library/sqlite3.rst:1202 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1204 +#: ../../library/sqlite3.rst:1205 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: ../../library/sqlite3.rst:1209 +#: ../../library/sqlite3.rst:1210 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: ../../library/sqlite3.rst:1216 +#: ../../library/sqlite3.rst:1217 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:1219 +#: ../../library/sqlite3.rst:1220 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: ../../library/sqlite3.rst:1226 +#: ../../library/sqlite3.rst:1227 msgid "" "This attribute controls the :ref:`transaction handling ` performed by :mod:`!sqlite3`. If set to ``None``, " @@ -1200,13 +1200,13 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:1234 +#: ../../library/sqlite3.rst:1235 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:1239 +#: ../../library/sqlite3.rst:1240 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " "from this connection. Assigning to this attribute does not affect the :attr:" @@ -1215,30 +1215,30 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1246 ../../library/sqlite3.rst:1538 -#: ../../library/sqlite3.rst:1561 +#: ../../library/sqlite3.rst:1247 ../../library/sqlite3.rst:1539 +#: ../../library/sqlite3.rst:1562 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "" -#: ../../library/sqlite3.rst:1250 +#: ../../library/sqlite3.rst:1251 msgid "" -"A callable that accepts a :class:`bytes` parameter and returns a text " -"representation of it. The callable is invoked for SQLite values with the " -"``TEXT`` data type. By default, this attribute is set to :class:`str`. If " -"you want to return ``bytes`` instead, set *text_factory* to ``bytes``." +"A :term:`callable` that accepts a :class:`bytes` parameter and returns a " +"text representation of it. The callable is invoked for SQLite values with " +"the ``TEXT`` data type. By default, this attribute is set to :class:`str`. " +"If you want to return ``bytes`` instead, set *text_factory* to ``bytes``." msgstr "" -#: ../../library/sqlite3.rst:1290 +#: ../../library/sqlite3.rst:1291 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:1297 +#: ../../library/sqlite3.rst:1298 msgid "Cursor objects" msgstr "" -#: ../../library/sqlite3.rst:1299 +#: ../../library/sqlite3.rst:1300 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 " @@ -1246,39 +1246,39 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1306 +#: ../../library/sqlite3.rst:1307 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:" msgstr "" -#: ../../library/sqlite3.rst:1331 +#: ../../library/sqlite3.rst:1332 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:1338 +#: ../../library/sqlite3.rst:1339 msgid "" "Execute SQL a single SQL statement, optionally binding Python values using :" "ref:`placeholders `." msgstr "" -#: ../../library/sqlite3.rst:1342 +#: ../../library/sqlite3.rst:1343 msgid "A single SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1345 +#: ../../library/sqlite3.rst:1346 msgid "" "Python values to bind to placeholders in *sql*. A :class:`!dict` if named " "placeholders are used. A :term:`!sequence` if unnamed placeholders are used. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1352 +#: ../../library/sqlite3.rst:1353 msgid "If *sql* contains more than one SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1355 +#: ../../library/sqlite3.rst:1356 msgid "" "If :attr:`~Connection.isolation_level` is not ``None``, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " @@ -1286,43 +1286,43 @@ msgid "" "*sql*." msgstr "" -#: ../../library/sqlite3.rst:1360 +#: ../../library/sqlite3.rst:1361 msgid "Use :meth:`executescript` to execute multiple SQL statements." msgstr "" -#: ../../library/sqlite3.rst:1364 +#: ../../library/sqlite3.rst:1365 msgid "" "For every item in *parameters*, repeatedly execute the :ref:`parameterized " "` :abbr:`DML (Data Manipulation Language)` SQL " "statement *sql*." msgstr "" -#: ../../library/sqlite3.rst:1368 +#: ../../library/sqlite3.rst:1369 msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1370 +#: ../../library/sqlite3.rst:1371 msgid "A single SQL DML statement." msgstr "" -#: ../../library/sqlite3.rst:1373 +#: ../../library/sqlite3.rst:1374 msgid "" "An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1379 +#: ../../library/sqlite3.rst:1380 msgid "" "If *sql* contains more than one SQL statement, or is not a DML statment." msgstr "" -#: ../../library/sqlite3.rst:1396 +#: ../../library/sqlite3.rst:1397 msgid "" "Any resulting rows are discarded, including DML statements with `RETURNING " "clauses`_." msgstr "" -#: ../../library/sqlite3.rst:1403 +#: ../../library/sqlite3.rst:1404 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " "transaction, an implicit ``COMMIT`` statement is executed first. No other " @@ -1330,24 +1330,24 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1409 +#: ../../library/sqlite3.rst:1410 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1427 +#: ../../library/sqlite3.rst:1428 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1435 +#: ../../library/sqlite3.rst:1436 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1438 +#: ../../library/sqlite3.rst:1439 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1355,7 +1355,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1444 +#: ../../library/sqlite3.rst:1445 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1363,36 +1363,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1451 +#: ../../library/sqlite3.rst:1452 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1458 +#: ../../library/sqlite3.rst:1459 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1460 +#: ../../library/sqlite3.rst:1461 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." msgstr "" -#: ../../library/sqlite3.rst:1465 ../../library/sqlite3.rst:1469 +#: ../../library/sqlite3.rst:1466 ../../library/sqlite3.rst:1470 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1473 +#: ../../library/sqlite3.rst:1474 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." msgstr "" -#: ../../library/sqlite3.rst:1478 +#: ../../library/sqlite3.rst:1479 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1400,18 +1400,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1492 +#: ../../library/sqlite3.rst:1493 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1496 +#: ../../library/sqlite3.rst:1497 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1500 +#: ../../library/sqlite3.rst:1501 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1421,15 +1421,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1508 +#: ../../library/sqlite3.rst:1509 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1510 +#: ../../library/sqlite3.rst:1511 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1515 +#: ../../library/sqlite3.rst:1516 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1439,7 +1439,7 @@ msgid "" "resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: ../../library/sqlite3.rst:1526 +#: ../../library/sqlite3.rst:1527 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1448,18 +1448,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1533 +#: ../../library/sqlite3.rst:1534 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." msgstr "" -#: ../../library/sqlite3.rst:1549 +#: ../../library/sqlite3.rst:1550 msgid "Row objects" msgstr "" -#: ../../library/sqlite3.rst:1553 +#: ../../library/sqlite3.rst:1554 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1467,28 +1467,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1558 +#: ../../library/sqlite3.rst:1559 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1565 +#: ../../library/sqlite3.rst:1566 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`." msgstr "" -#: ../../library/sqlite3.rst:1569 +#: ../../library/sqlite3.rst:1570 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:1576 +#: ../../library/sqlite3.rst:1577 msgid "Blob objects" msgstr "" -#: ../../library/sqlite3.rst:1582 +#: ../../library/sqlite3.rst:1583 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:" @@ -1496,24 +1496,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1587 +#: ../../library/sqlite3.rst:1588 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1617 +#: ../../library/sqlite3.rst:1618 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1619 +#: ../../library/sqlite3.rst:1620 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." msgstr "" -#: ../../library/sqlite3.rst:1625 +#: ../../library/sqlite3.rst:1626 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)` " @@ -1521,18 +1521,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1633 +#: ../../library/sqlite3.rst:1634 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`." msgstr "" -#: ../../library/sqlite3.rst:1639 +#: ../../library/sqlite3.rst:1640 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1643 +#: ../../library/sqlite3.rst:1644 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :data:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1540,26 +1540,26 @@ msgid "" "position) and :data:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1651 +#: ../../library/sqlite3.rst:1652 msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:1655 +#: ../../library/sqlite3.rst:1656 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1663 +#: ../../library/sqlite3.rst:1664 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1665 +#: ../../library/sqlite3.rst:1666 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1669 +#: ../../library/sqlite3.rst:1670 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1567,39 +1567,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1676 +#: ../../library/sqlite3.rst:1677 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1680 +#: ../../library/sqlite3.rst:1681 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1685 +#: ../../library/sqlite3.rst:1686 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1692 +#: ../../library/sqlite3.rst:1693 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1699 +#: ../../library/sqlite3.rst:1700 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1706 +#: ../../library/sqlite3.rst:1707 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1607,14 +1607,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1713 +#: ../../library/sqlite3.rst:1714 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1719 +#: ../../library/sqlite3.rst:1720 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1622,20 +1622,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1727 +#: ../../library/sqlite3.rst:1728 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1732 +#: ../../library/sqlite3.rst:1733 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1739 +#: ../../library/sqlite3.rst:1740 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 " @@ -1643,7 +1643,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1746 +#: ../../library/sqlite3.rst:1747 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1652,78 +1652,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1756 +#: ../../library/sqlite3.rst:1757 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1758 +#: ../../library/sqlite3.rst:1759 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1761 +#: ../../library/sqlite3.rst:1762 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1764 ../../library/sqlite3.rst:1781 +#: ../../library/sqlite3.rst:1765 ../../library/sqlite3.rst:1782 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1764 ../../library/sqlite3.rst:1781 +#: ../../library/sqlite3.rst:1765 ../../library/sqlite3.rst:1782 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1766 ../../library/sqlite3.rst:1783 +#: ../../library/sqlite3.rst:1767 ../../library/sqlite3.rst:1784 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1766 ../../library/sqlite3.rst:1783 +#: ../../library/sqlite3.rst:1767 ../../library/sqlite3.rst:1784 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1768 ../../library/sqlite3.rst:1785 +#: ../../library/sqlite3.rst:1769 ../../library/sqlite3.rst:1786 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1768 ../../library/sqlite3.rst:1785 +#: ../../library/sqlite3.rst:1769 ../../library/sqlite3.rst:1786 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1770 ../../library/sqlite3.rst:1787 +#: ../../library/sqlite3.rst:1771 ../../library/sqlite3.rst:1788 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1770 ../../library/sqlite3.rst:1787 +#: ../../library/sqlite3.rst:1771 ../../library/sqlite3.rst:1788 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1772 +#: ../../library/sqlite3.rst:1773 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1772 ../../library/sqlite3.rst:1789 +#: ../../library/sqlite3.rst:1773 ../../library/sqlite3.rst:1790 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1774 ../../library/sqlite3.rst:1792 +#: ../../library/sqlite3.rst:1775 ../../library/sqlite3.rst:1793 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1774 ../../library/sqlite3.rst:1792 +#: ../../library/sqlite3.rst:1775 ../../library/sqlite3.rst:1793 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1778 +#: ../../library/sqlite3.rst:1779 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1789 +#: ../../library/sqlite3.rst:1790 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1795 +#: ../../library/sqlite3.rst:1796 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1732,42 +1732,42 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1805 +#: ../../library/sqlite3.rst:1806 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1807 +#: ../../library/sqlite3.rst:1808 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1810 +#: ../../library/sqlite3.rst:1811 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1814 +#: ../../library/sqlite3.rst:1815 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1818 +#: ../../library/sqlite3.rst:1819 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1822 +#: ../../library/sqlite3.rst:1823 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1828 +#: ../../library/sqlite3.rst:1829 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1775,15 +1775,15 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1837 +#: ../../library/sqlite3.rst:1838 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:1842 +#: ../../library/sqlite3.rst:1843 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:1844 +#: ../../library/sqlite3.rst:1845 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1791,7 +1791,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:1857 +#: ../../library/sqlite3.rst:1858 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1799,7 +1799,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:1862 +#: ../../library/sqlite3.rst:1863 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -1810,24 +1810,24 @@ msgid "" "are ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1899 +#: ../../library/sqlite3.rst:1900 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:1906 +#: ../../library/sqlite3.rst:1907 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1908 +#: ../../library/sqlite3.rst:1909 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1912 +#: ../../library/sqlite3.rst:1913 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1837,11 +1837,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1924 +#: ../../library/sqlite3.rst:1925 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1926 +#: ../../library/sqlite3.rst:1927 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1851,84 +1851,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1957 +#: ../../library/sqlite3.rst:1958 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1959 +#: ../../library/sqlite3.rst:1960 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1989 +#: ../../library/sqlite3.rst:1990 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1991 +#: ../../library/sqlite3.rst:1992 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1996 +#: ../../library/sqlite3.rst:1997 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1999 +#: ../../library/sqlite3.rst:2000 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:2004 +#: ../../library/sqlite3.rst:2005 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2013 +#: ../../library/sqlite3.rst:2014 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:2017 +#: ../../library/sqlite3.rst:2018 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2018 +#: ../../library/sqlite3.rst:2019 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2019 +#: ../../library/sqlite3.rst:2020 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2023 +#: ../../library/sqlite3.rst:2024 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2074 +#: ../../library/sqlite3.rst:2075 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2076 +#: ../../library/sqlite3.rst:2077 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2138 +#: ../../library/sqlite3.rst:2139 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2140 +#: ../../library/sqlite3.rst:2141 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1940,11 +1940,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2181 +#: ../../library/sqlite3.rst:2182 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2183 +#: ../../library/sqlite3.rst:2184 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1954,58 +1954,58 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2192 +#: ../../library/sqlite3.rst:2193 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2197 +#: ../../library/sqlite3.rst:2198 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2230 +#: ../../library/sqlite3.rst:2231 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2232 +#: ../../library/sqlite3.rst:2233 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2234 +#: ../../library/sqlite3.rst:2235 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2243 +#: ../../library/sqlite3.rst:2244 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2253 +#: ../../library/sqlite3.rst:2254 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2267 +#: ../../library/sqlite3.rst:2268 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2276 +#: ../../library/sqlite3.rst:2277 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2278 +#: ../../library/sqlite3.rst:2279 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`." msgstr "" -#: ../../library/sqlite3.rst:2283 +#: ../../library/sqlite3.rst:2284 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -2013,7 +2013,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2288 +#: ../../library/sqlite3.rst:2289 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -2021,51 +2021,51 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2298 +#: ../../library/sqlite3.rst:2299 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2313 +#: ../../library/sqlite3.rst:2314 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2322 +#: ../../library/sqlite3.rst:2323 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2332 +#: ../../library/sqlite3.rst:2333 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2343 +#: ../../library/sqlite3.rst:2344 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2358 +#: ../../library/sqlite3.rst:2359 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`." msgstr "" -#: ../../library/sqlite3.rst:2366 +#: ../../library/sqlite3.rst:2367 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2371 +#: ../../library/sqlite3.rst:2372 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2373 +#: ../../library/sqlite3.rst:2374 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2376 +#: ../../library/sqlite3.rst:2377 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2079,7 +2079,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2389 +#: ../../library/sqlite3.rst:2390 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2089,27 +2089,27 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2397 +#: ../../library/sqlite3.rst:2398 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2401 +#: ../../library/sqlite3.rst:2402 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1333 +#: ../../library/sqlite3.rst:1334 msgid "? (question mark)" msgstr "" -#: ../../library/sqlite3.rst:1333 ../../library/sqlite3.rst:1334 +#: ../../library/sqlite3.rst:1334 ../../library/sqlite3.rst:1335 msgid "in SQL statements" msgstr "" -#: ../../library/sqlite3.rst:1334 +#: ../../library/sqlite3.rst:1335 msgid ": (colon)" msgstr "" From 2d36685f53f9ff6134f73cd01f3ba16ae60f5dcc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 27 Jun 2023 00:40:56 +0000 Subject: [PATCH 115/130] sync with cpython 97cf0291 --- library/dataclasses.po | 4 +- library/typing.po | 1040 ++++++++++++++++++++-------------------- 2 files changed, 522 insertions(+), 522 deletions(-) diff --git a/library/dataclasses.po b/library/dataclasses.po index 2c919350d3..02e585e205 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-25 00:30+0000\n" +"POT-Creation-Date: 2023-06-27 00:38+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -798,7 +798,7 @@ msgid "" "dataclasses just use normal Python class creation they also share this " "behavior. There is no general way for Data Classes to detect this " "condition. Instead, the :func:`dataclass` decorator will raise a :exc:" -"`TypeError` if it detects an unhashable default parameter. The assumption " +"`ValueError` if it detects an unhashable default parameter. The assumption " "is that if a value is unhashable, it is mutable. This is a partial " "solution, but it does protect against many common errors." msgstr "" diff --git a/library/typing.po b/library/typing.po index b33d5e2cbb..7fbe9495a1 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-24 00:39+0000\n" +"POT-Creation-Date: 2023-06-27 00:38+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -368,7 +368,7 @@ msgid "" "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:254 ../../library/typing.rst:2682 +#: ../../library/typing.rst:254 ../../library/typing.rst:2679 #, fuzzy msgid "For example:" msgstr "" @@ -383,7 +383,7 @@ msgid "" "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:276 ../../library/typing.rst:962 +#: ../../library/typing.rst:276 ../../library/typing.rst:1008 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -394,7 +394,7 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:284 ../../library/typing.rst:974 +#: ../../library/typing.rst:284 ../../library/typing.rst:1020 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -458,67 +458,95 @@ msgid "" msgstr "" #: ../../library/typing.rst:392 -msgid "User-defined generic types" +msgid "The type of class objects" msgstr "" #: ../../library/typing.rst:394 -msgid "A user-defined class can be defined as a generic class." +msgid "" +"A variable annotated with ``C`` may accept a value of type ``C``. In " +"contrast, a variable annotated with ``type[C]`` (or :class:`typing.Type[C] " +"`) may accept values that are classes themselves -- specifically, it " +"will accept the *class object* of ``C``. For example::" +msgstr "" + +#: ../../library/typing.rst:404 +msgid "Note that ``type[C]`` is covariant::" msgstr "" #: ../../library/typing.rst:420 msgid "" +"The only legal parameters for :class:`type` are classes, :data:`Any`, :ref:" +"`type variables `, and unions of any of these types. For example::" +msgstr "" + +#: ../../library/typing.rst:432 +msgid "" +"``type[Any]`` is equivalent to :class:`type`, which is the root of Python's :" +"ref:`metaclass hierarchy `." +msgstr "" + +#: ../../library/typing.rst:438 +msgid "User-defined generic types" +msgstr "" + +#: ../../library/typing.rst:440 +msgid "A user-defined class can be defined as a generic class." +msgstr "" + +#: ../../library/typing.rst:466 +msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:424 +#: ../../library/typing.rst:470 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[T]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:433 +#: ../../library/typing.rst:479 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:445 +#: ../../library/typing.rst:491 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:456 +#: ../../library/typing.rst:502 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:466 +#: ../../library/typing.rst:512 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:476 +#: ../../library/typing.rst:522 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:478 +#: ../../library/typing.rst:524 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``:" msgstr "" -#: ../../library/typing.rst:489 +#: ../../library/typing.rst:535 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:506 +#: ../../library/typing.rst:552 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:509 +#: ../../library/typing.rst:555 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -528,7 +556,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:525 +#: ../../library/typing.rst:571 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -536,20 +564,20 @@ msgid "" "converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:537 +#: ../../library/typing.rst:583 msgid "" "Note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:541 +#: ../../library/typing.rst:587 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:545 +#: ../../library/typing.rst:591 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -557,24 +585,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:552 +#: ../../library/typing.rst:598 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:554 +#: ../../library/typing.rst:600 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:558 +#: ../../library/typing.rst:604 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:576 +#: ../../library/typing.rst:622 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -583,19 +611,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:582 +#: ../../library/typing.rst:628 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:595 +#: ../../library/typing.rst:641 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:598 +#: ../../library/typing.rst:644 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -603,7 +631,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:603 +#: ../../library/typing.rst:649 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -611,24 +639,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:625 +#: ../../library/typing.rst:671 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:630 +#: ../../library/typing.rst:676 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:632 +#: ../../library/typing.rst:678 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:636 +#: ../../library/typing.rst:682 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -637,7 +665,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:649 +#: ../../library/typing.rst:695 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -646,85 +674,85 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:665 +#: ../../library/typing.rst:711 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:670 +#: ../../library/typing.rst:716 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:672 +#: ../../library/typing.rst:718 msgid "" "The ``typing`` module defines the following classes, functions and " "decorators." msgstr "" -#: ../../library/typing.rst:675 +#: ../../library/typing.rst:721 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:678 +#: ../../library/typing.rst:724 msgid "Special types" msgstr "" -#: ../../library/typing.rst:680 +#: ../../library/typing.rst:726 msgid "" "These can be used as types in annotations. They do not support subscription " "using ``[]``." msgstr "" -#: ../../library/typing.rst:685 +#: ../../library/typing.rst:731 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:687 +#: ../../library/typing.rst:733 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:688 +#: ../../library/typing.rst:734 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:690 +#: ../../library/typing.rst:736 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:697 +#: ../../library/typing.rst:743 msgid "A :ref:`constrained type variable `." msgstr "" -#: ../../library/typing.rst:699 +#: ../../library/typing.rst:745 msgid "Definition::" msgstr "" -#: ../../library/typing.rst:703 +#: ../../library/typing.rst:749 msgid "" "``AnyStr`` is meant to be used for functions that may accept :class:`str` " "or :class:`bytes` arguments but cannot allow the two to mix." msgstr "" -#: ../../library/typing.rst:706 ../../library/typing.rst:782 -#: ../../library/typing.rst:802 ../../library/typing.rst:848 -#: ../../library/typing.rst:1095 ../../library/typing.rst:1152 -#: ../../library/typing.rst:1360 ../../library/typing.rst:2522 +#: ../../library/typing.rst:752 ../../library/typing.rst:828 +#: ../../library/typing.rst:848 ../../library/typing.rst:894 +#: ../../library/typing.rst:1092 ../../library/typing.rst:1149 +#: ../../library/typing.rst:1357 ../../library/typing.rst:2519 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:717 +#: ../../library/typing.rst:763 msgid "Special type that includes only literal strings." msgstr "" -#: ../../library/typing.rst:719 +#: ../../library/typing.rst:765 msgid "" "Any string literal is compatible with ``LiteralString``, as is another " "``LiteralString``. However, an object typed as just ``str`` is not. A string " @@ -732,7 +760,7 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:725 +#: ../../library/typing.rst:771 #, fuzzy msgid "Example:" msgstr "" @@ -740,7 +768,7 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:741 +#: ../../library/typing.rst:787 msgid "" "``LiteralString`` is useful for sensitive APIs where arbitrary user-" "generated strings could generate problems. For example, the two cases above " @@ -748,33 +776,33 @@ msgid "" "attack." msgstr "" -#: ../../library/typing.rst:746 +#: ../../library/typing.rst:792 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:752 +#: ../../library/typing.rst:798 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:755 +#: ../../library/typing.rst:801 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:775 +#: ../../library/typing.rst:821 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:780 +#: ../../library/typing.rst:826 msgid "Special type indicating that a function never returns." msgstr "" -#: ../../library/typing.rst:789 +#: ../../library/typing.rst:835 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -782,127 +810,127 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:800 +#: ../../library/typing.rst:846 msgid "Special type to represent the current enclosed class." msgstr "" -#: ../../library/typing.rst:812 +#: ../../library/typing.rst:858 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:824 +#: ../../library/typing.rst:870 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:831 +#: ../../library/typing.rst:877 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:834 +#: ../../library/typing.rst:880 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:836 +#: ../../library/typing.rst:882 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:838 +#: ../../library/typing.rst:884 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:840 +#: ../../library/typing.rst:886 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:846 +#: ../../library/typing.rst:892 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: ../../library/typing.rst:854 +#: ../../library/typing.rst:900 msgid "" "``TypeAlias`` is particularly useful for annotating aliases that make use of " "forward references, as it can be hard for type checkers to distinguish these " "from normal variable assignments:" msgstr "" -#: ../../library/typing.rst:874 +#: ../../library/typing.rst:920 #, fuzzy msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:879 +#: ../../library/typing.rst:925 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:881 +#: ../../library/typing.rst:927 msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." msgstr "" -#: ../../library/typing.rst:886 +#: ../../library/typing.rst:932 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:888 +#: ../../library/typing.rst:934 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:890 +#: ../../library/typing.rst:936 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:892 +#: ../../library/typing.rst:938 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:896 +#: ../../library/typing.rst:942 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:900 +#: ../../library/typing.rst:946 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:904 +#: ../../library/typing.rst:950 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:908 +#: ../../library/typing.rst:954 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:910 +#: ../../library/typing.rst:956 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:912 +#: ../../library/typing.rst:958 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:915 +#: ../../library/typing.rst:961 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:921 +#: ../../library/typing.rst:967 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:923 +#: ../../library/typing.rst:969 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -910,30 +938,30 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:931 +#: ../../library/typing.rst:977 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:938 +#: ../../library/typing.rst:984 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:944 +#: ../../library/typing.rst:990 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "" -#: ../../library/typing.rst:946 +#: ../../library/typing.rst:992 msgid "" "``Callable[[int], str]`` signifies a function that takes a single parameter " "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:949 +#: ../../library/typing.rst:995 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " @@ -941,7 +969,7 @@ msgid "" "type must be a single type." msgstr "" -#: ../../library/typing.rst:954 +#: ../../library/typing.rst:1000 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -951,23 +979,23 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:970 +#: ../../library/typing.rst:1016 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:979 +#: ../../library/typing.rst:1025 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:984 +#: ../../library/typing.rst:1030 msgid "Special form for annotating higher-order functions." msgstr "" -#: ../../library/typing.rst:986 +#: ../../library/typing.rst:1032 msgid "" "``Concatenate`` can be used in conjunction with :data:`Callable` and :class:" "`ParamSpec` to annotate a higher-order callable which adds, removes, or " @@ -978,7 +1006,7 @@ msgid "" "`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:995 +#: ../../library/typing.rst:1041 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -989,78 +1017,34 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1034 ../../library/typing.rst:1739 +#: ../../library/typing.rst:1080 ../../library/typing.rst:1736 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:1036 +#: ../../library/typing.rst:1082 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:1041 -msgid "Deprecated alias to :class:`type`." -msgstr "" - -#: ../../library/typing.rst:1043 -msgid "" -"A variable annotated with ``C`` may accept a value of type ``C``. In " -"contrast, a variable annotated with ``type[C]`` or ``Type[C]`` may accept " -"values that are classes themselves -- specifically, it will accept the " -"*class object* of ``C``. For example::" -msgstr "" - -#: ../../library/typing.rst:1052 -msgid "Note that ``Type[C]`` is covariant::" -msgstr "" - -#: ../../library/typing.rst:1064 -msgid "" -"The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " -"should implement the same constructor signature and class method signatures " -"as ``C``. The type checker should flag violations of this, but should also " -"allow constructor calls in subclasses that match the constructor calls in " -"the indicated base class. How the type checker is required to handle this " -"particular case may change in future revisions of :pep:`484`." -msgstr "" - -#: ../../library/typing.rst:1072 -msgid "" -"The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" -"`type variables `, and unions of any of these types. For example::" -msgstr "" - -#: ../../library/typing.rst:1078 -msgid "" -"``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " -"``type``, which is the root of Python's metaclass hierarchy." -msgstr "" - -#: ../../library/typing.rst:1083 -msgid "" -":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" -"`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1089 +#: ../../library/typing.rst:1086 msgid "Special typing form to define \"literal types\"." msgstr "" -#: ../../library/typing.rst:1091 +#: ../../library/typing.rst:1088 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" -#: ../../library/typing.rst:1107 +#: ../../library/typing.rst:1104 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:1113 +#: ../../library/typing.rst:1110 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1068,22 +1052,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1121 +#: ../../library/typing.rst:1118 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1123 +#: ../../library/typing.rst:1120 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1131 +#: ../../library/typing.rst:1128 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1133 +#: ../../library/typing.rst:1130 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1091,48 +1075,48 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1147 +#: ../../library/typing.rst:1144 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: ../../library/typing.rst:1149 +#: ../../library/typing.rst:1146 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1163 ../../library/typing.rst:2538 +#: ../../library/typing.rst:1160 ../../library/typing.rst:2535 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1170 +#: ../../library/typing.rst:1167 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: ../../library/typing.rst:1172 +#: ../../library/typing.rst:1169 #, fuzzy msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1179 +#: ../../library/typing.rst:1176 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: ../../library/typing.rst:1182 +#: ../../library/typing.rst:1179 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1188 +#: ../../library/typing.rst:1185 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1190 +#: ../../library/typing.rst:1187 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1140,7 +1124,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1195 +#: ../../library/typing.rst:1192 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1149,7 +1133,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1201 +#: ../../library/typing.rst:1198 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1159,7 +1143,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1208 +#: ../../library/typing.rst:1205 msgid "" "The responsibility of how to interpret the metadata lies with the the tool " "or library encountering an ``Annotated`` annotation. A tool or library " @@ -1167,64 +1151,64 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1216 +#: ../../library/typing.rst:1213 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1229 +#: ../../library/typing.rst:1226 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1231 +#: ../../library/typing.rst:1228 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1233 +#: ../../library/typing.rst:1230 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1242 +#: ../../library/typing.rst:1239 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1246 +#: ../../library/typing.rst:1243 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1249 +#: ../../library/typing.rst:1246 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1256 +#: ../../library/typing.rst:1253 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1263 +#: ../../library/typing.rst:1260 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1269 +#: ../../library/typing.rst:1266 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1282 +#: ../../library/typing.rst:1279 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1286 +#: ../../library/typing.rst:1283 #, fuzzy msgid "This would be equivalent to::" msgstr "" @@ -1232,44 +1216,44 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:1290 +#: ../../library/typing.rst:1287 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1293 +#: ../../library/typing.rst:1290 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1306 +#: ../../library/typing.rst:1303 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1320 +#: ../../library/typing.rst:1317 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1321 +#: ../../library/typing.rst:1318 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1328 +#: ../../library/typing.rst:1325 msgid "Special typing construct for marking user-defined type guard functions." msgstr "" -#: ../../library/typing.rst:1330 +#: ../../library/typing.rst:1327 msgid "" "``TypeGuard`` can be used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1334 +#: ../../library/typing.rst:1331 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1278,44 +1262,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1349 +#: ../../library/typing.rst:1346 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1353 +#: ../../library/typing.rst:1350 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1356 +#: ../../library/typing.rst:1353 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1357 +#: ../../library/typing.rst:1354 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1374 +#: ../../library/typing.rst:1371 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1378 +#: ../../library/typing.rst:1375 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1384 +#: ../../library/typing.rst:1381 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1324,24 +1308,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1390 +#: ../../library/typing.rst:1387 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1397 +#: ../../library/typing.rst:1394 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1399 +#: ../../library/typing.rst:1396 msgid "" "For example, using the unpack operator ``*`` on a :class:`type variable " "tuple ` is equivalent to using ``Unpack`` to mark the type " "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1408 +#: ../../library/typing.rst:1405 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1349,45 +1333,45 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1425 +#: ../../library/typing.rst:1422 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1427 +#: ../../library/typing.rst:1424 msgid "" "The following classes should not be used directly as annotations. Their " "intended purpose is to be building blocks for creating generic types." msgstr "" -#: ../../library/typing.rst:1433 +#: ../../library/typing.rst:1430 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1435 +#: ../../library/typing.rst:1432 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1444 +#: ../../library/typing.rst:1441 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1457 +#: ../../library/typing.rst:1454 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1459 ../../library/typing.rst:1554 -#: ../../library/typing.rst:1664 ../../library/typing.rst:1777 -#: ../../library/typing.rst:1848 ../../library/typing.rst:2722 +#: ../../library/typing.rst:1456 ../../library/typing.rst:1551 +#: ../../library/typing.rst:1661 ../../library/typing.rst:1774 +#: ../../library/typing.rst:1845 ../../library/typing.rst:2719 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1465 +#: ../../library/typing.rst:1462 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1395,69 +1379,69 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1486 +#: ../../library/typing.rst:1483 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1489 +#: ../../library/typing.rst:1486 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " "details. By default, type variables are invariant." msgstr "" -#: ../../library/typing.rst:1493 +#: ../../library/typing.rst:1490 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1508 +#: ../../library/typing.rst:1505 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1516 +#: ../../library/typing.rst:1513 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1527 +#: ../../library/typing.rst:1524 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1531 +#: ../../library/typing.rst:1528 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1535 +#: ../../library/typing.rst:1532 msgid "Whether the type var has been marked as covariant." msgstr "" -#: ../../library/typing.rst:1539 +#: ../../library/typing.rst:1536 msgid "Whether the type var has been marked as contravariant." msgstr "" -#: ../../library/typing.rst:1543 +#: ../../library/typing.rst:1540 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1547 +#: ../../library/typing.rst:1544 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1551 +#: ../../library/typing.rst:1548 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1562 +#: ../../library/typing.rst:1559 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1465,7 +1449,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1584 +#: ../../library/typing.rst:1581 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1475,36 +1459,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1592 +#: ../../library/typing.rst:1589 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1599 +#: ../../library/typing.rst:1596 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1608 +#: ../../library/typing.rst:1605 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1627 +#: ../../library/typing.rst:1624 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1634 +#: ../../library/typing.rst:1631 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1644 +#: ../../library/typing.rst:1641 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1513,21 +1497,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1651 +#: ../../library/typing.rst:1648 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1655 +#: ../../library/typing.rst:1652 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1661 +#: ../../library/typing.rst:1658 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1668 +#: ../../library/typing.rst:1665 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1537,7 +1521,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1675 +#: ../../library/typing.rst:1672 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1545,27 +1529,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1699 +#: ../../library/typing.rst:1696 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1703 +#: ../../library/typing.rst:1700 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1705 +#: ../../library/typing.rst:1702 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1712 +#: ../../library/typing.rst:1709 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1578,11 +1562,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1724 +#: ../../library/typing.rst:1721 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1726 +#: ../../library/typing.rst:1723 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1591,17 +1575,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1735 +#: ../../library/typing.rst:1732 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1741 +#: ../../library/typing.rst:1738 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1746 +#: ../../library/typing.rst:1743 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1609,45 +1593,45 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1751 +#: ../../library/typing.rst:1748 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1767 +#: ../../library/typing.rst:1764 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1769 +#: ../../library/typing.rst:1766 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:1775 +#: ../../library/typing.rst:1772 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1783 +#: ../../library/typing.rst:1780 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1787 +#: ../../library/typing.rst:1784 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1796 +#: ../../library/typing.rst:1793 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1798 +#: ../../library/typing.rst:1795 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1656,83 +1640,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1804 +#: ../../library/typing.rst:1801 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1814 +#: ../../library/typing.rst:1811 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1820 +#: ../../library/typing.rst:1817 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1824 +#: ../../library/typing.rst:1821 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1827 +#: ../../library/typing.rst:1824 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1830 +#: ../../library/typing.rst:1827 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1834 +#: ../../library/typing.rst:1831 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1838 +#: ../../library/typing.rst:1835 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1843 +#: ../../library/typing.rst:1840 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:1845 +#: ../../library/typing.rst:1842 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:1855 +#: ../../library/typing.rst:1852 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1859 +#: ../../library/typing.rst:1856 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1863 +#: ../../library/typing.rst:1860 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1867 +#: ../../library/typing.rst:1864 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1872 +#: ../../library/typing.rst:1869 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:1874 +#: ../../library/typing.rst:1871 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1880 +#: ../../library/typing.rst:1877 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1892 +#: ../../library/typing.rst:1889 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1740,15 +1724,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1897 +#: ../../library/typing.rst:1894 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1909 +#: ../../library/typing.rst:1906 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1911 +#: ../../library/typing.rst:1908 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1757,7 +1741,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1931 +#: ../../library/typing.rst:1928 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1768,7 +1752,7 @@ msgid "" "SSLObject`." msgstr "" -#: ../../library/typing.rst:1942 +#: ../../library/typing.rst:1939 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1776,13 +1760,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:1950 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1956 +#: ../../library/typing.rst:1953 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1790,53 +1774,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1972 +#: ../../library/typing.rst:1969 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1976 +#: ../../library/typing.rst:1973 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1980 +#: ../../library/typing.rst:1977 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1987 +#: ../../library/typing.rst:1984 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1988 +#: ../../library/typing.rst:1985 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:2000 +#: ../../library/typing.rst:1997 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:2011 +#: ../../library/typing.rst:2008 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2014 +#: ../../library/typing.rst:2011 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2024 +#: ../../library/typing.rst:2021 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1844,61 +1828,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2029 +#: ../../library/typing.rst:2026 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2044 +#: ../../library/typing.rst:2041 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:2051 +#: ../../library/typing.rst:2048 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2059 +#: ../../library/typing.rst:2056 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2077 +#: ../../library/typing.rst:2074 msgid "A ``TypedDict`` can be generic:" msgstr "" -#: ../../library/typing.rst:2087 +#: ../../library/typing.rst:2084 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2093 +#: ../../library/typing.rst:2090 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2115 +#: ../../library/typing.rst:2112 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2115 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2121 +#: ../../library/typing.rst:2118 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1907,133 +1891,133 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2144 +#: ../../library/typing.rst:2141 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2148 +#: ../../library/typing.rst:2145 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2152 +#: ../../library/typing.rst:2149 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2156 +#: ../../library/typing.rst:2153 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2158 +#: ../../library/typing.rst:2155 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2163 +#: ../../library/typing.rst:2160 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2168 +#: ../../library/typing.rst:2165 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2172 +#: ../../library/typing.rst:2169 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2176 +#: ../../library/typing.rst:2173 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2180 +#: ../../library/typing.rst:2177 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2186 +#: ../../library/typing.rst:2183 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2190 +#: ../../library/typing.rst:2187 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2194 +#: ../../library/typing.rst:2191 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2200 +#: ../../library/typing.rst:2197 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2206 +#: ../../library/typing.rst:2203 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2210 +#: ../../library/typing.rst:2207 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2212 +#: ../../library/typing.rst:2209 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2219 +#: ../../library/typing.rst:2216 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2221 +#: ../../library/typing.rst:2218 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2224 +#: ../../library/typing.rst:2221 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2231 +#: ../../library/typing.rst:2228 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2245 +#: ../../library/typing.rst:2242 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2247 +#: ../../library/typing.rst:2244 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2258 +#: ../../library/typing.rst:2255 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2263 +#: ../../library/typing.rst:2260 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2043,59 +2027,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2268 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2274 +#: ../../library/typing.rst:2271 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2282 +#: ../../library/typing.rst:2279 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2284 +#: ../../library/typing.rst:2281 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2290 +#: ../../library/typing.rst:2287 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2293 +#: ../../library/typing.rst:2290 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2298 +#: ../../library/typing.rst:2295 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2303 +#: ../../library/typing.rst:2300 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2315 +#: ../../library/typing.rst:2312 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2318 +#: ../../library/typing.rst:2315 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2104,19 +2088,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2325 +#: ../../library/typing.rst:2322 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2341 +#: ../../library/typing.rst:2338 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2350 +#: ../../library/typing.rst:2347 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2361 +#: ../../library/typing.rst:2358 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2492 +#: ../../library/typing.rst:2489 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2321,32 +2305,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2499 +#: ../../library/typing.rst:2496 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2507 +#: ../../library/typing.rst:2504 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2509 +#: ../../library/typing.rst:2506 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2516 +#: ../../library/typing.rst:2513 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2518 +#: ../../library/typing.rst:2515 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2543 +#: ../../library/typing.rst:2540 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2356,11 +2340,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2554 +#: ../../library/typing.rst:2551 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2556 +#: ../../library/typing.rst:2553 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2368,48 +2352,48 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2562 +#: ../../library/typing.rst:2559 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2566 +#: ../../library/typing.rst:2563 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2568 +#: ../../library/typing.rst:2565 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2573 +#: ../../library/typing.rst:2570 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2575 +#: ../../library/typing.rst:2572 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2586 +#: ../../library/typing.rst:2583 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2590 +#: ../../library/typing.rst:2587 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2594 +#: ../../library/typing.rst:2591 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2597 +#: ../../library/typing.rst:2594 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2418,41 +2402,41 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2603 +#: ../../library/typing.rst:2600 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example:" msgstr "" -#: ../../library/typing.rst:2620 +#: ../../library/typing.rst:2617 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2625 +#: ../../library/typing.rst:2622 #, fuzzy msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2629 +#: ../../library/typing.rst:2626 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2636 +#: ../../library/typing.rst:2633 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2639 +#: ../../library/typing.rst:2636 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2460,7 +2444,7 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2645 ../../library/typing.rst:2668 +#: ../../library/typing.rst:2642 ../../library/typing.rst:2665 #, fuzzy msgid "Examples:" msgstr "" @@ -2468,13 +2452,13 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2657 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2663 +#: ../../library/typing.rst:2660 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2482,40 +2466,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:2680 +#: ../../library/typing.rst:2677 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2701 +#: ../../library/typing.rst:2698 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:2703 +#: ../../library/typing.rst:2700 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2708 +#: ../../library/typing.rst:2705 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2715 +#: ../../library/typing.rst:2712 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2719 +#: ../../library/typing.rst:2716 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:2730 +#: ../../library/typing.rst:2727 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2523,7 +2507,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2737 +#: ../../library/typing.rst:2734 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2531,12 +2515,12 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2748 +#: ../../library/typing.rst:2745 #, fuzzy msgid "Deprecated aliases" msgstr "棄用於" -#: ../../library/typing.rst:2750 +#: ../../library/typing.rst:2747 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2545,7 +2529,7 @@ msgid "" "existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:2756 +#: ../../library/typing.rst:2753 msgid "" "The redundant types are deprecated as of Python 3.9 but no deprecation " "warnings are issued by the interpreter. It is expected that type checkers " @@ -2553,7 +2537,7 @@ msgid "" "or newer." msgstr "" -#: ../../library/typing.rst:2761 +#: ../../library/typing.rst:2758 msgid "" "The deprecated types will be removed from the :mod:`typing` module no sooner " "than the first Python version released 5 years after the release of Python " @@ -2561,160 +2545,176 @@ msgid "" "Collections*." msgstr "" -#: ../../library/typing.rst:2768 +#: ../../library/typing.rst:2765 msgid "Aliases to built-in types" msgstr "" -#: ../../library/typing.rst:2772 +#: ../../library/typing.rst:2769 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2774 +#: ../../library/typing.rst:2771 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2778 ../../library/typing.rst:3005 +#: ../../library/typing.rst:2775 ../../library/typing.rst:3015 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2783 +#: ../../library/typing.rst:2780 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2789 +#: ../../library/typing.rst:2786 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2791 +#: ../../library/typing.rst:2788 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2795 +#: ../../library/typing.rst:2792 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2805 +#: ../../library/typing.rst:2802 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2811 +#: ../../library/typing.rst:2808 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2813 +#: ../../library/typing.rst:2810 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2817 +#: ../../library/typing.rst:2814 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2823 +#: ../../library/typing.rst:2820 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2825 +#: ../../library/typing.rst:2822 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2832 +#: ../../library/typing.rst:2829 msgid "Deprecated alias for :class:`tuple`." msgstr "" -#: ../../library/typing.rst:2834 +#: ../../library/typing.rst:2831 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:2837 +#: ../../library/typing.rst:2834 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2844 +#: ../../library/typing.rst:2840 +msgid "Deprecated alias to :class:`type`." +msgstr "" + +#: ../../library/typing.rst:2842 +msgid "" +"See :ref:`type-of-class-objects` for details on using :class:`type` or " +"``typing.Type`` in type annotations." +msgstr "" + +#: ../../library/typing.rst:2847 +msgid "" +":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." +msgstr "" + +#: ../../library/typing.rst:2854 msgid "Aliases to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2848 +#: ../../library/typing.rst:2858 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2852 +#: ../../library/typing.rst:2862 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:2868 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:2872 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2878 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2873 +#: ../../library/typing.rst:2883 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2879 +#: ../../library/typing.rst:2889 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2884 +#: ../../library/typing.rst:2894 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2890 +#: ../../library/typing.rst:2900 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2895 +#: ../../library/typing.rst:2905 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2902 +#: ../../library/typing.rst:2912 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:2907 +#: ../../library/typing.rst:2917 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2910 +#: ../../library/typing.rst:2920 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2722,367 +2722,367 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2918 +#: ../../library/typing.rst:2928 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2919 +#: ../../library/typing.rst:2929 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2925 +#: ../../library/typing.rst:2935 msgid "Deprecated alias for :class:`str`." msgstr "" -#: ../../library/typing.rst:2927 +#: ../../library/typing.rst:2937 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:2931 +#: ../../library/typing.rst:2941 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2939 +#: ../../library/typing.rst:2949 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2949 +#: ../../library/typing.rst:2959 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2953 +#: ../../library/typing.rst:2963 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2955 +#: ../../library/typing.rst:2965 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2961 +#: ../../library/typing.rst:2971 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2965 +#: ../../library/typing.rst:2975 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2969 +#: ../../library/typing.rst:2979 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2973 +#: ../../library/typing.rst:2983 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2979 +#: ../../library/typing.rst:2989 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2981 +#: ../../library/typing.rst:2991 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2987 +#: ../../library/typing.rst:2997 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2989 +#: ../../library/typing.rst:2999 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2995 +#: ../../library/typing.rst:3005 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2997 +#: ../../library/typing.rst:3007 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3003 +#: ../../library/typing.rst:3013 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:3010 +#: ../../library/typing.rst:3020 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3016 +#: ../../library/typing.rst:3026 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:3018 +#: ../../library/typing.rst:3028 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3024 +#: ../../library/typing.rst:3034 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:3026 +#: ../../library/typing.rst:3036 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3033 +#: ../../library/typing.rst:3043 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:3035 +#: ../../library/typing.rst:3045 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3042 +#: ../../library/typing.rst:3052 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:3044 +#: ../../library/typing.rst:3054 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3050 +#: ../../library/typing.rst:3060 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:3052 +#: ../../library/typing.rst:3062 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3058 +#: ../../library/typing.rst:3068 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:3060 +#: ../../library/typing.rst:3070 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3067 +#: ../../library/typing.rst:3077 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3071 +#: ../../library/typing.rst:3081 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:3073 +#: ../../library/typing.rst:3083 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3084 +#: ../../library/typing.rst:3094 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3090 +#: ../../library/typing.rst:3100 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:3092 +#: ../../library/typing.rst:3102 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3101 +#: ../../library/typing.rst:3111 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:3105 +#: ../../library/typing.rst:3115 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3113 +#: ../../library/typing.rst:3123 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3123 +#: ../../library/typing.rst:3133 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3130 +#: ../../library/typing.rst:3140 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:3134 +#: ../../library/typing.rst:3144 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3140 +#: ../../library/typing.rst:3150 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:3144 +#: ../../library/typing.rst:3154 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3150 +#: ../../library/typing.rst:3160 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:3154 +#: ../../library/typing.rst:3164 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3161 +#: ../../library/typing.rst:3171 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3165 +#: ../../library/typing.rst:3175 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:3167 +#: ../../library/typing.rst:3177 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3173 +#: ../../library/typing.rst:3183 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3185 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3181 +#: ../../library/typing.rst:3191 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:3183 +#: ../../library/typing.rst:3193 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3192 +#: ../../library/typing.rst:3202 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:3196 +#: ../../library/typing.rst:3206 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3204 +#: ../../library/typing.rst:3214 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3212 +#: ../../library/typing.rst:3222 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3218 +#: ../../library/typing.rst:3228 msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:3222 +#: ../../library/typing.rst:3232 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:3224 +#: ../../library/typing.rst:3234 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3230 +#: ../../library/typing.rst:3240 msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:3235 +#: ../../library/typing.rst:3245 msgid "Aliases to :mod:`contextlib` ABCs" msgstr "" -#: ../../library/typing.rst:3239 +#: ../../library/typing.rst:3249 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3244 +#: ../../library/typing.rst:3254 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3251 +#: ../../library/typing.rst:3261 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3256 +#: ../../library/typing.rst:3266 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3262 +#: ../../library/typing.rst:3272 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3264 +#: ../../library/typing.rst:3274 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3090,76 +3090,76 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3269 +#: ../../library/typing.rst:3279 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3269 +#: ../../library/typing.rst:3279 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3269 +#: ../../library/typing.rst:3279 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3269 +#: ../../library/typing.rst:3279 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3271 +#: ../../library/typing.rst:3281 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3271 +#: ../../library/typing.rst:3281 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3271 +#: ../../library/typing.rst:3281 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3271 +#: ../../library/typing.rst:3281 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3274 +#: ../../library/typing.rst:3284 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3274 ../../library/typing.rst:3277 +#: ../../library/typing.rst:3284 ../../library/typing.rst:3287 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3274 ../../library/typing.rst:3279 +#: ../../library/typing.rst:3284 ../../library/typing.rst:3289 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3274 +#: ../../library/typing.rst:3284 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3277 +#: ../../library/typing.rst:3287 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3277 +#: ../../library/typing.rst:3287 msgid "3.14" msgstr "" -#: ../../library/typing.rst:3277 +#: ../../library/typing.rst:3287 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3289 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3289 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3289 msgid ":gh:`92332`" msgstr ":gh:`92332`" From 232b198295bdd8edb04e5ec718eb5ad990048a7c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 28 Jun 2023 00:40:31 +0000 Subject: [PATCH 116/130] sync with cpython fbb0151e --- library/ast.po | 442 ++++++++++++++++++++++---------------- library/decimal.po | 523 ++++++++++++++++++++++++--------------------- 2 files changed, 532 insertions(+), 433 deletions(-) diff --git a/library/ast.po b/library/ast.po index fb296d5d1b..c643da78ad 100644 --- a/library/ast.po +++ b/library/ast.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-27 00:32+0000\n" +"POT-Creation-Date: 2023-06-28 00:38+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-" @@ -176,11 +176,73 @@ msgid "" "readthedocs.io/en/latest/>`__ project and all its contributors." msgstr "" -#: ../../library/ast.rst:150 +#: ../../library/ast.rst:153 +msgid "Root nodes" +msgstr "" + +#: ../../library/ast.rst:157 +msgid "" +"A Python module, as with :ref:`file input `. Node type generated " +"by :func:`ast.parse` in the default ``\"exec\"`` *mode*." +msgstr "" + +#: ../../library/ast.rst:160 +msgid "*body* is a :class:`list` of the module's :ref:`ast-statements`." +msgstr "" + +#: ../../library/ast.rst:162 +msgid "" +"*type_ignores* is a :class:`list` of the module's type ignore comments; see :" +"func:`ast.parse` for more details." +msgstr "" + +#: ../../library/ast.rst:179 +msgid "" +"A single Python :ref:`expression input `. Node type " +"generated by :func:`ast.parse` when *mode* is ``\"eval\"``." +msgstr "" + +#: ../../library/ast.rst:182 +msgid "" +"*body* is a single node, one of the :ref:`expression types `." +msgstr "" + +#: ../../library/ast.rst:194 +msgid "" +"A single :ref:`interactive input `, like in :ref:`tut-interac`. " +"Node type generated by :func:`ast.parse` when *mode* is ``\"single\"``." +msgstr "" + +#: ../../library/ast.rst:197 +msgid "*body* is a :class:`list` of :ref:`statement nodes `." +msgstr "" + +#: ../../library/ast.rst:216 +msgid "" +"A representation of an old-style type comments for functions, as Python " +"versions prior to 3.5 didn't support :pep:`484` annotations. Node type " +"generated by :func:`ast.parse` when *mode* is ``\"func_type\"``." +msgstr "" + +#: ../../library/ast.rst:220 +msgid "Such type comments would look like this::" +msgstr "" + +#: ../../library/ast.rst:226 +msgid "" +"*argtypes* is a :class:`list` of :ref:`expression nodes `." +msgstr "" + +#: ../../library/ast.rst:228 +msgid "*returns* is a single :ref:`expression node `." +msgstr "" + +#: ../../library/ast.rst:246 msgid "Literals" msgstr "" -#: ../../library/ast.rst:154 +#: ../../library/ast.rst:250 msgid "" "A constant value. The ``value`` attribute of the ``Constant`` literal " "contains the Python object it represents. The values represented can be " @@ -189,106 +251,106 @@ msgid "" "constant." msgstr "" -#: ../../library/ast.rst:168 +#: ../../library/ast.rst:264 msgid "" "Node representing a single formatting field in an f-string. If the string " "contains a single formatting field and nothing else the node can be isolated " "otherwise it appears in :class:`JoinedStr`." msgstr "" -#: ../../library/ast.rst:172 +#: ../../library/ast.rst:268 msgid "" "``value`` is any expression node (such as a literal, a variable, or a " "function call)." msgstr "" -#: ../../library/ast.rst:174 +#: ../../library/ast.rst:270 msgid "``conversion`` is an integer:" msgstr "" -#: ../../library/ast.rst:176 +#: ../../library/ast.rst:272 msgid "-1: no formatting" msgstr "" -#: ../../library/ast.rst:177 +#: ../../library/ast.rst:273 msgid "115: ``!s`` string formatting" msgstr "" -#: ../../library/ast.rst:178 +#: ../../library/ast.rst:274 msgid "114: ``!r`` repr formatting" msgstr "" -#: ../../library/ast.rst:179 +#: ../../library/ast.rst:275 msgid "97: ``!a`` ascii formatting" msgstr "" -#: ../../library/ast.rst:181 +#: ../../library/ast.rst:277 msgid "" "``format_spec`` is a :class:`JoinedStr` node representing the formatting of " "the value, or ``None`` if no format was specified. Both ``conversion`` and " "``format_spec`` can be set at the same time." msgstr "" -#: ../../library/ast.rst:188 +#: ../../library/ast.rst:284 msgid "" "An f-string, comprising a series of :class:`FormattedValue` and :class:" "`Constant` nodes." msgstr "" -#: ../../library/ast.rst:217 +#: ../../library/ast.rst:313 msgid "" "A list or tuple. ``elts`` holds a list of nodes representing the elements. " "``ctx`` is :class:`Store` if the container is an assignment target (i.e. " "``(x,y)=something``), and :class:`Load` otherwise." msgstr "" -#: ../../library/ast.rst:243 +#: ../../library/ast.rst:339 msgid "A set. ``elts`` holds a list of nodes representing the set's elements." msgstr "" -#: ../../library/ast.rst:258 +#: ../../library/ast.rst:354 msgid "" "A dictionary. ``keys`` and ``values`` hold lists of nodes representing the " "keys and the values respectively, in matching order (what would be returned " "when calling :code:`dictionary.keys()` and :code:`dictionary.values()`)." msgstr "" -#: ../../library/ast.rst:262 +#: ../../library/ast.rst:358 msgid "" "When doing dictionary unpacking using dictionary literals the expression to " "be expanded goes in the ``values`` list, with a ``None`` at the " "corresponding position in ``keys``." msgstr "" -#: ../../library/ast.rst:280 +#: ../../library/ast.rst:376 msgid "Variables" msgstr "" -#: ../../library/ast.rst:284 +#: ../../library/ast.rst:380 msgid "" "A variable name. ``id`` holds the name as a string, and ``ctx`` is one of " "the following types." msgstr "" -#: ../../library/ast.rst:292 +#: ../../library/ast.rst:388 msgid "" "Variable references can be used to load the value of a variable, to assign a " "new value to it, or to delete it. Variable references are given a context to " "distinguish these cases." msgstr "" -#: ../../library/ast.rst:325 +#: ../../library/ast.rst:421 msgid "" "A ``*var`` variable reference. ``value`` holds the variable, typically a :" "class:`Name` node. This type must be used when building a :class:`Call` node " "with ``*args``." msgstr "" -#: ../../library/ast.rst:348 +#: ../../library/ast.rst:446 msgid "Expressions" msgstr "" -#: ../../library/ast.rst:352 +#: ../../library/ast.rst:450 msgid "" "When an expression, such as a function call, appears as a statement by " "itself with its return value not used or stored, it is wrapped in this " @@ -297,29 +359,29 @@ msgid "" "`YieldFrom` node." msgstr "" -#: ../../library/ast.rst:371 +#: ../../library/ast.rst:469 msgid "" "A unary operation. ``op`` is the operator, and ``operand`` any expression " "node." msgstr "" -#: ../../library/ast.rst:380 +#: ../../library/ast.rst:478 msgid "" "Unary operator tokens. :class:`Not` is the ``not`` keyword, :class:`Invert` " "is the ``~`` operator." msgstr "" -#: ../../library/ast.rst:394 +#: ../../library/ast.rst:492 msgid "" "A binary operation (like addition or division). ``op`` is the operator, and " "``left`` and ``right`` are any expression nodes." msgstr "" -#: ../../library/ast.rst:421 +#: ../../library/ast.rst:519 msgid "Binary operator tokens." msgstr "" -#: ../../library/ast.rst:426 +#: ../../library/ast.rst:524 msgid "" "A boolean operation, 'or' or 'and'. ``op`` is :class:`Or` or :class:`And`. " "``values`` are the values involved. Consecutive operations with the same " @@ -327,60 +389,60 @@ msgid "" "values." msgstr "" -#: ../../library/ast.rst:431 +#: ../../library/ast.rst:529 msgid "This doesn't include ``not``, which is a :class:`UnaryOp`." msgstr "" -#: ../../library/ast.rst:447 +#: ../../library/ast.rst:545 msgid "Boolean operator tokens." msgstr "" -#: ../../library/ast.rst:452 +#: ../../library/ast.rst:550 msgid "" "A comparison of two or more values. ``left`` is the first value in the " "comparison, ``ops`` the list of operators, and ``comparators`` the list of " "values after the first element in the comparison." msgstr "" -#: ../../library/ast.rst:481 +#: ../../library/ast.rst:579 msgid "Comparison operator tokens." msgstr "" -#: ../../library/ast.rst:486 +#: ../../library/ast.rst:584 msgid "" "A function call. ``func`` is the function, which will often be a :class:" "`Name` or :class:`Attribute` object. Of the arguments:" msgstr "" -#: ../../library/ast.rst:489 +#: ../../library/ast.rst:587 msgid "``args`` holds a list of the arguments passed by position." msgstr "" -#: ../../library/ast.rst:490 +#: ../../library/ast.rst:588 msgid "" "``keywords`` holds a list of :class:`keyword` objects representing arguments " "passed by keyword." msgstr "" -#: ../../library/ast.rst:493 +#: ../../library/ast.rst:591 msgid "" "When creating a ``Call`` node, ``args`` and ``keywords`` are required, but " "they can be empty lists." msgstr "" -#: ../../library/ast.rst:517 +#: ../../library/ast.rst:615 msgid "" "A keyword argument to a function call or class definition. ``arg`` is a raw " "string of the parameter name, ``value`` is a node to pass in." msgstr "" -#: ../../library/ast.rst:523 +#: ../../library/ast.rst:621 msgid "" "An expression such as ``a if b else c``. Each field holds a single node, so " "in the following example, all three are :class:`Name` nodes." msgstr "" -#: ../../library/ast.rst:538 +#: ../../library/ast.rst:636 msgid "" "Attribute access, e.g. ``d.keys``. ``value`` is a node, typically a :class:" "`Name`. ``attr`` is a bare string giving the name of the attribute, and " @@ -388,7 +450,7 @@ msgid "" "the attribute is acted on." msgstr "" -#: ../../library/ast.rst:555 +#: ../../library/ast.rst:653 msgid "" "A named expression. This AST node is produced by the assignment expressions " "operator (also known as the walrus operator). As opposed to the :class:" @@ -396,11 +458,11 @@ msgid "" "case both ``target`` and ``value`` must be single nodes." msgstr "" -#: ../../library/ast.rst:570 +#: ../../library/ast.rst:668 msgid "Subscripting" msgstr "" -#: ../../library/ast.rst:574 +#: ../../library/ast.rst:672 msgid "" "A subscript, such as ``l[1]``. ``value`` is the subscripted object (usually " "sequence or mapping). ``slice`` is an index, slice or key. It can be a :" @@ -408,29 +470,29 @@ msgid "" "`Store` or :class:`Del` according to the action performed with the subscript." msgstr "" -#: ../../library/ast.rst:598 +#: ../../library/ast.rst:696 msgid "" "Regular slicing (on the form ``lower:upper`` or ``lower:upper:step``). Can " "occur only inside the *slice* field of :class:`Subscript`, either directly " "or as an element of :class:`Tuple`." msgstr "" -#: ../../library/ast.rst:615 +#: ../../library/ast.rst:713 msgid "Comprehensions" msgstr "" -#: ../../library/ast.rst:622 +#: ../../library/ast.rst:720 msgid "" "List and set comprehensions, generator expressions, and dictionary " "comprehensions. ``elt`` (or ``key`` and ``value``) is a single node " "representing the part that will be evaluated for each item." msgstr "" -#: ../../library/ast.rst:626 +#: ../../library/ast.rst:724 msgid "``generators`` is a list of :class:`comprehension` nodes." msgstr "" -#: ../../library/ast.rst:668 +#: ../../library/ast.rst:766 msgid "" "One ``for`` clause in a comprehension. ``target`` is the reference to use " "for each element - typically a :class:`Name` or :class:`Tuple` node. " @@ -438,36 +500,36 @@ msgid "" "expressions: each ``for`` clause can have multiple ``ifs``." msgstr "" -#: ../../library/ast.rst:673 +#: ../../library/ast.rst:771 msgid "" "``is_async`` indicates a comprehension is asynchronous (using an ``async " "for`` instead of ``for``). The value is an integer (0 or 1)." msgstr "" -#: ../../library/ast.rst:739 +#: ../../library/ast.rst:840 msgid "Statements" msgstr "" -#: ../../library/ast.rst:743 +#: ../../library/ast.rst:844 msgid "" "An assignment. ``targets`` is a list of nodes, and ``value`` is a single " "node." msgstr "" -#: ../../library/ast.rst:745 +#: ../../library/ast.rst:846 msgid "" "Multiple nodes in ``targets`` represents assigning the same value to each. " "Unpacking is represented by putting a :class:`Tuple` or :class:`List` within " "``targets``." msgstr "" -#: ../../library/ast.rst:751 ../../library/ast.rst:1038 -#: ../../library/ast.rst:1242 ../../library/ast.rst:1663 +#: ../../library/ast.rst:852 ../../library/ast.rst:1139 +#: ../../library/ast.rst:1343 ../../library/ast.rst:1764 msgid "" "``type_comment`` is an optional string with the type annotation as a comment." msgstr "" -#: ../../library/ast.rst:781 +#: ../../library/ast.rst:882 msgid "" "An assignment with a type annotation. ``target`` is a single node and can be " "a :class:`Name`, a :class:`Attribute` or a :class:`Subscript`. " @@ -477,7 +539,7 @@ msgid "" "appear in between parenthesis and are hence pure names and not expressions." msgstr "" -#: ../../library/ast.rst:836 +#: ../../library/ast.rst:937 msgid "" "Augmented assignment, such as ``a += 1``. In the following example, " "``target`` is a :class:`Name` node for ``x`` (with the :class:`Store` " @@ -485,50 +547,50 @@ msgid "" "value for 1." msgstr "" -#: ../../library/ast.rst:841 +#: ../../library/ast.rst:942 msgid "" "The ``target`` attribute cannot be of class :class:`Tuple` or :class:`List`, " "unlike the targets of :class:`Assign`." msgstr "" -#: ../../library/ast.rst:858 +#: ../../library/ast.rst:959 msgid "" "A ``raise`` statement. ``exc`` is the exception object to be raised, " "normally a :class:`Call` or :class:`Name`, or ``None`` for a standalone " "``raise``. ``cause`` is the optional part for ``y`` in ``raise x from y``." msgstr "" -#: ../../library/ast.rst:875 +#: ../../library/ast.rst:976 msgid "" "An assertion. ``test`` holds the condition, such as a :class:`Compare` node. " "``msg`` holds the failure message." msgstr "" -#: ../../library/ast.rst:891 +#: ../../library/ast.rst:992 msgid "" "Represents a ``del`` statement. ``targets`` is a list of nodes, such as :" "class:`Name`, :class:`Attribute` or :class:`Subscript` nodes." msgstr "" -#: ../../library/ast.rst:909 +#: ../../library/ast.rst:1010 msgid "A ``pass`` statement." msgstr "" -#: ../../library/ast.rst:920 +#: ../../library/ast.rst:1021 msgid "" "Other statements which are only applicable inside functions or loops are " "described in other sections." msgstr "" -#: ../../library/ast.rst:924 +#: ../../library/ast.rst:1025 msgid "Imports" msgstr "" -#: ../../library/ast.rst:928 +#: ../../library/ast.rst:1029 msgid "An import statement. ``names`` is a list of :class:`alias` nodes." msgstr "" -#: ../../library/ast.rst:945 +#: ../../library/ast.rst:1046 msgid "" "Represents ``from x import y``. ``module`` is a raw string of the 'from' " "name, without any leading dots, or ``None`` for statements such as ``from . " @@ -536,36 +598,36 @@ msgid "" "import (0 means absolute import)." msgstr "" -#: ../../library/ast.rst:967 +#: ../../library/ast.rst:1068 msgid "" "Both parameters are raw strings of the names. ``asname`` can be ``None`` if " "the regular name is to be used." msgstr "" -#: ../../library/ast.rst:984 +#: ../../library/ast.rst:1085 msgid "Control flow" msgstr "" -#: ../../library/ast.rst:987 +#: ../../library/ast.rst:1088 msgid "" "Optional clauses such as ``else`` are stored as an empty list if they're not " "present." msgstr "" -#: ../../library/ast.rst:992 +#: ../../library/ast.rst:1093 msgid "" "An ``if`` statement. ``test`` holds a single node, such as a :class:" "`Compare` node. ``body`` and ``orelse`` each hold a list of nodes." msgstr "" -#: ../../library/ast.rst:995 +#: ../../library/ast.rst:1096 msgid "" "``elif`` clauses don't have a special representation in the AST, but rather " "appear as extra :class:`If` nodes within the ``orelse`` section of the " "previous one." msgstr "" -#: ../../library/ast.rst:1030 +#: ../../library/ast.rst:1131 msgid "" "A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " "single :class:`Name`, :class:`Tuple` or :class:`List` node. ``iter`` holds " @@ -574,30 +636,30 @@ msgid "" "loop finishes normally, rather than via a ``break`` statement." msgstr "" -#: ../../library/ast.rst:1064 +#: ../../library/ast.rst:1165 msgid "" "A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` " "node." msgstr "" -#: ../../library/ast.rst:1091 +#: ../../library/ast.rst:1192 msgid "The ``break`` and ``continue`` statements." msgstr "" -#: ../../library/ast.rst:1126 +#: ../../library/ast.rst:1227 msgid "" "``try`` blocks. All attributes are list of nodes to execute, except for " "``handlers``, which is a list of :class:`ExceptHandler` nodes." msgstr "" -#: ../../library/ast.rst:1172 +#: ../../library/ast.rst:1273 msgid "" "``try`` blocks which are followed by ``except*`` clauses. The attributes are " "the same as for :class:`Try` but the :class:`ExceptHandler` nodes in " "``handlers`` are interpreted as ``except*`` blocks rather then ``except``." msgstr "" -#: ../../library/ast.rst:1203 +#: ../../library/ast.rst:1304 msgid "" "A single ``except`` clause. ``type`` is the exception type it will match, " "typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` " @@ -605,14 +667,14 @@ msgid "" "``None`` if the clause doesn't have ``as foo``. ``body`` is a list of nodes." msgstr "" -#: ../../library/ast.rst:1237 +#: ../../library/ast.rst:1338 msgid "" "A ``with`` block. ``items`` is a list of :class:`withitem` nodes " "representing the context managers, and ``body`` is the indented block inside " "the context." msgstr "" -#: ../../library/ast.rst:1247 +#: ../../library/ast.rst:1348 msgid "" "A single context manager in a ``with`` block. ``context_expr`` is the " "context manager, often a :class:`Call` node. ``optional_vars`` is a :class:" @@ -620,18 +682,18 @@ msgid "" "if that isn't used." msgstr "" -#: ../../library/ast.rst:1280 +#: ../../library/ast.rst:1381 msgid "Pattern matching" msgstr "" -#: ../../library/ast.rst:1285 +#: ../../library/ast.rst:1386 msgid "" "A ``match`` statement. ``subject`` holds the subject of the match (the " "object that is being matched against the cases) and ``cases`` contains an " "iterable of :class:`match_case` nodes with the different cases." msgstr "" -#: ../../library/ast.rst:1291 +#: ../../library/ast.rst:1392 msgid "" "A single case pattern in a ``match`` statement. ``pattern`` contains the " "match pattern that the subject will be matched against. Note that the :class:" @@ -639,19 +701,19 @@ msgid "" "expressions, even when they share the same syntax." msgstr "" -#: ../../library/ast.rst:1296 +#: ../../library/ast.rst:1397 msgid "" "The ``guard`` attribute contains an expression that will be evaluated if the " "pattern matches the subject." msgstr "" -#: ../../library/ast.rst:1299 +#: ../../library/ast.rst:1400 msgid "" "``body`` contains a list of nodes to execute if the pattern matches and the " "result of evaluating the guard expression is true." msgstr "" -#: ../../library/ast.rst:1342 +#: ../../library/ast.rst:1443 msgid "" "A match literal or value pattern that compares by equality. ``value`` is an " "expression node. Permitted value nodes are restricted as described in the " @@ -659,14 +721,14 @@ msgid "" "equal to the evaluated value." msgstr "" -#: ../../library/ast.rst:1369 +#: ../../library/ast.rst:1470 msgid "" "A match literal pattern that compares by identity. ``value`` is the " "singleton to be compared against: ``None``, ``True``, or ``False``. This " "pattern succeeds if the match subject is the given constant." msgstr "" -#: ../../library/ast.rst:1394 +#: ../../library/ast.rst:1495 msgid "" "A match sequence pattern. ``patterns`` contains the patterns to be matched " "against the subject elements if the subject is a sequence. Matches a " @@ -674,7 +736,7 @@ msgid "" "otherwise matches a fixed length sequence." msgstr "" -#: ../../library/ast.rst:1425 +#: ../../library/ast.rst:1526 msgid "" "Matches the rest of the sequence in a variable length match sequence " "pattern. If ``name`` is not ``None``, a list containing the remaining " @@ -682,7 +744,7 @@ msgid "" "successful." msgstr "" -#: ../../library/ast.rst:1465 +#: ../../library/ast.rst:1566 msgid "" "A match mapping pattern. ``keys`` is a sequence of expression nodes. " "``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an " @@ -691,7 +753,7 @@ msgid "" "statement documentation." msgstr "" -#: ../../library/ast.rst:1471 +#: ../../library/ast.rst:1572 msgid "" "This pattern succeeds if the subject is a mapping, all evaluated key " "expressions are present in the mapping, and the value corresponding to each " @@ -700,7 +762,7 @@ msgid "" "overall mapping pattern is successful." msgstr "" -#: ../../library/ast.rst:1511 +#: ../../library/ast.rst:1612 msgid "" "A match class pattern. ``cls`` is an expression giving the nominal class to " "be matched. ``patterns`` is a sequence of pattern nodes to be matched " @@ -711,21 +773,21 @@ msgid "" "pattern)." msgstr "" -#: ../../library/ast.rst:1518 +#: ../../library/ast.rst:1619 msgid "" "This pattern succeeds if the subject is an instance of the nominated class, " "all positional patterns match the corresponding class-defined attributes, " "and any specified keyword attributes match their corresponding pattern." msgstr "" -#: ../../library/ast.rst:1522 +#: ../../library/ast.rst:1623 msgid "" "Note: classes may define a property that returns self in order to match a " "pattern node against the instance being matched. Several builtin types are " "also matched that way, as described in the match statement documentation." msgstr "" -#: ../../library/ast.rst:1575 +#: ../../library/ast.rst:1676 msgid "" "A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` " "contains the match pattern that the subject will be matched against. If the " @@ -733,14 +795,14 @@ msgid "" "and will always succeed." msgstr "" -#: ../../library/ast.rst:1580 +#: ../../library/ast.rst:1681 msgid "" "The ``name`` attribute contains the name that will be bound if the pattern " "is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` " "and the node represents the wildcard pattern." msgstr "" -#: ../../library/ast.rst:1616 +#: ../../library/ast.rst:1717 msgid "" "A match \"or-pattern\". An or-pattern matches each of its subpatterns in " "turn to the subject, until one succeeds. The or-pattern is then deemed to " @@ -749,151 +811,151 @@ msgid "" "matched against the subject." msgstr "" -#: ../../library/ast.rst:1648 +#: ../../library/ast.rst:1749 msgid "Function and class definitions" msgstr "" -#: ../../library/ast.rst:1652 +#: ../../library/ast.rst:1753 msgid "A function definition." msgstr "" -#: ../../library/ast.rst:1654 +#: ../../library/ast.rst:1755 msgid "``name`` is a raw string of the function name." msgstr "" -#: ../../library/ast.rst:1655 +#: ../../library/ast.rst:1756 msgid "``args`` is an :class:`arguments` node." msgstr "" -#: ../../library/ast.rst:1656 +#: ../../library/ast.rst:1757 msgid "``body`` is the list of nodes inside the function." msgstr "" -#: ../../library/ast.rst:1657 +#: ../../library/ast.rst:1758 msgid "" "``decorator_list`` is the list of decorators to be applied, stored outermost " "first (i.e. the first in the list will be applied last)." msgstr "" -#: ../../library/ast.rst:1659 +#: ../../library/ast.rst:1760 msgid "``returns`` is the return annotation." msgstr "" -#: ../../library/ast.rst:1668 +#: ../../library/ast.rst:1769 msgid "" "``lambda`` is a minimal function definition that can be used inside an " "expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." msgstr "" -#: ../../library/ast.rst:1692 +#: ../../library/ast.rst:1793 msgid "The arguments for a function." msgstr "" -#: ../../library/ast.rst:1694 +#: ../../library/ast.rst:1795 msgid "" "``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." msgstr "" -#: ../../library/ast.rst:1695 +#: ../../library/ast.rst:1796 msgid "" "``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the " "``*args, **kwargs`` parameters." msgstr "" -#: ../../library/ast.rst:1697 +#: ../../library/ast.rst:1798 msgid "" "``kw_defaults`` is a list of default values for keyword-only arguments. If " "one is ``None``, the corresponding argument is required." msgstr "" -#: ../../library/ast.rst:1699 +#: ../../library/ast.rst:1800 msgid "" "``defaults`` is a list of default values for arguments that can be passed " "positionally. If there are fewer defaults, they correspond to the last n " "arguments." msgstr "" -#: ../../library/ast.rst:1706 +#: ../../library/ast.rst:1807 msgid "" "A single argument in a list. ``arg`` is a raw string of the argument name, " "``annotation`` is its annotation, such as a :class:`Str` or :class:`Name` " "node." msgstr "" -#: ../../library/ast.rst:1712 +#: ../../library/ast.rst:1813 msgid "" "``type_comment`` is an optional string with the type annotation as a comment" msgstr "" -#: ../../library/ast.rst:1756 +#: ../../library/ast.rst:1857 msgid "A ``return`` statement." msgstr "" -#: ../../library/ast.rst:1771 +#: ../../library/ast.rst:1872 msgid "" "A ``yield`` or ``yield from`` expression. Because these are expressions, " "they must be wrapped in a :class:`Expr` node if the value sent back is not " "used." msgstr "" -#: ../../library/ast.rst:1796 +#: ../../library/ast.rst:1897 msgid "" "``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." msgstr "" -#: ../../library/ast.rst:1823 +#: ../../library/ast.rst:1924 msgid "A class definition." msgstr "" -#: ../../library/ast.rst:1825 +#: ../../library/ast.rst:1926 msgid "``name`` is a raw string for the class name" msgstr "" -#: ../../library/ast.rst:1826 +#: ../../library/ast.rst:1927 msgid "``bases`` is a list of nodes for explicitly specified base classes." msgstr "" -#: ../../library/ast.rst:1827 +#: ../../library/ast.rst:1928 msgid "" "``keywords`` is a list of :class:`keyword` nodes, principally for " "'metaclass'. Other keywords will be passed to the metaclass, as per " "`PEP-3115 `_." msgstr "" -#: ../../library/ast.rst:1830 +#: ../../library/ast.rst:1931 msgid "" "``body`` is a list of nodes representing the code within the class " "definition." msgstr "" -#: ../../library/ast.rst:1832 +#: ../../library/ast.rst:1933 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "" -#: ../../library/ast.rst:1861 +#: ../../library/ast.rst:1962 msgid "Async and await" msgstr "" -#: ../../library/ast.rst:1865 +#: ../../library/ast.rst:1966 msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." msgstr "" -#: ../../library/ast.rst:1871 +#: ../../library/ast.rst:1972 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:1904 +#: ../../library/ast.rst:2005 msgid "" "``async for`` loops and ``async with`` context managers. They have the same " "fields as :class:`For` and :class:`With`, respectively. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:1909 +#: ../../library/ast.rst:2010 msgid "" "When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" "class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." @@ -902,23 +964,23 @@ msgid "" "same value (e.g. :class:`ast.Add`)." msgstr "" -#: ../../library/ast.rst:1917 +#: ../../library/ast.rst:2018 msgid ":mod:`ast` Helpers" msgstr "" -#: ../../library/ast.rst:1919 +#: ../../library/ast.rst:2020 msgid "" "Apart from the node classes, the :mod:`ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" msgstr "" -#: ../../library/ast.rst:1924 +#: ../../library/ast.rst:2025 msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " "filename, mode, ast.PyCF_ONLY_AST)``." msgstr "" -#: ../../library/ast.rst:1927 +#: ../../library/ast.rst:2028 msgid "" "If ``type_comments=True`` is given, the parser is modified to check and " "return type comments as specified by :pep:`484` and :pep:`526`. This is " @@ -931,14 +993,14 @@ msgid "" "empty list)." msgstr "" -#: ../../library/ast.rst:1937 +#: ../../library/ast.rst:2038 msgid "" "In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " "correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> " "List[str]``." msgstr "" -#: ../../library/ast.rst:1941 +#: ../../library/ast.rst:2042 msgid "" "Also, setting ``feature_version`` to a tuple ``(major, minor)`` will attempt " "to parse using that Python version's grammar. Currently ``major`` must equal " @@ -947,12 +1009,12 @@ msgid "" "version is ``(3, 4)``; the highest is ``sys.version_info[0:2]``." msgstr "" -#: ../../library/ast.rst:1948 +#: ../../library/ast.rst:2049 msgid "" "If source contains a null character ('\\0'), :exc:`ValueError` is raised." msgstr "" -#: ../../library/ast.rst:1951 +#: ../../library/ast.rst:2052 msgid "" "Note that successfully parsing source code into an AST object doesn't " "guarantee that the source code provided is valid Python code that can be " @@ -962,45 +1024,45 @@ msgid "" "inside a function node)." msgstr "" -#: ../../library/ast.rst:1958 +#: ../../library/ast.rst:2059 msgid "" "In particular, :func:`ast.parse` won't do any scoping checks, which the " "compilation step does." msgstr "" -#: ../../library/ast.rst:1962 +#: ../../library/ast.rst:2063 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string due to stack depth limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:1966 +#: ../../library/ast.rst:2067 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" "新增 ``type_comments``\\ 、\\ ``mode='func_type'`` 與 " "``feature_version``\\ 。" -#: ../../library/ast.rst:1972 +#: ../../library/ast.rst:2073 msgid "" "Unparse an :class:`ast.AST` object and generate a string with code that " "would produce an equivalent :class:`ast.AST` object if parsed back with :" "func:`ast.parse`." msgstr "" -#: ../../library/ast.rst:1977 +#: ../../library/ast.rst:2078 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " "optimizations, such as constant tuples/frozensets)." msgstr "" -#: ../../library/ast.rst:1982 +#: ../../library/ast.rst:2083 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "" -#: ../../library/ast.rst:1990 +#: ../../library/ast.rst:2091 msgid "" "Evaluate an expression node or a string containing only a Python literal or " "container display. The string or node provided may only consist of the " @@ -1008,14 +1070,14 @@ msgid "" "dicts, sets, booleans, ``None`` and ``Ellipsis``." msgstr "" -#: ../../library/ast.rst:1995 +#: ../../library/ast.rst:2096 msgid "" "This can be used for evaluating strings containing Python values without the " "need to parse the values oneself. It is not capable of evaluating " "arbitrarily complex expressions, for example involving operators or indexing." msgstr "" -#: ../../library/ast.rst:2000 +#: ../../library/ast.rst:2101 msgid "" "This function had been documented as \"safe\" in the past without defining " "what that meant. That was misleading. This is specifically designed not to " @@ -1027,31 +1089,31 @@ msgid "" "untrusted data is thus not recommended." msgstr "" -#: ../../library/ast.rst:2010 +#: ../../library/ast.rst:2111 msgid "" "It is possible to crash the Python interpreter due to stack depth " "limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:2013 +#: ../../library/ast.rst:2114 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." msgstr "" -#: ../../library/ast.rst:2017 +#: ../../library/ast.rst:2118 msgid "Now allows bytes and set literals." msgstr "" -#: ../../library/ast.rst:2020 +#: ../../library/ast.rst:2121 msgid "Now supports creating empty sets with ``'set()'``." msgstr "" -#: ../../library/ast.rst:2023 +#: ../../library/ast.rst:2124 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "" -#: ../../library/ast.rst:2029 +#: ../../library/ast.rst:2130 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -1059,24 +1121,24 @@ msgid "" "clean up the docstring's indentation with :func:`inspect.cleandoc`." msgstr "" -#: ../../library/ast.rst:2035 +#: ../../library/ast.rst:2136 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "目前已支援 :class:`AsyncFunctionDef`\\ 。" -#: ../../library/ast.rst:2041 +#: ../../library/ast.rst:2142 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`lineno`, :attr:`end_lineno`, :attr:" "`col_offset`, or :attr:`end_col_offset`) is missing, return ``None``." msgstr "" -#: ../../library/ast.rst:2045 +#: ../../library/ast.rst:2146 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." msgstr "" -#: ../../library/ast.rst:2053 +#: ../../library/ast.rst:2154 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`lineno` and :attr:`col_offset` attributes for every node that supports " @@ -1085,77 +1147,77 @@ msgid "" "the values of the parent node. It works recursively starting at *node*." msgstr "" -#: ../../library/ast.rst:2062 +#: ../../library/ast.rst:2163 msgid "" "Increment the line number and end line number of each node in the tree " "starting at *node* by *n*. This is useful to \"move code\" to a different " "location in a file." msgstr "" -#: ../../library/ast.rst:2069 +#: ../../library/ast.rst:2170 msgid "" "Copy source location (:attr:`lineno`, :attr:`col_offset`, :attr:" "`end_lineno`, and :attr:`end_col_offset`) from *old_node* to *new_node* if " "possible, and return *new_node*." msgstr "" -#: ../../library/ast.rst:2076 +#: ../../library/ast.rst:2177 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." msgstr "" -#: ../../library/ast.rst:2082 +#: ../../library/ast.rst:2183 msgid "" "Yield all direct child nodes of *node*, that is, all fields that are nodes " "and all items of fields that are lists of nodes." msgstr "" -#: ../../library/ast.rst:2088 +#: ../../library/ast.rst:2189 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " "only want to modify nodes in place and don't care about the context." msgstr "" -#: ../../library/ast.rst:2095 +#: ../../library/ast.rst:2196 msgid "" "A node visitor base class that walks the abstract syntax tree and calls a " "visitor function for every node found. This function may return a value " "which is forwarded by the :meth:`visit` method." msgstr "" -#: ../../library/ast.rst:2099 +#: ../../library/ast.rst:2200 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "" -#: ../../library/ast.rst:2104 +#: ../../library/ast.rst:2205 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " "or :meth:`generic_visit` if that method doesn't exist." msgstr "" -#: ../../library/ast.rst:2110 +#: ../../library/ast.rst:2211 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "" -#: ../../library/ast.rst:2112 +#: ../../library/ast.rst:2213 msgid "" "Note that child nodes of nodes that have a custom visitor method won't be " "visited unless the visitor calls :meth:`generic_visit` or visits them itself." msgstr "" -#: ../../library/ast.rst:2116 +#: ../../library/ast.rst:2217 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" "`NodeTransformer`) that allows modifications." msgstr "" -#: ../../library/ast.rst:2122 +#: ../../library/ast.rst:2223 msgid "" "Methods :meth:`visit_Num`, :meth:`visit_Str`, :meth:`visit_Bytes`, :meth:" "`visit_NameConstant` and :meth:`visit_Ellipsis` are deprecated now and will " @@ -1163,13 +1225,13 @@ msgid "" "method to handle all constant nodes." msgstr "" -#: ../../library/ast.rst:2130 +#: ../../library/ast.rst:2231 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "" -#: ../../library/ast.rst:2133 +#: ../../library/ast.rst:2234 msgid "" "The :class:`NodeTransformer` will walk the AST and use the return value of " "the visitor methods to replace or remove the old node. If the return value " @@ -1178,27 +1240,27 @@ msgid "" "may be the original node in which case no replacement takes place." msgstr "" -#: ../../library/ast.rst:2139 +#: ../../library/ast.rst:2240 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" msgstr "" -#: ../../library/ast.rst:2151 +#: ../../library/ast.rst:2252 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " "either transform the child nodes yourself or call the :meth:`generic_visit` " "method for the node first." msgstr "" -#: ../../library/ast.rst:2155 +#: ../../library/ast.rst:2256 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " "just a single node." msgstr "" -#: ../../library/ast.rst:2159 +#: ../../library/ast.rst:2260 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:" @@ -1206,11 +1268,11 @@ msgid "" "tree to recalculate the location information::" msgstr "" -#: ../../library/ast.rst:2167 +#: ../../library/ast.rst:2268 msgid "Usually you use the transformer like this::" msgstr "" -#: ../../library/ast.rst:2174 +#: ../../library/ast.rst:2275 msgid "" "Return a formatted dump of the tree in *node*. This is mainly useful for " "debugging purposes. If *annotate_fields* is true (by default), the returned " @@ -1221,7 +1283,7 @@ msgid "" "true." msgstr "" -#: ../../library/ast.rst:2182 +#: ../../library/ast.rst:2283 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " "pretty-printed with that indent level. An indent level of 0, negative, or " @@ -1231,87 +1293,87 @@ msgid "" "string is used to indent each level." msgstr "" -#: ../../library/ast.rst:2189 +#: ../../library/ast.rst:2290 msgid "Added the *indent* option." msgstr "新增 *indent* 選項。" -#: ../../library/ast.rst:2196 +#: ../../library/ast.rst:2297 msgid "Compiler Flags" msgstr "" -#: ../../library/ast.rst:2198 +#: ../../library/ast.rst:2299 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" msgstr "" -#: ../../library/ast.rst:2203 +#: ../../library/ast.rst:2304 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." msgstr "" -#: ../../library/ast.rst:2210 +#: ../../library/ast.rst:2311 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "" -#: ../../library/ast.rst:2215 +#: ../../library/ast.rst:2316 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." msgstr "" -#: ../../library/ast.rst:2224 +#: ../../library/ast.rst:2325 msgid "Command-Line Usage" msgstr "" -#: ../../library/ast.rst:2228 +#: ../../library/ast.rst:2329 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr "" -#: ../../library/ast.rst:2235 +#: ../../library/ast.rst:2336 msgid "The following options are accepted:" msgstr "" -#: ../../library/ast.rst:2241 +#: ../../library/ast.rst:2342 msgid "Show the help message and exit." msgstr "" -#: ../../library/ast.rst:2246 +#: ../../library/ast.rst:2347 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "" -#: ../../library/ast.rst:2251 +#: ../../library/ast.rst:2352 msgid "Don't parse type comments." msgstr "" -#: ../../library/ast.rst:2255 +#: ../../library/ast.rst:2356 msgid "Include attributes such as line numbers and column offsets." msgstr "" -#: ../../library/ast.rst:2260 +#: ../../library/ast.rst:2361 msgid "Indentation of nodes in AST (number of spaces)." msgstr "" -#: ../../library/ast.rst:2262 +#: ../../library/ast.rst:2363 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." msgstr "" -#: ../../library/ast.rst:2268 +#: ../../library/ast.rst:2369 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." msgstr "" -#: ../../library/ast.rst:2271 +#: ../../library/ast.rst:2372 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -1319,21 +1381,21 @@ msgid "" "transformations." msgstr "" -#: ../../library/ast.rst:2276 +#: ../../library/ast.rst:2377 msgid "" "`leoAst.py `_ unifies the " "token-based and parse-tree-based views of python programs by inserting two-" "way links between tokens and ast nodes." msgstr "" -#: ../../library/ast.rst:2280 +#: ../../library/ast.rst:2381 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " "useful for building automated refactoring (codemod) applications and linters." msgstr "" -#: ../../library/ast.rst:2285 +#: ../../library/ast.rst:2386 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " diff --git a/library/decimal.po b/library/decimal.po index 2d9d024873..dfa393fffc 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-26 00:38+0000\n" +"POT-Creation-Date: 2023-06-28 00:38+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -455,7 +455,7 @@ msgid "" msgstr "" #: ../../library/decimal.rst:520 ../../library/decimal.rst:531 -#: ../../library/decimal.rst:559 ../../library/decimal.rst:835 +#: ../../library/decimal.rst:559 ../../library/decimal.rst:846 msgid "" "This operation is unaffected by context and is quiet: no flags are changed " "and no rounding is performed. As an exception, the C version may raise " @@ -686,70 +686,93 @@ msgstr "" #: ../../library/decimal.rst:746 msgid "" -"Normalize the number by stripping the rightmost trailing zeros and " -"converting any result equal to ``Decimal('0')`` to ``Decimal('0e0')``. Used " -"for producing canonical values for attributes of an equivalence class. For " -"example, ``Decimal('32.100')`` and ``Decimal('0.321000e+2')`` both normalize " -"to the equivalent value ``Decimal('32.1')``." +"Used for producing canonical values of an equivalence class within either " +"the current context or the specified context." msgstr "" -#: ../../library/decimal.rst:755 +#: ../../library/decimal.rst:749 +msgid "" +"This has the same semantics as the unary plus operation, except that if the " +"final result is finite it is reduced to its simplest form, with all trailing " +"zeros removed and its sign preserved. That is, while the coefficient is non-" +"zero and a multiple of ten the coefficient is divided by ten and the " +"exponent is incremented by 1. Otherwise (the coefficient is zero) the " +"exponent is set to 0. In all cases the sign is unchanged." +msgstr "" + +#: ../../library/decimal.rst:756 +msgid "" +"For example, ``Decimal('32.100')`` and ``Decimal('0.321000e+2')`` both " +"normalize to the equivalent value ``Decimal('32.1')``." +msgstr "" + +#: ../../library/decimal.rst:759 +msgid "Note that rounding is applied *before* reducing to simplest form." +msgstr "" + +#: ../../library/decimal.rst:761 +msgid "" +"In the latest versions of the specification, this operation is also known as " +"``reduce``." +msgstr "" + +#: ../../library/decimal.rst:766 msgid "" "Return a string describing the *class* of the operand. The returned value " "is one of the following ten strings." msgstr "" -#: ../../library/decimal.rst:758 +#: ../../library/decimal.rst:769 msgid "``\"-Infinity\"``, indicating that the operand is negative infinity." msgstr "" -#: ../../library/decimal.rst:759 +#: ../../library/decimal.rst:770 msgid "" "``\"-Normal\"``, indicating that the operand is a negative normal number." msgstr "" -#: ../../library/decimal.rst:760 +#: ../../library/decimal.rst:771 msgid "" "``\"-Subnormal\"``, indicating that the operand is negative and subnormal." msgstr "" -#: ../../library/decimal.rst:761 +#: ../../library/decimal.rst:772 msgid "``\"-Zero\"``, indicating that the operand is a negative zero." msgstr "" -#: ../../library/decimal.rst:762 +#: ../../library/decimal.rst:773 msgid "``\"+Zero\"``, indicating that the operand is a positive zero." msgstr "" -#: ../../library/decimal.rst:763 +#: ../../library/decimal.rst:774 msgid "" "``\"+Subnormal\"``, indicating that the operand is positive and subnormal." msgstr "" -#: ../../library/decimal.rst:764 +#: ../../library/decimal.rst:775 msgid "" "``\"+Normal\"``, indicating that the operand is a positive normal number." msgstr "" -#: ../../library/decimal.rst:765 +#: ../../library/decimal.rst:776 msgid "``\"+Infinity\"``, indicating that the operand is positive infinity." msgstr "" -#: ../../library/decimal.rst:766 +#: ../../library/decimal.rst:777 msgid "``\"NaN\"``, indicating that the operand is a quiet NaN (Not a Number)." msgstr "" -#: ../../library/decimal.rst:767 +#: ../../library/decimal.rst:778 msgid "``\"sNaN\"``, indicating that the operand is a signaling NaN." msgstr "" -#: ../../library/decimal.rst:771 +#: ../../library/decimal.rst:782 msgid "" "Return a value equal to the first operand after rounding and having the " "exponent of the second operand." msgstr "" -#: ../../library/decimal.rst:777 +#: ../../library/decimal.rst:788 msgid "" "Unlike other operations, if the length of the coefficient after the quantize " "operation would be greater than precision, then an :const:`InvalidOperation` " @@ -757,13 +780,13 @@ msgid "" "quantized exponent is always equal to that of the right-hand operand." msgstr "" -#: ../../library/decimal.rst:783 +#: ../../library/decimal.rst:794 msgid "" "Also unlike other operations, quantize never signals Underflow, even if the " "result is subnormal and inexact." msgstr "" -#: ../../library/decimal.rst:786 +#: ../../library/decimal.rst:797 msgid "" "If the exponent of the second operand is larger than that of the first then " "rounding may be necessary. In this case, the rounding mode is determined by " @@ -772,19 +795,19 @@ msgid "" "context is used." msgstr "" -#: ../../library/decimal.rst:792 +#: ../../library/decimal.rst:803 msgid "" "An error is returned whenever the resulting exponent is greater than :attr:" "`~Context.Emax` or less than :meth:`~Context.Etiny`." msgstr "" -#: ../../library/decimal.rst:797 +#: ../../library/decimal.rst:808 msgid "" "Return ``Decimal(10)``, the radix (base) in which the :class:`Decimal` class " "does all its arithmetic. Included for compatibility with the specification." msgstr "" -#: ../../library/decimal.rst:803 +#: ../../library/decimal.rst:814 msgid "" "Return the remainder from dividing *self* by *other*. This differs from " "``self % other`` in that the sign of the remainder is chosen so as to " @@ -793,11 +816,11 @@ msgid "" "other``, and if two integers are equally near then the even one is chosen." msgstr "" -#: ../../library/decimal.rst:810 +#: ../../library/decimal.rst:821 msgid "If the result is zero then its sign will be the sign of *self*." msgstr "" -#: ../../library/decimal.rst:821 +#: ../../library/decimal.rst:832 msgid "" "Return the result of rotating the digits of the first operand by an amount " "specified by the second operand. The second operand must be an integer in " @@ -809,20 +832,20 @@ msgid "" "are unchanged." msgstr "" -#: ../../library/decimal.rst:832 +#: ../../library/decimal.rst:843 msgid "" "Test whether self and other have the same exponent or whether both are " "``NaN``." msgstr "" -#: ../../library/decimal.rst:841 +#: ../../library/decimal.rst:852 msgid "" "Return the first operand with exponent adjusted by the second. Equivalently, " "return the first operand multiplied by ``10**other``. The second operand " "must be an integer." msgstr "" -#: ../../library/decimal.rst:847 +#: ../../library/decimal.rst:858 msgid "" "Return the result of shifting the digits of the first operand by an amount " "specified by the second operand. The second operand must be an integer in " @@ -833,34 +856,34 @@ msgid "" "exponent of the first operand are unchanged." msgstr "" -#: ../../library/decimal.rst:857 +#: ../../library/decimal.rst:868 msgid "Return the square root of the argument to full precision." msgstr "" -#: ../../library/decimal.rst:862 ../../library/decimal.rst:1457 +#: ../../library/decimal.rst:873 ../../library/decimal.rst:1468 msgid "" "Convert to a string, using engineering notation if an exponent is needed." msgstr "" -#: ../../library/decimal.rst:864 ../../library/decimal.rst:1459 +#: ../../library/decimal.rst:875 ../../library/decimal.rst:1470 msgid "" "Engineering notation has an exponent which is a multiple of 3. This can " "leave up to 3 digits to the left of the decimal place and may require the " "addition of either one or two trailing zeros." msgstr "" -#: ../../library/decimal.rst:868 +#: ../../library/decimal.rst:879 msgid "" "For example, this converts ``Decimal('123E+1')`` to ``Decimal('1.23E+3')``." msgstr "" -#: ../../library/decimal.rst:872 +#: ../../library/decimal.rst:883 msgid "" "Identical to the :meth:`to_integral_value` method. The ``to_integral`` name " "has been kept for compatibility with older versions." msgstr "" -#: ../../library/decimal.rst:877 +#: ../../library/decimal.rst:888 msgid "" "Round to the nearest integer, signaling :const:`Inexact` or :const:`Rounded` " "as appropriate if rounding occurs. The rounding mode is determined by the " @@ -868,18 +891,18 @@ msgid "" "parameter is given then the rounding mode of the current context is used." msgstr "" -#: ../../library/decimal.rst:885 +#: ../../library/decimal.rst:896 msgid "" "Round to the nearest integer without signaling :const:`Inexact` or :const:" "`Rounded`. If given, applies *rounding*; otherwise, uses the rounding " "method in either the supplied *context* or the current context." msgstr "" -#: ../../library/decimal.rst:893 +#: ../../library/decimal.rst:904 msgid "Logical operands" msgstr "" -#: ../../library/decimal.rst:895 +#: ../../library/decimal.rst:906 msgid "" "The :meth:`~Decimal.logical_and`, :meth:`~Decimal.logical_invert`, :meth:" "`~Decimal.logical_or`, and :meth:`~Decimal.logical_xor` methods expect their " @@ -888,38 +911,38 @@ msgid "" "are all either ``0`` or ``1``." msgstr "" -#: ../../library/decimal.rst:907 +#: ../../library/decimal.rst:918 msgid "Context objects" msgstr "" -#: ../../library/decimal.rst:909 +#: ../../library/decimal.rst:920 msgid "" "Contexts are environments for arithmetic operations. They govern precision, " "set rules for rounding, determine which signals are treated as exceptions, " "and limit the range for exponents." msgstr "" -#: ../../library/decimal.rst:913 +#: ../../library/decimal.rst:924 msgid "" "Each thread has its own current context which is accessed or changed using " "the :func:`getcontext` and :func:`setcontext` functions:" msgstr "" -#: ../../library/decimal.rst:919 +#: ../../library/decimal.rst:930 msgid "Return the current context for the active thread." msgstr "" -#: ../../library/decimal.rst:924 +#: ../../library/decimal.rst:935 msgid "Set the current context for the active thread to *c*." msgstr "" -#: ../../library/decimal.rst:926 +#: ../../library/decimal.rst:937 msgid "" "You can also use the :keyword:`with` statement and the :func:`localcontext` " "function to temporarily change the active context." msgstr "" -#: ../../library/decimal.rst:931 +#: ../../library/decimal.rst:942 msgid "" "Return a context manager that will set the current context for the active " "thread to a copy of *ctx* on entry to the with-statement and restore the " @@ -928,37 +951,37 @@ msgid "" "used to set the attributes of the new context." msgstr "" -#: ../../library/decimal.rst:937 +#: ../../library/decimal.rst:948 msgid "" "For example, the following code sets the current decimal precision to 42 " "places, performs a calculation, and then automatically restores the previous " "context::" msgstr "" -#: ../../library/decimal.rst:947 +#: ../../library/decimal.rst:958 msgid "Using keyword arguments, the code would be the following::" msgstr "" -#: ../../library/decimal.rst:955 +#: ../../library/decimal.rst:966 msgid "" "Raises :exc:`TypeError` if *kwargs* supplies an attribute that :class:" "`Context` doesn't support. Raises either :exc:`TypeError` or :exc:" "`ValueError` if *kwargs* supplies an invalid value for an attribute." msgstr "" -#: ../../library/decimal.rst:959 +#: ../../library/decimal.rst:970 msgid "" ":meth:`localcontext` now supports setting context attributes through the use " "of keyword arguments." msgstr "" -#: ../../library/decimal.rst:962 +#: ../../library/decimal.rst:973 msgid "" "New contexts can also be created using the :class:`Context` constructor " "described below. In addition, the module provides three pre-made contexts:" msgstr "" -#: ../../library/decimal.rst:968 +#: ../../library/decimal.rst:979 msgid "" "This is a standard context defined by the General Decimal Arithmetic " "Specification. Precision is set to nine. Rounding is set to :const:" @@ -967,12 +990,12 @@ msgid "" "`Subnormal`." msgstr "" -#: ../../library/decimal.rst:974 +#: ../../library/decimal.rst:985 msgid "" "Because many of the traps are enabled, this context is useful for debugging." msgstr "" -#: ../../library/decimal.rst:979 +#: ../../library/decimal.rst:990 msgid "" "This is a standard context defined by the General Decimal Arithmetic " "Specification. Precision is set to nine. Rounding is set to :const:" @@ -980,7 +1003,7 @@ msgid "" "exceptions are not raised during computations)." msgstr "" -#: ../../library/decimal.rst:984 +#: ../../library/decimal.rst:995 msgid "" "Because the traps are disabled, this context is useful for applications that " "prefer to have result value of ``NaN`` or ``Infinity`` instead of raising " @@ -988,7 +1011,7 @@ msgid "" "conditions that would otherwise halt the program." msgstr "" -#: ../../library/decimal.rst:992 +#: ../../library/decimal.rst:1003 msgid "" "This context is used by the :class:`Context` constructor as a prototype for " "new contexts. Changing a field (such a precision) has the effect of " @@ -996,7 +1019,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/decimal.rst:996 +#: ../../library/decimal.rst:1007 msgid "" "This context is most useful in multi-threaded environments. Changing one of " "the fields before threads are started has the effect of setting system-wide " @@ -1004,65 +1027,65 @@ msgid "" "as it would require thread synchronization to prevent race conditions." msgstr "" -#: ../../library/decimal.rst:1001 +#: ../../library/decimal.rst:1012 msgid "" "In single threaded environments, it is preferable to not use this context at " "all. Instead, simply create contexts explicitly as described below." msgstr "" -#: ../../library/decimal.rst:1004 +#: ../../library/decimal.rst:1015 msgid "" "The default values are :attr:`Context.prec`\\ =\\ ``28``, :attr:`Context." "rounding`\\ =\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:" "`Overflow`, :class:`InvalidOperation`, and :class:`DivisionByZero`." msgstr "" -#: ../../library/decimal.rst:1009 +#: ../../library/decimal.rst:1020 msgid "" "In addition to the three supplied contexts, new contexts can be created with " "the :class:`Context` constructor." msgstr "" -#: ../../library/decimal.rst:1015 +#: ../../library/decimal.rst:1026 msgid "" "Creates a new context. If a field is not specified or is :const:`None`, the " "default values are copied from the :const:`DefaultContext`. If the *flags* " "field is not specified or is :const:`None`, all flags are cleared." msgstr "" -#: ../../library/decimal.rst:1019 +#: ../../library/decimal.rst:1030 msgid "" "*prec* is an integer in the range [``1``, :const:`MAX_PREC`] that sets the " "precision for arithmetic operations in the context." msgstr "" -#: ../../library/decimal.rst:1022 +#: ../../library/decimal.rst:1033 msgid "" "The *rounding* option is one of the constants listed in the section " "`Rounding Modes`_." msgstr "" -#: ../../library/decimal.rst:1025 +#: ../../library/decimal.rst:1036 msgid "" "The *traps* and *flags* fields list any signals to be set. Generally, new " "contexts should only set traps and leave the flags clear." msgstr "" -#: ../../library/decimal.rst:1028 +#: ../../library/decimal.rst:1039 msgid "" "The *Emin* and *Emax* fields are integers specifying the outer limits " "allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, " "``0``], *Emax* in the range [``0``, :const:`MAX_EMAX`]." msgstr "" -#: ../../library/decimal.rst:1032 +#: ../../library/decimal.rst:1043 msgid "" "The *capitals* field is either ``0`` or ``1`` (the default). If set to " "``1``, exponents are printed with a capital ``E``; otherwise, a lowercase " "``e`` is used: ``Decimal('6.02e+23')``." msgstr "" -#: ../../library/decimal.rst:1036 +#: ../../library/decimal.rst:1047 msgid "" "The *clamp* field is either ``0`` (the default) or ``1``. If set to ``1``, " "the exponent ``e`` of a :class:`Decimal` instance representable in this " @@ -1076,13 +1099,13 @@ msgid "" "For example::" msgstr "" -#: ../../library/decimal.rst:1051 +#: ../../library/decimal.rst:1062 msgid "" "A *clamp* value of ``1`` allows compatibility with the fixed-width decimal " "interchange formats specified in IEEE 754." msgstr "" -#: ../../library/decimal.rst:1054 +#: ../../library/decimal.rst:1065 msgid "" "The :class:`Context` class defines several general purpose methods as well " "as a large number of methods for doing arithmetic directly in a given " @@ -1095,30 +1118,30 @@ msgid "" "instance of :class:`int`) anywhere that a Decimal instance is accepted." msgstr "" -#: ../../library/decimal.rst:1067 +#: ../../library/decimal.rst:1078 msgid "Resets all of the flags to ``0``." msgstr "" -#: ../../library/decimal.rst:1071 +#: ../../library/decimal.rst:1082 msgid "Resets all of the traps to ``0``." msgstr "" -#: ../../library/decimal.rst:1077 +#: ../../library/decimal.rst:1088 msgid "Return a duplicate of the context." msgstr "" -#: ../../library/decimal.rst:1081 +#: ../../library/decimal.rst:1092 msgid "Return a copy of the Decimal instance num." msgstr "" -#: ../../library/decimal.rst:1085 +#: ../../library/decimal.rst:1096 msgid "" "Creates a new Decimal instance from *num* but using *self* as context. " "Unlike the :class:`Decimal` constructor, the context precision, rounding " "method, flags, and traps are applied to the conversion." msgstr "" -#: ../../library/decimal.rst:1089 +#: ../../library/decimal.rst:1100 msgid "" "This is useful because constants are often given to a greater precision than " "is needed by the application. Another benefit is that rounding immediately " @@ -1127,14 +1150,14 @@ msgid "" "sum can change the result:" msgstr "" -#: ../../library/decimal.rst:1103 +#: ../../library/decimal.rst:1114 msgid "" "This method implements the to-number operation of the IBM specification. If " "the argument is a string, no leading or trailing whitespace or underscores " "are permitted." msgstr "" -#: ../../library/decimal.rst:1109 +#: ../../library/decimal.rst:1120 msgid "" "Creates a new Decimal instance from a float *f* but rounding using *self* as " "the context. Unlike the :meth:`Decimal.from_float` class method, the " @@ -1142,18 +1165,18 @@ msgid "" "conversion." msgstr "" -#: ../../library/decimal.rst:1129 +#: ../../library/decimal.rst:1140 msgid "" "Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent " "value for subnormal results. When underflow occurs, the exponent is set to :" "const:`Etiny`." msgstr "" -#: ../../library/decimal.rst:1135 +#: ../../library/decimal.rst:1146 msgid "Returns a value equal to ``Emax - prec + 1``." msgstr "" -#: ../../library/decimal.rst:1137 +#: ../../library/decimal.rst:1148 msgid "" "The usual approach to working with decimals is to create :class:`Decimal` " "instances and then apply arithmetic operations which take place within the " @@ -1163,189 +1186,189 @@ msgid "" "recounted here." msgstr "" -#: ../../library/decimal.rst:1147 +#: ../../library/decimal.rst:1158 msgid "Returns the absolute value of *x*." msgstr "" -#: ../../library/decimal.rst:1152 +#: ../../library/decimal.rst:1163 msgid "Return the sum of *x* and *y*." msgstr "" -#: ../../library/decimal.rst:1157 +#: ../../library/decimal.rst:1168 msgid "Returns the same Decimal object *x*." msgstr "" -#: ../../library/decimal.rst:1162 +#: ../../library/decimal.rst:1173 msgid "Compares *x* and *y* numerically." msgstr "" -#: ../../library/decimal.rst:1167 +#: ../../library/decimal.rst:1178 msgid "Compares the values of the two operands numerically." msgstr "" -#: ../../library/decimal.rst:1172 +#: ../../library/decimal.rst:1183 msgid "Compares two operands using their abstract representation." msgstr "" -#: ../../library/decimal.rst:1177 +#: ../../library/decimal.rst:1188 msgid "" "Compares two operands using their abstract representation, ignoring sign." msgstr "" -#: ../../library/decimal.rst:1182 +#: ../../library/decimal.rst:1193 msgid "Returns a copy of *x* with the sign set to 0." msgstr "" -#: ../../library/decimal.rst:1187 +#: ../../library/decimal.rst:1198 msgid "Returns a copy of *x* with the sign inverted." msgstr "" -#: ../../library/decimal.rst:1192 +#: ../../library/decimal.rst:1203 msgid "Copies the sign from *y* to *x*." msgstr "" -#: ../../library/decimal.rst:1197 +#: ../../library/decimal.rst:1208 msgid "Return *x* divided by *y*." msgstr "" -#: ../../library/decimal.rst:1202 +#: ../../library/decimal.rst:1213 msgid "Return *x* divided by *y*, truncated to an integer." msgstr "" -#: ../../library/decimal.rst:1207 +#: ../../library/decimal.rst:1218 msgid "Divides two numbers and returns the integer part of the result." msgstr "" -#: ../../library/decimal.rst:1212 +#: ../../library/decimal.rst:1223 msgid "Returns ``e ** x``." msgstr "" -#: ../../library/decimal.rst:1217 +#: ../../library/decimal.rst:1228 msgid "Returns *x* multiplied by *y*, plus *z*." msgstr "" -#: ../../library/decimal.rst:1222 +#: ../../library/decimal.rst:1233 msgid "Returns ``True`` if *x* is canonical; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1227 +#: ../../library/decimal.rst:1238 msgid "Returns ``True`` if *x* is finite; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1232 +#: ../../library/decimal.rst:1243 msgid "Returns ``True`` if *x* is infinite; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1237 +#: ../../library/decimal.rst:1248 msgid "Returns ``True`` if *x* is a qNaN or sNaN; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1242 +#: ../../library/decimal.rst:1253 msgid "" "Returns ``True`` if *x* is a normal number; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1247 +#: ../../library/decimal.rst:1258 msgid "Returns ``True`` if *x* is a quiet NaN; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1252 +#: ../../library/decimal.rst:1263 msgid "Returns ``True`` if *x* is negative; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1257 +#: ../../library/decimal.rst:1268 msgid "" "Returns ``True`` if *x* is a signaling NaN; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1262 +#: ../../library/decimal.rst:1273 msgid "Returns ``True`` if *x* is subnormal; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1267 +#: ../../library/decimal.rst:1278 msgid "Returns ``True`` if *x* is a zero; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1272 +#: ../../library/decimal.rst:1283 msgid "Returns the natural (base e) logarithm of *x*." msgstr "" -#: ../../library/decimal.rst:1277 +#: ../../library/decimal.rst:1288 msgid "Returns the base 10 logarithm of *x*." msgstr "" -#: ../../library/decimal.rst:1282 +#: ../../library/decimal.rst:1293 msgid "Returns the exponent of the magnitude of the operand's MSD." msgstr "" -#: ../../library/decimal.rst:1287 +#: ../../library/decimal.rst:1298 msgid "Applies the logical operation *and* between each operand's digits." msgstr "" -#: ../../library/decimal.rst:1292 +#: ../../library/decimal.rst:1303 msgid "Invert all the digits in *x*." msgstr "" -#: ../../library/decimal.rst:1297 +#: ../../library/decimal.rst:1308 msgid "Applies the logical operation *or* between each operand's digits." msgstr "" -#: ../../library/decimal.rst:1302 +#: ../../library/decimal.rst:1313 msgid "Applies the logical operation *xor* between each operand's digits." msgstr "" -#: ../../library/decimal.rst:1307 +#: ../../library/decimal.rst:1318 msgid "Compares two values numerically and returns the maximum." msgstr "" -#: ../../library/decimal.rst:1312 ../../library/decimal.rst:1322 +#: ../../library/decimal.rst:1323 ../../library/decimal.rst:1333 msgid "Compares the values numerically with their sign ignored." msgstr "" -#: ../../library/decimal.rst:1317 +#: ../../library/decimal.rst:1328 msgid "Compares two values numerically and returns the minimum." msgstr "" -#: ../../library/decimal.rst:1327 +#: ../../library/decimal.rst:1338 msgid "Minus corresponds to the unary prefix minus operator in Python." msgstr "" -#: ../../library/decimal.rst:1332 +#: ../../library/decimal.rst:1343 msgid "Return the product of *x* and *y*." msgstr "" -#: ../../library/decimal.rst:1337 +#: ../../library/decimal.rst:1348 msgid "Returns the largest representable number smaller than *x*." msgstr "" -#: ../../library/decimal.rst:1342 +#: ../../library/decimal.rst:1353 msgid "Returns the smallest representable number larger than *x*." msgstr "" -#: ../../library/decimal.rst:1347 +#: ../../library/decimal.rst:1358 msgid "Returns the number closest to *x*, in direction towards *y*." msgstr "" -#: ../../library/decimal.rst:1352 +#: ../../library/decimal.rst:1363 msgid "Reduces *x* to its simplest form." msgstr "" -#: ../../library/decimal.rst:1357 +#: ../../library/decimal.rst:1368 msgid "Returns an indication of the class of *x*." msgstr "" -#: ../../library/decimal.rst:1362 +#: ../../library/decimal.rst:1373 msgid "" "Plus corresponds to the unary prefix plus operator in Python. This " "operation applies the context precision and rounding, so it is *not* an " "identity operation." msgstr "" -#: ../../library/decimal.rst:1369 +#: ../../library/decimal.rst:1380 msgid "Return ``x`` to the power of ``y``, reduced modulo ``modulo`` if given." msgstr "" -#: ../../library/decimal.rst:1371 +#: ../../library/decimal.rst:1382 msgid "" "With two arguments, compute ``x**y``. If ``x`` is negative then ``y`` must " "be integral. The result will be inexact unless ``y`` is integral and the " @@ -1354,42 +1377,42 @@ msgid "" "in the Python version." msgstr "" -#: ../../library/decimal.rst:1377 +#: ../../library/decimal.rst:1388 msgid "" "``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if " "``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``." msgstr "" -#: ../../library/decimal.rst:1380 +#: ../../library/decimal.rst:1391 msgid "" "The C module computes :meth:`power` in terms of the correctly rounded :meth:" "`exp` and :meth:`ln` functions. The result is well-defined but only \"almost " "always correctly rounded\"." msgstr "" -#: ../../library/decimal.rst:1385 +#: ../../library/decimal.rst:1396 msgid "" "With three arguments, compute ``(x**y) % modulo``. For the three argument " "form, the following restrictions on the arguments hold:" msgstr "" -#: ../../library/decimal.rst:1388 +#: ../../library/decimal.rst:1399 msgid "all three arguments must be integral" msgstr "" -#: ../../library/decimal.rst:1389 +#: ../../library/decimal.rst:1400 msgid "``y`` must be nonnegative" msgstr "" -#: ../../library/decimal.rst:1390 +#: ../../library/decimal.rst:1401 msgid "at least one of ``x`` or ``y`` must be nonzero" msgstr "" -#: ../../library/decimal.rst:1391 +#: ../../library/decimal.rst:1402 msgid "``modulo`` must be nonzero and have at most 'precision' digits" msgstr "" -#: ../../library/decimal.rst:1393 +#: ../../library/decimal.rst:1404 msgid "" "The value resulting from ``Context.power(x, y, modulo)`` is equal to the " "value that would be obtained by computing ``(x**y) % modulo`` with unbounded " @@ -1398,116 +1421,116 @@ msgid "" "result is always exact." msgstr "" -#: ../../library/decimal.rst:1403 +#: ../../library/decimal.rst:1414 msgid "Returns a value equal to *x* (rounded), having the exponent of *y*." msgstr "" -#: ../../library/decimal.rst:1408 +#: ../../library/decimal.rst:1419 msgid "Just returns 10, as this is Decimal, :)" msgstr "" -#: ../../library/decimal.rst:1413 +#: ../../library/decimal.rst:1424 msgid "Returns the remainder from integer division." msgstr "" -#: ../../library/decimal.rst:1415 +#: ../../library/decimal.rst:1426 msgid "" "The sign of the result, if non-zero, is the same as that of the original " "dividend." msgstr "" -#: ../../library/decimal.rst:1421 +#: ../../library/decimal.rst:1432 msgid "" "Returns ``x - y * n``, where *n* is the integer nearest the exact value of " "``x / y`` (if the result is 0 then its sign will be the sign of *x*)." msgstr "" -#: ../../library/decimal.rst:1427 +#: ../../library/decimal.rst:1438 msgid "Returns a rotated copy of *x*, *y* times." msgstr "" -#: ../../library/decimal.rst:1432 +#: ../../library/decimal.rst:1443 msgid "Returns ``True`` if the two operands have the same exponent." msgstr "" -#: ../../library/decimal.rst:1437 +#: ../../library/decimal.rst:1448 msgid "Returns the first operand after adding the second value its exp." msgstr "" -#: ../../library/decimal.rst:1442 +#: ../../library/decimal.rst:1453 msgid "Returns a shifted copy of *x*, *y* times." msgstr "" -#: ../../library/decimal.rst:1447 +#: ../../library/decimal.rst:1458 msgid "Square root of a non-negative number to context precision." msgstr "" -#: ../../library/decimal.rst:1452 +#: ../../library/decimal.rst:1463 msgid "Return the difference between *x* and *y*." msgstr "" -#: ../../library/decimal.rst:1466 +#: ../../library/decimal.rst:1477 msgid "Rounds to an integer." msgstr "" -#: ../../library/decimal.rst:1471 +#: ../../library/decimal.rst:1482 msgid "Converts a number to a string using scientific notation." msgstr "" -#: ../../library/decimal.rst:1478 +#: ../../library/decimal.rst:1489 msgid "Constants" msgstr "常數" -#: ../../library/decimal.rst:1480 +#: ../../library/decimal.rst:1491 msgid "" "The constants in this section are only relevant for the C module. They are " "also included in the pure Python version for compatibility." msgstr "" -#: ../../library/decimal.rst:1484 +#: ../../library/decimal.rst:1495 msgid "32-bit" msgstr "" -#: ../../library/decimal.rst:1484 +#: ../../library/decimal.rst:1495 msgid "64-bit" msgstr "" -#: ../../library/decimal.rst:1486 ../../library/decimal.rst:1488 +#: ../../library/decimal.rst:1497 ../../library/decimal.rst:1499 #, fuzzy msgid "``425000000``" msgstr ":const:`425000000`" -#: ../../library/decimal.rst:1486 ../../library/decimal.rst:1488 +#: ../../library/decimal.rst:1497 ../../library/decimal.rst:1499 #, fuzzy msgid "``999999999999999999``" msgstr ":const:`999999999999999999`" -#: ../../library/decimal.rst:1490 +#: ../../library/decimal.rst:1501 #, fuzzy msgid "``-425000000``" msgstr ":const:`-425000000`" -#: ../../library/decimal.rst:1490 +#: ../../library/decimal.rst:1501 #, fuzzy msgid "``-999999999999999999``" msgstr ":const:`-999999999999999999`" -#: ../../library/decimal.rst:1492 +#: ../../library/decimal.rst:1503 #, fuzzy msgid "``-849999999``" msgstr ":const:`-849999999`" -#: ../../library/decimal.rst:1492 +#: ../../library/decimal.rst:1503 #, fuzzy msgid "``-1999999999999999997``" msgstr ":const:`-1999999999999999997`" -#: ../../library/decimal.rst:1498 +#: ../../library/decimal.rst:1509 msgid "" "The value is ``True``. Deprecated, because Python now always has threads." msgstr "" -#: ../../library/decimal.rst:1504 +#: ../../library/decimal.rst:1515 msgid "" "The default value is ``True``. If Python is :option:`configured using the --" "without-decimal-contextvar option <--without-decimal-contextvar>`, the C " @@ -1516,59 +1539,59 @@ msgid "" "scenarios." msgstr "" -#: ../../library/decimal.rst:1509 +#: ../../library/decimal.rst:1520 msgid "backported to 3.7 and 3.8." msgstr "" -#: ../../library/decimal.rst:1513 +#: ../../library/decimal.rst:1524 msgid "Rounding modes" msgstr "" -#: ../../library/decimal.rst:1517 +#: ../../library/decimal.rst:1528 msgid "Round towards ``Infinity``." msgstr "" -#: ../../library/decimal.rst:1521 +#: ../../library/decimal.rst:1532 msgid "Round towards zero." msgstr "" -#: ../../library/decimal.rst:1525 +#: ../../library/decimal.rst:1536 msgid "Round towards ``-Infinity``." msgstr "" -#: ../../library/decimal.rst:1529 +#: ../../library/decimal.rst:1540 msgid "Round to nearest with ties going towards zero." msgstr "" -#: ../../library/decimal.rst:1533 +#: ../../library/decimal.rst:1544 msgid "Round to nearest with ties going to nearest even integer." msgstr "" -#: ../../library/decimal.rst:1537 +#: ../../library/decimal.rst:1548 msgid "Round to nearest with ties going away from zero." msgstr "" -#: ../../library/decimal.rst:1541 +#: ../../library/decimal.rst:1552 msgid "Round away from zero." msgstr "" -#: ../../library/decimal.rst:1545 +#: ../../library/decimal.rst:1556 msgid "" "Round away from zero if last digit after rounding towards zero would have " "been 0 or 5; otherwise round towards zero." msgstr "" -#: ../../library/decimal.rst:1552 +#: ../../library/decimal.rst:1563 msgid "Signals" msgstr "" -#: ../../library/decimal.rst:1554 +#: ../../library/decimal.rst:1565 msgid "" "Signals represent conditions that arise during computation. Each corresponds " "to one context flag and one context trap enabler." msgstr "" -#: ../../library/decimal.rst:1557 +#: ../../library/decimal.rst:1568 msgid "" "The context flag is set whenever the condition is encountered. After the " "computation, flags may be checked for informational purposes (for instance, " @@ -1576,7 +1599,7 @@ msgid "" "sure to clear all flags before starting the next computation." msgstr "" -#: ../../library/decimal.rst:1562 +#: ../../library/decimal.rst:1573 msgid "" "If the context's trap enabler is set for the signal, then the condition " "causes a Python exception to be raised. For example, if the :class:" @@ -1584,58 +1607,58 @@ msgid "" "raised upon encountering the condition." msgstr "" -#: ../../library/decimal.rst:1570 +#: ../../library/decimal.rst:1581 msgid "Altered an exponent to fit representation constraints." msgstr "" -#: ../../library/decimal.rst:1572 +#: ../../library/decimal.rst:1583 msgid "" "Typically, clamping occurs when an exponent falls outside the context's :" "attr:`~Context.Emin` and :attr:`~Context.Emax` limits. If possible, the " "exponent is reduced to fit by adding zeros to the coefficient." msgstr "" -#: ../../library/decimal.rst:1579 +#: ../../library/decimal.rst:1590 msgid "Base class for other signals and a subclass of :exc:`ArithmeticError`." msgstr "" -#: ../../library/decimal.rst:1584 +#: ../../library/decimal.rst:1595 msgid "Signals the division of a non-infinite number by zero." msgstr "" -#: ../../library/decimal.rst:1586 +#: ../../library/decimal.rst:1597 msgid "" "Can occur with division, modulo division, or when raising a number to a " "negative power. If this signal is not trapped, returns ``Infinity`` or ``-" "Infinity`` with the sign determined by the inputs to the calculation." msgstr "" -#: ../../library/decimal.rst:1593 +#: ../../library/decimal.rst:1604 msgid "Indicates that rounding occurred and the result is not exact." msgstr "" -#: ../../library/decimal.rst:1595 +#: ../../library/decimal.rst:1606 msgid "" "Signals when non-zero digits were discarded during rounding. The rounded " "result is returned. The signal flag or trap is used to detect when results " "are inexact." msgstr "" -#: ../../library/decimal.rst:1602 +#: ../../library/decimal.rst:1613 msgid "An invalid operation was performed." msgstr "" -#: ../../library/decimal.rst:1604 +#: ../../library/decimal.rst:1615 msgid "" "Indicates that an operation was requested that does not make sense. If not " "trapped, returns ``NaN``. Possible causes include::" msgstr "" -#: ../../library/decimal.rst:1620 +#: ../../library/decimal.rst:1631 msgid "Numerical overflow." msgstr "" -#: ../../library/decimal.rst:1622 +#: ../../library/decimal.rst:1633 msgid "" "Indicates the exponent is larger than :attr:`Context.Emax` after rounding " "has occurred. If not trapped, the result depends on the rounding mode, " @@ -1644,42 +1667,42 @@ msgid "" "`Rounded` are also signaled." msgstr "" -#: ../../library/decimal.rst:1631 +#: ../../library/decimal.rst:1642 msgid "Rounding occurred though possibly no information was lost." msgstr "" -#: ../../library/decimal.rst:1633 +#: ../../library/decimal.rst:1644 msgid "" "Signaled whenever rounding discards digits; even if those digits are zero " "(such as rounding ``5.00`` to ``5.0``). If not trapped, returns the result " "unchanged. This signal is used to detect loss of significant digits." msgstr "" -#: ../../library/decimal.rst:1641 +#: ../../library/decimal.rst:1652 msgid "Exponent was lower than :attr:`~Context.Emin` prior to rounding." msgstr "" -#: ../../library/decimal.rst:1643 +#: ../../library/decimal.rst:1654 msgid "" "Occurs when an operation result is subnormal (the exponent is too small). If " "not trapped, returns the result unchanged." msgstr "" -#: ../../library/decimal.rst:1649 +#: ../../library/decimal.rst:1660 msgid "Numerical underflow with result rounded to zero." msgstr "" -#: ../../library/decimal.rst:1651 +#: ../../library/decimal.rst:1662 msgid "" "Occurs when a subnormal result is pushed to zero by rounding. :class:" "`Inexact` and :class:`Subnormal` are also signaled." msgstr "" -#: ../../library/decimal.rst:1657 +#: ../../library/decimal.rst:1668 msgid "Enable stricter semantics for mixing floats and Decimals." msgstr "" -#: ../../library/decimal.rst:1659 +#: ../../library/decimal.rst:1670 msgid "" "If the signal is not trapped (default), mixing floats and Decimals is " "permitted in the :class:`~decimal.Decimal` constructor, :meth:`~decimal." @@ -1690,26 +1713,26 @@ msgid "" "Context.create_decimal_from_float` do not set the flag." msgstr "" -#: ../../library/decimal.rst:1667 +#: ../../library/decimal.rst:1678 msgid "" "Otherwise (the signal is trapped), only equality comparisons and explicit " "conversions are silent. All other mixed operations raise :exc:" "`FloatOperation`." msgstr "" -#: ../../library/decimal.rst:1671 +#: ../../library/decimal.rst:1682 msgid "The following table summarizes the hierarchy of signals::" msgstr "" -#: ../../library/decimal.rst:1692 +#: ../../library/decimal.rst:1703 msgid "Floating Point Notes" msgstr "" -#: ../../library/decimal.rst:1696 +#: ../../library/decimal.rst:1707 msgid "Mitigating round-off error with increased precision" msgstr "" -#: ../../library/decimal.rst:1698 +#: ../../library/decimal.rst:1709 msgid "" "The use of decimal floating point eliminates decimal representation error " "(making it possible to represent ``0.1`` exactly); however, some operations " @@ -1717,7 +1740,7 @@ msgid "" "precision." msgstr "" -#: ../../library/decimal.rst:1702 +#: ../../library/decimal.rst:1713 msgid "" "The effects of round-off error can be amplified by the addition or " "subtraction of nearly offsetting quantities resulting in loss of " @@ -1726,24 +1749,24 @@ msgid "" "of the associative and distributive properties of addition:" msgstr "" -#: ../../library/decimal.rst:1726 +#: ../../library/decimal.rst:1737 msgid "" "The :mod:`decimal` module makes it possible to restore the identities by " "expanding the precision sufficiently to avoid loss of significance:" msgstr "" -#: ../../library/decimal.rst:1746 +#: ../../library/decimal.rst:1757 msgid "Special values" msgstr "" -#: ../../library/decimal.rst:1748 +#: ../../library/decimal.rst:1759 msgid "" "The number system for the :mod:`decimal` module provides special values " "including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, " "``+0`` and ``-0``." msgstr "" -#: ../../library/decimal.rst:1752 +#: ../../library/decimal.rst:1763 msgid "" "Infinities can be constructed directly with: ``Decimal('Infinity')``. Also, " "they can arise from dividing by zero when the :exc:`DivisionByZero` signal " @@ -1752,14 +1775,14 @@ msgid "" "representable number." msgstr "" -#: ../../library/decimal.rst:1757 +#: ../../library/decimal.rst:1768 msgid "" "The infinities are signed (affine) and can be used in arithmetic operations " "where they get treated as very large, indeterminate numbers. For instance, " "adding a constant to infinity gives another infinite result." msgstr "" -#: ../../library/decimal.rst:1761 +#: ../../library/decimal.rst:1772 msgid "" "Some operations are indeterminate and return ``NaN``, or if the :exc:" "`InvalidOperation` signal is trapped, raise an exception. For example, " @@ -1770,14 +1793,14 @@ msgid "" "the calculation to proceed while flagging specific results as invalid." msgstr "" -#: ../../library/decimal.rst:1769 +#: ../../library/decimal.rst:1780 msgid "" "A variant is ``sNaN`` which signals rather than remaining quiet after every " "operation. This is a useful return value when an invalid result needs to " "interrupt a calculation for special handling." msgstr "" -#: ../../library/decimal.rst:1773 +#: ../../library/decimal.rst:1784 msgid "" "The behavior of Python's comparison operators can be a little surprising " "where a ``NaN`` is involved. A test for equality where one of the operands " @@ -1794,7 +1817,7 @@ msgid "" "compare_signal` methods instead." msgstr "" -#: ../../library/decimal.rst:1786 +#: ../../library/decimal.rst:1797 msgid "" "The signed zeros can result from calculations that underflow. They keep the " "sign that would have resulted if the calculation had been carried out to " @@ -1802,7 +1825,7 @@ msgid "" "negative zeros are treated as equal and their sign is informational." msgstr "" -#: ../../library/decimal.rst:1791 +#: ../../library/decimal.rst:1802 msgid "" "In addition to the two signed zeros which are distinct yet equal, there are " "various representations of zero with differing precisions yet equivalent in " @@ -1811,11 +1834,11 @@ msgid "" "that the following calculation returns a value equal to zero:" msgstr "" -#: ../../library/decimal.rst:1806 +#: ../../library/decimal.rst:1817 msgid "Working with threads" msgstr "" -#: ../../library/decimal.rst:1808 +#: ../../library/decimal.rst:1819 msgid "" "The :func:`getcontext` function accesses a different :class:`Context` object " "for each thread. Having separate thread contexts means that threads may " @@ -1823,20 +1846,20 @@ msgid "" "other threads." msgstr "" -#: ../../library/decimal.rst:1812 +#: ../../library/decimal.rst:1823 msgid "" "Likewise, the :func:`setcontext` function automatically assigns its target " "to the current thread." msgstr "" -#: ../../library/decimal.rst:1815 +#: ../../library/decimal.rst:1826 msgid "" "If :func:`setcontext` has not been called before :func:`getcontext`, then :" "func:`getcontext` will automatically create a new context for use in the " "current thread." msgstr "" -#: ../../library/decimal.rst:1819 +#: ../../library/decimal.rst:1830 msgid "" "The new context is copied from a prototype context called *DefaultContext*. " "To control the defaults so that each thread will use the same values " @@ -1845,51 +1868,51 @@ msgid "" "a race condition between threads calling :func:`getcontext`. For example::" msgstr "" -#: ../../library/decimal.rst:1844 +#: ../../library/decimal.rst:1855 msgid "Recipes" msgstr "" -#: ../../library/decimal.rst:1846 +#: ../../library/decimal.rst:1857 msgid "" "Here are a few recipes that serve as utility functions and that demonstrate " "ways to work with the :class:`Decimal` class::" msgstr "" -#: ../../library/decimal.rst:2001 +#: ../../library/decimal.rst:2012 msgid "Decimal FAQ" msgstr "" -#: ../../library/decimal.rst:2003 +#: ../../library/decimal.rst:2014 msgid "" "Q. It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way " "to minimize typing when using the interactive interpreter?" msgstr "" -#: ../../library/decimal.rst:2006 +#: ../../library/decimal.rst:2017 msgid "A. Some users abbreviate the constructor to just a single letter:" msgstr "" -#: ../../library/decimal.rst:2012 +#: ../../library/decimal.rst:2023 msgid "" "Q. In a fixed-point application with two decimal places, some inputs have " "many places and need to be rounded. Others are not supposed to have excess " "digits and need to be validated. What methods should be used?" msgstr "" -#: ../../library/decimal.rst:2016 +#: ../../library/decimal.rst:2027 msgid "" "A. The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal " "places. If the :const:`Inexact` trap is set, it is also useful for " "validation:" msgstr "" -#: ../../library/decimal.rst:2034 +#: ../../library/decimal.rst:2045 msgid "" "Q. Once I have valid two place inputs, how do I maintain that invariant " "throughout an application?" msgstr "" -#: ../../library/decimal.rst:2037 +#: ../../library/decimal.rst:2048 msgid "" "A. Some operations like addition, subtraction, and multiplication by an " "integer will automatically preserve fixed point. Others operations, like " @@ -1897,13 +1920,13 @@ msgid "" "places and need to be followed-up with a :meth:`~Decimal.quantize` step:" msgstr "" -#: ../../library/decimal.rst:2055 +#: ../../library/decimal.rst:2066 msgid "" "In developing fixed-point applications, it is convenient to define functions " "to handle the :meth:`~Decimal.quantize` step:" msgstr "" -#: ../../library/decimal.rst:2068 +#: ../../library/decimal.rst:2079 msgid "" "Q. There are many ways to express the same value. The numbers ``200``, " "``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various " @@ -1911,19 +1934,33 @@ msgid "" "canonical value?" msgstr "" -#: ../../library/decimal.rst:2073 +#: ../../library/decimal.rst:2084 msgid "" "A. The :meth:`~Decimal.normalize` method maps all equivalent values to a " "single representative:" msgstr "" -#: ../../library/decimal.rst:2080 +#: ../../library/decimal.rst:2091 +msgid "Q. When does rounding occur in a computation?" +msgstr "" + +#: ../../library/decimal.rst:2093 +msgid "" +"A. It occurs *after* the computation. The philosophy of the decimal " +"specification is that numbers are considered exact and are created " +"independent of the current context. They can even have greater precision " +"than current context. Computations process with those exact inputs and then " +"rounding (or other context operations) is applied to the *result* of the " +"computation::" +msgstr "" + +#: ../../library/decimal.rst:2111 msgid "" "Q. Some decimal values always print with exponential notation. Is there a " "way to get a non-exponential representation?" msgstr "" -#: ../../library/decimal.rst:2083 +#: ../../library/decimal.rst:2114 msgid "" "A. For some values, exponential notation is the only way to express the " "number of significant places in the coefficient. For example, expressing " @@ -1931,31 +1968,31 @@ msgid "" "original's two-place significance." msgstr "" -#: ../../library/decimal.rst:2088 +#: ../../library/decimal.rst:2119 msgid "" "If an application does not care about tracking significance, it is easy to " "remove the exponent and trailing zeroes, losing significance, but keeping " "the value unchanged:" msgstr "" -#: ../../library/decimal.rst:2098 +#: ../../library/decimal.rst:2129 msgid "Q. Is there a way to convert a regular float to a :class:`Decimal`?" msgstr "" -#: ../../library/decimal.rst:2100 +#: ../../library/decimal.rst:2131 msgid "" "A. Yes, any binary floating point number can be exactly expressed as a " "Decimal though an exact conversion may take more precision than intuition " "would suggest:" msgstr "" -#: ../../library/decimal.rst:2109 +#: ../../library/decimal.rst:2140 msgid "" "Q. Within a complex calculation, how can I make sure that I haven't gotten a " "spurious result because of insufficient precision or rounding anomalies." msgstr "" -#: ../../library/decimal.rst:2112 +#: ../../library/decimal.rst:2143 msgid "" "A. The decimal module makes it easy to test results. A best practice is to " "re-run calculations using greater precision and with various rounding modes. " @@ -1963,14 +2000,14 @@ msgid "" "issues, ill-conditioned inputs, or a numerically unstable algorithm." msgstr "" -#: ../../library/decimal.rst:2117 +#: ../../library/decimal.rst:2148 msgid "" "Q. I noticed that context precision is applied to the results of operations " "but not to the inputs. Is there anything to watch out for when mixing " "values of different precisions?" msgstr "" -#: ../../library/decimal.rst:2121 +#: ../../library/decimal.rst:2152 msgid "" "A. Yes. The principle is that all values are considered to be exact and so " "is the arithmetic on those values. Only the results are rounded. The " @@ -1979,23 +2016,23 @@ msgid "" "haven't been rounded:" msgstr "" -#: ../../library/decimal.rst:2134 +#: ../../library/decimal.rst:2165 msgid "" "The solution is either to increase precision or to force rounding of inputs " "using the unary plus operation:" msgstr "" -#: ../../library/decimal.rst:2143 +#: ../../library/decimal.rst:2174 msgid "" "Alternatively, inputs can be rounded upon creation using the :meth:`Context." "create_decimal` method:" msgstr "" -#: ../../library/decimal.rst:2149 +#: ../../library/decimal.rst:2180 msgid "Q. Is the CPython implementation fast for large numbers?" msgstr "" -#: ../../library/decimal.rst:2151 +#: ../../library/decimal.rst:2182 msgid "" "A. Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of " "the decimal module integrate the high speed `libmpdec Date: Thu, 29 Jun 2023 00:41:46 +0000 Subject: [PATCH 117/130] sync with cpython ce091c96 --- glossary.po | 40 +- library/asyncio-eventloop.po | 426 ++++++++++---------- library/asyncio-task.po | 13 +- library/exceptions.po | 4 +- library/optparse.po | 725 ++++++++++++++++++----------------- 5 files changed, 614 insertions(+), 594 deletions(-) diff --git a/glossary.po b/glossary.po index 2ab53cfec6..b3f2f31e02 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-29 00:39+0000\n" "PO-Revision-Date: 2022-10-23 20:00+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -205,10 +205,11 @@ msgid "asynchronous context manager" msgstr "asynchronous context manager(非同步情境管理器)" #: ../../glossary.rst:94 +#, fuzzy msgid "" "An object which controls the environment seen in an :keyword:`async with` " -"statement by defining :meth:`__aenter__` and :meth:`__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:`__aenter__` 和 :meth:`__aexit__` method(方法)來控制的。由 :pep:`492` " @@ -258,23 +259,25 @@ msgstr "" "一個由 :term:`asynchronous generator`\\ (非同步產生器)函式所建立的物件。" #: ../../glossary.rst:115 +#, fuzzy msgid "" "This is an :term:`asynchronous iterator` which when called using the :meth:" -"`__anext__` method returns an awaitable object which will execute the body " -"of the asynchronous generator function until the next :keyword:`yield` " -"expression." +"`~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:" "`__anext__` method 被呼叫時,會回傳一個可等待物件 (awaitable object),該物件" "將執行非同步產生器的函式主體,直到遇到下一個 :keyword:`yield` 運算式。" #: ../../glossary.rst:120 +#, fuzzy msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" "statements). When the *asynchronous generator iterator* effectively resumes " -"with another awaitable returned by :meth:`__anext__`, it picks up where it " -"left off. See :pep:`492` and :pep:`525`." +"with another awaitable returned by :meth:`~object.__anext__`, it picks up " +"where it left off. See :pep:`492` and :pep:`525`." msgstr "" "每個 :keyword:`yield` 會暫停處理程序,並記住位置執行狀態(包括區域變數及擱置" "中的 try 陳述式)。當\\ *非同步產生器疊代器*\\ 以另一個被 :meth:`__anext__` " @@ -286,10 +289,11 @@ msgid "asynchronous iterable" msgstr "asynchronous iterable(非同步可疊代物件)" #: ../../glossary.rst:127 +#, fuzzy msgid "" "An object, that can be used in an :keyword:`async for` statement. Must " -"return an :term:`asynchronous iterator` from its :meth:`__aiter__` method. " -"Introduced by :pep:`492`." +"return an :term:`asynchronous iterator` from its :meth:`~object.__aiter__` " +"method. Introduced by :pep:`492`." msgstr "" "一個物件,它可以在 :keyword:`async for` 陳述式中被使用。必須從它的 :meth:" "`__aiter__` method 回傳一個 :term:`asynchronous iterator`\\ (非同步疊代" @@ -300,12 +304,13 @@ msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" #: ../../glossary.rst:132 +#, fuzzy msgid "" -"An object that implements the :meth:`__aiter__` and :meth:`__anext__` " -"methods. ``__anext__`` must return an :term:`awaitable` object. :keyword:" -"`async for` resolves the awaitables returned by an asynchronous iterator's :" -"meth:`__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:`__aiter__` 和 :meth:`__anext__` method 的物件。\\ " "``__anext__`` 必須回傳一個 :term:`awaitable`\\ (可等待物件)。\\ :keyword:" @@ -342,10 +347,11 @@ msgid "awaitable" msgstr "awaitable(可等待物件)" #: ../../glossary.rst:151 +#, fuzzy msgid "" "An object that can be used in an :keyword:`await` expression. Can be a :" -"term:`coroutine` or an object with an :meth:`__await__` method. See also :" -"pep:`492`." +"term:`coroutine` or an object with an :meth:`~object.__await__` method. See " +"also :pep:`492`." msgstr "" "一個可以在 :keyword:`await` 運算式中被使用的物件。它可以是一個 :term:" "`coroutine`\\ (協程),或是一個有 :meth:`__await__` method 的物件。另請參" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index aeb0867e59..c518fadbbb 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-06-29 00:39+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -262,8 +262,8 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:182 -#: ../../library/asyncio-eventloop.rst:1216 -#: ../../library/asyncio-eventloop.rst:1604 +#: ../../library/asyncio-eventloop.rst:1219 +#: ../../library/asyncio-eventloop.rst:1607 msgid "Example::" msgstr "" "範例:\n" @@ -526,8 +526,8 @@ msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:406 -#: ../../library/asyncio-eventloop.rst:1132 -#: ../../library/asyncio-eventloop.rst:1148 +#: ../../library/asyncio-eventloop.rst:1135 +#: ../../library/asyncio-eventloop.rst:1151 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." @@ -653,7 +653,7 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:484 -#: ../../library/asyncio-eventloop.rst:895 +#: ../../library/asyncio-eventloop.rst:898 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " @@ -663,7 +663,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:488 #: ../../library/asyncio-eventloop.rst:721 #: ../../library/asyncio-eventloop.rst:815 -#: ../../library/asyncio-eventloop.rst:899 +#: ../../library/asyncio-eventloop.rst:902 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " @@ -711,7 +711,7 @@ msgstr "更多資訊請見:\\ https://tools.ietf.org/html/rfc6555" #: ../../library/asyncio-eventloop.rst:747 #: ../../library/asyncio-eventloop.rst:782 #: ../../library/asyncio-eventloop.rst:829 -#: ../../library/asyncio-eventloop.rst:907 +#: ../../library/asyncio-eventloop.rst:910 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" @@ -864,7 +864,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:633 #: ../../library/asyncio-eventloop.rst:773 -#: ../../library/asyncio-eventloop.rst:1199 +#: ../../library/asyncio-eventloop.rst:1202 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -1045,7 +1045,7 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:794 -#: ../../library/asyncio-eventloop.rst:881 +#: ../../library/asyncio-eventloop.rst:884 msgid "Parameters:" msgstr "參數:" @@ -1090,7 +1090,7 @@ msgid "*file* must be a regular file object opened in binary mode." msgstr "" #: ../../library/asyncio-eventloop.rst:845 -#: ../../library/asyncio-eventloop.rst:1087 +#: ../../library/asyncio-eventloop.rst:1090 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1135,74 +1135,80 @@ msgid "" "exchanges extra TLS session packets with *transport*." msgstr "" -#: ../../library/asyncio-eventloop.rst:883 +#: ../../library/asyncio-eventloop.rst:881 +msgid "" +"In some situations (e.g. when the passed transport is already closing) this " +"may return ``None``." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:886 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:887 +#: ../../library/asyncio-eventloop.rst:890 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:889 +#: ../../library/asyncio-eventloop.rst:892 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:892 +#: ../../library/asyncio-eventloop.rst:895 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:912 +#: ../../library/asyncio-eventloop.rst:915 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:916 +#: ../../library/asyncio-eventloop.rst:919 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: ../../library/asyncio-eventloop.rst:922 +#: ../../library/asyncio-eventloop.rst:925 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." msgstr "" -#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:930 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:931 -#: ../../library/asyncio-eventloop.rst:1186 +#: ../../library/asyncio-eventloop.rst:934 +#: ../../library/asyncio-eventloop.rst:1189 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:936 +#: ../../library/asyncio-eventloop.rst:939 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." msgstr "" -#: ../../library/asyncio-eventloop.rst:939 +#: ../../library/asyncio-eventloop.rst:942 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:944 +#: ../../library/asyncio-eventloop.rst:947 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:946 +#: ../../library/asyncio-eventloop.rst:949 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1211,72 +1217,72 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:955 +#: ../../library/asyncio-eventloop.rst:958 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:958 +#: ../../library/asyncio-eventloop.rst:961 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:960 -#: ../../library/asyncio-eventloop.rst:974 -#: ../../library/asyncio-eventloop.rst:985 -#: ../../library/asyncio-eventloop.rst:997 -#: ../../library/asyncio-eventloop.rst:1012 -#: ../../library/asyncio-eventloop.rst:1027 -#: ../../library/asyncio-eventloop.rst:1037 -#: ../../library/asyncio-eventloop.rst:1063 -#: ../../library/asyncio-eventloop.rst:1101 +#: ../../library/asyncio-eventloop.rst:963 +#: ../../library/asyncio-eventloop.rst:977 +#: ../../library/asyncio-eventloop.rst:988 +#: ../../library/asyncio-eventloop.rst:1000 +#: ../../library/asyncio-eventloop.rst:1015 +#: ../../library/asyncio-eventloop.rst:1030 +#: ../../library/asyncio-eventloop.rst:1040 +#: ../../library/asyncio-eventloop.rst:1066 +#: ../../library/asyncio-eventloop.rst:1104 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:962 +#: ../../library/asyncio-eventloop.rst:965 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:969 +#: ../../library/asyncio-eventloop.rst:972 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:972 +#: ../../library/asyncio-eventloop.rst:975 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:980 +#: ../../library/asyncio-eventloop.rst:983 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:983 +#: ../../library/asyncio-eventloop.rst:986 msgid "Return a tuple of (received data, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:991 +#: ../../library/asyncio-eventloop.rst:994 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:995 +#: ../../library/asyncio-eventloop.rst:998 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1003 +#: ../../library/asyncio-eventloop.rst:1006 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1006 +#: ../../library/asyncio-eventloop.rst:1009 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1285,34 +1291,34 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1014 -#: ../../library/asyncio-eventloop.rst:1065 +#: ../../library/asyncio-eventloop.rst:1017 +#: ../../library/asyncio-eventloop.rst:1068 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1021 +#: ../../library/asyncio-eventloop.rst:1024 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1025 +#: ../../library/asyncio-eventloop.rst:1028 msgid "Return the number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1033 +#: ../../library/asyncio-eventloop.rst:1036 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1035 +#: ../../library/asyncio-eventloop.rst:1038 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1039 +#: ../../library/asyncio-eventloop.rst:1042 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1320,19 +1326,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1048 +#: ../../library/asyncio-eventloop.rst:1051 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1054 +#: ../../library/asyncio-eventloop.rst:1057 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1057 +#: ../../library/asyncio-eventloop.rst:1060 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1340,57 +1346,57 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1072 +#: ../../library/asyncio-eventloop.rst:1075 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:1077 +#: ../../library/asyncio-eventloop.rst:1080 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1080 +#: ../../library/asyncio-eventloop.rst:1083 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1082 +#: ../../library/asyncio-eventloop.rst:1085 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1085 +#: ../../library/asyncio-eventloop.rst:1088 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1094 +#: ../../library/asyncio-eventloop.rst:1097 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1098 +#: ../../library/asyncio-eventloop.rst:1101 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1107 +#: ../../library/asyncio-eventloop.rst:1110 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1112 +#: ../../library/asyncio-eventloop.rst:1115 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1116 +#: ../../library/asyncio-eventloop.rst:1119 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1118 +#: ../../library/asyncio-eventloop.rst:1121 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1398,67 +1404,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:1126 +#: ../../library/asyncio-eventloop.rst:1129 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:1130 +#: ../../library/asyncio-eventloop.rst:1133 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1135 +#: ../../library/asyncio-eventloop.rst:1138 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1137 +#: ../../library/asyncio-eventloop.rst:1140 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1141 -#: ../../library/asyncio-eventloop.rst:1157 +#: ../../library/asyncio-eventloop.rst:1144 +#: ../../library/asyncio-eventloop.rst:1160 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1146 +#: ../../library/asyncio-eventloop.rst:1149 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1151 +#: ../../library/asyncio-eventloop.rst:1154 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1153 +#: ../../library/asyncio-eventloop.rst:1156 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1162 +#: ../../library/asyncio-eventloop.rst:1165 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1167 +#: ../../library/asyncio-eventloop.rst:1170 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1172 +#: ../../library/asyncio-eventloop.rst:1175 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1176 +#: ../../library/asyncio-eventloop.rst:1179 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1178 +#: ../../library/asyncio-eventloop.rst:1181 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1466,46 +1472,46 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1183 +#: ../../library/asyncio-eventloop.rst:1186 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1189 +#: ../../library/asyncio-eventloop.rst:1192 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1194 +#: ../../library/asyncio-eventloop.rst:1197 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1196 +#: ../../library/asyncio-eventloop.rst:1199 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1203 +#: ../../library/asyncio-eventloop.rst:1206 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1207 +#: ../../library/asyncio-eventloop.rst:1210 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1211 +#: ../../library/asyncio-eventloop.rst:1214 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1213 +#: ../../library/asyncio-eventloop.rst:1216 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1258 +#: ../../library/asyncio-eventloop.rst:1261 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1513,17 +1519,17 @@ msgid "" "importing of main module `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1263 +#: ../../library/asyncio-eventloop.rst:1266 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1265 +#: ../../library/asyncio-eventloop.rst:1268 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1268 +#: ../../library/asyncio-eventloop.rst:1271 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1531,32 +1537,32 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1277 +#: ../../library/asyncio-eventloop.rst:1280 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1281 +#: ../../library/asyncio-eventloop.rst:1284 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1287 +#: ../../library/asyncio-eventloop.rst:1290 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1289 +#: ../../library/asyncio-eventloop.rst:1292 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1293 +#: ../../library/asyncio-eventloop.rst:1296 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1295 +#: ../../library/asyncio-eventloop.rst:1298 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1565,158 +1571,158 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1305 +#: ../../library/asyncio-eventloop.rst:1308 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1312 +#: ../../library/asyncio-eventloop.rst:1315 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1314 +#: ../../library/asyncio-eventloop.rst:1317 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1318 +#: ../../library/asyncio-eventloop.rst:1321 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1323 +#: ../../library/asyncio-eventloop.rst:1326 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1325 +#: ../../library/asyncio-eventloop.rst:1328 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1328 +#: ../../library/asyncio-eventloop.rst:1331 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1329 +#: ../../library/asyncio-eventloop.rst:1332 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1330 +#: ../../library/asyncio-eventloop.rst:1333 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1331 +#: ../../library/asyncio-eventloop.rst:1334 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1332 +#: ../../library/asyncio-eventloop.rst:1335 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1333 +#: ../../library/asyncio-eventloop.rst:1336 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1334 +#: ../../library/asyncio-eventloop.rst:1337 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1335 +#: ../../library/asyncio-eventloop.rst:1338 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1337 +#: ../../library/asyncio-eventloop.rst:1340 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1337 +#: ../../library/asyncio-eventloop.rst:1340 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1341 +#: ../../library/asyncio-eventloop.rst:1344 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1346 +#: ../../library/asyncio-eventloop.rst:1349 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1350 +#: ../../library/asyncio-eventloop.rst:1353 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1352 +#: ../../library/asyncio-eventloop.rst:1355 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1358 +#: ../../library/asyncio-eventloop.rst:1361 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1362 +#: ../../library/asyncio-eventloop.rst:1365 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1367 +#: ../../library/asyncio-eventloop.rst:1370 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1371 +#: ../../library/asyncio-eventloop.rst:1374 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1373 +#: ../../library/asyncio-eventloop.rst:1376 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1380 +#: ../../library/asyncio-eventloop.rst:1383 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1389 +#: ../../library/asyncio-eventloop.rst:1392 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1392 +#: ../../library/asyncio-eventloop.rst:1395 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1394 +#: ../../library/asyncio-eventloop.rst:1397 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1395 +#: ../../library/asyncio-eventloop.rst:1398 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1398 +#: ../../library/asyncio-eventloop.rst:1401 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1402 +#: ../../library/asyncio-eventloop.rst:1405 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1724,136 +1730,136 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1408 +#: ../../library/asyncio-eventloop.rst:1411 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1411 +#: ../../library/asyncio-eventloop.rst:1414 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1413 +#: ../../library/asyncio-eventloop.rst:1416 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1415 +#: ../../library/asyncio-eventloop.rst:1418 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard input stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1418 -#: ../../library/asyncio-eventloop.rst:1430 -#: ../../library/asyncio-eventloop.rst:1442 +#: ../../library/asyncio-eventloop.rst:1421 +#: ../../library/asyncio-eventloop.rst:1433 +#: ../../library/asyncio-eventloop.rst:1445 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1420 -#: ../../library/asyncio-eventloop.rst:1432 -#: ../../library/asyncio-eventloop.rst:1444 +#: ../../library/asyncio-eventloop.rst:1423 +#: ../../library/asyncio-eventloop.rst:1435 +#: ../../library/asyncio-eventloop.rst:1447 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1422 -#: ../../library/asyncio-eventloop.rst:1434 -#: ../../library/asyncio-eventloop.rst:1446 +#: ../../library/asyncio-eventloop.rst:1425 +#: ../../library/asyncio-eventloop.rst:1437 +#: ../../library/asyncio-eventloop.rst:1449 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1425 +#: ../../library/asyncio-eventloop.rst:1428 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1427 +#: ../../library/asyncio-eventloop.rst:1430 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard output stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1437 +#: ../../library/asyncio-eventloop.rst:1440 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1439 +#: ../../library/asyncio-eventloop.rst:1442 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard error stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1448 +#: ../../library/asyncio-eventloop.rst:1451 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1451 +#: ../../library/asyncio-eventloop.rst:1454 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1456 +#: ../../library/asyncio-eventloop.rst:1459 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1460 +#: ../../library/asyncio-eventloop.rst:1463 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1463 +#: ../../library/asyncio-eventloop.rst:1466 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1471 +#: ../../library/asyncio-eventloop.rst:1474 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1476 +#: ../../library/asyncio-eventloop.rst:1479 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1479 +#: ../../library/asyncio-eventloop.rst:1482 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1482 +#: ../../library/asyncio-eventloop.rst:1485 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1485 +#: ../../library/asyncio-eventloop.rst:1488 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1490 +#: ../../library/asyncio-eventloop.rst:1493 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1863,105 +1869,105 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1499 +#: ../../library/asyncio-eventloop.rst:1502 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1503 +#: ../../library/asyncio-eventloop.rst:1506 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1508 +#: ../../library/asyncio-eventloop.rst:1511 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1513 +#: ../../library/asyncio-eventloop.rst:1516 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1519 +#: ../../library/asyncio-eventloop.rst:1522 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1522 +#: ../../library/asyncio-eventloop.rst:1525 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1526 +#: ../../library/asyncio-eventloop.rst:1529 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1528 +#: ../../library/asyncio-eventloop.rst:1531 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1535 +#: ../../library/asyncio-eventloop.rst:1538 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1537 +#: ../../library/asyncio-eventloop.rst:1540 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1541 +#: ../../library/asyncio-eventloop.rst:1544 msgid "Do not instantiate the :class:`Server` class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1545 +#: ../../library/asyncio-eventloop.rst:1548 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1558 +#: ../../library/asyncio-eventloop.rst:1561 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1563 +#: ../../library/asyncio-eventloop.rst:1566 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1566 +#: ../../library/asyncio-eventloop.rst:1569 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1569 +#: ../../library/asyncio-eventloop.rst:1572 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1574 +#: ../../library/asyncio-eventloop.rst:1577 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1580 +#: ../../library/asyncio-eventloop.rst:1583 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1582 +#: ../../library/asyncio-eventloop.rst:1585 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1585 +#: ../../library/asyncio-eventloop.rst:1588 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -1970,98 +1976,98 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1596 +#: ../../library/asyncio-eventloop.rst:1599 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1600 +#: ../../library/asyncio-eventloop.rst:1603 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1622 +#: ../../library/asyncio-eventloop.rst:1625 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1628 +#: ../../library/asyncio-eventloop.rst:1631 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1632 +#: ../../library/asyncio-eventloop.rst:1635 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1635 +#: ../../library/asyncio-eventloop.rst:1638 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1645 +#: ../../library/asyncio-eventloop.rst:1648 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1647 +#: ../../library/asyncio-eventloop.rst:1650 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1650 +#: ../../library/asyncio-eventloop.rst:1653 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1656 +#: ../../library/asyncio-eventloop.rst:1659 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1658 +#: ../../library/asyncio-eventloop.rst:1661 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1673 +#: ../../library/asyncio-eventloop.rst:1676 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1678 +#: ../../library/asyncio-eventloop.rst:1681 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1680 +#: ../../library/asyncio-eventloop.rst:1683 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1684 +#: ../../library/asyncio-eventloop.rst:1687 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1690 +#: ../../library/asyncio-eventloop.rst:1693 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1692 +#: ../../library/asyncio-eventloop.rst:1695 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1698 +#: ../../library/asyncio-eventloop.rst:1701 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1700 +#: ../../library/asyncio-eventloop.rst:1703 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2069,70 +2075,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1710 +#: ../../library/asyncio-eventloop.rst:1713 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1712 +#: ../../library/asyncio-eventloop.rst:1715 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1736 +#: ../../library/asyncio-eventloop.rst:1739 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1743 +#: ../../library/asyncio-eventloop.rst:1746 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1745 +#: ../../library/asyncio-eventloop.rst:1748 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1773 +#: ../../library/asyncio-eventloop.rst:1776 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1780 +#: ../../library/asyncio-eventloop.rst:1783 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1782 +#: ../../library/asyncio-eventloop.rst:1785 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1820 +#: ../../library/asyncio-eventloop.rst:1823 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1824 +#: ../../library/asyncio-eventloop.rst:1827 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1832 +#: ../../library/asyncio-eventloop.rst:1835 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1834 +#: ../../library/asyncio-eventloop.rst:1837 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1836 +#: ../../library/asyncio-eventloop.rst:1839 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 13b59c3f0f..a4fbbbae7b 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-29 00:39+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -564,20 +564,19 @@ msgstr "" msgid "" "If ``long_running_task`` takes more than 10 seconds to complete, the context " "manager will cancel the current task and handle the resulting :exc:`asyncio." -"CancelledError` internally, transforming it into an :exc:`asyncio." -"TimeoutError` which can be caught and handled." +"CancelledError` internally, transforming it into a :exc:`TimeoutError` which " +"can be caught and handled." msgstr "" #: ../../library/asyncio-task.rst:608 msgid "" "The :func:`asyncio.timeout` context manager is what transforms the :exc:" -"`asyncio.CancelledError` into an :exc:`asyncio.TimeoutError`, which means " -"the :exc:`asyncio.TimeoutError` can only be caught *outside* of the context " -"manager." +"`asyncio.CancelledError` into a :exc:`TimeoutError`, which means the :exc:" +"`TimeoutError` can only be caught *outside* of the context manager." msgstr "" #: ../../library/asyncio-task.rst:613 -msgid "Example of catching :exc:`asyncio.TimeoutError`::" +msgid "Example of catching :exc:`TimeoutError`::" msgstr "" #: ../../library/asyncio-task.rst:624 diff --git a/library/exceptions.po b/library/exceptions.po index f4bd3bae70..f1cc37416d 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-29 00:39+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-" @@ -524,7 +524,7 @@ msgstr "" #: ../../library/exceptions.rst:453 msgid "" -"Must be raised by :meth:`__anext__` method of an :term:`asynchronous " +"Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" diff --git a/library/optparse.po b/library/optparse.po index e16f5b0631..688782bc86 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-25 00:30+0000\n" +"POT-Creation-Date: 2023-06-29 00:39+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -56,13 +56,14 @@ msgstr "" #: ../../library/optparse.rst:44 msgid "" "As it parses the command line, :mod:`optparse` sets attributes of the " -"``options`` object returned by :meth:`parse_args` based on user-supplied " -"command-line values. When :meth:`parse_args` returns from parsing this " -"command line, ``options.filename`` will be ``\"outfile\"`` and ``options." -"verbose`` will be ``False``. :mod:`optparse` supports both long and short " -"options, allows short options to be merged together, and allows options to " -"be associated with their arguments in a variety of ways. Thus, the " -"following command lines are all equivalent to the above example::" +"``options`` object returned by :meth:`~OptionParser.parse_args` based on " +"user-supplied command-line values. When :meth:`~OptionParser.parse_args` " +"returns from parsing this command line, ``options.filename`` will be " +"``\"outfile\"`` and ``options.verbose`` will be ``False``. :mod:`optparse` " +"supports both long and short options, allows short options to be merged " +"together, and allows options to be associated with their arguments in a " +"variety of ways. Thus, the following command lines are all equivalent to " +"the above example::" msgstr "" #: ../../library/optparse.rst:58 @@ -365,12 +366,14 @@ msgstr "" #: ../../library/optparse.rst:288 msgid "" -"(If you like, you can pass a custom argument list to :meth:`parse_args`, but " -"that's rarely necessary: by default it uses ``sys.argv[1:]``.)" +"(If you like, you can pass a custom argument list to :meth:`~OptionParser." +"parse_args`, but that's rarely necessary: by default it uses ``sys." +"argv[1:]``.)" msgstr "" #: ../../library/optparse.rst:291 -msgid ":meth:`parse_args` returns two values:" +#, fuzzy +msgid ":meth:`~OptionParser.parse_args` returns two values:" msgstr ":meth:`parse_args` 回傳兩個值:" #: ../../library/optparse.rst:293 @@ -440,7 +443,8 @@ msgstr "" msgid "" "When :mod:`optparse` sees the option string ``-f``, it consumes the next " "argument, ``foo.txt``, and stores it in ``options.filename``. So, after " -"this call to :meth:`parse_args`, ``options.filename`` is ``\"foo.txt\"``." +"this call to :meth:`~OptionParser.parse_args`, ``options.filename`` is " +"``\"foo.txt\"``." msgstr "" #: ../../library/optparse.rst:344 @@ -522,35 +526,35 @@ msgstr "" msgid "Some other actions supported by :mod:`optparse` are:" msgstr "" -#: ../../library/optparse.rst:407 ../../library/optparse.rst:928 +#: ../../library/optparse.rst:407 ../../library/optparse.rst:929 msgid "``\"store_const\"``" msgstr "``\"store_const\"``" -#: ../../library/optparse.rst:407 ../../library/optparse.rst:928 +#: ../../library/optparse.rst:407 ../../library/optparse.rst:929 msgid "store a constant value, pre-set via :attr:`Option.const`" msgstr "" -#: ../../library/optparse.rst:410 ../../library/optparse.rst:937 +#: ../../library/optparse.rst:410 ../../library/optparse.rst:938 msgid "``\"append\"``" msgstr "``\"append\"``" -#: ../../library/optparse.rst:410 ../../library/optparse.rst:937 +#: ../../library/optparse.rst:410 ../../library/optparse.rst:938 msgid "append this option's argument to a list" msgstr "" -#: ../../library/optparse.rst:413 ../../library/optparse.rst:943 +#: ../../library/optparse.rst:413 ../../library/optparse.rst:944 msgid "``\"count\"``" msgstr "``\"count\"``" -#: ../../library/optparse.rst:413 ../../library/optparse.rst:943 +#: ../../library/optparse.rst:413 ../../library/optparse.rst:944 msgid "increment a counter by one" msgstr "" -#: ../../library/optparse.rst:416 ../../library/optparse.rst:946 +#: ../../library/optparse.rst:416 ../../library/optparse.rst:947 msgid "``\"callback\"``" msgstr "``\"callback\"``" -#: ../../library/optparse.rst:416 ../../library/optparse.rst:946 +#: ../../library/optparse.rst:416 ../../library/optparse.rst:947 msgid "call a specified function" msgstr "" @@ -601,21 +605,21 @@ msgstr "" msgid "" "A clearer way to specify default values is the :meth:`set_defaults` method " "of OptionParser, which you can call at any time before calling :meth:" -"`parse_args`::" +"`~OptionParser.parse_args`::" msgstr "" -#: ../../library/optparse.rst:462 +#: ../../library/optparse.rst:463 msgid "" "As before, the last value specified for a given option destination is the " "one that counts. For clarity, try to use one method or the other of setting " "default values, not both." msgstr "" -#: ../../library/optparse.rst:470 +#: ../../library/optparse.rst:471 msgid "Generating help" msgstr "" -#: ../../library/optparse.rst:472 +#: ../../library/optparse.rst:473 msgid "" ":mod:`optparse`'s ability to generate help and usage text automatically is " "useful for creating user-friendly command-line interfaces. All you have to " @@ -624,57 +628,57 @@ msgid "" "populated with user-friendly (documented) options::" msgstr "" -#: ../../library/optparse.rst:493 +#: ../../library/optparse.rst:494 msgid "" "If :mod:`optparse` encounters either ``-h`` or ``--help`` on the command-" "line, or if you just call :meth:`parser.print_help`, it prints the following " "to standard output:" msgstr "" -#: ../../library/optparse.rst:510 +#: ../../library/optparse.rst:511 msgid "" "(If the help output is triggered by a help option, :mod:`optparse` exits " "after printing the help text.)" msgstr "" -#: ../../library/optparse.rst:513 +#: ../../library/optparse.rst:514 msgid "" "There's a lot going on here to help :mod:`optparse` generate the best " "possible help message:" msgstr "" -#: ../../library/optparse.rst:516 +#: ../../library/optparse.rst:517 msgid "the script defines its own usage message::" msgstr "" -#: ../../library/optparse.rst:520 +#: ../../library/optparse.rst:521 msgid "" ":mod:`optparse` expands ``%prog`` in the usage string to the name of the " "current program, i.e. ``os.path.basename(sys.argv[0])``. The expanded " "string is then printed before the detailed option help." msgstr "" -#: ../../library/optparse.rst:524 +#: ../../library/optparse.rst:525 msgid "" "If you don't supply a usage string, :mod:`optparse` uses a bland but " "sensible default: ``\"Usage: %prog [options]\"``, which is fine if your " "script doesn't take any positional arguments." msgstr "" -#: ../../library/optparse.rst:528 +#: ../../library/optparse.rst:529 msgid "" "every option defines a help string, and doesn't worry about line-wrapping---" "\\ :mod:`optparse` takes care of wrapping lines and making the help output " "look good." msgstr "" -#: ../../library/optparse.rst:532 +#: ../../library/optparse.rst:533 msgid "" "options that take a value indicate this fact in their automatically " "generated help message, e.g. for the \"mode\" option::" msgstr "" -#: ../../library/optparse.rst:537 +#: ../../library/optparse.rst:538 msgid "" "Here, \"MODE\" is called the meta-variable: it stands for the argument that " "the user is expected to supply to ``-m``/``--mode``. By default, :mod:" @@ -684,7 +688,7 @@ msgid "" "this automatically generated option description::" msgstr "" -#: ../../library/optparse.rst:546 +#: ../../library/optparse.rst:547 msgid "" "This is important for more than just saving space, though: the manually " "written help text uses the meta-variable ``FILE`` to clue the user in that " @@ -694,7 +698,7 @@ msgid "" "users." msgstr "" -#: ../../library/optparse.rst:552 +#: ../../library/optparse.rst:553 msgid "" "options that have a default value can include ``%default`` in the help " "string---\\ :mod:`optparse` will replace it with :func:`str` of the option's " @@ -702,96 +706,96 @@ msgid "" "``None``), ``%default`` expands to ``none``." msgstr "" -#: ../../library/optparse.rst:558 +#: ../../library/optparse.rst:559 msgid "Grouping Options" msgstr "" -#: ../../library/optparse.rst:560 +#: ../../library/optparse.rst:561 msgid "" "When dealing with many options, it is convenient to group these options for " "better help output. An :class:`OptionParser` can contain several option " "groups, each of which can contain several options." msgstr "" -#: ../../library/optparse.rst:564 +#: ../../library/optparse.rst:565 msgid "An option group is obtained using the class :class:`OptionGroup`:" msgstr "" -#: ../../library/optparse.rst:568 ../../library/optparse.rst:1637 +#: ../../library/optparse.rst:569 ../../library/optparse.rst:1640 msgid "where" msgstr "" -#: ../../library/optparse.rst:570 +#: ../../library/optparse.rst:571 msgid "" "parser is the :class:`OptionParser` instance the group will be inserted in to" msgstr "" -#: ../../library/optparse.rst:572 +#: ../../library/optparse.rst:573 msgid "title is the group title" msgstr "" -#: ../../library/optparse.rst:573 +#: ../../library/optparse.rst:574 msgid "description, optional, is a long description of the group" msgstr "" -#: ../../library/optparse.rst:575 +#: ../../library/optparse.rst:576 msgid "" ":class:`OptionGroup` inherits from :class:`OptionContainer` (like :class:" "`OptionParser`) and so the :meth:`add_option` method can be used to add an " "option to the group." msgstr "" -#: ../../library/optparse.rst:579 +#: ../../library/optparse.rst:580 msgid "" "Once all the options are declared, using the :class:`OptionParser` method :" "meth:`add_option_group` the group is added to the previously defined parser." msgstr "" -#: ../../library/optparse.rst:582 +#: ../../library/optparse.rst:583 msgid "" "Continuing with the parser defined in the previous section, adding an :class:" "`OptionGroup` to a parser is easy::" msgstr "" -#: ../../library/optparse.rst:591 +#: ../../library/optparse.rst:592 msgid "This would result in the following help output:" msgstr "" -#: ../../library/optparse.rst:612 +#: ../../library/optparse.rst:613 msgid "" "A bit more complete example might involve using more than one group: still " "extending the previous example::" msgstr "" -#: ../../library/optparse.rst:629 +#: ../../library/optparse.rst:630 msgid "that results in the following output:" msgstr "" -#: ../../library/optparse.rst:655 +#: ../../library/optparse.rst:656 msgid "" "Another interesting method, in particular when working programmatically with " "option groups is:" msgstr "" -#: ../../library/optparse.rst:660 +#: ../../library/optparse.rst:661 msgid "" "Return the :class:`OptionGroup` to which the short or long option string " "*opt_str* (e.g. ``'-o'`` or ``'--option'``) belongs. If there's no such :" "class:`OptionGroup`, return ``None``." msgstr "" -#: ../../library/optparse.rst:667 +#: ../../library/optparse.rst:668 msgid "Printing a version string" msgstr "" -#: ../../library/optparse.rst:669 +#: ../../library/optparse.rst:670 msgid "" "Similar to the brief usage string, :mod:`optparse` can also print a version " "string for your program. You have to supply the string as the ``version`` " "argument to OptionParser::" msgstr "" -#: ../../library/optparse.rst:675 +#: ../../library/optparse.rst:676 msgid "" "``%prog`` is expanded just like it is in ``usage``. Apart from that, " "``version`` can contain anything you like. When you supply it, :mod:" @@ -800,17 +804,17 @@ msgid "" "string (by replacing ``%prog``), prints it to stdout, and exits." msgstr "" -#: ../../library/optparse.rst:681 +#: ../../library/optparse.rst:682 msgid "For example, if your script is called ``/usr/bin/foo``:" msgstr "" -#: ../../library/optparse.rst:688 +#: ../../library/optparse.rst:689 msgid "" "The following two methods can be used to print and get the ``version`` " "string:" msgstr "" -#: ../../library/optparse.rst:692 +#: ../../library/optparse.rst:693 msgid "" "Print the version message for the current program (``self.version``) to " "*file* (default stdout). As with :meth:`print_usage`, any occurrence of " @@ -818,17 +822,17 @@ msgid "" "program. Does nothing if ``self.version`` is empty or undefined." msgstr "" -#: ../../library/optparse.rst:699 +#: ../../library/optparse.rst:700 msgid "" "Same as :meth:`print_version` but returns the version string instead of " "printing it." msgstr "" -#: ../../library/optparse.rst:706 +#: ../../library/optparse.rst:707 msgid "How :mod:`optparse` handles errors" msgstr "" -#: ../../library/optparse.rst:708 +#: ../../library/optparse.rst:709 msgid "" "There are two broad classes of errors that :mod:`optparse` has to worry " "about: programmer errors and user errors. Programmer errors are usually " @@ -838,7 +842,7 @@ msgid "" "OptionError` or :exc:`TypeError`) and let the program crash." msgstr "" -#: ../../library/optparse.rst:715 +#: ../../library/optparse.rst:716 msgid "" "Handling user errors is much more important, since they are guaranteed to " "happen no matter how stable your code is. :mod:`optparse` can automatically " @@ -849,71 +853,71 @@ msgid "" "error condition::" msgstr "" -#: ../../library/optparse.rst:728 +#: ../../library/optparse.rst:729 msgid "" "In either case, :mod:`optparse` handles the error the same way: it prints " "the program's usage message and an error message to standard error and exits " "with error status 2." msgstr "" -#: ../../library/optparse.rst:732 +#: ../../library/optparse.rst:733 msgid "" "Consider the first example above, where the user passes ``4x`` to an option " "that takes an integer:" msgstr "" -#: ../../library/optparse.rst:742 +#: ../../library/optparse.rst:743 msgid "Or, where the user fails to pass a value at all:" msgstr "" -#: ../../library/optparse.rst:751 +#: ../../library/optparse.rst:752 msgid "" ":mod:`optparse`\\ -generated error messages take care always to mention the " "option involved in the error; be sure to do the same when calling :func:" "`OptionParser.error` from your application code." msgstr "" -#: ../../library/optparse.rst:755 +#: ../../library/optparse.rst:756 msgid "" "If :mod:`optparse`'s default error-handling behaviour does not suit your " "needs, you'll need to subclass OptionParser and override its :meth:" "`~OptionParser.exit` and/or :meth:`~OptionParser.error` methods." msgstr "" -#: ../../library/optparse.rst:763 +#: ../../library/optparse.rst:764 msgid "Putting it all together" msgstr "" -#: ../../library/optparse.rst:765 +#: ../../library/optparse.rst:766 msgid "Here's what :mod:`optparse`\\ -based scripts usually look like::" msgstr "" -#: ../../library/optparse.rst:793 +#: ../../library/optparse.rst:794 msgid "Reference Guide" msgstr "" -#: ../../library/optparse.rst:799 +#: ../../library/optparse.rst:800 msgid "Creating the parser" msgstr "" -#: ../../library/optparse.rst:801 +#: ../../library/optparse.rst:802 msgid "" "The first step in using :mod:`optparse` is to create an OptionParser " "instance." msgstr "" -#: ../../library/optparse.rst:805 +#: ../../library/optparse.rst:806 msgid "" "The OptionParser constructor has no required arguments, but a number of " "optional keyword arguments. You should always pass them as keyword " "arguments, i.e. do not rely on the order in which the arguments are declared." msgstr "" -#: ../../library/optparse.rst:814 +#: ../../library/optparse.rst:815 msgid "``usage`` (default: ``\"%prog [options]\"``)" msgstr "" -#: ../../library/optparse.rst:810 +#: ../../library/optparse.rst:811 msgid "" "The usage summary to print when your program is run incorrectly or with a " "help option. When :mod:`optparse` prints the usage string, it expands " @@ -922,11 +926,11 @@ msgid "" "value :data:`optparse.SUPPRESS_USAGE`." msgstr "" -#: ../../library/optparse.rst:821 +#: ../../library/optparse.rst:822 msgid "``option_list`` (default: ``[]``)" msgstr "" -#: ../../library/optparse.rst:817 +#: ../../library/optparse.rst:818 msgid "" "A list of Option objects to populate the parser with. The options in " "``option_list`` are added after any options in ``standard_option_list`` (a " @@ -935,19 +939,19 @@ msgid "" "the parser instead." msgstr "" -#: ../../library/optparse.rst:824 +#: ../../library/optparse.rst:825 msgid "``option_class`` (default: optparse.Option)" msgstr "" -#: ../../library/optparse.rst:824 +#: ../../library/optparse.rst:825 msgid "Class to use when adding options to the parser in :meth:`add_option`." msgstr "" -#: ../../library/optparse.rst:830 +#: ../../library/optparse.rst:831 msgid "``version`` (default: ``None``)" msgstr "" -#: ../../library/optparse.rst:827 +#: ../../library/optparse.rst:828 msgid "" "A version string to print when the user supplies a version option. If you " "supply a true value for ``version``, :mod:`optparse` automatically adds a " @@ -955,21 +959,21 @@ msgid "" "``%prog`` is expanded the same as for ``usage``." msgstr "" -#: ../../library/optparse.rst:835 +#: ../../library/optparse.rst:836 msgid "``conflict_handler`` (default: ``\"error\"``)" msgstr "" -#: ../../library/optparse.rst:833 +#: ../../library/optparse.rst:834 msgid "" "Specifies what to do when options with conflicting option strings are added " "to the parser; see section :ref:`optparse-conflicts-between-options`." msgstr "" -#: ../../library/optparse.rst:841 +#: ../../library/optparse.rst:842 msgid "``description`` (default: ``None``)" msgstr "" -#: ../../library/optparse.rst:838 +#: ../../library/optparse.rst:839 msgid "" "A paragraph of text giving a brief overview of your program. :mod:`optparse` " "reformats this paragraph to fit the current terminal width and prints it " @@ -977,74 +981,74 @@ msgid "" "options)." msgstr "" -#: ../../library/optparse.rst:846 +#: ../../library/optparse.rst:847 msgid "``formatter`` (default: a new :class:`IndentedHelpFormatter`)" msgstr "" -#: ../../library/optparse.rst:844 +#: ../../library/optparse.rst:845 msgid "" "An instance of optparse.HelpFormatter that will be used for printing help " "text. :mod:`optparse` provides two concrete classes for this purpose: " "IndentedHelpFormatter and TitledHelpFormatter." msgstr "" -#: ../../library/optparse.rst:850 +#: ../../library/optparse.rst:851 msgid "``add_help_option`` (default: ``True``)" msgstr "" -#: ../../library/optparse.rst:849 +#: ../../library/optparse.rst:850 msgid "" "If true, :mod:`optparse` will add a help option (with option strings ``-h`` " "and ``--help``) to the parser." msgstr "" -#: ../../library/optparse.rst:854 +#: ../../library/optparse.rst:855 msgid "``prog``" msgstr "``prog``" -#: ../../library/optparse.rst:853 +#: ../../library/optparse.rst:854 msgid "" "The string to use when expanding ``%prog`` in ``usage`` and ``version`` " "instead of ``os.path.basename(sys.argv[0])``." msgstr "" -#: ../../library/optparse.rst:856 +#: ../../library/optparse.rst:857 msgid "``epilog`` (default: ``None``)" msgstr "" -#: ../../library/optparse.rst:857 +#: ../../library/optparse.rst:858 msgid "A paragraph of help text to print after the option help." msgstr "" -#: ../../library/optparse.rst:862 +#: ../../library/optparse.rst:863 msgid "Populating the parser" msgstr "" -#: ../../library/optparse.rst:864 +#: ../../library/optparse.rst:865 msgid "" "There are several ways to populate the parser with options. The preferred " "way is by using :meth:`OptionParser.add_option`, as shown in section :ref:" "`optparse-tutorial`. :meth:`add_option` can be called in one of two ways:" msgstr "" -#: ../../library/optparse.rst:868 +#: ../../library/optparse.rst:869 msgid "pass it an Option instance (as returned by :func:`make_option`)" msgstr "" -#: ../../library/optparse.rst:870 +#: ../../library/optparse.rst:871 msgid "" "pass it any combination of positional and keyword arguments that are " "acceptable to :func:`make_option` (i.e., to the Option constructor), and it " "will create the Option instance for you" msgstr "" -#: ../../library/optparse.rst:874 +#: ../../library/optparse.rst:875 msgid "" "The other alternative is to pass a list of pre-constructed Option instances " "to the OptionParser constructor, as in::" msgstr "" -#: ../../library/optparse.rst:885 +#: ../../library/optparse.rst:886 msgid "" "(:func:`make_option` is a factory function for creating Option instances; " "currently it is an alias for the Option constructor. A future version of :" @@ -1053,32 +1057,32 @@ msgid "" "Option directly.)" msgstr "" -#: ../../library/optparse.rst:894 +#: ../../library/optparse.rst:895 msgid "Defining options" msgstr "" -#: ../../library/optparse.rst:896 +#: ../../library/optparse.rst:897 msgid "" "Each Option instance represents a set of synonymous command-line option " "strings, e.g. ``-f`` and ``--file``. You can specify any number of short or " "long option strings, but you must specify at least one overall option string." msgstr "" -#: ../../library/optparse.rst:900 +#: ../../library/optparse.rst:901 msgid "" "The canonical way to create an :class:`Option` instance is with the :meth:" "`add_option` method of :class:`OptionParser`." msgstr "" -#: ../../library/optparse.rst:906 +#: ../../library/optparse.rst:907 msgid "To define an option with only a short option string::" msgstr "" -#: ../../library/optparse.rst:910 +#: ../../library/optparse.rst:911 msgid "And to define an option with only a long option string::" msgstr "" -#: ../../library/optparse.rst:914 +#: ../../library/optparse.rst:915 msgid "" "The keyword arguments define attributes of the new Option object. The most " "important option attribute is :attr:`~Option.action`, and it largely " @@ -1087,69 +1091,69 @@ msgid "" "raises an :exc:`OptionError` exception explaining your mistake." msgstr "" -#: ../../library/optparse.rst:920 +#: ../../library/optparse.rst:921 msgid "" "An option's *action* determines what :mod:`optparse` does when it encounters " "this option on the command-line. The standard option actions hard-coded " "into :mod:`optparse` are:" msgstr "" -#: ../../library/optparse.rst:925 +#: ../../library/optparse.rst:926 msgid "``\"store\"``" msgstr "``\"store\"``" -#: ../../library/optparse.rst:925 +#: ../../library/optparse.rst:926 msgid "store this option's argument (default)" msgstr "" -#: ../../library/optparse.rst:931 +#: ../../library/optparse.rst:932 msgid "``\"store_true\"``" msgstr "``\"store_true\"``" -#: ../../library/optparse.rst:931 +#: ../../library/optparse.rst:932 msgid "store ``True``" msgstr "" -#: ../../library/optparse.rst:934 +#: ../../library/optparse.rst:935 msgid "``\"store_false\"``" msgstr "``\"store_false\"``" -#: ../../library/optparse.rst:934 +#: ../../library/optparse.rst:935 msgid "store ``False``" msgstr "" -#: ../../library/optparse.rst:940 +#: ../../library/optparse.rst:941 msgid "``\"append_const\"``" msgstr "``\"append_const\"``" -#: ../../library/optparse.rst:940 +#: ../../library/optparse.rst:941 msgid "append a constant value to a list, pre-set via :attr:`Option.const`" msgstr "" -#: ../../library/optparse.rst:949 ../../library/optparse.rst:1243 +#: ../../library/optparse.rst:950 ../../library/optparse.rst:1244 msgid "``\"help\"``" msgstr "``\"help\"``" -#: ../../library/optparse.rst:949 +#: ../../library/optparse.rst:950 msgid "" "print a usage message including all options and the documentation for them" msgstr "" -#: ../../library/optparse.rst:951 +#: ../../library/optparse.rst:952 msgid "" "(If you don't supply an action, the default is ``\"store\"``. For this " "action, you may also supply :attr:`~Option.type` and :attr:`~Option.dest` " "option attributes; see :ref:`optparse-standard-option-actions`.)" msgstr "" -#: ../../library/optparse.rst:955 +#: ../../library/optparse.rst:956 msgid "" "As you can see, most actions involve storing or updating a value somewhere. :" "mod:`optparse` always creates a special object for this, conventionally " "called ``options``, which is an instance of :class:`optparse.Values`." msgstr "" -#: ../../library/optparse.rst:961 +#: ../../library/optparse.rst:962 msgid "" "An object holding parsed argument names and values as attributes. Normally " "created by calling when calling :meth:`OptionParser.parse_args`, and can be " @@ -1158,50 +1162,50 @@ msgid "" "arguments`)." msgstr "" -#: ../../library/optparse.rst:966 +#: ../../library/optparse.rst:967 msgid "" "Option arguments (and various other values) are stored as attributes of this " "object, according to the :attr:`~Option.dest` (destination) option attribute." msgstr "" -#: ../../library/optparse.rst:970 +#: ../../library/optparse.rst:971 msgid "For example, when you call ::" msgstr "" "例如說,當你呼叫:\n" "\n" "::" -#: ../../library/optparse.rst:974 +#: ../../library/optparse.rst:975 msgid "" "one of the first things :mod:`optparse` does is create the ``options`` " "object::" msgstr "" -#: ../../library/optparse.rst:978 +#: ../../library/optparse.rst:979 msgid "If one of the options in this parser is defined with ::" msgstr "" -#: ../../library/optparse.rst:982 +#: ../../library/optparse.rst:983 msgid "and the command-line being parsed includes any of the following::" msgstr "" -#: ../../library/optparse.rst:989 +#: ../../library/optparse.rst:990 msgid "" "then :mod:`optparse`, on seeing this option, will do the equivalent of ::" msgstr "" -#: ../../library/optparse.rst:993 +#: ../../library/optparse.rst:994 msgid "" "The :attr:`~Option.type` and :attr:`~Option.dest` option attributes are " "almost as important as :attr:`~Option.action`, but :attr:`~Option.action` is " "the only one that makes sense for *all* options." msgstr "" -#: ../../library/optparse.rst:1001 +#: ../../library/optparse.rst:1002 msgid "Option attributes" msgstr "" -#: ../../library/optparse.rst:1005 +#: ../../library/optparse.rst:1006 msgid "" "A single command line argument, with various attributes passed by keyword to " "the constructor. Normally created with :meth:`OptionParser.add_option` " @@ -1209,7 +1213,7 @@ msgid "" "*option_class* argument to :class:`OptionParser`." msgstr "" -#: ../../library/optparse.rst:1011 +#: ../../library/optparse.rst:1012 msgid "" "The following option attributes may be passed as keyword arguments to :meth:" "`OptionParser.add_option`. If you pass an option attribute that is not " @@ -1217,33 +1221,33 @@ msgid "" "attribute, :mod:`optparse` raises :exc:`OptionError`." msgstr "" -#: ../../library/optparse.rst:1018 +#: ../../library/optparse.rst:1019 msgid "(default: ``\"store\"``)" msgstr "" -#: ../../library/optparse.rst:1020 +#: ../../library/optparse.rst:1021 msgid "" "Determines :mod:`optparse`'s behaviour when this option is seen on the " "command line; the available options are documented :ref:`here `." msgstr "" -#: ../../library/optparse.rst:1026 +#: ../../library/optparse.rst:1027 msgid "(default: ``\"string\"``)" msgstr "" -#: ../../library/optparse.rst:1028 +#: ../../library/optparse.rst:1029 msgid "" "The argument type expected by this option (e.g., ``\"string\"`` or " "``\"int\"``); the available option types are documented :ref:`here `." msgstr "" -#: ../../library/optparse.rst:1034 ../../library/optparse.rst:1084 +#: ../../library/optparse.rst:1035 ../../library/optparse.rst:1085 msgid "(default: derived from option strings)" msgstr "" -#: ../../library/optparse.rst:1036 +#: ../../library/optparse.rst:1037 msgid "" "If the option's action implies writing or modifying a value somewhere, this " "tells :mod:`optparse` where to write it: :attr:`~Option.dest` names an " @@ -1251,47 +1255,47 @@ msgid "" "the command line." msgstr "" -#: ../../library/optparse.rst:1043 +#: ../../library/optparse.rst:1044 msgid "" "The value to use for this option's destination if the option is not seen on " "the command line. See also :meth:`OptionParser.set_defaults`." msgstr "" -#: ../../library/optparse.rst:1048 +#: ../../library/optparse.rst:1049 msgid "(default: 1)" msgstr "" -#: ../../library/optparse.rst:1050 +#: ../../library/optparse.rst:1051 msgid "" "How many arguments of type :attr:`~Option.type` should be consumed when this " "option is seen. If > 1, :mod:`optparse` will store a tuple of values to :" "attr:`~Option.dest`." msgstr "" -#: ../../library/optparse.rst:1056 +#: ../../library/optparse.rst:1057 msgid "For actions that store a constant value, the constant value to store." msgstr "" -#: ../../library/optparse.rst:1060 +#: ../../library/optparse.rst:1061 msgid "" "For options of type ``\"choice\"``, the list of strings the user may choose " "from." msgstr "" -#: ../../library/optparse.rst:1065 +#: ../../library/optparse.rst:1066 msgid "" "For options with action ``\"callback\"``, the callable to call when this " "option is seen. See section :ref:`optparse-option-callbacks` for detail on " "the arguments passed to the callable." msgstr "" -#: ../../library/optparse.rst:1072 +#: ../../library/optparse.rst:1073 msgid "" "Additional positional and keyword arguments to pass to ``callback`` after " "the four standard callback arguments." msgstr "" -#: ../../library/optparse.rst:1077 +#: ../../library/optparse.rst:1078 msgid "" "Help text to print for this option when listing all available options after " "the user supplies a :attr:`~Option.help` option (such as ``--help``). If no " @@ -1299,17 +1303,17 @@ msgid "" "this option, use the special value :data:`optparse.SUPPRESS_HELP`." msgstr "" -#: ../../library/optparse.rst:1086 +#: ../../library/optparse.rst:1087 msgid "" "Stand-in for the option argument(s) to use when printing help text. See " "section :ref:`optparse-tutorial` for an example." msgstr "" -#: ../../library/optparse.rst:1093 +#: ../../library/optparse.rst:1094 msgid "Standard option actions" msgstr "" -#: ../../library/optparse.rst:1095 +#: ../../library/optparse.rst:1096 msgid "" "The various option actions all have slightly different requirements and " "effects. Most actions have several relevant option attributes which you may " @@ -1317,13 +1321,13 @@ msgid "" "attributes, which you must specify for any option using that action." msgstr "" -#: ../../library/optparse.rst:1100 +#: ../../library/optparse.rst:1101 msgid "" "``\"store\"`` [relevant: :attr:`~Option.type`, :attr:`~Option.dest`, :attr:" "`~Option.nargs`, :attr:`~Option.choices`]" msgstr "" -#: ../../library/optparse.rst:1103 +#: ../../library/optparse.rst:1104 msgid "" "The option must be followed by an argument, which is converted to a value " "according to :attr:`~Option.type` and stored in :attr:`~Option.dest`. If :" @@ -1333,17 +1337,17 @@ msgid "" "option-types` section." msgstr "" -#: ../../library/optparse.rst:1110 +#: ../../library/optparse.rst:1111 msgid "" "If :attr:`~Option.choices` is supplied (a list or tuple of strings), the " "type defaults to ``\"choice\"``." msgstr "" -#: ../../library/optparse.rst:1113 +#: ../../library/optparse.rst:1114 msgid "If :attr:`~Option.type` is not supplied, it defaults to ``\"string\"``." msgstr "" -#: ../../library/optparse.rst:1115 +#: ../../library/optparse.rst:1116 msgid "" "If :attr:`~Option.dest` is not supplied, :mod:`optparse` derives a " "destination from the first long option string (e.g., ``--foo-bar`` implies " @@ -1351,62 +1355,62 @@ msgid "" "destination from the first short option string (e.g., ``-f`` implies ``f``)." msgstr "" -#: ../../library/optparse.rst:1120 ../../library/optparse.rst:1140 -#: ../../library/optparse.rst:1162 ../../library/optparse.rst:1180 -#: ../../library/optparse.rst:1219 ../../library/optparse.rst:1257 +#: ../../library/optparse.rst:1121 ../../library/optparse.rst:1141 +#: ../../library/optparse.rst:1163 ../../library/optparse.rst:1181 +#: ../../library/optparse.rst:1220 ../../library/optparse.rst:1258 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/optparse.rst:1125 +#: ../../library/optparse.rst:1126 msgid "As it parses the command line ::" msgstr "" -#: ../../library/optparse.rst:1129 +#: ../../library/optparse.rst:1130 msgid ":mod:`optparse` will set ::" msgstr "" -#: ../../library/optparse.rst:1135 +#: ../../library/optparse.rst:1136 msgid "" "``\"store_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1138 +#: ../../library/optparse.rst:1139 msgid "The value :attr:`~Option.const` is stored in :attr:`~Option.dest`." msgstr "" -#: ../../library/optparse.rst:1149 +#: ../../library/optparse.rst:1150 msgid "If ``--noisy`` is seen, :mod:`optparse` will set ::" msgstr "" -#: ../../library/optparse.rst:1153 +#: ../../library/optparse.rst:1154 msgid "``\"store_true\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1155 +#: ../../library/optparse.rst:1156 msgid "" "A special case of ``\"store_const\"`` that stores ``True`` to :attr:`~Option." "dest`." msgstr "" -#: ../../library/optparse.rst:1158 +#: ../../library/optparse.rst:1159 msgid "``\"store_false\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1160 +#: ../../library/optparse.rst:1161 msgid "Like ``\"store_true\"``, but stores ``False``." msgstr "" -#: ../../library/optparse.rst:1167 +#: ../../library/optparse.rst:1168 msgid "" "``\"append\"`` [relevant: :attr:`~Option.type`, :attr:`~Option.dest`, :attr:" "`~Option.nargs`, :attr:`~Option.choices`]" msgstr "" -#: ../../library/optparse.rst:1170 +#: ../../library/optparse.rst:1171 msgid "" "The option must be followed by an argument, which is appended to the list " "in :attr:`~Option.dest`. If no default value for :attr:`~Option.dest` is " @@ -1416,23 +1420,23 @@ msgid "" "is appended to :attr:`~Option.dest`." msgstr "" -#: ../../library/optparse.rst:1177 +#: ../../library/optparse.rst:1178 msgid "" "The defaults for :attr:`~Option.type` and :attr:`~Option.dest` are the same " "as for the ``\"store\"`` action." msgstr "" -#: ../../library/optparse.rst:1184 +#: ../../library/optparse.rst:1185 msgid "" "If ``-t3`` is seen on the command-line, :mod:`optparse` does the equivalent " "of::" msgstr "" -#: ../../library/optparse.rst:1190 +#: ../../library/optparse.rst:1191 msgid "If, a little later on, ``--tracks=4`` is seen, it does::" msgstr "" -#: ../../library/optparse.rst:1194 +#: ../../library/optparse.rst:1195 msgid "" "The ``append`` action calls the ``append`` method on the current value of " "the option. This means that any default value specified must have an " @@ -1441,13 +1445,13 @@ msgid "" "with any values from the command line appended after those default values::" msgstr "" -#: ../../library/optparse.rst:1205 +#: ../../library/optparse.rst:1206 msgid "" "``\"append_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1208 +#: ../../library/optparse.rst:1209 msgid "" "Like ``\"store_const\"``, but the value :attr:`~Option.const` is appended " "to :attr:`~Option.dest`; as with ``\"append\"``, :attr:`~Option.dest` " @@ -1455,45 +1459,45 @@ msgid "" "time the option is encountered." msgstr "" -#: ../../library/optparse.rst:1213 +#: ../../library/optparse.rst:1214 msgid "``\"count\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1215 +#: ../../library/optparse.rst:1216 msgid "" "Increment the integer stored at :attr:`~Option.dest`. If no default value " "is supplied, :attr:`~Option.dest` is set to zero before being incremented " "the first time." msgstr "" -#: ../../library/optparse.rst:1223 +#: ../../library/optparse.rst:1224 msgid "" "The first time ``-v`` is seen on the command line, :mod:`optparse` does the " "equivalent of::" msgstr "" -#: ../../library/optparse.rst:1229 +#: ../../library/optparse.rst:1230 msgid "Every subsequent occurrence of ``-v`` results in ::" msgstr "" -#: ../../library/optparse.rst:1233 +#: ../../library/optparse.rst:1234 msgid "" "``\"callback\"`` [required: :attr:`~Option.callback`; relevant: :attr:" "`~Option.type`, :attr:`~Option.nargs`, :attr:`~Option.callback_args`, :attr:" "`~Option.callback_kwargs`]" msgstr "" -#: ../../library/optparse.rst:1237 +#: ../../library/optparse.rst:1238 msgid "" "Call the function specified by :attr:`~Option.callback`, which is called " "as ::" msgstr "" -#: ../../library/optparse.rst:1241 +#: ../../library/optparse.rst:1242 msgid "See section :ref:`optparse-option-callbacks` for more detail." msgstr "更多細節請見 :ref:`optparse-option-callbacks`\\ 。" -#: ../../library/optparse.rst:1245 +#: ../../library/optparse.rst:1246 msgid "" "Prints a complete help message for all the options in the current option " "parser. The help message is constructed from the ``usage`` string passed to " @@ -1501,37 +1505,37 @@ msgid "" "every option." msgstr "" -#: ../../library/optparse.rst:1250 +#: ../../library/optparse.rst:1251 msgid "" "If no :attr:`~Option.help` string is supplied for an option, it will still " "be listed in the help message. To omit an option entirely, use the special " "value :data:`optparse.SUPPRESS_HELP`." msgstr "" -#: ../../library/optparse.rst:1254 +#: ../../library/optparse.rst:1255 msgid "" ":mod:`optparse` automatically adds a :attr:`~Option.help` option to all " "OptionParsers, so you do not normally need to create one." msgstr "" -#: ../../library/optparse.rst:1272 +#: ../../library/optparse.rst:1273 msgid "" "If :mod:`optparse` sees either ``-h`` or ``--help`` on the command line, it " "will print something like the following help message to stdout (assuming " "``sys.argv[0]`` is ``\"foo.py\"``):" msgstr "" -#: ../../library/optparse.rst:1285 +#: ../../library/optparse.rst:1286 msgid "" "After printing the help message, :mod:`optparse` terminates your process " "with ``sys.exit(0)``." msgstr "" -#: ../../library/optparse.rst:1288 +#: ../../library/optparse.rst:1289 msgid "``\"version\"``" msgstr "``\"version\"``" -#: ../../library/optparse.rst:1290 +#: ../../library/optparse.rst:1291 msgid "" "Prints the version number supplied to the OptionParser to stdout and exits. " "The version number is actually formatted and printed by the " @@ -1541,58 +1545,58 @@ msgid "" "since :mod:`optparse` automatically adds them when needed." msgstr "" -#: ../../library/optparse.rst:1301 +#: ../../library/optparse.rst:1302 msgid "Standard option types" msgstr "" -#: ../../library/optparse.rst:1303 +#: ../../library/optparse.rst:1304 msgid "" ":mod:`optparse` has five built-in option types: ``\"string\"``, ``\"int\"``, " "``\"choice\"``, ``\"float\"`` and ``\"complex\"``. If you need to add new " "option types, see section :ref:`optparse-extending-optparse`." msgstr "" -#: ../../library/optparse.rst:1307 +#: ../../library/optparse.rst:1308 msgid "" "Arguments to string options are not checked or converted in any way: the " "text on the command line is stored in the destination (or passed to the " "callback) as-is." msgstr "" -#: ../../library/optparse.rst:1310 +#: ../../library/optparse.rst:1311 msgid "Integer arguments (type ``\"int\"``) are parsed as follows:" msgstr "" -#: ../../library/optparse.rst:1312 +#: ../../library/optparse.rst:1313 msgid "if the number starts with ``0x``, it is parsed as a hexadecimal number" msgstr "" -#: ../../library/optparse.rst:1314 +#: ../../library/optparse.rst:1315 msgid "if the number starts with ``0``, it is parsed as an octal number" msgstr "" -#: ../../library/optparse.rst:1316 +#: ../../library/optparse.rst:1317 msgid "if the number starts with ``0b``, it is parsed as a binary number" msgstr "" -#: ../../library/optparse.rst:1318 +#: ../../library/optparse.rst:1319 msgid "otherwise, the number is parsed as a decimal number" msgstr "" -#: ../../library/optparse.rst:1321 +#: ../../library/optparse.rst:1322 msgid "" "The conversion is done by calling :func:`int` with the appropriate base (2, " "8, 10, or 16). If this fails, so will :mod:`optparse`, although with a more " "useful error message." msgstr "" -#: ../../library/optparse.rst:1325 +#: ../../library/optparse.rst:1326 msgid "" "``\"float\"`` and ``\"complex\"`` option arguments are converted directly " "with :func:`float` and :func:`complex`, with similar error-handling." msgstr "" -#: ../../library/optparse.rst:1328 +#: ../../library/optparse.rst:1329 msgid "" "``\"choice\"`` options are a subtype of ``\"string\"`` options. The :attr:" "`~Option.choices` option attribute (a sequence of strings) defines the set " @@ -1601,129 +1605,133 @@ msgid "" "`OptionValueError` if an invalid string is given." msgstr "" -#: ../../library/optparse.rst:1338 +#: ../../library/optparse.rst:1339 msgid "Parsing arguments" msgstr "" -#: ../../library/optparse.rst:1340 +#: ../../library/optparse.rst:1341 msgid "" "The whole point of creating and populating an OptionParser is to call its :" -"meth:`parse_args` method::" +"meth:`~OptionParser.parse_args` method." msgstr "" -#: ../../library/optparse.rst:1345 -msgid "where the input parameters are" +#: ../../library/optparse.rst:1346 +msgid "Parse the command-line options found in *args*." msgstr "" -#: ../../library/optparse.rst:1348 ../../library/optparse.rst:1362 -#: ../../library/optparse.rst:1681 +#: ../../library/optparse.rst:1348 +msgid "The input parameters are" +msgstr "" + +#: ../../library/optparse.rst:1351 ../../library/optparse.rst:1364 +#: ../../library/optparse.rst:1684 msgid "``args``" msgstr "``args``" -#: ../../library/optparse.rst:1348 +#: ../../library/optparse.rst:1351 msgid "the list of arguments to process (default: ``sys.argv[1:]``)" msgstr "" -#: ../../library/optparse.rst:1353 +#: ../../library/optparse.rst:1356 msgid "``values``" msgstr "``values``" -#: ../../library/optparse.rst:1351 +#: ../../library/optparse.rst:1354 msgid "" -"an :class:`optparse.Values` object to store option arguments in (default: a " -"new instance of :class:`Values`) -- if you give an existing object, the " -"option defaults will not be initialized on it" +"an :class:`Values` object to store option arguments in (default: a new " +"instance of :class:`Values`) -- if you give an existing object, the option " +"defaults will not be initialized on it" msgstr "" -#: ../../library/optparse.rst:1355 -msgid "and the return values are" +#: ../../library/optparse.rst:1358 +msgid "and the return value is a pair ``(options, args)`` where" msgstr "" -#: ../../library/optparse.rst:1359 +#: ../../library/optparse.rst:1362 msgid "``options``" msgstr "``options``" -#: ../../library/optparse.rst:1358 +#: ../../library/optparse.rst:1361 msgid "" -"the same object that was passed in as ``values``, or the optparse.Values " +"the same object that was passed in as *values*, or the ``optparse.Values`` " "instance created by :mod:`optparse`" msgstr "" -#: ../../library/optparse.rst:1362 +#: ../../library/optparse.rst:1365 msgid "the leftover positional arguments after all options have been processed" msgstr "" -#: ../../library/optparse.rst:1364 +#: ../../library/optparse.rst:1367 msgid "" "The most common usage is to supply neither keyword argument. If you supply " "``values``, it will be modified with repeated :func:`setattr` calls (roughly " "one for every option argument stored to an option destination) and returned " -"by :meth:`parse_args`." +"by :meth:`~OptionParser.parse_args`." msgstr "" -#: ../../library/optparse.rst:1369 +#: ../../library/optparse.rst:1372 msgid "" -"If :meth:`parse_args` encounters any errors in the argument list, it calls " -"the OptionParser's :meth:`error` method with an appropriate end-user error " -"message. This ultimately terminates your process with an exit status of 2 " -"(the traditional Unix exit status for command-line errors)." +"If :meth:`~OptionParser.parse_args` encounters any errors in the argument " +"list, it calls the OptionParser's :meth:`error` method with an appropriate " +"end-user error message. This ultimately terminates your process with an exit " +"status of 2 (the traditional Unix exit status for command-line errors)." msgstr "" -#: ../../library/optparse.rst:1378 +#: ../../library/optparse.rst:1381 msgid "Querying and manipulating your option parser" msgstr "" -#: ../../library/optparse.rst:1380 +#: ../../library/optparse.rst:1383 msgid "" "The default behavior of the option parser can be customized slightly, and " "you can also poke around your option parser and see what's there. " "OptionParser provides several methods to help you out:" msgstr "" -#: ../../library/optparse.rst:1386 +#: ../../library/optparse.rst:1389 msgid "" "Set parsing to stop on the first non-option. For example, if ``-a`` and ``-" "b`` are both simple options that take no arguments, :mod:`optparse` normally " "accepts this syntax::" msgstr "" -#: ../../library/optparse.rst:1392 +#: ../../library/optparse.rst:1395 msgid "and treats it as equivalent to ::" msgstr "" -#: ../../library/optparse.rst:1396 +#: ../../library/optparse.rst:1399 msgid "" "To disable this feature, call :meth:`disable_interspersed_args`. This " "restores traditional Unix syntax, where option parsing stops with the first " "non-option argument." msgstr "" -#: ../../library/optparse.rst:1400 +#: ../../library/optparse.rst:1403 msgid "" "Use this if you have a command processor which runs another command which " "has options of its own and you want to make sure these options don't get " "confused. For example, each command might have a different set of options." msgstr "" -#: ../../library/optparse.rst:1406 +#: ../../library/optparse.rst:1409 msgid "" "Set parsing to not stop on the first non-option, allowing interspersing " "switches with command arguments. This is the default behavior." msgstr "" -#: ../../library/optparse.rst:1411 +#: ../../library/optparse.rst:1414 msgid "" "Returns the Option instance with the option string *opt_str*, or ``None`` if " "no options have that option string." msgstr "" -#: ../../library/optparse.rst:1416 +#: ../../library/optparse.rst:1419 msgid "" "Return ``True`` if the OptionParser has an option with option string " "*opt_str* (e.g., ``-q`` or ``--verbose``)." msgstr "" -#: ../../library/optparse.rst:1421 +#: ../../library/optparse.rst:1424 msgid "" "If the :class:`OptionParser` has an option corresponding to *opt_str*, that " "option is removed. If that option provided any other option strings, all of " @@ -1731,23 +1739,23 @@ msgid "" "option belonging to this :class:`OptionParser`, raises :exc:`ValueError`." msgstr "" -#: ../../library/optparse.rst:1430 +#: ../../library/optparse.rst:1433 msgid "Conflicts between options" msgstr "" -#: ../../library/optparse.rst:1432 +#: ../../library/optparse.rst:1435 msgid "" "If you're not careful, it's easy to define options with conflicting option " "strings::" msgstr "" -#: ../../library/optparse.rst:1439 +#: ../../library/optparse.rst:1442 msgid "" "(This is particularly true if you've defined your own OptionParser subclass " "with some standard options.)" msgstr "" -#: ../../library/optparse.rst:1442 +#: ../../library/optparse.rst:1445 msgid "" "Every time you add an option, :mod:`optparse` checks for conflicts with " "existing options. If it finds any, it invokes the current conflict-handling " @@ -1755,39 +1763,39 @@ msgid "" "constructor::" msgstr "" -#: ../../library/optparse.rst:1448 +#: ../../library/optparse.rst:1451 msgid "or with a separate call::" msgstr "" -#: ../../library/optparse.rst:1452 +#: ../../library/optparse.rst:1455 msgid "The available conflict handlers are:" msgstr "" -#: ../../library/optparse.rst:1456 +#: ../../library/optparse.rst:1459 msgid "``\"error\"`` (default)" msgstr "" -#: ../../library/optparse.rst:1455 +#: ../../library/optparse.rst:1458 msgid "" "assume option conflicts are a programming error and raise :exc:" "`OptionConflictError`" msgstr "" -#: ../../library/optparse.rst:1460 +#: ../../library/optparse.rst:1463 msgid "``\"resolve\"``" msgstr "``\"resolve\"``" -#: ../../library/optparse.rst:1459 +#: ../../library/optparse.rst:1462 msgid "resolve option conflicts intelligently (see below)" msgstr "" -#: ../../library/optparse.rst:1462 +#: ../../library/optparse.rst:1465 msgid "" "As an example, let's define an :class:`OptionParser` that resolves conflicts " "intelligently and add conflicting options to it::" msgstr "" -#: ../../library/optparse.rst:1469 +#: ../../library/optparse.rst:1472 msgid "" "At this point, :mod:`optparse` detects that a previously added option is " "already using the ``-n`` option string. Since ``conflict_handler`` is " @@ -1797,7 +1805,7 @@ msgid "" "message will reflect that::" msgstr "" -#: ../../library/optparse.rst:1480 +#: ../../library/optparse.rst:1483 msgid "" "It's possible to whittle away the option strings for a previously added " "option until there are none left, and the user has no way of invoking that " @@ -1806,17 +1814,17 @@ msgid "" "Carrying on with our existing OptionParser::" msgstr "" -#: ../../library/optparse.rst:1488 +#: ../../library/optparse.rst:1491 msgid "" "At this point, the original ``-n``/``--dry-run`` option is no longer " "accessible, so :mod:`optparse` removes it, leaving this help text::" msgstr "" -#: ../../library/optparse.rst:1500 +#: ../../library/optparse.rst:1503 msgid "Cleanup" msgstr "" -#: ../../library/optparse.rst:1502 +#: ../../library/optparse.rst:1505 msgid "" "OptionParser instances have several cyclic references. This should not be a " "problem for Python's garbage collector, but you may wish to break the cyclic " @@ -1826,15 +1834,15 @@ msgid "" "OptionParser." msgstr "" -#: ../../library/optparse.rst:1513 +#: ../../library/optparse.rst:1516 msgid "Other methods" msgstr "" -#: ../../library/optparse.rst:1515 +#: ../../library/optparse.rst:1518 msgid "OptionParser supports several other public methods:" msgstr "" -#: ../../library/optparse.rst:1519 +#: ../../library/optparse.rst:1522 msgid "" "Set the usage string according to the rules described above for the " "``usage`` constructor keyword argument. Passing ``None`` sets the default " @@ -1842,7 +1850,7 @@ msgid "" "message." msgstr "" -#: ../../library/optparse.rst:1525 +#: ../../library/optparse.rst:1528 msgid "" "Print the usage message for the current program (``self.usage``) to *file* " "(default stdout). Any occurrence of the string ``%prog`` in ``self.usage`` " @@ -1850,13 +1858,13 @@ msgid "" "usage`` is empty or not defined." msgstr "" -#: ../../library/optparse.rst:1532 +#: ../../library/optparse.rst:1535 msgid "" "Same as :meth:`print_usage` but returns the usage string instead of printing " "it." msgstr "" -#: ../../library/optparse.rst:1537 +#: ../../library/optparse.rst:1540 msgid "" "Set default values for several option destinations at once. Using :meth:" "`set_defaults` is the preferred way to set default values for options, since " @@ -1865,15 +1873,15 @@ msgid "" "default, and the last one wins::" msgstr "" -#: ../../library/optparse.rst:1550 +#: ../../library/optparse.rst:1553 msgid "To avoid this confusion, use :meth:`set_defaults`::" msgstr "" -#: ../../library/optparse.rst:1562 +#: ../../library/optparse.rst:1565 msgid "Option Callbacks" msgstr "" -#: ../../library/optparse.rst:1564 +#: ../../library/optparse.rst:1567 msgid "" "When :mod:`optparse`'s built-in actions and types aren't quite enough for " "your needs, you have two choices: extend :mod:`optparse` or define a " @@ -1881,25 +1889,25 @@ msgid "" "a lot of simple cases. Quite often a simple callback is all you need." msgstr "" -#: ../../library/optparse.rst:1569 +#: ../../library/optparse.rst:1572 msgid "There are two steps to defining a callback option:" msgstr "" -#: ../../library/optparse.rst:1571 +#: ../../library/optparse.rst:1574 msgid "define the option itself using the ``\"callback\"`` action" msgstr "" -#: ../../library/optparse.rst:1573 +#: ../../library/optparse.rst:1576 msgid "" "write the callback; this is a function (or method) that takes at least four " "arguments, as described below" msgstr "" -#: ../../library/optparse.rst:1580 +#: ../../library/optparse.rst:1583 msgid "Defining a callback option" msgstr "" -#: ../../library/optparse.rst:1582 +#: ../../library/optparse.rst:1585 msgid "" "As always, the easiest way to define a callback option is by using the :meth:" "`OptionParser.add_option` method. Apart from :attr:`~Option.action`, the " @@ -1907,7 +1915,7 @@ msgid "" "call::" msgstr "" -#: ../../library/optparse.rst:1588 +#: ../../library/optparse.rst:1591 msgid "" "``callback`` is a function (or other callable object), so you must have " "already defined ``my_callback()`` when you create this callback option. In " @@ -1919,7 +1927,7 @@ msgid "" "tricky; it's covered later in this section." msgstr "" -#: ../../library/optparse.rst:1597 +#: ../../library/optparse.rst:1600 msgid "" ":mod:`optparse` always passes four particular arguments to your callback, " "and it will only pass additional arguments if you specify them via :attr:" @@ -1927,21 +1935,21 @@ msgid "" "minimal callback function signature is::" msgstr "" -#: ../../library/optparse.rst:1604 +#: ../../library/optparse.rst:1607 msgid "The four arguments to a callback are described below." msgstr "" -#: ../../library/optparse.rst:1606 +#: ../../library/optparse.rst:1609 msgid "" "There are several other option attributes that you can supply when you " "define a callback option:" msgstr "" -#: ../../library/optparse.rst:1613 +#: ../../library/optparse.rst:1616 msgid ":attr:`~Option.type`" msgstr ":attr:`~Option.type`" -#: ../../library/optparse.rst:1610 +#: ../../library/optparse.rst:1613 msgid "" "has its usual meaning: as with the ``\"store\"`` or ``\"append\"`` actions, " "it instructs :mod:`optparse` to consume one argument and convert it to :attr:" @@ -1949,11 +1957,11 @@ msgid "" "though, :mod:`optparse` passes it to your callback function." msgstr "" -#: ../../library/optparse.rst:1619 +#: ../../library/optparse.rst:1622 msgid ":attr:`~Option.nargs`" msgstr ":attr:`~Option.nargs`" -#: ../../library/optparse.rst:1616 +#: ../../library/optparse.rst:1619 msgid "" "also has its usual meaning: if it is supplied and > 1, :mod:`optparse` will " "consume :attr:`~Option.nargs` arguments, each of which must be convertible " @@ -1961,43 +1969,43 @@ msgid "" "callback." msgstr "" -#: ../../library/optparse.rst:1622 +#: ../../library/optparse.rst:1625 msgid ":attr:`~Option.callback_args`" msgstr ":attr:`~Option.callback_args`" -#: ../../library/optparse.rst:1622 +#: ../../library/optparse.rst:1625 msgid "a tuple of extra positional arguments to pass to the callback" msgstr "" -#: ../../library/optparse.rst:1626 +#: ../../library/optparse.rst:1629 msgid ":attr:`~Option.callback_kwargs`" msgstr ":attr:`~Option.callback_kwargs`" -#: ../../library/optparse.rst:1625 +#: ../../library/optparse.rst:1628 msgid "a dictionary of extra keyword arguments to pass to the callback" msgstr "" -#: ../../library/optparse.rst:1631 +#: ../../library/optparse.rst:1634 msgid "How callbacks are called" msgstr "" -#: ../../library/optparse.rst:1633 +#: ../../library/optparse.rst:1636 msgid "All callbacks are called as follows::" msgstr "" -#: ../../library/optparse.rst:1640 +#: ../../library/optparse.rst:1643 msgid "``option``" msgstr "``option``" -#: ../../library/optparse.rst:1640 +#: ../../library/optparse.rst:1643 msgid "is the Option instance that's calling the callback" msgstr "" -#: ../../library/optparse.rst:1647 +#: ../../library/optparse.rst:1650 msgid "``opt_str``" msgstr "``opt_str``" -#: ../../library/optparse.rst:1643 +#: ../../library/optparse.rst:1646 msgid "" "is the option string seen on the command-line that's triggering the " "callback. (If an abbreviated long option was used, ``opt_str`` will be the " @@ -2006,11 +2014,11 @@ msgid "" "``\"--foobar\"``.)" msgstr "" -#: ../../library/optparse.rst:1654 +#: ../../library/optparse.rst:1657 msgid "``value``" msgstr "``value``" -#: ../../library/optparse.rst:1650 +#: ../../library/optparse.rst:1653 msgid "" "is the argument to this option seen on the command-line. :mod:`optparse` " "will only expect an argument if :attr:`~Option.type` is set; the type of " @@ -2020,44 +2028,45 @@ msgid "" "of values of the appropriate type." msgstr "" -#: ../../library/optparse.rst:1677 +#: ../../library/optparse.rst:1680 msgid "``parser``" msgstr "``parser``" -#: ../../library/optparse.rst:1657 +#: ../../library/optparse.rst:1660 msgid "" "is the OptionParser instance driving the whole thing, mainly useful because " "you can access some other interesting data through its instance attributes:" msgstr "" -#: ../../library/optparse.rst:1664 +#: ../../library/optparse.rst:1667 msgid "``parser.largs``" msgstr "``parser.largs``" -#: ../../library/optparse.rst:1661 +#: ../../library/optparse.rst:1664 msgid "" "the current list of leftover arguments, ie. arguments that have been " "consumed but are neither options nor option arguments. Feel free to modify " "``parser.largs``, e.g. by adding more arguments to it. (This list will " -"become ``args``, the second return value of :meth:`parse_args`.)" +"become ``args``, the second return value of :meth:`~OptionParser." +"parse_args`.)" msgstr "" -#: ../../library/optparse.rst:1670 +#: ../../library/optparse.rst:1673 msgid "``parser.rargs``" msgstr "``parser.rargs``" -#: ../../library/optparse.rst:1667 +#: ../../library/optparse.rst:1670 msgid "" "the current list of remaining arguments, ie. with ``opt_str`` and ``value`` " "(if applicable) removed, and only the arguments following them still there. " "Feel free to modify ``parser.rargs``, e.g. by consuming more arguments." msgstr "" -#: ../../library/optparse.rst:1677 +#: ../../library/optparse.rst:1680 msgid "``parser.values``" msgstr "``parser.values``" -#: ../../library/optparse.rst:1673 +#: ../../library/optparse.rst:1676 msgid "" "the object where option values are by default stored (an instance of " "optparse.OptionValues). This lets callbacks use the same mechanism as the " @@ -2066,27 +2075,27 @@ msgid "" "of any options already encountered on the command-line." msgstr "" -#: ../../library/optparse.rst:1680 +#: ../../library/optparse.rst:1683 msgid "" "is a tuple of arbitrary positional arguments supplied via the :attr:`~Option." "callback_args` option attribute." msgstr "" -#: ../../library/optparse.rst:1686 +#: ../../library/optparse.rst:1689 msgid "``kwargs``" msgstr "``kwargs``" -#: ../../library/optparse.rst:1684 +#: ../../library/optparse.rst:1687 msgid "" "is a dictionary of arbitrary keyword arguments supplied via :attr:`~Option." "callback_kwargs`." msgstr "" -#: ../../library/optparse.rst:1691 +#: ../../library/optparse.rst:1694 msgid "Raising errors in a callback" msgstr "" -#: ../../library/optparse.rst:1693 +#: ../../library/optparse.rst:1696 msgid "" "The callback function should raise :exc:`OptionValueError` if there are any " "problems with the option or its argument(s). :mod:`optparse` catches this " @@ -2096,46 +2105,46 @@ msgid "" "they did wrong." msgstr "" -#: ../../library/optparse.rst:1703 +#: ../../library/optparse.rst:1706 msgid "Callback example 1: trivial callback" msgstr "" -#: ../../library/optparse.rst:1705 +#: ../../library/optparse.rst:1708 msgid "" "Here's an example of a callback option that takes no arguments, and simply " "records that the option was seen::" msgstr "" -#: ../../library/optparse.rst:1713 +#: ../../library/optparse.rst:1716 msgid "Of course, you could do that with the ``\"store_true\"`` action." msgstr "" -#: ../../library/optparse.rst:1719 +#: ../../library/optparse.rst:1722 msgid "Callback example 2: check option order" msgstr "" -#: ../../library/optparse.rst:1721 +#: ../../library/optparse.rst:1724 msgid "" "Here's a slightly more interesting example: record the fact that ``-a`` is " "seen, but blow up if it comes after ``-b`` in the command-line. ::" msgstr "" -#: ../../library/optparse.rst:1736 +#: ../../library/optparse.rst:1739 msgid "Callback example 3: check option order (generalized)" msgstr "" -#: ../../library/optparse.rst:1738 +#: ../../library/optparse.rst:1741 msgid "" "If you want to re-use this callback for several similar options (set a flag, " "but blow up if ``-b`` has already been seen), it needs a bit of work: the " "error message and the flag that it sets must be generalized. ::" msgstr "" -#: ../../library/optparse.rst:1755 +#: ../../library/optparse.rst:1758 msgid "Callback example 4: check arbitrary condition" msgstr "" -#: ../../library/optparse.rst:1757 +#: ../../library/optparse.rst:1760 msgid "" "Of course, you could put any condition in there---you're not limited to " "checking the values of already-defined options. For example, if you have " @@ -2143,16 +2152,16 @@ msgid "" "is this::" msgstr "" -#: ../../library/optparse.rst:1770 +#: ../../library/optparse.rst:1773 msgid "" "(The definition of ``is_moon_full()`` is left as an exercise for the reader.)" msgstr "" -#: ../../library/optparse.rst:1776 +#: ../../library/optparse.rst:1779 msgid "Callback example 5: fixed arguments" msgstr "" -#: ../../library/optparse.rst:1778 +#: ../../library/optparse.rst:1781 msgid "" "Things get slightly more interesting when you define callback options that " "take a fixed number of arguments. Specifying that a callback option takes " @@ -2162,23 +2171,23 @@ msgid "" "nargs`, then the option takes :attr:`~Option.nargs` arguments." msgstr "" -#: ../../library/optparse.rst:1785 +#: ../../library/optparse.rst:1788 msgid "" "Here's an example that just emulates the standard ``\"store\"`` action::" msgstr "" -#: ../../library/optparse.rst:1794 +#: ../../library/optparse.rst:1797 msgid "" "Note that :mod:`optparse` takes care of consuming 3 arguments and converting " "them to integers for you; all you have to do is store them. (Or whatever; " "obviously you don't need a callback for this example.)" msgstr "" -#: ../../library/optparse.rst:1802 +#: ../../library/optparse.rst:1805 msgid "Callback example 6: variable arguments" msgstr "" -#: ../../library/optparse.rst:1804 +#: ../../library/optparse.rst:1807 msgid "" "Things get hairy when you want an option to take a variable number of " "arguments. For this case, you must write a callback, as :mod:`optparse` " @@ -2188,23 +2197,23 @@ msgid "" "implement the conventional rules for bare ``--`` and ``-`` arguments:" msgstr "" -#: ../../library/optparse.rst:1811 +#: ../../library/optparse.rst:1814 msgid "either ``--`` or ``-`` can be option arguments" msgstr "" -#: ../../library/optparse.rst:1813 +#: ../../library/optparse.rst:1816 msgid "" "bare ``--`` (if not the argument to some option): halt command-line " "processing and discard the ``--``" msgstr "" -#: ../../library/optparse.rst:1816 +#: ../../library/optparse.rst:1819 msgid "" "bare ``-`` (if not the argument to some option): halt command-line " "processing but keep the ``-`` (append it to ``parser.largs``)" msgstr "" -#: ../../library/optparse.rst:1819 +#: ../../library/optparse.rst:1822 msgid "" "If you want an option that takes a variable number of arguments, there are " "several subtle, tricky issues to worry about. The exact implementation you " @@ -2213,28 +2222,28 @@ msgid "" "directly)." msgstr "" -#: ../../library/optparse.rst:1825 +#: ../../library/optparse.rst:1828 msgid "" "Nevertheless, here's a stab at a callback for an option with variable " "arguments::" msgstr "" -#: ../../library/optparse.rst:1859 +#: ../../library/optparse.rst:1862 msgid "Extending :mod:`optparse`" msgstr "" -#: ../../library/optparse.rst:1861 +#: ../../library/optparse.rst:1864 msgid "" "Since the two major controlling factors in how :mod:`optparse` interprets " "command-line options are the action and type of each option, the most likely " "direction of extension is to add new actions and new types." msgstr "" -#: ../../library/optparse.rst:1869 +#: ../../library/optparse.rst:1872 msgid "Adding new types" msgstr "" -#: ../../library/optparse.rst:1871 +#: ../../library/optparse.rst:1874 msgid "" "To add new types, you need to define your own subclass of :mod:`optparse`'s :" "class:`Option` class. This class has a couple of attributes that define :" @@ -2242,19 +2251,19 @@ msgid "" "TYPE_CHECKER`." msgstr "" -#: ../../library/optparse.rst:1877 +#: ../../library/optparse.rst:1880 msgid "" "A tuple of type names; in your subclass, simply define a new tuple :attr:" "`TYPES` that builds on the standard one." msgstr "" -#: ../../library/optparse.rst:1882 +#: ../../library/optparse.rst:1885 msgid "" "A dictionary mapping type names to type-checking functions. A type-checking " "function has the following signature::" msgstr "" -#: ../../library/optparse.rst:1887 +#: ../../library/optparse.rst:1890 msgid "" "where ``option`` is an :class:`Option` instance, ``opt`` is an option string " "(e.g., ``-f``), and ``value`` is the string from the command line that must " @@ -2265,7 +2274,7 @@ msgid "" "``value`` parameter." msgstr "" -#: ../../library/optparse.rst:1895 +#: ../../library/optparse.rst:1898 msgid "" "Your type-checking function should raise :exc:`OptionValueError` if it " "encounters any problems. :exc:`OptionValueError` takes a single string " @@ -2274,7 +2283,7 @@ msgid "" "\"`` and prints everything to stderr before terminating the process." msgstr "" -#: ../../library/optparse.rst:1901 +#: ../../library/optparse.rst:1904 msgid "" "Here's a silly example that demonstrates adding a ``\"complex\"`` option " "type to parse Python-style complex numbers on the command line. (This is " @@ -2282,21 +2291,21 @@ msgid "" "support for complex numbers, but never mind.)" msgstr "" -#: ../../library/optparse.rst:1906 +#: ../../library/optparse.rst:1909 msgid "First, the necessary imports::" msgstr "" -#: ../../library/optparse.rst:1911 +#: ../../library/optparse.rst:1914 msgid "" "You need to define your type-checker first, since it's referred to later (in " "the :attr:`~Option.TYPE_CHECKER` class attribute of your Option subclass)::" msgstr "" -#: ../../library/optparse.rst:1921 +#: ../../library/optparse.rst:1924 msgid "Finally, the Option subclass::" msgstr "" -#: ../../library/optparse.rst:1928 +#: ../../library/optparse.rst:1931 msgid "" "(If we didn't make a :func:`copy` of :attr:`Option.TYPE_CHECKER`, we would " "end up modifying the :attr:`~Option.TYPE_CHECKER` attribute of :mod:" @@ -2304,46 +2313,46 @@ msgid "" "that except good manners and common sense.)" msgstr "" -#: ../../library/optparse.rst:1933 +#: ../../library/optparse.rst:1936 msgid "" "That's it! Now you can write a script that uses the new option type just " "like any other :mod:`optparse`\\ -based script, except you have to instruct " "your OptionParser to use MyOption instead of Option::" msgstr "" -#: ../../library/optparse.rst:1940 +#: ../../library/optparse.rst:1943 msgid "" "Alternately, you can build your own option list and pass it to OptionParser; " "if you don't use :meth:`add_option` in the above way, you don't need to tell " "OptionParser which option class to use::" msgstr "" -#: ../../library/optparse.rst:1951 +#: ../../library/optparse.rst:1954 msgid "Adding new actions" msgstr "" -#: ../../library/optparse.rst:1953 +#: ../../library/optparse.rst:1956 msgid "" "Adding new actions is a bit trickier, because you have to understand that :" "mod:`optparse` has a couple of classifications for actions:" msgstr "" -#: ../../library/optparse.rst:1959 +#: ../../library/optparse.rst:1962 msgid "\"store\" actions" msgstr "" -#: ../../library/optparse.rst:1957 +#: ../../library/optparse.rst:1960 msgid "" "actions that result in :mod:`optparse` storing a value to an attribute of " "the current OptionValues instance; these options require a :attr:`~Option." "dest` attribute to be supplied to the Option constructor." msgstr "" -#: ../../library/optparse.rst:1965 +#: ../../library/optparse.rst:1968 msgid "\"typed\" actions" msgstr "" -#: ../../library/optparse.rst:1962 +#: ../../library/optparse.rst:1965 msgid "" "actions that take a value from the command line and expect it to be of a " "certain type; or rather, a string that can be converted to a certain type. " @@ -2351,7 +2360,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/optparse.rst:1967 +#: ../../library/optparse.rst:1970 msgid "" "These are overlapping sets: some default \"store\" actions are " "``\"store\"``, ``\"store_const\"``, ``\"append\"``, and ``\"count\"``, while " @@ -2359,25 +2368,25 @@ msgid "" "``\"callback\"``." msgstr "" -#: ../../library/optparse.rst:1971 +#: ../../library/optparse.rst:1974 msgid "" "When you add an action, you need to categorize it by listing it in at least " "one of the following class attributes of Option (all are lists of strings):" msgstr "" -#: ../../library/optparse.rst:1976 +#: ../../library/optparse.rst:1979 msgid "All actions must be listed in ACTIONS." msgstr "" -#: ../../library/optparse.rst:1980 +#: ../../library/optparse.rst:1983 msgid "\"store\" actions are additionally listed here." msgstr "" -#: ../../library/optparse.rst:1984 +#: ../../library/optparse.rst:1987 msgid "\"typed\" actions are additionally listed here." msgstr "" -#: ../../library/optparse.rst:1988 +#: ../../library/optparse.rst:1991 msgid "" "Actions that always take a type (i.e. whose options always take a value) are " "additionally listed here. The only effect of this is that :mod:`optparse` " @@ -2385,13 +2394,13 @@ msgid "" "whose action is listed in :attr:`ALWAYS_TYPED_ACTIONS`." msgstr "" -#: ../../library/optparse.rst:1993 +#: ../../library/optparse.rst:1996 msgid "" "In order to actually implement your new action, you must override Option's :" "meth:`take_action` method and add a case that recognizes your action." msgstr "" -#: ../../library/optparse.rst:1996 +#: ../../library/optparse.rst:1999 msgid "" "For example, let's add an ``\"extend\"`` action. This is similar to the " "standard ``\"append\"`` action, but instead of taking a single value from " @@ -2401,47 +2410,47 @@ msgid "" "option of type ``\"string\"``, the command line ::" msgstr "" -#: ../../library/optparse.rst:2005 +#: ../../library/optparse.rst:2008 msgid "would result in a list ::" msgstr "" -#: ../../library/optparse.rst:2009 +#: ../../library/optparse.rst:2012 msgid "Again we define a subclass of Option::" msgstr "" -#: ../../library/optparse.rst:2026 +#: ../../library/optparse.rst:2029 msgid "Features of note:" msgstr "" -#: ../../library/optparse.rst:2028 +#: ../../library/optparse.rst:2031 msgid "" "``\"extend\"`` both expects a value on the command-line and stores that " "value somewhere, so it goes in both :attr:`~Option.STORE_ACTIONS` and :attr:" "`~Option.TYPED_ACTIONS`." msgstr "" -#: ../../library/optparse.rst:2032 +#: ../../library/optparse.rst:2035 msgid "" "to ensure that :mod:`optparse` assigns the default type of ``\"string\"`` to " "``\"extend\"`` actions, we put the ``\"extend\"`` action in :attr:`~Option." "ALWAYS_TYPED_ACTIONS` as well." msgstr "" -#: ../../library/optparse.rst:2036 +#: ../../library/optparse.rst:2039 msgid "" ":meth:`MyOption.take_action` implements just this one new action, and passes " "control back to :meth:`Option.take_action` for the standard :mod:`optparse` " "actions." msgstr "" -#: ../../library/optparse.rst:2040 +#: ../../library/optparse.rst:2043 msgid "" "``values`` is an instance of the optparse_parser.Values class, which " "provides the very useful :meth:`ensure_value` method. :meth:`ensure_value` " "is essentially :func:`getattr` with a safety valve; it is called as ::" msgstr "" -#: ../../library/optparse.rst:2046 +#: ../../library/optparse.rst:2049 msgid "" "If the ``attr`` attribute of ``values`` doesn't exist or is ``None``, then " "ensure_value() first sets it to ``value``, and then returns 'value. This is " @@ -2454,28 +2463,28 @@ msgid "" "meth:`ensure_value` will take care of getting it right when it's needed." msgstr "" -#: ../../library/optparse.rst:2057 +#: ../../library/optparse.rst:2060 msgid "Exceptions" msgstr "" -#: ../../library/optparse.rst:2061 +#: ../../library/optparse.rst:2064 msgid "" "Raised if an :class:`Option` instance is created with invalid or " "inconsistent arguments." msgstr "" -#: ../../library/optparse.rst:2066 +#: ../../library/optparse.rst:2069 msgid "Raised if conflicting options are added to an :class:`OptionParser`." msgstr "" -#: ../../library/optparse.rst:2070 +#: ../../library/optparse.rst:2073 msgid "Raised if an invalid option value is encountered on the command line." msgstr "" -#: ../../library/optparse.rst:2074 +#: ../../library/optparse.rst:2077 msgid "Raised if an invalid option is passed on the command line." msgstr "" -#: ../../library/optparse.rst:2078 +#: ../../library/optparse.rst:2081 msgid "Raised if an ambiguous option is passed on the command line." msgstr "" From 0fd39cf6d800a99dc8fb81b971bb30ce71e16eb2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 30 Jun 2023 20:19:55 +0000 Subject: [PATCH 118/130] sync with cpython f5e29f42 --- c-api/complex.po | 16 +++++++-------- c-api/float.po | 14 ++++++------- c-api/long.po | 22 ++++++++++---------- library/cmath.po | 10 ++++----- library/functions.po | 49 ++++++++++++++++++++++++++++---------------- library/struct.po | 8 ++++---- 6 files changed, 66 insertions(+), 53 deletions(-) diff --git a/c-api/complex.po b/c-api/complex.po index c1370ccea6..fe532b9ca4 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-30 20:18+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -148,16 +148,16 @@ msgstr "" #: ../../c-api/complex.rst:130 msgid "" -"If *op* is not a Python complex number object but has a :meth:`__complex__` " -"method, this method will first be called to convert *op* to a Python complex " -"number object. If ``__complex__()`` is not defined then it falls back to :" -"meth:`__float__`. If ``__float__()`` is not defined then it falls back to :" -"meth:`__index__`. Upon failure, this method returns ``-1.0`` as a real " -"value." +"If *op* is not a Python complex number object but has a :meth:`~object." +"__complex__` method, this method will first be called to convert *op* to a " +"Python complex number object. If :meth:`!__complex__` is not defined then " +"it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not " +"defined then it falls back to :meth:`~object.__index__`. Upon failure, this " +"method returns ``-1.0`` as a real value." msgstr "" #: ../../c-api/complex.rst:137 -msgid "Use :meth:`__index__` if available." +msgid "Use :meth:`~object.__index__` if available." msgstr "" #: ../../c-api/complex.rst:8 diff --git a/c-api/float.po b/c-api/float.po index 142017c66b..3491309c57 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-30 20:18+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,15 +61,15 @@ msgstr "" #: ../../c-api/float.rst:47 msgid "" "Return a C :c:expr:`double` representation of the contents of *pyfloat*. If " -"*pyfloat* is not a Python floating point object but has a :meth:`__float__` " -"method, this method will first be called to convert *pyfloat* into a float. " -"If ``__float__()`` is not defined then it falls back to :meth:`__index__`. " -"This method returns ``-1.0`` upon failure, so one should call :c:func:" -"`PyErr_Occurred` to check for errors." +"*pyfloat* is not a Python floating point object but has a :meth:`~object." +"__float__` method, this method will first be called to convert *pyfloat* " +"into a float. If :meth:`!__float__` is not defined then it falls back to :" +"meth:`~object.__index__`. This method returns ``-1.0`` upon failure, so one " +"should call :c:func:`PyErr_Occurred` to check for errors." msgstr "" #: ../../c-api/float.rst:54 -msgid "Use :meth:`__index__` if available." +msgid "Use :meth:`~object.__index__` if available." msgstr "" #: ../../c-api/float.rst:60 diff --git a/c-api/long.po b/c-api/long.po index 64850771ed..6a84e38b6e 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-30 20:18+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -140,8 +140,8 @@ msgstr "" #: ../../c-api/long.rst:122 ../../c-api/long.rst:140 msgid "" "Return a C :c:expr:`long` representation of *obj*. If *obj* is not an " -"instance of :c:type:`PyLongObject`, first call its :meth:`__index__` method " -"(if present) to convert it to a :c:type:`PyLongObject`." +"instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` " +"method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" #: ../../c-api/long.rst:126 @@ -157,12 +157,12 @@ msgstr "" #: ../../c-api/long.rst:131 ../../c-api/long.rst:151 ../../c-api/long.rst:172 #: ../../c-api/long.rst:194 ../../c-api/long.rst:278 ../../c-api/long.rst:298 -msgid "Use :meth:`__index__` if available." +msgid "Use :meth:`~object.__index__` if available." msgstr "" #: ../../c-api/long.rst:134 ../../c-api/long.rst:154 ../../c-api/long.rst:175 #: ../../c-api/long.rst:197 ../../c-api/long.rst:281 ../../c-api/long.rst:301 -msgid "This function will no longer use :meth:`__int__`." +msgid "This function will no longer use :meth:`~object.__int__`." msgstr "" #: ../../c-api/long.rst:144 @@ -176,8 +176,8 @@ msgstr "" #: ../../c-api/long.rst:163 ../../c-api/long.rst:181 msgid "" "Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an " -"instance of :c:type:`PyLongObject`, first call its :meth:`__index__` method " -"(if present) to convert it to a :c:type:`PyLongObject`." +"instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` " +"method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" #: ../../c-api/long.rst:167 @@ -268,8 +268,8 @@ msgstr "" #: ../../c-api/long.rst:268 msgid "" "Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is not " -"an instance of :c:type:`PyLongObject`, first call its :meth:`__index__` " -"method (if present) to convert it to a :c:type:`PyLongObject`." +"an instance of :c:type:`PyLongObject`, first call its :meth:`~object." +"__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" #: ../../c-api/long.rst:272 @@ -287,8 +287,8 @@ msgstr "" #: ../../c-api/long.rst:287 msgid "" "Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* " -"is not an instance of :c:type:`PyLongObject`, first call its :meth:" -"`__index__` method (if present) to convert it to a :c:type:`PyLongObject`." +"is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object." +"__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" #: ../../c-api/long.rst:292 diff --git a/library/cmath.po b/library/cmath.po index bd32a9cc9e..b1a7d7c07e 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-30 20:18+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-" @@ -27,10 +27,10 @@ msgid "" "This module provides access to mathematical functions for complex numbers. " "The functions in this module accept integers, floating-point numbers or " "complex numbers as arguments. They will also accept any Python object that " -"has either a :meth:`__complex__` or a :meth:`__float__` method: these " -"methods are used to convert the object to a complex or floating-point " -"number, respectively, and the function is then applied to the result of the " -"conversion." +"has either a :meth:`~object.__complex__` or a :meth:`~object.__float__` " +"method: these methods are used to convert the object to a complex or " +"floating-point number, respectively, and the function is then applied to the " +"result of the conversion." msgstr "" #: ../../library/cmath.rst:18 diff --git a/library/functions.po b/library/functions.po index 7f2770f3e7..1bdc94e5ec 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-14 00:32+0000\n" +"POT-Creation-Date: 2023-06-30 20:18+0000\n" "PO-Revision-Date: 2023-01-04 14:53+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -466,10 +466,11 @@ msgstr "" "函式生成的字串和 Python 2 的 :func:`repr` 回傳的結果相似。" #: ../../library/functions.rst:123 +#, fuzzy msgid "" "Convert an integer number to a binary string prefixed with \"0b\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " -"object, it has to define an :meth:`__index__` method that returns an " +"object, it has to define an :meth:`~object.__index__` method that returns an " "integer. Some examples:" msgstr "" "將一個整數轉變為一個前綴為 \"0b\" 的二進位制字串。結果是一個有效的 Python 運" @@ -882,12 +883,15 @@ msgstr "" "果兩個引數都省略,則回傳 ``0j``。" #: ../../library/functions.rst:385 +#, fuzzy msgid "" "For a general Python object ``x``, ``complex(x)`` delegates to ``x." -"__complex__()``. If ``__complex__()`` is not defined then it falls back to :" -"meth:`__float__`. If ``__float__()`` is not defined then it falls back to :" -"meth:`__index__`." +"__complex__()``. If :meth:`~object.__complex__` is not defined then it " +"falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not " +"defined then it falls back to :meth:`~object.__index__`." msgstr "" +"對於一般的 Python 物件 ``x``,``float(x)`` 指派給 ``x.__float__()``。如果未定" +"義 ``__float__()`` 則使用 :meth:`__index__`。" #: ../../library/functions.rst:392 msgid "" @@ -910,8 +914,8 @@ msgstr "可以使用底線將程式碼文字中的數字進行分組。" #: ../../library/functions.rst:402 msgid "" -"Falls back to :meth:`__index__` if :meth:`__complex__` and :meth:`__float__` " -"are not defined." +"Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and :" +"meth:`~object.__float__` are not defined." msgstr "" #: ../../library/functions.rst:409 @@ -1309,10 +1313,11 @@ msgstr "" "浮點數。如果引數在 Python 浮點精度範圍外,則會觸發 :exc:`OverflowError`。" #: ../../library/functions.rst:682 +#, fuzzy msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." -"__float__()``. If ``__float__()`` is not defined then it falls back to :" -"meth:`__index__`." +"__float__()``. If :meth:`~object.__float__` is not defined then it falls " +"back to :meth:`~object.__index__`." msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 指派給 ``x.__float__()``。如果未定" "義 ``__float__()`` 則使用 :meth:`__index__`。" @@ -1333,7 +1338,9 @@ msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點數型別。" #: ../../library/functions.rst:709 -msgid "Falls back to :meth:`__index__` if :meth:`__float__` is not defined." +msgid "" +"Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " +"defined." msgstr "" #: ../../library/functions.rst:719 @@ -1494,10 +1501,11 @@ msgstr "" "加全面和一致。" #: ../../library/functions.rst:822 +#, fuzzy msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " "\"0x\". If *x* is not a Python :class:`int` object, it has to define an :" -"meth:`__index__` method that returns an integer. Some examples:" +"meth:`~object.__index__` method that returns an integer. Some examples:" msgstr "" "將整數轉換為以 \"0x\" 為前綴的小寫十六進位制字串。如果 *x* 不是 Python :" "class:`int` 物件,則必須定義一個 :meth:`__index__` method 並且回傳一個整數。" @@ -1591,12 +1599,14 @@ msgid "" msgstr "" #: ../../library/functions.rst:894 +#, fuzzy msgid "" "Return an integer object constructed from a number or string *x*, or return " -"``0`` if no arguments are given. If *x* defines :meth:`__int__`, ``int(x)`` " -"returns ``x.__int__()``. If *x* defines :meth:`__index__`, it returns ``x." -"__index__()``. If *x* defines :meth:`__trunc__`, it returns ``x." -"__trunc__()``. For floating point numbers, this truncates towards zero." +"``0`` if no arguments are given. If *x* defines :meth:`~object.__int__`, " +"``int(x)`` returns ``x.__int__()``. If *x* defines :meth:`~object." +"__index__`, it returns ``x.__index__()``. If *x* defines :meth:`~object." +"__trunc__`, it returns ``x.__trunc__()``. For floating point numbers, this " +"truncates towards zero." msgstr "" "回傳一個使用數字或字串 *x* 建構的整數物件,或者在沒有引數時回傳 ``0``。如果 " "*x* 定義了 :meth:`__int__`,``int(x)`` 回傳 ``x.__int__()``。如果 *x* 定義" @@ -1655,11 +1665,13 @@ msgstr "" "`。" #: ../../library/functions.rst:933 -msgid "Falls back to :meth:`__index__` if :meth:`__int__` is not defined." +msgid "" +"Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " +"defined." msgstr "" #: ../../library/functions.rst:936 -msgid "The delegation to :meth:`__trunc__` is deprecated." +msgid "The delegation to :meth:`~object.__trunc__` is deprecated." msgstr "" #: ../../library/functions.rst:939 @@ -1911,10 +1923,11 @@ msgstr "" "給 :class:`object` class 的實例。" #: ../../library/functions.rst:1138 +#, fuzzy msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " -"object, it has to define an :meth:`__index__` method that returns an " +"object, it has to define an :meth:`~object.__index__` method that returns an " "integer. For example:" msgstr "" "將一個整數轉變為一個前綴為 \"0o\" 的八進位制字串。回傳結果是一個有效的 " diff --git a/library/struct.po b/library/struct.po index 4b319c7d86..aa5758c829 100644 --- a/library/struct.po +++ b/library/struct.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-06-30 20:18+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -595,12 +595,12 @@ msgstr "" #: ../../library/struct.rst:268 msgid "" "When attempting to pack a non-integer using any of the integer conversion " -"codes, if the non-integer has a :meth:`__index__` method then that method is " -"called to convert the argument to an integer before packing." +"codes, if the non-integer has a :meth:`~object.__index__` method then that " +"method is called to convert the argument to an integer before packing." msgstr "" #: ../../library/struct.rst:272 -msgid "Added use of the :meth:`__index__` method for non-integers." +msgid "Added use of the :meth:`~object.__index__` method for non-integers." msgstr "" #: ../../library/struct.rst:276 From 099e091ebfe62034a27a71da91f5beb64ebb3186 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 3 Jul 2023 10:20:29 +0000 Subject: [PATCH 119/130] sync with cpython e0d951d6 --- reference/expressions.po | 28 ++++++++++++++-------------- reference/simple_stmts.po | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/reference/expressions.po b/reference/expressions.po index 63b0164e84..4eee74c52a 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-08 00:35+0000\n" +"POT-Creation-Date: 2023-07-03 10:18+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -313,8 +313,8 @@ msgstr "" #: ../../reference/expressions.rst:307 msgid "" -"A dictionary display is a possibly empty series of key/datum pairs enclosed " -"in curly braces:" +"A dictionary display is a possibly empty series of dict items (key/value " +"pairs) enclosed in curly braces:" msgstr "" #: ../../reference/expressions.rst:316 @@ -323,20 +323,20 @@ msgstr "" #: ../../reference/expressions.rst:318 msgid "" -"If a comma-separated sequence of key/datum pairs is given, they are " -"evaluated from left to right to define the entries of the dictionary: each " -"key object is used as a key into the dictionary to store the corresponding " -"datum. This means that you can specify the same key multiple times in the " -"key/datum list, and the final dictionary's value for that key will be the " -"last one given." +"If a comma-separated sequence of dict items is given, they are evaluated " +"from left to right to define the entries of the dictionary: each key object " +"is used as a key into the dictionary to store the corresponding value. This " +"means that you can specify the same key multiple times in the dict item " +"list, and the final dictionary's value for that key will be the last one " +"given." msgstr "" #: ../../reference/expressions.rst:328 msgid "" "A double asterisk ``**`` denotes :dfn:`dictionary unpacking`. Its operand " "must be a :term:`mapping`. Each mapping item is added to the new " -"dictionary. Later values replace values already set by earlier key/datum " -"pairs and earlier dictionary unpackings." +"dictionary. Later values replace values already set by earlier dict items " +"and earlier dictionary unpackings." msgstr "" #: ../../reference/expressions.rst:333 @@ -356,7 +356,7 @@ msgid "" "Restrictions on the types of the key values are listed earlier in section :" "ref:`types`. (To summarize, the key type should be :term:`hashable`, which " "excludes all mutable objects.) Clashes between duplicate keys are not " -"detected; the last datum (textually rightmost in the display) stored for a " +"detected; the last value (textually rightmost in the display) stored for a " "given key value prevails." msgstr "" @@ -2421,11 +2421,11 @@ msgid "key" msgstr "" #: ../../reference/expressions.rst:298 -msgid "datum" +msgid "value" msgstr "" #: ../../reference/expressions.rst:298 -msgid "key/datum pair" +msgid "key/value pair" msgstr "" #: ../../reference/expressions.rst:298 diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index 3bea6bbeee..59840a334e 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-03 10:18+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -205,7 +205,7 @@ msgstr "" msgid "" "If the primary is a mapping object (such as a dictionary), the subscript " "must have a type compatible with the mapping's key type, and the mapping is " -"then asked to create a key/datum pair which maps the subscript to the " +"then asked to create a key/value pair which maps the subscript to the " "assigned object. This can either replace an existing key/value pair with " "the same key value, or insert a new key/value pair (if no key with the same " "value existed)." From 72c0dcb58dad1584d4d299a3ff7a6724bee23d3f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 6 Jul 2023 00:42:20 +0000 Subject: [PATCH 120/130] sync with cpython ada22db1 --- library/asyncio-exceptions.po | 11 ++++++++--- library/urllib.parse.po | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/library/asyncio-exceptions.po b/library/asyncio-exceptions.po index 075e7bc684..92a8db92e8 100644 --- a/library/asyncio-exceptions.po +++ b/library/asyncio-exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-06 00:40+0000\n" "PO-Revision-Date: 2022-01-31 21:41+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,9 @@ msgstr "**原始碼:**\\ :source:`Lib/asyncio/exceptions.py`" msgid "" "A deprecated alias of :exc:`TimeoutError`, raised when the operation has " "exceeded the given deadline." -msgstr ":exc:`TimeoutError` 的一個已被棄用的別名,當操作已超過規定的截止時間時被引發。" +msgstr "" +":exc:`TimeoutError` 的一個已被棄用的別名,當操作已超過規定的截止時間時被引" +"發。" #: ../../library/asyncio-exceptions.rst:21 msgid "This class was made an alias of :exc:`TimeoutError`." @@ -51,7 +53,10 @@ msgstr "" "該例外必須重新被引發。" #: ../../library/asyncio-exceptions.rst:34 -msgid ":exc:`CancelledError` is now a subclass of :class:`BaseException`." +#, fuzzy +msgid "" +":exc:`CancelledError` is now a subclass of :class:`BaseException` rather " +"than :class:`Exception`." msgstr ":exc:`CancelledError` 現在是 :class:`BaseException` 的子類別。" #: ../../library/asyncio-exceptions.rst:39 diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 3710df73b1..66b29168a6 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-18 00:30+0000\n" +"POT-Creation-Date: 2023-07-06 00:40+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,9 +39,9 @@ msgid "" "The module has been designed to match the internet RFC on Relative Uniform " "Resource Locators. It supports the following URL schemes: ``file``, ``ftp``, " "``gopher``, ``hdl``, ``http``, ``https``, ``imap``, ``mailto``, ``mms``, " -"``news``, ``nntp``, ``prospero``, ``rsync``, ``rtsp``, ``rtspu``, ``sftp``, " -"``shttp``, ``sip``, ``sips``, ``snews``, ``svn``, ``svn+ssh``, ``telnet``, " -"``wais``, ``ws``, ``wss``." +"``news``, ``nntp``, ``prospero``, ``rsync``, ``rtsp``, ``rtsps``, ``rtspu``, " +"``sftp``, ``shttp``, ``sip``, ``sips``, ``snews``, ``svn``, ``svn+ssh``, " +"``telnet``, ``wais``, ``ws``, ``wss``." msgstr "" #: ../../library/urllib.parse.rst:30 From 9fc76acf1c0cda5c7ef30ec0c74be60242e54ac6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 7 Jul 2023 00:41:15 +0000 Subject: [PATCH 121/130] sync with cpython 1931c2a4 --- library/exceptions.po | 38 +++++++++++++++++++------------------- tutorial/errors.po | 18 +++++++++--------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/library/exceptions.po b/library/exceptions.po index f1cc37416d..d600f1a5d3 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-29 00:39+0000\n" +"POT-Creation-Date: 2023-07-07 00:39+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-" @@ -990,11 +990,11 @@ msgstr "" msgid "Base class for warnings related to resource usage." msgstr "" -#: ../../library/exceptions.rst:875 +#: ../../library/exceptions.rst:877 msgid "Exception groups" msgstr "" -#: ../../library/exceptions.rst:877 +#: ../../library/exceptions.rst:879 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 " @@ -1003,7 +1003,7 @@ msgid "" "based on the types of the contained exceptions." msgstr "" -#: ../../library/exceptions.rst:886 +#: ../../library/exceptions.rst:888 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 " @@ -1014,7 +1014,7 @@ msgid "" "exc:`BaseExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:894 +#: ../../library/exceptions.rst:896 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1023,23 +1023,23 @@ msgid "" "`TypeError` if any contained exception is not an :exc:`Exception` subclass." msgstr "" -#: ../../library/exceptions.rst:903 +#: ../../library/exceptions.rst:905 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:907 +#: ../../library/exceptions.rst:909 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:912 +#: ../../library/exceptions.rst:914 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." msgstr "" -#: ../../library/exceptions.rst:915 +#: ../../library/exceptions.rst:917 msgid "" "The condition can be either a function that accepts an exception and returns " "true for those that should be in the subgroup, or it can be an exception " @@ -1047,7 +1047,7 @@ msgid "" "the same check that is used in an ``except`` clause." msgstr "" -#: ../../library/exceptions.rst:920 +#: ../../library/exceptions.rst:922 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`__traceback__`, :attr:" @@ -1055,34 +1055,34 @@ msgid "" "groups are omitted from the result." msgstr "" -#: ../../library/exceptions.rst:925 +#: ../../library/exceptions.rst:927 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 " "true for such an exception group, it is included in the result in full." msgstr "" -#: ../../library/exceptions.rst:931 +#: ../../library/exceptions.rst:933 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" "matching part." msgstr "" -#: ../../library/exceptions.rst:937 +#: ../../library/exceptions.rst:939 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "" -#: ../../library/exceptions.rst:940 +#: ../../library/exceptions.rst:942 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`. A subclass needs " "to override it in order to make :meth:`subgroup` and :meth:`split` return " "instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:945 +#: ../../library/exceptions.rst:947 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`__traceback__`, :attr:" "`__cause__`, :attr:`__context__` and :attr:`__notes__` fields from the " @@ -1090,7 +1090,7 @@ msgid "" "fields do not need to be updated by :meth:`derive`. ::" msgstr "" -#: ../../library/exceptions.rst:974 +#: ../../library/exceptions.rst:976 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`__new__`, so subclasses " "that need a different constructor signature need to override that rather " @@ -1099,18 +1099,18 @@ msgid "" "from it. ::" msgstr "" -#: ../../library/exceptions.rst:989 +#: ../../library/exceptions.rst:991 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" "`Exception`." msgstr "" -#: ../../library/exceptions.rst:997 +#: ../../library/exceptions.rst:999 msgid "Exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:999 +#: ../../library/exceptions.rst:1001 msgid "The class hierarchy for built-in exceptions is:" msgstr "" diff --git a/tutorial/errors.po b/tutorial/errors.po index d09bbd2026..6dd96e2c27 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-06 00:20+0000\n" +"POT-Creation-Date: 2023-07-07 00:39+0000\n" "PO-Revision-Date: 2022-10-24 14:54+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -197,8 +197,8 @@ msgid "" msgstr "" ":keyword:`try` 陳述式可以有不只一個 *except 子句*\\ ,為不同的例外指定處理" "者,而最多只有一個處理者會被執行。處理者只處理對應的 try 子句中發生的例外,而" -"不會處理同一 :keyword:`!try` 陳述式裡其他處理者內的例外。一個 *except 子句*" -"\\ 可以用一組括號內的 tuple 列舉多個例外,例如:\n" +"不會處理同一 :keyword:`!try` 陳述式裡其他處理者內的例外。一個 *except 子句" +"*\\ 可以用一組括號內的 tuple 列舉多個例外,例如:\n" "\n" "::" @@ -626,9 +626,9 @@ msgid "" "that they can be raised together. It is an exception itself, so it can be " "caught like any other exception. ::" msgstr "" -"內建的 :exc:`ExceptionGroup` 會包裝一個例外實例 (exception instance) 的 " -"list(串列),使得它們可以一起被引發。由於它本身就是一個例外,因此它也可以像" -"任何其他例外一樣被捕獲。\n" +"內建的 :exc:`ExceptionGroup` 會包裝一個例外實例 (exception instance) 的 list" +"(串列),使得它們可以一起被引發。由於它本身就是一個例外,因此它也可以像任何" +"其他例外一樣被捕獲。\n" "\n" "::" @@ -659,11 +659,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:582 +#: ../../tutorial/errors.rst:584 msgid "Enriching Exceptions with Notes" msgstr "用註解使例外更詳細" -#: ../../tutorial/errors.rst:584 +#: ../../tutorial/errors.rst:586 msgid "" "When an exception is created in order to be raised, it is usually " "initialized with information that describes the error that has occurred. " @@ -681,7 +681,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:605 +#: ../../tutorial/errors.rst:607 msgid "" "For example, when collecting exceptions into an exception group, we may want " "to add context information for the individual errors. In the following each " From dad36e003a5c1213f64cc80ba1babf23f64f87a1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 9 Jul 2023 00:44:55 +0000 Subject: [PATCH 122/130] sync with cpython 2d037fb4 --- library/functions.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/functions.po b/library/functions.po index 1bdc94e5ec..a60a0cef42 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-30 20:18+0000\n" +"POT-Creation-Date: 2023-07-09 00:42+0000\n" "PO-Revision-Date: 2023-01-04 14:53+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1457,10 +1457,11 @@ msgstr "" "別不同,如 1 和 1.0)。" #: ../../library/functions.rst:794 +#, fuzzy msgid "" "For objects with custom :meth:`__hash__` methods, note that :func:`hash` " "truncates the return value based on the bit width of the host machine. See :" -"meth:`__hash__` for details." +"meth:`__hash__ ` for details." msgstr "" "請注意,如果物件實現了自己的 :meth:`__hash__` method,:func:`hash` 根據執行機" "器的位元長度來擷取回傳值。另請參閱 :meth:`__hash__`。" From 58476d7db45e2da6eff24c474eab66be6df27098 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 10 Jul 2023 00:40:38 +0000 Subject: [PATCH 123/130] sync with cpython dd046973 --- library/typing.po | 1106 +++++++++++++++++++++++---------------------- 1 file changed, 554 insertions(+), 552 deletions(-) diff --git a/library/typing.po b/library/typing.po index 7fbe9495a1..ce0655dae9 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-27 00:38+0000\n" +"POT-Creation-Date: 2023-07-10 00:38+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -358,17 +358,19 @@ msgid "" "Python 3.9." msgstr "" -#: ../../library/typing.rst:249 -msgid "Callable" +#: ../../library/typing.rst:250 +msgid "Annotating callable objects" msgstr "" -#: ../../library/typing.rst:251 +#: ../../library/typing.rst:252 msgid "" -"Frameworks expecting callback functions of specific signatures might be type " -"hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." +"Functions -- or other :term:`callable` objects -- can be annotated using :" +"class:`collections.abc.Callable` or :data:`typing.Callable`. " +"``Callable[[int], str]`` signifies a function that takes a single parameter " +"of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:254 ../../library/typing.rst:2679 +#: ../../library/typing.rst:257 ../../library/typing.rst:2684 #, fuzzy msgid "For example:" msgstr "" @@ -376,14 +378,30 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:272 +#: ../../library/typing.rst:275 +msgid "" +"The subscription syntax must always be used with exactly two values: the " +"argument list and the return type. The argument list must be a list of " +"types, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return " +"type must be a single type." +msgstr "" + +#: ../../library/typing.rst:280 +msgid "" +"If a literal ellipsis ``...`` is given as the argument list, it indicates " +"that a callable with any arbitrary parameter list would be acceptable:" +msgstr "" + +#: ../../library/typing.rst:292 msgid "" -"It is possible to declare the return type of a callable without specifying " -"the call signature by substituting a literal ellipsis for the list of " -"arguments in the type hint: ``Callable[..., ReturnType]``." +"``Callable`` cannot express complex signatures such as functions that take a " +"variadic number of arguments, :func:`overloaded functions `, or " +"functions that have keyword-only parameters. However, these signatures can " +"be expressed by defining a :class:`Protocol` class with a :meth:`~object." +"__call__` method:" msgstr "" -#: ../../library/typing.rst:276 ../../library/typing.rst:1008 +#: ../../library/typing.rst:319 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -394,46 +412,46 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:284 ../../library/typing.rst:1020 +#: ../../library/typing.rst:327 ../../library/typing.rst:3205 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:289 +#: ../../library/typing.rst:332 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:295 +#: ../../library/typing.rst:338 msgid "Generics" msgstr "" -#: ../../library/typing.rst:297 +#: ../../library/typing.rst:340 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, many container classes in the standard library " "support subscription to denote the expected types of container elements." msgstr "" -#: ../../library/typing.rst:314 +#: ../../library/typing.rst:357 msgid "" "Generics can be parameterized by using a factory available in typing called :" "class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:330 +#: ../../library/typing.rst:373 msgid "Annotating tuples" msgstr "" -#: ../../library/typing.rst:332 +#: ../../library/typing.rst:375 msgid "" "For most containers in Python, the typing system assumes that all elements " "in the container will be of the same type. For example::" msgstr "" -#: ../../library/typing.rst:347 +#: ../../library/typing.rst:390 msgid "" ":class:`list` only accepts one type argument, so a type checker would emit " "an error on the ``y`` assignment above. Similarly, :class:`~collections.abc." @@ -441,7 +459,7 @@ msgid "" "the keys, and the second indicates the type of the values." msgstr "" -#: ../../library/typing.rst:353 +#: ../../library/typing.rst:396 msgid "" "Unlike most other Python containers, however, it is common in idiomatic " "Python code for tuples to have elements which are not all of the same type. " @@ -449,7 +467,7 @@ msgid "" "`tuple` accepts *any number* of type arguments::" msgstr "" -#: ../../library/typing.rst:369 +#: ../../library/typing.rst:412 msgid "" "To denote a tuple which could be of *any* length, and in which all elements " "are of the same type ``T``, use ``tuple[T, ...]``. To denote an empty tuple, " @@ -457,11 +475,11 @@ msgid "" "using ``tuple[Any, ...]``::" msgstr "" -#: ../../library/typing.rst:392 +#: ../../library/typing.rst:435 msgid "The type of class objects" msgstr "" -#: ../../library/typing.rst:394 +#: ../../library/typing.rst:437 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``type[C]`` (or :class:`typing.Type[C] " @@ -469,84 +487,84 @@ msgid "" "will accept the *class object* of ``C``. For example::" msgstr "" -#: ../../library/typing.rst:404 +#: ../../library/typing.rst:447 msgid "Note that ``type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:420 +#: ../../library/typing.rst:463 msgid "" "The only legal parameters for :class:`type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:432 +#: ../../library/typing.rst:475 msgid "" "``type[Any]`` is equivalent to :class:`type`, which is the root of Python's :" "ref:`metaclass hierarchy `." msgstr "" -#: ../../library/typing.rst:438 +#: ../../library/typing.rst:481 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:440 +#: ../../library/typing.rst:483 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:466 +#: ../../library/typing.rst:509 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:470 +#: ../../library/typing.rst:513 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[T]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:479 +#: ../../library/typing.rst:522 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:491 +#: ../../library/typing.rst:534 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:502 +#: ../../library/typing.rst:545 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:512 +#: ../../library/typing.rst:555 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:522 +#: ../../library/typing.rst:565 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:524 +#: ../../library/typing.rst:567 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``:" msgstr "" -#: ../../library/typing.rst:535 +#: ../../library/typing.rst:578 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:552 +#: ../../library/typing.rst:595 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:555 +#: ../../library/typing.rst:598 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -556,7 +574,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:571 +#: ../../library/typing.rst:614 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -564,20 +582,20 @@ msgid "" "converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:583 +#: ../../library/typing.rst:626 msgid "" "Note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:587 +#: ../../library/typing.rst:630 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:591 +#: ../../library/typing.rst:634 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -585,24 +603,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:598 +#: ../../library/typing.rst:641 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:600 +#: ../../library/typing.rst:643 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:604 +#: ../../library/typing.rst:647 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:622 +#: ../../library/typing.rst:665 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -611,19 +629,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:628 +#: ../../library/typing.rst:671 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:641 +#: ../../library/typing.rst:684 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:644 +#: ../../library/typing.rst:687 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -631,7 +649,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:649 +#: ../../library/typing.rst:692 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -639,24 +657,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:671 +#: ../../library/typing.rst:714 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:676 +#: ../../library/typing.rst:719 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:678 +#: ../../library/typing.rst:721 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:682 +#: ../../library/typing.rst:725 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -665,7 +683,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:695 +#: ../../library/typing.rst:738 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -674,85 +692,85 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:711 +#: ../../library/typing.rst:754 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:716 +#: ../../library/typing.rst:759 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:718 +#: ../../library/typing.rst:761 msgid "" "The ``typing`` module defines the following classes, functions and " "decorators." msgstr "" -#: ../../library/typing.rst:721 +#: ../../library/typing.rst:764 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:724 +#: ../../library/typing.rst:767 msgid "Special types" msgstr "" -#: ../../library/typing.rst:726 +#: ../../library/typing.rst:769 msgid "" "These can be used as types in annotations. They do not support subscription " "using ``[]``." msgstr "" -#: ../../library/typing.rst:731 +#: ../../library/typing.rst:774 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:733 +#: ../../library/typing.rst:776 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:734 +#: ../../library/typing.rst:777 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:736 +#: ../../library/typing.rst:779 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:743 +#: ../../library/typing.rst:786 msgid "A :ref:`constrained type variable `." msgstr "" -#: ../../library/typing.rst:745 +#: ../../library/typing.rst:788 msgid "Definition::" msgstr "" -#: ../../library/typing.rst:749 +#: ../../library/typing.rst:792 msgid "" "``AnyStr`` is meant to be used for functions that may accept :class:`str` " "or :class:`bytes` arguments but cannot allow the two to mix." msgstr "" -#: ../../library/typing.rst:752 ../../library/typing.rst:828 -#: ../../library/typing.rst:848 ../../library/typing.rst:894 -#: ../../library/typing.rst:1092 ../../library/typing.rst:1149 -#: ../../library/typing.rst:1357 ../../library/typing.rst:2519 +#: ../../library/typing.rst:795 ../../library/typing.rst:871 +#: ../../library/typing.rst:891 ../../library/typing.rst:937 +#: ../../library/typing.rst:1096 ../../library/typing.rst:1153 +#: ../../library/typing.rst:1361 ../../library/typing.rst:2524 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:763 +#: ../../library/typing.rst:806 msgid "Special type that includes only literal strings." msgstr "" -#: ../../library/typing.rst:765 +#: ../../library/typing.rst:808 msgid "" "Any string literal is compatible with ``LiteralString``, as is another " "``LiteralString``. However, an object typed as just ``str`` is not. A string " @@ -760,7 +778,7 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:771 +#: ../../library/typing.rst:814 #, fuzzy msgid "Example:" msgstr "" @@ -768,7 +786,7 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:787 +#: ../../library/typing.rst:830 msgid "" "``LiteralString`` is useful for sensitive APIs where arbitrary user-" "generated strings could generate problems. For example, the two cases above " @@ -776,33 +794,33 @@ msgid "" "attack." msgstr "" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:835 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:798 +#: ../../library/typing.rst:841 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:801 +#: ../../library/typing.rst:844 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:821 +#: ../../library/typing.rst:864 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:826 +#: ../../library/typing.rst:869 msgid "Special type indicating that a function never returns." msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:878 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -810,127 +828,127 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:846 +#: ../../library/typing.rst:889 msgid "Special type to represent the current enclosed class." msgstr "" -#: ../../library/typing.rst:858 +#: ../../library/typing.rst:901 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:870 +#: ../../library/typing.rst:913 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:877 +#: ../../library/typing.rst:920 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:880 +#: ../../library/typing.rst:923 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:882 +#: ../../library/typing.rst:925 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:884 +#: ../../library/typing.rst:927 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:886 +#: ../../library/typing.rst:929 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:892 +#: ../../library/typing.rst:935 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: ../../library/typing.rst:900 +#: ../../library/typing.rst:943 msgid "" "``TypeAlias`` is particularly useful for annotating aliases that make use of " "forward references, as it can be hard for type checkers to distinguish these " "from normal variable assignments:" msgstr "" -#: ../../library/typing.rst:920 +#: ../../library/typing.rst:963 #, fuzzy msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:925 +#: ../../library/typing.rst:968 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:927 +#: ../../library/typing.rst:970 msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." msgstr "" -#: ../../library/typing.rst:932 +#: ../../library/typing.rst:975 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:934 +#: ../../library/typing.rst:977 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:936 +#: ../../library/typing.rst:979 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:938 +#: ../../library/typing.rst:981 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:942 +#: ../../library/typing.rst:985 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:946 +#: ../../library/typing.rst:989 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:950 +#: ../../library/typing.rst:993 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:954 +#: ../../library/typing.rst:997 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:956 +#: ../../library/typing.rst:999 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:958 +#: ../../library/typing.rst:1001 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:961 +#: ../../library/typing.rst:1004 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:967 +#: ../../library/typing.rst:1010 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:969 +#: ../../library/typing.rst:1012 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -938,75 +956,35 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:977 +#: ../../library/typing.rst:1020 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:984 +#: ../../library/typing.rst:1027 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:990 -msgid "Deprecated alias to :class:`collections.abc.Callable`." -msgstr "" - -#: ../../library/typing.rst:992 -msgid "" -"``Callable[[int], str]`` signifies a function that takes a single parameter " -"of type :class:`int` and returns a :class:`str`." -msgstr "" - -#: ../../library/typing.rst:995 -msgid "" -"The subscription syntax must always be used with exactly two values: the " -"argument list and the return type. The argument list must be a list of " -"types, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return " -"type must be a single type." -msgstr "" - -#: ../../library/typing.rst:1000 -msgid "" -"There is no syntax to indicate optional or keyword arguments; such function " -"types are rarely used as callback types. ``Callable[..., ReturnType]`` " -"(literal ellipsis) can be used to type hint a callable taking any number of " -"arguments and returning ``ReturnType``. A plain :data:`Callable` is " -"equivalent to ``Callable[..., Any]``, and in turn to :class:`collections.abc." -"Callable`." -msgstr "" - -#: ../../library/typing.rst:1016 -msgid "" -":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1025 -msgid "" -"The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " -"examples of usage with ``Callable``." -msgstr "" - -#: ../../library/typing.rst:1030 +#: ../../library/typing.rst:1033 msgid "Special form for annotating higher-order functions." msgstr "" -#: ../../library/typing.rst:1032 +#: ../../library/typing.rst:1035 msgid "" -"``Concatenate`` can be used in conjunction with :data:`Callable` and :class:" -"`ParamSpec` to annotate a higher-order callable which adds, removes, or " -"transforms parameters of another callable. Usage is in the form " -"``Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable]``. ``Concatenate`` " -"is currently only valid when used as the first argument to a :data:" -"`Callable`. The last parameter to ``Concatenate`` must be a :class:" -"`ParamSpec` or ellipsis (``...``)." +"``Concatenate`` can be used in conjunction with :ref:`Callable ` and :class:`ParamSpec` to annotate a higher-order callable which " +"adds, removes, or transforms parameters of another callable. Usage is in " +"the form ``Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable]``. " +"``Concatenate`` is currently only valid when used as the first argument to " +"a :ref:`Callable `. The last parameter to " +"``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:1041 +#: ../../library/typing.rst:1044 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -1017,34 +995,39 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1080 ../../library/typing.rst:1736 +#: ../../library/typing.rst:1083 ../../library/typing.rst:1740 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " -"``ParamSpec`` and ``Concatenate``)." +"``ParamSpec`` and ``Concatenate``)" msgstr "" -#: ../../library/typing.rst:1082 -msgid ":class:`ParamSpec` and :class:`Callable`." +#: ../../library/typing.rst:1085 +#, fuzzy +msgid ":class:`ParamSpec`" msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:1086 +#: ../../library/typing.rst:1086 ../../library/typing.rst:1743 +msgid ":ref:`annotating-callables`" +msgstr "" + +#: ../../library/typing.rst:1090 msgid "Special typing form to define \"literal types\"." msgstr "" -#: ../../library/typing.rst:1088 +#: ../../library/typing.rst:1092 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" -#: ../../library/typing.rst:1104 +#: ../../library/typing.rst:1108 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:1110 +#: ../../library/typing.rst:1114 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1052,22 +1035,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1118 +#: ../../library/typing.rst:1122 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1120 +#: ../../library/typing.rst:1124 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1128 +#: ../../library/typing.rst:1132 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1130 +#: ../../library/typing.rst:1134 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1075,48 +1058,48 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1144 +#: ../../library/typing.rst:1148 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: ../../library/typing.rst:1146 +#: ../../library/typing.rst:1150 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1160 ../../library/typing.rst:2535 +#: ../../library/typing.rst:1164 ../../library/typing.rst:2540 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1167 +#: ../../library/typing.rst:1171 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: ../../library/typing.rst:1169 +#: ../../library/typing.rst:1173 #, fuzzy msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1176 +#: ../../library/typing.rst:1180 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: ../../library/typing.rst:1179 +#: ../../library/typing.rst:1183 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1185 +#: ../../library/typing.rst:1189 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1187 +#: ../../library/typing.rst:1191 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1124,7 +1107,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1192 +#: ../../library/typing.rst:1196 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1133,7 +1116,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1198 +#: ../../library/typing.rst:1202 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1143,7 +1126,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1205 +#: ../../library/typing.rst:1209 msgid "" "The responsibility of how to interpret the metadata lies with the the tool " "or library encountering an ``Annotated`` annotation. A tool or library " @@ -1151,64 +1134,64 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1213 +#: ../../library/typing.rst:1217 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1226 +#: ../../library/typing.rst:1230 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1228 +#: ../../library/typing.rst:1232 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1230 +#: ../../library/typing.rst:1234 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1239 +#: ../../library/typing.rst:1243 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1243 +#: ../../library/typing.rst:1247 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1246 +#: ../../library/typing.rst:1250 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1253 +#: ../../library/typing.rst:1257 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1260 +#: ../../library/typing.rst:1264 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1266 +#: ../../library/typing.rst:1270 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1279 +#: ../../library/typing.rst:1283 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1283 +#: ../../library/typing.rst:1287 #, fuzzy msgid "This would be equivalent to::" msgstr "" @@ -1216,44 +1199,44 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:1287 +#: ../../library/typing.rst:1291 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1290 +#: ../../library/typing.rst:1294 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1303 +#: ../../library/typing.rst:1307 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1317 +#: ../../library/typing.rst:1321 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1318 +#: ../../library/typing.rst:1322 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1325 +#: ../../library/typing.rst:1329 msgid "Special typing construct for marking user-defined type guard functions." msgstr "" -#: ../../library/typing.rst:1327 +#: ../../library/typing.rst:1331 msgid "" "``TypeGuard`` can be used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1331 +#: ../../library/typing.rst:1335 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1262,44 +1245,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1346 +#: ../../library/typing.rst:1350 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1350 +#: ../../library/typing.rst:1354 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1353 +#: ../../library/typing.rst:1357 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1354 +#: ../../library/typing.rst:1358 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1371 +#: ../../library/typing.rst:1375 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1375 +#: ../../library/typing.rst:1379 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1381 +#: ../../library/typing.rst:1385 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1308,24 +1291,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1387 +#: ../../library/typing.rst:1391 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1394 +#: ../../library/typing.rst:1398 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1396 +#: ../../library/typing.rst:1400 msgid "" "For example, using the unpack operator ``*`` on a :class:`type variable " "tuple ` is equivalent to using ``Unpack`` to mark the type " "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1405 +#: ../../library/typing.rst:1409 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1333,45 +1316,45 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1422 +#: ../../library/typing.rst:1426 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1424 +#: ../../library/typing.rst:1428 msgid "" "The following classes should not be used directly as annotations. Their " "intended purpose is to be building blocks for creating generic types." msgstr "" -#: ../../library/typing.rst:1430 +#: ../../library/typing.rst:1434 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1432 +#: ../../library/typing.rst:1436 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1441 +#: ../../library/typing.rst:1445 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1454 +#: ../../library/typing.rst:1458 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1456 ../../library/typing.rst:1551 -#: ../../library/typing.rst:1661 ../../library/typing.rst:1774 -#: ../../library/typing.rst:1845 ../../library/typing.rst:2719 +#: ../../library/typing.rst:1460 ../../library/typing.rst:1555 +#: ../../library/typing.rst:1665 ../../library/typing.rst:1779 +#: ../../library/typing.rst:1850 ../../library/typing.rst:2724 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1462 +#: ../../library/typing.rst:1466 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1379,69 +1362,69 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1483 +#: ../../library/typing.rst:1487 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1486 +#: ../../library/typing.rst:1490 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " "details. By default, type variables are invariant." msgstr "" -#: ../../library/typing.rst:1490 +#: ../../library/typing.rst:1494 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1505 +#: ../../library/typing.rst:1509 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1513 +#: ../../library/typing.rst:1517 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1524 +#: ../../library/typing.rst:1528 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1528 +#: ../../library/typing.rst:1532 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1532 +#: ../../library/typing.rst:1536 msgid "Whether the type var has been marked as covariant." msgstr "" -#: ../../library/typing.rst:1536 +#: ../../library/typing.rst:1540 msgid "Whether the type var has been marked as contravariant." msgstr "" -#: ../../library/typing.rst:1540 +#: ../../library/typing.rst:1544 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1544 +#: ../../library/typing.rst:1548 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1548 +#: ../../library/typing.rst:1552 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1559 +#: ../../library/typing.rst:1563 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1449,7 +1432,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1585 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1459,36 +1442,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1589 +#: ../../library/typing.rst:1593 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1596 +#: ../../library/typing.rst:1600 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1605 +#: ../../library/typing.rst:1609 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1624 +#: ../../library/typing.rst:1628 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1631 +#: ../../library/typing.rst:1635 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1641 +#: ../../library/typing.rst:1645 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1497,21 +1480,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1648 +#: ../../library/typing.rst:1652 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1652 +#: ../../library/typing.rst:1656 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1658 +#: ../../library/typing.rst:1662 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1665 +#: ../../library/typing.rst:1669 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1521,7 +1504,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1676 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1529,27 +1512,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1696 +#: ../../library/typing.rst:1700 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1700 +#: ../../library/typing.rst:1704 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1702 +#: ../../library/typing.rst:1706 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1709 +#: ../../library/typing.rst:1713 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1562,11 +1545,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1721 +#: ../../library/typing.rst:1725 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1727 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1575,17 +1558,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1732 +#: ../../library/typing.rst:1736 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1738 -msgid ":class:`Callable` and :class:`Concatenate`." -msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" +#: ../../library/typing.rst:1742 +msgid ":data:`Concatenate`" +msgstr "" -#: ../../library/typing.rst:1743 +#: ../../library/typing.rst:1748 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1593,45 +1576,45 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1748 +#: ../../library/typing.rst:1753 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1764 +#: ../../library/typing.rst:1769 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1766 +#: ../../library/typing.rst:1771 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:1772 +#: ../../library/typing.rst:1777 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1780 +#: ../../library/typing.rst:1785 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1784 +#: ../../library/typing.rst:1789 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1793 +#: ../../library/typing.rst:1798 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1795 +#: ../../library/typing.rst:1800 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1640,83 +1623,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:1806 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1811 +#: ../../library/typing.rst:1816 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1817 +#: ../../library/typing.rst:1822 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1821 +#: ../../library/typing.rst:1826 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1824 +#: ../../library/typing.rst:1829 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1827 +#: ../../library/typing.rst:1832 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1831 +#: ../../library/typing.rst:1836 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1835 +#: ../../library/typing.rst:1840 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1840 +#: ../../library/typing.rst:1845 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:1842 +#: ../../library/typing.rst:1847 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:1852 +#: ../../library/typing.rst:1857 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1856 +#: ../../library/typing.rst:1861 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1860 +#: ../../library/typing.rst:1865 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1864 +#: ../../library/typing.rst:1869 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1869 +#: ../../library/typing.rst:1874 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:1876 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1877 +#: ../../library/typing.rst:1882 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1889 +#: ../../library/typing.rst:1894 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1724,15 +1707,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1894 +#: ../../library/typing.rst:1899 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1906 +#: ../../library/typing.rst:1911 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1908 +#: ../../library/typing.rst:1913 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1741,18 +1724,18 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1928 +#: ../../library/typing.rst:1933 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" "class:`ssl.SSLObject` is a class, therefore it passes an :func:`issubclass` " -"check against :data:`Callable`. However, the ``ssl.SSLObject.__init__`` " -"method exists only to raise a :exc:`TypeError` with a more informative " -"message, therefore making it impossible to call (instantiate) :class:`ssl." -"SSLObject`." +"check against :ref:`Callable `. However, the ``ssl." +"SSLObject.__init__`` method exists only to raise a :exc:`TypeError` with a " +"more informative message, therefore making it impossible to call " +"(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:1939 +#: ../../library/typing.rst:1944 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1760,13 +1743,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1950 +#: ../../library/typing.rst:1955 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:1958 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1774,53 +1757,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:1974 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1973 +#: ../../library/typing.rst:1978 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1977 +#: ../../library/typing.rst:1982 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1984 +#: ../../library/typing.rst:1989 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1985 +#: ../../library/typing.rst:1990 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1997 +#: ../../library/typing.rst:2002 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:2008 +#: ../../library/typing.rst:2013 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2011 +#: ../../library/typing.rst:2016 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2026 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1828,61 +1811,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2026 +#: ../../library/typing.rst:2031 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2041 +#: ../../library/typing.rst:2046 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:2048 +#: ../../library/typing.rst:2053 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2056 +#: ../../library/typing.rst:2061 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2074 +#: ../../library/typing.rst:2079 msgid "A ``TypedDict`` can be generic:" msgstr "" -#: ../../library/typing.rst:2084 +#: ../../library/typing.rst:2089 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2090 +#: ../../library/typing.rst:2095 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2112 +#: ../../library/typing.rst:2117 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2115 +#: ../../library/typing.rst:2120 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2123 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1891,133 +1874,133 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2141 +#: ../../library/typing.rst:2146 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2145 +#: ../../library/typing.rst:2150 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2154 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2153 +#: ../../library/typing.rst:2158 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2160 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2160 +#: ../../library/typing.rst:2165 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2165 +#: ../../library/typing.rst:2170 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2169 +#: ../../library/typing.rst:2174 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2173 +#: ../../library/typing.rst:2178 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2177 +#: ../../library/typing.rst:2182 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2183 +#: ../../library/typing.rst:2188 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2187 +#: ../../library/typing.rst:2192 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2191 +#: ../../library/typing.rst:2196 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2197 +#: ../../library/typing.rst:2202 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2203 +#: ../../library/typing.rst:2208 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2212 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2209 +#: ../../library/typing.rst:2214 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2216 +#: ../../library/typing.rst:2221 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2218 +#: ../../library/typing.rst:2223 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2221 +#: ../../library/typing.rst:2226 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2228 +#: ../../library/typing.rst:2233 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2242 +#: ../../library/typing.rst:2247 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2244 +#: ../../library/typing.rst:2249 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2255 +#: ../../library/typing.rst:2260 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2260 +#: ../../library/typing.rst:2265 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2027,59 +2010,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2268 +#: ../../library/typing.rst:2273 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2276 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2279 +#: ../../library/typing.rst:2284 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2281 +#: ../../library/typing.rst:2286 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2287 +#: ../../library/typing.rst:2292 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2290 +#: ../../library/typing.rst:2295 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2295 +#: ../../library/typing.rst:2300 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2300 +#: ../../library/typing.rst:2305 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2312 +#: ../../library/typing.rst:2317 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2315 +#: ../../library/typing.rst:2320 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2088,19 +2071,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2322 +#: ../../library/typing.rst:2327 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2338 +#: ../../library/typing.rst:2343 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2347 +#: ../../library/typing.rst:2352 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2358 +#: ../../library/typing.rst:2363 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2489 +#: ../../library/typing.rst:2494 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2305,32 +2288,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2496 +#: ../../library/typing.rst:2501 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2504 +#: ../../library/typing.rst:2509 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2506 +#: ../../library/typing.rst:2511 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2513 +#: ../../library/typing.rst:2518 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2515 +#: ../../library/typing.rst:2520 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2540 +#: ../../library/typing.rst:2545 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2340,11 +2323,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2551 +#: ../../library/typing.rst:2556 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2553 +#: ../../library/typing.rst:2558 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2352,48 +2335,48 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2559 +#: ../../library/typing.rst:2564 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2563 +#: ../../library/typing.rst:2568 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2565 +#: ../../library/typing.rst:2570 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2570 +#: ../../library/typing.rst:2575 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2577 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2583 +#: ../../library/typing.rst:2588 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2587 +#: ../../library/typing.rst:2592 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2591 +#: ../../library/typing.rst:2596 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2594 +#: ../../library/typing.rst:2599 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2402,41 +2385,41 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2600 +#: ../../library/typing.rst:2605 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example:" msgstr "" -#: ../../library/typing.rst:2617 +#: ../../library/typing.rst:2622 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2622 +#: ../../library/typing.rst:2627 #, fuzzy msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2626 +#: ../../library/typing.rst:2631 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2633 +#: ../../library/typing.rst:2638 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2636 +#: ../../library/typing.rst:2641 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2444,7 +2427,7 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2642 ../../library/typing.rst:2665 +#: ../../library/typing.rst:2647 ../../library/typing.rst:2670 #, fuzzy msgid "Examples:" msgstr "" @@ -2452,13 +2435,13 @@ msgstr "" "\n" "::" -#: ../../library/typing.rst:2657 +#: ../../library/typing.rst:2662 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2665 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2466,40 +2449,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:2677 +#: ../../library/typing.rst:2682 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2698 +#: ../../library/typing.rst:2703 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:2700 +#: ../../library/typing.rst:2705 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2705 +#: ../../library/typing.rst:2710 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2712 +#: ../../library/typing.rst:2717 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2716 +#: ../../library/typing.rst:2721 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:2727 +#: ../../library/typing.rst:2732 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2507,7 +2490,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2734 +#: ../../library/typing.rst:2739 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2515,12 +2498,12 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2745 +#: ../../library/typing.rst:2750 #, fuzzy msgid "Deprecated aliases" msgstr "棄用於" -#: ../../library/typing.rst:2747 +#: ../../library/typing.rst:2752 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2529,7 +2512,7 @@ msgid "" "existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:2753 +#: ../../library/typing.rst:2758 msgid "" "The redundant types are deprecated as of Python 3.9 but no deprecation " "warnings are issued by the interpreter. It is expected that type checkers " @@ -2537,7 +2520,7 @@ msgid "" "or newer." msgstr "" -#: ../../library/typing.rst:2758 +#: ../../library/typing.rst:2763 msgid "" "The deprecated types will be removed from the :mod:`typing` module no sooner " "than the first Python version released 5 years after the release of Python " @@ -2545,176 +2528,176 @@ msgid "" "Collections*." msgstr "" -#: ../../library/typing.rst:2765 +#: ../../library/typing.rst:2770 msgid "Aliases to built-in types" msgstr "" -#: ../../library/typing.rst:2769 +#: ../../library/typing.rst:2774 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2771 +#: ../../library/typing.rst:2776 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2775 ../../library/typing.rst:3015 +#: ../../library/typing.rst:2780 ../../library/typing.rst:3020 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2780 +#: ../../library/typing.rst:2785 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2786 +#: ../../library/typing.rst:2791 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2788 +#: ../../library/typing.rst:2793 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2792 +#: ../../library/typing.rst:2797 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2802 +#: ../../library/typing.rst:2807 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2808 +#: ../../library/typing.rst:2813 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2810 +#: ../../library/typing.rst:2815 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2814 +#: ../../library/typing.rst:2819 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2820 +#: ../../library/typing.rst:2825 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2822 +#: ../../library/typing.rst:2827 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2829 +#: ../../library/typing.rst:2834 msgid "Deprecated alias for :class:`tuple`." msgstr "" -#: ../../library/typing.rst:2831 +#: ../../library/typing.rst:2836 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:2834 +#: ../../library/typing.rst:2839 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2840 +#: ../../library/typing.rst:2845 msgid "Deprecated alias to :class:`type`." msgstr "" -#: ../../library/typing.rst:2842 +#: ../../library/typing.rst:2847 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2852 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2854 +#: ../../library/typing.rst:2859 msgid "Aliases to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:2863 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:2867 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2873 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2872 +#: ../../library/typing.rst:2877 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2878 +#: ../../library/typing.rst:2883 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2888 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2894 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2899 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2900 +#: ../../library/typing.rst:2905 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2905 +#: ../../library/typing.rst:2910 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2912 +#: ../../library/typing.rst:2917 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:2917 +#: ../../library/typing.rst:2922 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2920 +#: ../../library/typing.rst:2925 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2722,367 +2705,383 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2928 +#: ../../library/typing.rst:2933 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2929 +#: ../../library/typing.rst:2934 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2935 +#: ../../library/typing.rst:2940 msgid "Deprecated alias for :class:`str`." msgstr "" -#: ../../library/typing.rst:2937 +#: ../../library/typing.rst:2942 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:2941 +#: ../../library/typing.rst:2946 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2949 +#: ../../library/typing.rst:2954 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2959 +#: ../../library/typing.rst:2964 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2963 +#: ../../library/typing.rst:2968 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2965 +#: ../../library/typing.rst:2970 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2971 +#: ../../library/typing.rst:2976 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2975 +#: ../../library/typing.rst:2980 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2979 +#: ../../library/typing.rst:2984 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2983 +#: ../../library/typing.rst:2988 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2989 +#: ../../library/typing.rst:2994 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2991 +#: ../../library/typing.rst:2996 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2997 +#: ../../library/typing.rst:3002 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2999 +#: ../../library/typing.rst:3004 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3005 +#: ../../library/typing.rst:3010 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:3007 +#: ../../library/typing.rst:3012 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3013 +#: ../../library/typing.rst:3018 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:3020 +#: ../../library/typing.rst:3025 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3026 +#: ../../library/typing.rst:3031 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:3028 +#: ../../library/typing.rst:3033 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3034 +#: ../../library/typing.rst:3039 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:3036 +#: ../../library/typing.rst:3041 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3043 +#: ../../library/typing.rst:3048 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:3045 +#: ../../library/typing.rst:3050 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3052 +#: ../../library/typing.rst:3057 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:3054 +#: ../../library/typing.rst:3059 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3060 +#: ../../library/typing.rst:3065 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:3062 +#: ../../library/typing.rst:3067 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3068 +#: ../../library/typing.rst:3073 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:3075 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3077 +#: ../../library/typing.rst:3082 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3081 +#: ../../library/typing.rst:3086 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:3083 +#: ../../library/typing.rst:3088 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3094 +#: ../../library/typing.rst:3099 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3100 +#: ../../library/typing.rst:3105 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:3102 +#: ../../library/typing.rst:3107 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3116 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:3115 +#: ../../library/typing.rst:3120 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3123 +#: ../../library/typing.rst:3128 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3133 +#: ../../library/typing.rst:3138 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3140 +#: ../../library/typing.rst:3145 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:3144 +#: ../../library/typing.rst:3149 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3150 +#: ../../library/typing.rst:3155 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:3154 +#: ../../library/typing.rst:3159 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3160 +#: ../../library/typing.rst:3165 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:3164 +#: ../../library/typing.rst:3169 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3176 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3180 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:3177 +#: ../../library/typing.rst:3182 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3183 +#: ../../library/typing.rst:3188 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:3185 +#: ../../library/typing.rst:3190 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3191 +#: ../../library/typing.rst:3196 +msgid "Deprecated alias to :class:`collections.abc.Callable`." +msgstr "" + +#: ../../library/typing.rst:3198 +msgid "" +"See :ref:`annotating-callables` for details on how to use :class:" +"`collections.abc.Callable` and ``typing.Callable`` in type annotations." +msgstr "" + +#: ../../library/typing.rst:3201 +msgid "" +":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." +msgstr "" + +#: ../../library/typing.rst:3211 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:3193 +#: ../../library/typing.rst:3213 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3222 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:3206 +#: ../../library/typing.rst:3226 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3214 +#: ../../library/typing.rst:3234 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3222 +#: ../../library/typing.rst:3242 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3228 +#: ../../library/typing.rst:3248 msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:3232 +#: ../../library/typing.rst:3252 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:3234 +#: ../../library/typing.rst:3254 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3240 +#: ../../library/typing.rst:3260 msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:3245 +#: ../../library/typing.rst:3265 msgid "Aliases to :mod:`contextlib` ABCs" msgstr "" -#: ../../library/typing.rst:3249 +#: ../../library/typing.rst:3269 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3254 +#: ../../library/typing.rst:3274 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3261 +#: ../../library/typing.rst:3281 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3266 +#: ../../library/typing.rst:3286 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3272 +#: ../../library/typing.rst:3292 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3274 +#: ../../library/typing.rst:3294 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3090,76 +3089,79 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3299 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3299 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3299 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3299 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3301 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3301 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3301 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3301 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3284 +#: ../../library/typing.rst:3304 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3284 ../../library/typing.rst:3287 +#: ../../library/typing.rst:3304 ../../library/typing.rst:3307 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3284 ../../library/typing.rst:3289 +#: ../../library/typing.rst:3304 ../../library/typing.rst:3309 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3284 +#: ../../library/typing.rst:3304 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3307 #, fuzzy msgid "``typing.ByteString``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3307 msgid "3.14" msgstr "" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3307 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3309 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3309 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3309 msgid ":gh:`92332`" msgstr ":gh:`92332`" + +#~ msgid ":class:`Callable` and :class:`Concatenate`." +#~ msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" From 9c670243dd1baa6d1cac3452f0db435ec560ddbf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 12 Jul 2023 00:43:13 +0000 Subject: [PATCH 124/130] sync with cpython 247f0500 --- library/sqlite3.po | 655 ++++++++++++++++++++-------------------- tutorial/controlflow.po | 246 +++++++-------- 2 files changed, 455 insertions(+), 446 deletions(-) diff --git a/library/sqlite3.po b/library/sqlite3.po index c00d11c3b2..e961a9e3ae 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-25 19:55+0000\n" +"POT-Creation-Date: 2023-07-12 00:40+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-" @@ -236,7 +236,7 @@ msgstr ":ref:`sqlite3-adapters`" msgid ":ref:`sqlite3-converters`" msgstr ":ref:`sqlite3-converters`" -#: ../../library/sqlite3.rst:241 ../../library/sqlite3.rst:557 +#: ../../library/sqlite3.rst:241 ../../library/sqlite3.rst:558 msgid ":ref:`sqlite3-connection-context-manager`" msgstr ":ref:`sqlite3-connection-context-manager`" @@ -267,11 +267,12 @@ msgstr "參數" #: ../../library/sqlite3.rst:266 msgid "" -"The path to the database file to be opened. Pass ``\":memory:\"`` to open a " -"connection to a database that is in RAM instead of on disk." +"The path to the database file to be opened. You can pass ``\":memory:\"`` to " +"create an `SQLite database existing only in memory `_, and open a connection to it." msgstr "" -#: ../../library/sqlite3.rst:272 +#: ../../library/sqlite3.rst:273 msgid "" "How many seconds the connection should wait before raising an :exc:" "`OperationalError` when a table is locked. If another connection opens a " @@ -279,7 +280,7 @@ msgid "" "transaction is committed. Default five seconds." msgstr "" -#: ../../library/sqlite3.rst:279 +#: ../../library/sqlite3.rst:280 msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " @@ -292,7 +293,7 @@ msgid "" "disabled." msgstr "" -#: ../../library/sqlite3.rst:293 +#: ../../library/sqlite3.rst:294 msgid "" "The :attr:`~Connection.isolation_level` of the connection, controlling " "whether and how transactions are implicitly opened. Can be ``\"DEFERRED\"`` " @@ -301,7 +302,7 @@ msgid "" "for more." msgstr "" -#: ../../library/sqlite3.rst:301 +#: ../../library/sqlite3.rst:302 msgid "" "If ``True`` (default), :exc:`ProgrammingError` will be raised if the " "database connection is used by a thread other than the one that created it. " @@ -310,19 +311,19 @@ msgid "" "See :attr:`threadsafety` for more information." msgstr "" -#: ../../library/sqlite3.rst:310 +#: ../../library/sqlite3.rst:311 msgid "" "A custom subclass of :class:`Connection` to create the connection with, if " "not the default :class:`Connection` class." msgstr "" -#: ../../library/sqlite3.rst:314 +#: ../../library/sqlite3.rst:315 msgid "" "The number of statements that :mod:`!sqlite3` should internally cache for " "this connection, to avoid parsing overhead. By default, 128 statements." msgstr "" -#: ../../library/sqlite3.rst:319 +#: ../../library/sqlite3.rst:320 msgid "" "If set to ``True``, *database* is interpreted as a :abbr:`URI (Uniform " "Resource Identifier)` with a file path and an optional query string. The " @@ -335,32 +336,32 @@ msgstr "" msgid "Return type" msgstr "" -#: ../../library/sqlite3.rst:330 +#: ../../library/sqlite3.rst:331 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -#: ../../library/sqlite3.rst:331 +#: ../../library/sqlite3.rst:332 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." msgstr "" -#: ../../library/sqlite3.rst:333 +#: ../../library/sqlite3.rst:334 msgid "The *uri* parameter." msgstr "*uri* 參數。" -#: ../../library/sqlite3.rst:336 +#: ../../library/sqlite3.rst:337 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" -#: ../../library/sqlite3.rst:339 +#: ../../library/sqlite3.rst:340 msgid "The ``sqlite3.connect/handle`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:344 +#: ../../library/sqlite3.rst:345 msgid "" "Return ``True`` if the string *statement* appears to contain one or more " "complete SQL statements. No syntactic verification or parsing of any kind is " @@ -368,18 +369,18 @@ msgid "" "and the statement is terminated by a semicolon." msgstr "" -#: ../../library/sqlite3.rst:350 +#: ../../library/sqlite3.rst:351 msgid "For example:" msgstr "範例:" -#: ../../library/sqlite3.rst:359 +#: ../../library/sqlite3.rst:360 msgid "" "This function may be useful during command-line input to determine if the " "entered text seems to form a complete SQL statement, or if additional input " "is needed before calling :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:365 +#: ../../library/sqlite3.rst:366 msgid "" "Enable or disable callback tracebacks. By default you will not get any " "tracebacks in user-defined functions, aggregates, converters, authorizer " @@ -388,13 +389,13 @@ msgid "" "on :data:`sys.stderr`. Use ``False`` to disable the feature again." msgstr "" -#: ../../library/sqlite3.rst:372 +#: ../../library/sqlite3.rst:373 msgid "" "Register an :func:`unraisable hook handler ` for an " "improved debug experience:" msgstr "" -#: ../../library/sqlite3.rst:397 +#: ../../library/sqlite3.rst:398 msgid "" "Register an *adapter* :term:`callable` to adapt the Python type *type* into " "an SQLite type. The adapter is called with a Python object of type *type* as " @@ -402,7 +403,7 @@ msgid "" "natively understands `." msgstr "" -#: ../../library/sqlite3.rst:405 +#: ../../library/sqlite3.rst:406 msgid "" "Register the *converter* :term:`callable` to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " @@ -412,17 +413,17 @@ msgid "" "type detection works." msgstr "" -#: ../../library/sqlite3.rst:413 +#: ../../library/sqlite3.rst:414 msgid "" "Note: *typename* and the name of the type in your query are matched case-" "insensitively." msgstr "" -#: ../../library/sqlite3.rst:420 +#: ../../library/sqlite3.rst:421 msgid "Module constants" msgstr "" -#: ../../library/sqlite3.rst:424 +#: ../../library/sqlite3.rst:425 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function by using the type name, parsed from the query " @@ -430,13 +431,13 @@ msgid "" "in square brackets (``[]``)." msgstr "" -#: ../../library/sqlite3.rst:434 +#: ../../library/sqlite3.rst:435 msgid "" "This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:439 +#: ../../library/sqlite3.rst:440 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function using the declared types for each column. The " @@ -445,61 +446,61 @@ msgid "" "the converter dictionary key. For example:" msgstr "" -#: ../../library/sqlite3.rst:455 +#: ../../library/sqlite3.rst:456 msgid "" "This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:462 +#: ../../library/sqlite3.rst:463 msgid "" "Flags that should be returned by the *authorizer_callback* :term:`callable` " "passed to :meth:`Connection.set_authorizer`, to indicate whether:" msgstr "" -#: ../../library/sqlite3.rst:465 +#: ../../library/sqlite3.rst:466 msgid "Access is allowed (:const:`!SQLITE_OK`)," msgstr "" -#: ../../library/sqlite3.rst:466 +#: ../../library/sqlite3.rst:467 msgid "" "The SQL statement should be aborted with an error (:const:`!SQLITE_DENY`)" msgstr "" -#: ../../library/sqlite3.rst:467 +#: ../../library/sqlite3.rst:468 msgid "" "The column should be treated as a ``NULL`` value (:const:`!SQLITE_IGNORE`)" msgstr "" -#: ../../library/sqlite3.rst:471 +#: ../../library/sqlite3.rst:472 msgid "" "String constant stating the supported DB-API level. Required by the DB-API. " "Hard-coded to ``\"2.0\"``." msgstr "" -#: ../../library/sqlite3.rst:476 +#: ../../library/sqlite3.rst:477 msgid "" "String constant stating the type of parameter marker formatting expected by " "the :mod:`!sqlite3` module. Required by the DB-API. Hard-coded to " "``\"qmark\"``." msgstr "" -#: ../../library/sqlite3.rst:482 +#: ../../library/sqlite3.rst:483 msgid "The ``named`` DB-API parameter style is also supported." msgstr "" -#: ../../library/sqlite3.rst:486 +#: ../../library/sqlite3.rst:487 msgid "" "Version number of the runtime SQLite library as a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:490 +#: ../../library/sqlite3.rst:491 msgid "" "Version number of the runtime SQLite library as a :class:`tuple` of :class:" "`integers `." msgstr "" -#: ../../library/sqlite3.rst:495 +#: ../../library/sqlite3.rst:496 msgid "" "Integer constant required by the DB-API 2.0, stating the level of thread " "safety the :mod:`!sqlite3` module supports. This attribute is set based on " @@ -507,154 +508,154 @@ msgid "" "underlying SQLite library is compiled with. The SQLite threading modes are:" msgstr "" -#: ../../library/sqlite3.rst:500 +#: ../../library/sqlite3.rst:501 msgid "" "**Single-thread**: In this mode, all mutexes are disabled and SQLite is " "unsafe to use in more than a single thread at once." msgstr "" -#: ../../library/sqlite3.rst:502 +#: ../../library/sqlite3.rst:503 msgid "" "**Multi-thread**: In this mode, SQLite can be safely used by multiple " "threads provided that no single database connection is used simultaneously " "in two or more threads." msgstr "" -#: ../../library/sqlite3.rst:505 +#: ../../library/sqlite3.rst:506 msgid "" "**Serialized**: In serialized mode, SQLite can be safely used by multiple " "threads with no restriction." msgstr "" -#: ../../library/sqlite3.rst:508 +#: ../../library/sqlite3.rst:509 msgid "" "The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels " "are as follows:" msgstr "" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "SQLite threading mode" msgstr "" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "`threadsafety`_" msgstr "`threadsafety`_" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "`SQLITE_THREADSAFE`_" msgstr "`SQLITE_THREADSAFE`_" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "DB-API 2.0 meaning" msgstr "" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:516 msgid "single-thread" msgstr "" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:516 msgid "0" msgstr "0" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:516 msgid "Threads may not share the module" msgstr "" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:519 msgid "multi-thread" msgstr "" -#: ../../library/sqlite3.rst:518 ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:519 ../../library/sqlite3.rst:522 msgid "1" msgstr "1" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:519 msgid "2" msgstr "2" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:519 msgid "Threads may share the module, but not connections" msgstr "" -#: ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:522 msgid "serialized" msgstr "" -#: ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:522 msgid "3" msgstr "3" -#: ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:522 msgid "Threads may share the module, connections and cursors" msgstr "" -#: ../../library/sqlite3.rst:528 +#: ../../library/sqlite3.rst:529 msgid "Set *threadsafety* dynamically instead of hard-coding it to ``1``." msgstr "" -#: ../../library/sqlite3.rst:533 +#: ../../library/sqlite3.rst:534 msgid "" "Version number of this module as a :class:`string `. This is not the " "version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:538 +#: ../../library/sqlite3.rst:539 msgid "" "Version number of this module as a :class:`tuple` of :class:`integers " "`. This is not the version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:545 +#: ../../library/sqlite3.rst:546 msgid "Connection objects" msgstr "" -#: ../../library/sqlite3.rst:549 +#: ../../library/sqlite3.rst:550 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`." msgstr "" -#: ../../library/sqlite3.rst:556 +#: ../../library/sqlite3.rst:557 msgid ":ref:`sqlite3-connection-shortcuts`" msgstr ":ref:`sqlite3-connection-shortcuts`" -#: ../../library/sqlite3.rst:559 +#: ../../library/sqlite3.rst:560 msgid "An SQLite database connection has the following attributes and methods:" msgstr "" -#: ../../library/sqlite3.rst:563 +#: ../../library/sqlite3.rst:564 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." msgstr "" -#: ../../library/sqlite3.rst:570 +#: ../../library/sqlite3.rst:571 msgid "" "Open a :class:`Blob` handle to an existing :abbr:`BLOB (Binary Large " "OBject)`." msgstr "" -#: ../../library/sqlite3.rst:573 +#: ../../library/sqlite3.rst:574 msgid "The name of the table where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:576 +#: ../../library/sqlite3.rst:577 msgid "The name of the column where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:579 +#: ../../library/sqlite3.rst:580 msgid "The name of the row where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:582 +#: ../../library/sqlite3.rst:583 msgid "" "Set to ``True`` if the blob should be opened without write permissions. " "Defaults to ``False``." msgstr "" -#: ../../library/sqlite3.rst:587 +#: ../../library/sqlite3.rst:588 msgid "" "The name of the database where the blob is located. Defaults to ``\"main\"``." msgstr "" @@ -663,111 +664,111 @@ msgstr "" msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:591 +#: ../../library/sqlite3.rst:592 msgid "When trying to open a blob in a ``WITHOUT ROWID`` table." msgstr "" -#: ../../library/sqlite3.rst:598 +#: ../../library/sqlite3.rst:599 msgid "" "The blob size cannot be changed using the :class:`Blob` class. Use the SQL " "function ``zeroblob`` to create a blob with a fixed size." msgstr "" -#: ../../library/sqlite3.rst:605 +#: ../../library/sqlite3.rst:606 msgid "" "Commit any pending transaction to the database. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:610 +#: ../../library/sqlite3.rst:611 msgid "" "Roll back to the start of any pending transaction. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:615 +#: ../../library/sqlite3.rst:616 msgid "" "Close the database connection. Any pending transaction is not committed " "implicitly; make sure to :meth:`commit` before closing to avoid losing " "pending changes." msgstr "" -#: ../../library/sqlite3.rst:622 +#: ../../library/sqlite3.rst:623 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it " "with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:628 +#: ../../library/sqlite3.rst:629 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on " "it with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:634 +#: ../../library/sqlite3.rst:635 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` " "on it with the given *sql_script*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:640 +#: ../../library/sqlite3.rst:641 msgid "Create or remove a user-defined SQL function." msgstr "" -#: ../../library/sqlite3.rst:642 +#: ../../library/sqlite3.rst:643 msgid "The name of the SQL function." msgstr "" -#: ../../library/sqlite3.rst:645 +#: ../../library/sqlite3.rst:646 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:649 +#: ../../library/sqlite3.rst:650 msgid "" "A :term:`callable` that is called when the SQL function is invoked. The " "callable must return :ref:`a type natively supported by SQLite `. Set to ``None`` to remove an existing SQL function." msgstr "" -#: ../../library/sqlite3.rst:656 +#: ../../library/sqlite3.rst:657 msgid "" "If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional " "optimizations." msgstr "" -#: ../../library/sqlite3.rst:661 +#: ../../library/sqlite3.rst:662 msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" -#: ../../library/sqlite3.rst:664 +#: ../../library/sqlite3.rst:665 msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:667 ../../library/sqlite3.rst:705 -#: ../../library/sqlite3.rst:768 ../../library/sqlite3.rst:1020 -#: ../../library/sqlite3.rst:1257 ../../library/sqlite3.rst:1384 -#: ../../library/sqlite3.rst:1412 +#: ../../library/sqlite3.rst:668 ../../library/sqlite3.rst:706 +#: ../../library/sqlite3.rst:769 ../../library/sqlite3.rst:1021 +#: ../../library/sqlite3.rst:1258 ../../library/sqlite3.rst:1385 +#: ../../library/sqlite3.rst:1413 msgid "Example:" msgstr "範例:" -#: ../../library/sqlite3.rst:683 +#: ../../library/sqlite3.rst:684 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:685 +#: ../../library/sqlite3.rst:686 msgid "The name of the SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:688 +#: ../../library/sqlite3.rst:689 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:692 +#: ../../library/sqlite3.rst:693 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " @@ -776,45 +777,45 @@ msgid "" "*n_arg*. Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:693 +#: ../../library/sqlite3.rst:694 msgid "A class must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:695 +#: ../../library/sqlite3.rst:696 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:696 ../../library/sqlite3.rst:752 +#: ../../library/sqlite3.rst:697 ../../library/sqlite3.rst:753 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:699 +#: ../../library/sqlite3.rst:700 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:702 +#: ../../library/sqlite3.rst:703 msgid "Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:737 +#: ../../library/sqlite3.rst:738 msgid "Create or remove a user-defined aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:739 +#: ../../library/sqlite3.rst:740 msgid "The name of the SQL aggregate window function to create or remove." msgstr "" -#: ../../library/sqlite3.rst:742 +#: ../../library/sqlite3.rst:743 msgid "" "The number of arguments the SQL aggregate window function can accept. If " "``-1``, it may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:746 +#: ../../library/sqlite3.rst:747 msgid "" "A class that must implement the following methods: * ``step()``: Add a row " "to the current window. * ``value()``: Return the current value of the " @@ -826,79 +827,79 @@ msgid "" "function." msgstr "" -#: ../../library/sqlite3.rst:747 +#: ../../library/sqlite3.rst:748 msgid "A class that must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:749 +#: ../../library/sqlite3.rst:750 msgid "``step()``: Add a row to the current window." msgstr "" -#: ../../library/sqlite3.rst:750 +#: ../../library/sqlite3.rst:751 msgid "``value()``: Return the current value of the aggregate." msgstr "" -#: ../../library/sqlite3.rst:751 +#: ../../library/sqlite3.rst:752 msgid "``inverse()``: Remove a row from the current window." msgstr "" -#: ../../library/sqlite3.rst:755 +#: ../../library/sqlite3.rst:756 msgid "" "The number of arguments that the ``step()`` and ``value()`` methods must " "accept is controlled by *num_params*." msgstr "" -#: ../../library/sqlite3.rst:758 +#: ../../library/sqlite3.rst:759 msgid "Set to ``None`` to remove an existing SQL aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:760 +#: ../../library/sqlite3.rst:761 msgid "" "If used with a version of SQLite older than 3.25.0, which does not support " "aggregate window functions." msgstr "" -#: ../../library/sqlite3.rst:823 +#: ../../library/sqlite3.rst:824 msgid "" "Create a collation named *name* using the collating function *callable*. " "*callable* is passed two :class:`string ` arguments, and it should " "return an :class:`integer `:" msgstr "" -#: ../../library/sqlite3.rst:827 +#: ../../library/sqlite3.rst:828 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:828 +#: ../../library/sqlite3.rst:829 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:829 +#: ../../library/sqlite3.rst:830 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:831 +#: ../../library/sqlite3.rst:832 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:859 +#: ../../library/sqlite3.rst:860 msgid "Remove a collation function by setting *callable* to ``None``." msgstr "" -#: ../../library/sqlite3.rst:861 +#: ../../library/sqlite3.rst:862 msgid "" "The collation name can contain any Unicode character. Earlier, only ASCII " "characters were allowed." msgstr "" -#: ../../library/sqlite3.rst:868 +#: ../../library/sqlite3.rst:869 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`." msgstr "" -#: ../../library/sqlite3.rst:875 +#: ../../library/sqlite3.rst:876 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 " @@ -907,7 +908,7 @@ msgid "" "underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:882 +#: ../../library/sqlite3.rst:883 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or ``None`` " @@ -917,7 +918,7 @@ msgid "" "attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" -#: ../../library/sqlite3.rst:889 +#: ../../library/sqlite3.rst:890 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -925,15 +926,15 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:893 +#: ../../library/sqlite3.rst:894 msgid "Passing ``None`` as *authorizer_callback* will disable the authorizer." msgstr "" -#: ../../library/sqlite3.rst:895 +#: ../../library/sqlite3.rst:896 msgid "Added support for disabling the authorizer using ``None``." msgstr "" -#: ../../library/sqlite3.rst:901 +#: ../../library/sqlite3.rst:902 msgid "" "Register :term:`callable` *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -941,26 +942,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:906 +#: ../../library/sqlite3.rst:907 msgid "" "If you want to clear any previously installed progress handler, call the " "method with ``None`` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:909 +#: ../../library/sqlite3.rst:910 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise an :exc:`OperationalError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:916 +#: ../../library/sqlite3.rst:917 msgid "" "Register :term:`callable` *trace_callback* to be invoked for each SQL " "statement that is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:919 +#: ../../library/sqlite3.rst:920 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 " @@ -970,18 +971,18 @@ msgid "" "execution of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:927 +#: ../../library/sqlite3.rst:928 msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:930 +#: ../../library/sqlite3.rst:931 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: ../../library/sqlite3.rst:940 +#: ../../library/sqlite3.rst:941 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite " @@ -990,7 +991,7 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:949 +#: ../../library/sqlite3.rst:950 msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " @@ -999,61 +1000,61 @@ msgid "" "program:`configure`." msgstr "" -#: ../../library/sqlite3.rst:956 +#: ../../library/sqlite3.rst:957 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:960 +#: ../../library/sqlite3.rst:961 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:1003 +#: ../../library/sqlite3.rst:1004 msgid "" "Load an SQLite extension from a shared library located at *path*. Enable " "extension loading with :meth:`enable_load_extension` before calling this " "method." msgstr "" -#: ../../library/sqlite3.rst:1007 +#: ../../library/sqlite3.rst:1008 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:1011 +#: ../../library/sqlite3.rst:1012 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:1016 +#: ../../library/sqlite3.rst:1017 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." msgstr "" -#: ../../library/sqlite3.rst:1034 +#: ../../library/sqlite3.rst:1035 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1036 +#: ../../library/sqlite3.rst:1037 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:1039 +#: ../../library/sqlite3.rst:1040 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:1042 +#: ../../library/sqlite3.rst:1043 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:1048 +#: ../../library/sqlite3.rst:1049 msgid "" "If set to a :term:`callable`, it is invoked with three integer arguments for " "every backup iteration: the *status* of the last iteration, the *remaining* " @@ -1061,46 +1062,46 @@ msgid "" "Defaults to ``None``." msgstr "" -#: ../../library/sqlite3.rst:1057 +#: ../../library/sqlite3.rst:1058 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1064 +#: ../../library/sqlite3.rst:1065 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:1068 +#: ../../library/sqlite3.rst:1069 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1087 +#: ../../library/sqlite3.rst:1088 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1099 +#: ../../library/sqlite3.rst:1100 msgid "Get a connection runtime limit." msgstr "" -#: ../../library/sqlite3.rst:1101 +#: ../../library/sqlite3.rst:1102 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: ../../library/sqlite3.rst:1106 ../../library/sqlite3.rst:1143 +#: ../../library/sqlite3.rst:1107 ../../library/sqlite3.rst:1144 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:1109 +#: ../../library/sqlite3.rst:1110 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: ../../library/sqlite3.rst:1129 +#: ../../library/sqlite3.rst:1130 msgid "" "Set a connection runtime limit. Attempts to increase a limit above its hard " "upper bound are silently truncated to the hard upper bound. Regardless of " @@ -1108,22 +1109,22 @@ msgid "" "returned." msgstr "" -#: ../../library/sqlite3.rst:1134 +#: ../../library/sqlite3.rst:1135 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: ../../library/sqlite3.rst:1137 +#: ../../library/sqlite3.rst:1138 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: ../../library/sqlite3.rst:1146 +#: ../../library/sqlite3.rst:1147 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: ../../library/sqlite3.rst:1163 +#: ../../library/sqlite3.rst:1164 msgid "" "Serialize a database into a :class:`bytes` object. For an ordinary on-disk " "database file, the serialization is just a copy of the disk file. For an in-" @@ -1132,17 +1133,17 @@ msgid "" "backed up to disk." msgstr "" -#: ../../library/sqlite3.rst:1169 +#: ../../library/sqlite3.rst:1170 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1177 +#: ../../library/sqlite3.rst:1178 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: ../../library/sqlite3.rst:1185 +#: ../../library/sqlite3.rst:1186 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1150,47 +1151,47 @@ msgid "" "serialization contained in *data*." msgstr "" -#: ../../library/sqlite3.rst:1191 +#: ../../library/sqlite3.rst:1192 msgid "A serialized database." msgstr "" -#: ../../library/sqlite3.rst:1194 +#: ../../library/sqlite3.rst:1195 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1198 +#: ../../library/sqlite3.rst:1199 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: ../../library/sqlite3.rst:1202 +#: ../../library/sqlite3.rst:1203 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1205 +#: ../../library/sqlite3.rst:1206 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: ../../library/sqlite3.rst:1210 +#: ../../library/sqlite3.rst:1211 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: ../../library/sqlite3.rst:1217 +#: ../../library/sqlite3.rst:1218 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:1220 +#: ../../library/sqlite3.rst:1221 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: ../../library/sqlite3.rst:1227 +#: ../../library/sqlite3.rst:1228 msgid "" "This attribute controls the :ref:`transaction handling ` performed by :mod:`!sqlite3`. If set to ``None``, " @@ -1200,13 +1201,13 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:1235 +#: ../../library/sqlite3.rst:1236 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:1240 +#: ../../library/sqlite3.rst:1241 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " "from this connection. Assigning to this attribute does not affect the :attr:" @@ -1215,12 +1216,12 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1247 ../../library/sqlite3.rst:1539 -#: ../../library/sqlite3.rst:1562 +#: ../../library/sqlite3.rst:1248 ../../library/sqlite3.rst:1540 +#: ../../library/sqlite3.rst:1563 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "" -#: ../../library/sqlite3.rst:1251 +#: ../../library/sqlite3.rst:1252 msgid "" "A :term:`callable` that accepts a :class:`bytes` parameter and returns a " "text representation of it. The callable is invoked for SQLite values with " @@ -1228,17 +1229,17 @@ msgid "" "If you want to return ``bytes`` instead, set *text_factory* to ``bytes``." msgstr "" -#: ../../library/sqlite3.rst:1291 +#: ../../library/sqlite3.rst:1292 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:1298 +#: ../../library/sqlite3.rst:1299 msgid "Cursor objects" msgstr "" -#: ../../library/sqlite3.rst:1300 +#: ../../library/sqlite3.rst:1301 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 " @@ -1246,39 +1247,39 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1307 +#: ../../library/sqlite3.rst:1308 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:" msgstr "" -#: ../../library/sqlite3.rst:1332 +#: ../../library/sqlite3.rst:1333 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:1339 +#: ../../library/sqlite3.rst:1340 msgid "" "Execute SQL a single SQL statement, optionally binding Python values using :" "ref:`placeholders `." msgstr "" -#: ../../library/sqlite3.rst:1343 +#: ../../library/sqlite3.rst:1344 msgid "A single SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1346 +#: ../../library/sqlite3.rst:1347 msgid "" "Python values to bind to placeholders in *sql*. A :class:`!dict` if named " "placeholders are used. A :term:`!sequence` if unnamed placeholders are used. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1353 +#: ../../library/sqlite3.rst:1354 msgid "If *sql* contains more than one SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1356 +#: ../../library/sqlite3.rst:1357 msgid "" "If :attr:`~Connection.isolation_level` is not ``None``, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " @@ -1286,43 +1287,43 @@ msgid "" "*sql*." msgstr "" -#: ../../library/sqlite3.rst:1361 +#: ../../library/sqlite3.rst:1362 msgid "Use :meth:`executescript` to execute multiple SQL statements." msgstr "" -#: ../../library/sqlite3.rst:1365 +#: ../../library/sqlite3.rst:1366 msgid "" "For every item in *parameters*, repeatedly execute the :ref:`parameterized " "` :abbr:`DML (Data Manipulation Language)` SQL " "statement *sql*." msgstr "" -#: ../../library/sqlite3.rst:1369 +#: ../../library/sqlite3.rst:1370 msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1371 +#: ../../library/sqlite3.rst:1372 msgid "A single SQL DML statement." msgstr "" -#: ../../library/sqlite3.rst:1374 +#: ../../library/sqlite3.rst:1375 msgid "" "An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1380 +#: ../../library/sqlite3.rst:1381 msgid "" "If *sql* contains more than one SQL statement, or is not a DML statment." msgstr "" -#: ../../library/sqlite3.rst:1397 +#: ../../library/sqlite3.rst:1398 msgid "" "Any resulting rows are discarded, including DML statements with `RETURNING " "clauses`_." msgstr "" -#: ../../library/sqlite3.rst:1404 +#: ../../library/sqlite3.rst:1405 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " "transaction, an implicit ``COMMIT`` statement is executed first. No other " @@ -1330,24 +1331,24 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1410 +#: ../../library/sqlite3.rst:1411 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1428 +#: ../../library/sqlite3.rst:1429 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1436 +#: ../../library/sqlite3.rst:1437 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1439 +#: ../../library/sqlite3.rst:1440 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1355,7 +1356,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1445 +#: ../../library/sqlite3.rst:1446 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1363,36 +1364,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1452 +#: ../../library/sqlite3.rst:1453 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1459 +#: ../../library/sqlite3.rst:1460 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1461 +#: ../../library/sqlite3.rst:1462 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." msgstr "" -#: ../../library/sqlite3.rst:1466 ../../library/sqlite3.rst:1470 +#: ../../library/sqlite3.rst:1467 ../../library/sqlite3.rst:1471 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1474 +#: ../../library/sqlite3.rst:1475 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." msgstr "" -#: ../../library/sqlite3.rst:1479 +#: ../../library/sqlite3.rst:1480 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1400,18 +1401,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1493 +#: ../../library/sqlite3.rst:1494 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1497 +#: ../../library/sqlite3.rst:1498 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1501 +#: ../../library/sqlite3.rst:1502 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1421,15 +1422,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1509 +#: ../../library/sqlite3.rst:1510 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1511 +#: ../../library/sqlite3.rst:1512 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1516 +#: ../../library/sqlite3.rst:1517 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1439,7 +1440,7 @@ msgid "" "resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: ../../library/sqlite3.rst:1527 +#: ../../library/sqlite3.rst:1528 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1448,18 +1449,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1534 +#: ../../library/sqlite3.rst:1535 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." msgstr "" -#: ../../library/sqlite3.rst:1550 +#: ../../library/sqlite3.rst:1551 msgid "Row objects" msgstr "" -#: ../../library/sqlite3.rst:1554 +#: ../../library/sqlite3.rst:1555 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1467,28 +1468,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1559 +#: ../../library/sqlite3.rst:1560 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1566 +#: ../../library/sqlite3.rst:1567 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`." msgstr "" -#: ../../library/sqlite3.rst:1570 +#: ../../library/sqlite3.rst:1571 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:1577 +#: ../../library/sqlite3.rst:1578 msgid "Blob objects" msgstr "" -#: ../../library/sqlite3.rst:1583 +#: ../../library/sqlite3.rst:1584 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:" @@ -1496,24 +1497,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1588 +#: ../../library/sqlite3.rst:1589 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1618 +#: ../../library/sqlite3.rst:1619 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1620 +#: ../../library/sqlite3.rst:1621 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." msgstr "" -#: ../../library/sqlite3.rst:1626 +#: ../../library/sqlite3.rst:1627 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)` " @@ -1521,18 +1522,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1634 +#: ../../library/sqlite3.rst:1635 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`." msgstr "" -#: ../../library/sqlite3.rst:1640 +#: ../../library/sqlite3.rst:1641 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1644 +#: ../../library/sqlite3.rst:1645 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :data:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1540,26 +1541,26 @@ msgid "" "position) and :data:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1652 +#: ../../library/sqlite3.rst:1653 msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:1656 +#: ../../library/sqlite3.rst:1657 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1664 +#: ../../library/sqlite3.rst:1665 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1666 +#: ../../library/sqlite3.rst:1667 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1670 +#: ../../library/sqlite3.rst:1671 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1567,39 +1568,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1677 +#: ../../library/sqlite3.rst:1678 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1681 +#: ../../library/sqlite3.rst:1682 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1686 +#: ../../library/sqlite3.rst:1687 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1693 +#: ../../library/sqlite3.rst:1694 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1700 +#: ../../library/sqlite3.rst:1701 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1707 +#: ../../library/sqlite3.rst:1708 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1607,14 +1608,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1714 +#: ../../library/sqlite3.rst:1715 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1720 +#: ../../library/sqlite3.rst:1721 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1622,20 +1623,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1728 +#: ../../library/sqlite3.rst:1729 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1733 +#: ../../library/sqlite3.rst:1734 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1740 +#: ../../library/sqlite3.rst:1741 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 " @@ -1643,7 +1644,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1747 +#: ../../library/sqlite3.rst:1748 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1652,78 +1653,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1757 +#: ../../library/sqlite3.rst:1758 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1759 +#: ../../library/sqlite3.rst:1760 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1762 +#: ../../library/sqlite3.rst:1763 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1765 ../../library/sqlite3.rst:1782 +#: ../../library/sqlite3.rst:1766 ../../library/sqlite3.rst:1783 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1765 ../../library/sqlite3.rst:1782 +#: ../../library/sqlite3.rst:1766 ../../library/sqlite3.rst:1783 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1767 ../../library/sqlite3.rst:1784 +#: ../../library/sqlite3.rst:1768 ../../library/sqlite3.rst:1785 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1767 ../../library/sqlite3.rst:1784 +#: ../../library/sqlite3.rst:1768 ../../library/sqlite3.rst:1785 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1769 ../../library/sqlite3.rst:1786 +#: ../../library/sqlite3.rst:1770 ../../library/sqlite3.rst:1787 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1769 ../../library/sqlite3.rst:1786 +#: ../../library/sqlite3.rst:1770 ../../library/sqlite3.rst:1787 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1771 ../../library/sqlite3.rst:1788 +#: ../../library/sqlite3.rst:1772 ../../library/sqlite3.rst:1789 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1771 ../../library/sqlite3.rst:1788 +#: ../../library/sqlite3.rst:1772 ../../library/sqlite3.rst:1789 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1773 +#: ../../library/sqlite3.rst:1774 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1773 ../../library/sqlite3.rst:1790 +#: ../../library/sqlite3.rst:1774 ../../library/sqlite3.rst:1791 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1775 ../../library/sqlite3.rst:1793 +#: ../../library/sqlite3.rst:1776 ../../library/sqlite3.rst:1794 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1775 ../../library/sqlite3.rst:1793 +#: ../../library/sqlite3.rst:1776 ../../library/sqlite3.rst:1794 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1779 +#: ../../library/sqlite3.rst:1780 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1790 +#: ../../library/sqlite3.rst:1791 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1796 +#: ../../library/sqlite3.rst:1797 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1732,42 +1733,42 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1806 +#: ../../library/sqlite3.rst:1807 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1808 +#: ../../library/sqlite3.rst:1809 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1811 +#: ../../library/sqlite3.rst:1812 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1815 +#: ../../library/sqlite3.rst:1816 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1819 +#: ../../library/sqlite3.rst:1820 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1823 +#: ../../library/sqlite3.rst:1824 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1829 +#: ../../library/sqlite3.rst:1830 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1775,15 +1776,15 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1838 +#: ../../library/sqlite3.rst:1839 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:1843 +#: ../../library/sqlite3.rst:1844 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:1845 +#: ../../library/sqlite3.rst:1846 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1791,7 +1792,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:1858 +#: ../../library/sqlite3.rst:1859 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1799,7 +1800,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:1863 +#: ../../library/sqlite3.rst:1864 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -1810,24 +1811,24 @@ msgid "" "are ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1900 +#: ../../library/sqlite3.rst:1901 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:1907 +#: ../../library/sqlite3.rst:1908 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1909 +#: ../../library/sqlite3.rst:1910 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1913 +#: ../../library/sqlite3.rst:1914 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1837,11 +1838,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1925 +#: ../../library/sqlite3.rst:1926 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1927 +#: ../../library/sqlite3.rst:1928 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1851,84 +1852,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1958 +#: ../../library/sqlite3.rst:1959 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1960 +#: ../../library/sqlite3.rst:1961 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1990 +#: ../../library/sqlite3.rst:1991 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1992 +#: ../../library/sqlite3.rst:1993 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1997 +#: ../../library/sqlite3.rst:1998 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:2000 +#: ../../library/sqlite3.rst:2001 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:2005 +#: ../../library/sqlite3.rst:2006 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2014 +#: ../../library/sqlite3.rst:2015 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:2018 +#: ../../library/sqlite3.rst:2019 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2019 +#: ../../library/sqlite3.rst:2020 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2020 +#: ../../library/sqlite3.rst:2021 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2024 +#: ../../library/sqlite3.rst:2025 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2075 +#: ../../library/sqlite3.rst:2076 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2077 +#: ../../library/sqlite3.rst:2078 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2139 +#: ../../library/sqlite3.rst:2140 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2141 +#: ../../library/sqlite3.rst:2142 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1940,11 +1941,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2182 +#: ../../library/sqlite3.rst:2183 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2184 +#: ../../library/sqlite3.rst:2185 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1954,58 +1955,58 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2193 +#: ../../library/sqlite3.rst:2194 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2198 +#: ../../library/sqlite3.rst:2199 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2231 +#: ../../library/sqlite3.rst:2232 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2233 +#: ../../library/sqlite3.rst:2234 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2235 +#: ../../library/sqlite3.rst:2236 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2244 +#: ../../library/sqlite3.rst:2245 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2254 +#: ../../library/sqlite3.rst:2255 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2268 +#: ../../library/sqlite3.rst:2269 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2277 +#: ../../library/sqlite3.rst:2278 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2279 +#: ../../library/sqlite3.rst:2280 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`." msgstr "" -#: ../../library/sqlite3.rst:2284 +#: ../../library/sqlite3.rst:2285 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -2013,7 +2014,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2289 +#: ../../library/sqlite3.rst:2290 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -2021,51 +2022,59 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2299 +#: ../../library/sqlite3.rst:2300 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2314 +#: ../../library/sqlite3.rst:2317 +msgid "" +"The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the " +"above example. In such cases, SQLite returns a single row with columns " +"defined by expressions, e.g. literals, with the given aliases ``expr AS " +"alias``." +msgstr "" + +#: ../../library/sqlite3.rst:2322 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2323 +#: ../../library/sqlite3.rst:2331 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2333 +#: ../../library/sqlite3.rst:2341 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2344 +#: ../../library/sqlite3.rst:2352 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2359 +#: ../../library/sqlite3.rst:2367 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`." msgstr "" -#: ../../library/sqlite3.rst:2367 +#: ../../library/sqlite3.rst:2375 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2372 +#: ../../library/sqlite3.rst:2380 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2374 +#: ../../library/sqlite3.rst:2382 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2377 +#: ../../library/sqlite3.rst:2385 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2079,7 +2088,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2390 +#: ../../library/sqlite3.rst:2398 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2089,27 +2098,27 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2398 +#: ../../library/sqlite3.rst:2406 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2402 +#: ../../library/sqlite3.rst:2410 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1334 +#: ../../library/sqlite3.rst:1335 msgid "? (question mark)" msgstr "" -#: ../../library/sqlite3.rst:1334 ../../library/sqlite3.rst:1335 +#: ../../library/sqlite3.rst:1335 ../../library/sqlite3.rst:1336 msgid "in SQL statements" msgstr "" -#: ../../library/sqlite3.rst:1335 +#: ../../library/sqlite3.rst:1336 msgid ": (colon)" msgstr "" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 13e438f711..8845024f8b 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-12 00:40+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -362,7 +362,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:326 +#: ../../tutorial/controlflow.rst:327 msgid "" "You can use positional parameters with some builtin classes that provide an " "ordering for their attributes (e.g. dataclasses). You can also define a " @@ -378,7 +378,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:337 +#: ../../tutorial/controlflow.rst:338 msgid "" "A recommended way to read patterns is to look at them as an extended form of " "what you would put on the left of an assignment, to understand which " @@ -394,7 +394,7 @@ msgstr "" "的 ``x=`` 及 ``y=``)或 class 名稱(由它們後面的 \"(...)\" 被辨識,如上面的 " "``Point``)則永遠無法被賦值。" -#: ../../tutorial/controlflow.rst:344 +#: ../../tutorial/controlflow.rst:345 msgid "" "Patterns can be arbitrarily nested. For example, if we have a short list of " "points, we could match it like this::" @@ -404,7 +404,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:359 +#: ../../tutorial/controlflow.rst:360 msgid "" "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " "guard is false, ``match`` goes on to try the next case block. Note that " @@ -416,11 +416,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:369 +#: ../../tutorial/controlflow.rst:370 msgid "Several other key features of this statement:" msgstr "此種陳述式的其他幾個重要特色:" -#: ../../tutorial/controlflow.rst:371 +#: ../../tutorial/controlflow.rst:372 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. An important exception is " @@ -429,7 +429,7 @@ msgstr "" "與拆解賦值的情況類似,tuple(元組)和 list 模式具有完全相同的意義,而且實際上" "可以匹配任意的序列。一個重要的例外,是它們不能匹配疊代器 (iterator) 或字串。" -#: ../../tutorial/controlflow.rst:375 +#: ../../tutorial/controlflow.rst:376 msgid "" "Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, " "*rest)`` work similar to unpacking assignments. The name after ``*`` may " @@ -441,7 +441,7 @@ msgstr "" "是 ``_``,所以 ``(x, y, *_)`` 會匹配一個至少兩項的序列,且不會連結那兩項以外" "的其餘項。" -#: ../../tutorial/controlflow.rst:380 +#: ../../tutorial/controlflow.rst:381 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " @@ -453,14 +453,14 @@ msgstr "" "模式不同,額外的鍵 (key) 會被忽略。一種像是 ``**rest`` 的拆解方式,也是可被支" "援的。(但 ``**_`` 則是多餘的做法,所以它並不被允許。)" -#: ../../tutorial/controlflow.rst:385 +#: ../../tutorial/controlflow.rst:386 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "" "使用關鍵字 ``as`` 可以擷取子模式 (subpattern):\n" "\n" "::" -#: ../../tutorial/controlflow.rst:389 +#: ../../tutorial/controlflow.rst:390 msgid "" "will capture the second element of the input as ``p2`` (as long as the input " "is a sequence of two points)" @@ -468,7 +468,7 @@ msgstr "" "將會擷取輸入的第二個元素作為 ``p2``\\ (只要該輸入是一個由兩個點所組成的序" "列)。" -#: ../../tutorial/controlflow.rst:392 +#: ../../tutorial/controlflow.rst:393 msgid "" "Most literals are compared by equality, however the singletons ``True``, " "``False`` and ``None`` are compared by identity." @@ -476,7 +476,7 @@ msgstr "" "大部分的字面值是藉由相等性 (equality) 來比較,但是單例物件 (singleton) " "``True``\\ 、\\ ``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。" -#: ../../tutorial/controlflow.rst:395 +#: ../../tutorial/controlflow.rst:396 msgid "" "Patterns may use named constants. These must be dotted names to prevent " "them from being interpreted as capture variable::" @@ -486,18 +486,18 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:414 +#: ../../tutorial/controlflow.rst:415 msgid "" "For a more detailed explanation and additional examples, you can look into :" "pep:`636` which is written in a tutorial format." msgstr "" "關於更詳細的解釋和其他範例,你可以閱讀 :pep:`636`,它是以教學的格式編寫而成。" -#: ../../tutorial/controlflow.rst:420 +#: ../../tutorial/controlflow.rst:421 msgid "Defining Functions" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:422 +#: ../../tutorial/controlflow.rst:423 msgid "" "We can create a function that writes the Fibonacci series to an arbitrary " "boundary::" @@ -506,7 +506,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:442 +#: ../../tutorial/controlflow.rst:443 msgid "" "The keyword :keyword:`def` introduces a function *definition*. It must be " "followed by the function name and the parenthesized list of formal " @@ -516,7 +516,7 @@ msgstr "" "關鍵字 :keyword:`def` 介紹一個函式的\\ *定義*\\ 。它之後必須連著該函式的名稱" "和置於括號之中的一串參數。自下一行起,所有縮排的陳述式成為該函式的主體。" -#: ../../tutorial/controlflow.rst:447 +#: ../../tutorial/controlflow.rst:448 msgid "" "The first statement of the function body can optionally be a string literal; " "this string literal is the function's documentation string, or :dfn:" @@ -532,7 +532,7 @@ msgstr "" "件,或讓使用者能以互動的方式在原始碼中瀏覽文件。在原始碼中加入 docstring 是個" "好慣例,應該養成這樣的習慣。" -#: ../../tutorial/controlflow.rst:454 +#: ../../tutorial/controlflow.rst:455 msgid "" "The *execution* of a function introduces a new symbol table used for the " "local variables of the function. More precisely, all variable assignments " @@ -553,7 +553,7 @@ msgstr "" "域變數是在 :keyword:`global` 陳述式中被定義,或外層函式變數在 :keyword:" "`nonlocal` 陳述式中被定義)。" -#: ../../tutorial/controlflow.rst:465 +#: ../../tutorial/controlflow.rst:466 msgid "" "The actual parameters (arguments) to a function call are introduced in the " "local symbol table of the called function when it is called; thus, arguments " @@ -568,7 +568,7 @@ msgstr "" "函式呼叫別的函式或遞迴呼叫它自己時,在被呼叫的函式中會建立一個新的區域符號" "表。" -#: ../../tutorial/controlflow.rst:472 +#: ../../tutorial/controlflow.rst:473 msgid "" "A function definition associates the function name with the function object " "in the current symbol table. The interpreter recognizes the object pointed " @@ -581,7 +581,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:483 +#: ../../tutorial/controlflow.rst:484 msgid "" "Coming from other languages, you might object that ``fib`` is not a function " "but a procedure since it doesn't return a value. In fact, even functions " @@ -598,7 +598,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:494 +#: ../../tutorial/controlflow.rst:495 msgid "" "It is simple to write a function that returns a list of the numbers of the " "Fibonacci series, instead of printing it::" @@ -607,11 +607,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:510 +#: ../../tutorial/controlflow.rst:511 msgid "This example, as usual, demonstrates some new Python features:" msgstr "這個例子一樣示範了一些新的 Python 特性:" -#: ../../tutorial/controlflow.rst:512 +#: ../../tutorial/controlflow.rst:513 msgid "" "The :keyword:`return` statement returns with a value from a function. :" "keyword:`!return` without an expression argument returns ``None``. Falling " @@ -621,7 +621,7 @@ msgstr "" "不外加一個運算式作為引數時會回傳 ``None``\\ 。一個函式執行到結束也會回傳 " "``None``\\ 。" -#: ../../tutorial/controlflow.rst:516 +#: ../../tutorial/controlflow.rst:517 msgid "" "The statement ``result.append(a)`` calls a *method* of the list object " "``result``. A method is a function that 'belongs' to an object and is named " @@ -643,22 +643,22 @@ msgstr "" "method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" "於 ``result = result + [a]``\\ ,但更有效率。" -#: ../../tutorial/controlflow.rst:531 +#: ../../tutorial/controlflow.rst:532 msgid "More on Defining Functions" msgstr "深入了解函式定義" -#: ../../tutorial/controlflow.rst:533 +#: ../../tutorial/controlflow.rst:534 msgid "" "It is also possible to define functions with a variable number of arguments. " "There are three forms, which can be combined." msgstr "" "定義函式時使用的引數 (argument) 數量是可變的。總共有三種可以組合使用的形式。" -#: ../../tutorial/controlflow.rst:540 +#: ../../tutorial/controlflow.rst:541 msgid "Default Argument Values" msgstr "預設引數值" -#: ../../tutorial/controlflow.rst:542 +#: ../../tutorial/controlflow.rst:543 msgid "" "The most useful form is to specify a default value for one or more " "arguments. This creates a function that can be called with fewer arguments " @@ -669,22 +669,22 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:558 +#: ../../tutorial/controlflow.rst:559 msgid "This function can be called in several ways:" msgstr "該函式可以用以下幾種方式被呼叫:" -#: ../../tutorial/controlflow.rst:560 +#: ../../tutorial/controlflow.rst:561 msgid "" "giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``" msgstr "只給必要引數:\\ ``ask_ok('Do you really want to quit?')``" -#: ../../tutorial/controlflow.rst:562 +#: ../../tutorial/controlflow.rst:563 msgid "" "giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', " "2)``" msgstr "給予一個選擇性引數:\\ ``ask_ok('OK to overwrite the file?', 2)``" -#: ../../tutorial/controlflow.rst:564 +#: ../../tutorial/controlflow.rst:565 msgid "" "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " "on, only yes or no!')``" @@ -692,14 +692,14 @@ msgstr "" "給予所有引數:\\ ``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes " "or no!')``" -#: ../../tutorial/controlflow.rst:567 +#: ../../tutorial/controlflow.rst:568 msgid "" "This example also introduces the :keyword:`in` keyword. This tests whether " "or not a sequence contains a certain value." msgstr "" "此例也使用了關鍵字 :keyword:`in`\\ ,用於測試序列中是否包含某個特定值。" -#: ../../tutorial/controlflow.rst:570 +#: ../../tutorial/controlflow.rst:571 msgid "" "The default values are evaluated at the point of function definition in the " "*defining* scope, so that ::" @@ -708,11 +708,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:581 +#: ../../tutorial/controlflow.rst:582 msgid "will print ``5``." msgstr "將會輸出 ``5``\\ 。" -#: ../../tutorial/controlflow.rst:583 +#: ../../tutorial/controlflow.rst:584 msgid "" "**Important warning:** The default value is evaluated only once. This makes " "a difference when the default is a mutable object such as a list, " @@ -725,24 +725,24 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:596 +#: ../../tutorial/controlflow.rst:597 msgid "This will print ::" msgstr "" "將會輸出:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:602 +#: ../../tutorial/controlflow.rst:603 msgid "" "If you don't want the default to be shared between subsequent calls, you can " "write the function like this instead::" msgstr "如果不想在後續呼叫之間共用預設值,應以如下方式編寫函式:" -#: ../../tutorial/controlflow.rst:615 +#: ../../tutorial/controlflow.rst:616 msgid "Keyword Arguments" msgstr "關鍵字引數" -#: ../../tutorial/controlflow.rst:617 +#: ../../tutorial/controlflow.rst:618 msgid "" "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following " @@ -753,7 +753,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:626 +#: ../../tutorial/controlflow.rst:627 msgid "" "accepts one required argument (``voltage``) and three optional arguments " "(``state``, ``action``, and ``type``). This function can be called in any " @@ -764,14 +764,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:637 +#: ../../tutorial/controlflow.rst:638 msgid "but all the following calls would be invalid::" msgstr "" "但以下呼叫方式都無效:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:644 +#: ../../tutorial/controlflow.rst:645 msgid "" "In a function call, keyword arguments must follow positional arguments. All " "the keyword arguments passed must match one of the arguments accepted by the " @@ -789,7 +789,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:660 +#: ../../tutorial/controlflow.rst:661 msgid "" "When a final formal parameter of the form ``**name`` is present, it receives " "a dictionary (see :ref:`typesmapping`) containing all keyword arguments " @@ -807,31 +807,31 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:677 +#: ../../tutorial/controlflow.rst:678 msgid "It could be called like this::" msgstr "" "它可以被如此呼叫:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:685 +#: ../../tutorial/controlflow.rst:686 msgid "and of course it would print:" msgstr "" "輸出結果如下:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:698 +#: ../../tutorial/controlflow.rst:699 msgid "" "Note that the order in which the keyword arguments are printed is guaranteed " "to match the order in which they were provided in the function call." msgstr "注意,關鍵字引數的輸出順序與呼叫函式時被提供的順序必定一致。" -#: ../../tutorial/controlflow.rst:702 +#: ../../tutorial/controlflow.rst:703 msgid "Special parameters" msgstr "特殊參數" -#: ../../tutorial/controlflow.rst:704 +#: ../../tutorial/controlflow.rst:705 msgid "" "By default, arguments may be passed to a Python function either by position " "or explicitly by keyword. For readability and performance, it makes sense to " @@ -843,11 +843,11 @@ msgstr "" "及效能,限制引數的傳遞方式是合理的,如此,開發者只需查看函式定義,即可確定各" "項目是按位置,按位置或關鍵字,還是按關鍵字傳遞。" -#: ../../tutorial/controlflow.rst:710 +#: ../../tutorial/controlflow.rst:711 msgid "A function definition may look like:" msgstr "函式定義可能如以下樣式:" -#: ../../tutorial/controlflow.rst:721 +#: ../../tutorial/controlflow.rst:722 msgid "" "where ``/`` and ``*`` are optional. If used, these symbols indicate the kind " "of parameter by how the arguments may be passed to the function: positional-" @@ -858,22 +858,22 @@ msgstr "" "類:僅限位置、位置或關鍵字、僅限關鍵字。關鍵字參數也稱為附名參數 (named " "parameters)。" -#: ../../tutorial/controlflow.rst:728 +#: ../../tutorial/controlflow.rst:729 msgid "Positional-or-Keyword Arguments" msgstr "位置或關鍵字引數 (Positional-or-Keyword Arguments)" -#: ../../tutorial/controlflow.rst:730 +#: ../../tutorial/controlflow.rst:731 msgid "" "If ``/`` and ``*`` are not present in the function definition, arguments may " "be passed to a function by position or by keyword." msgstr "" "若函式定義中未使用 ``/`` 和 ``*`` 時,引數可以按位置或關鍵字傳遞給函式。" -#: ../../tutorial/controlflow.rst:735 +#: ../../tutorial/controlflow.rst:736 msgid "Positional-Only Parameters" msgstr "僅限位置參數 (Positional-Only Parameters)" -#: ../../tutorial/controlflow.rst:737 +#: ../../tutorial/controlflow.rst:738 msgid "" "Looking at this in a bit more detail, it is possible to mark certain " "parameters as *positional-only*. If *positional-only*, the parameters' order " @@ -888,17 +888,17 @@ msgstr "" "``/``\\ (斜線)之前。\\ ``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函" "式定義中沒有 ``/``\\ ,則表示沒有任何僅限位置參數。" -#: ../../tutorial/controlflow.rst:745 +#: ../../tutorial/controlflow.rst:746 msgid "" "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" "only*." msgstr "``/`` 後面的參數可以是\\ *位置或關鍵字*\\ 或\\ *僅限關鍵字*\\ 參數。" -#: ../../tutorial/controlflow.rst:749 +#: ../../tutorial/controlflow.rst:750 msgid "Keyword-Only Arguments" msgstr "僅限關鍵字引數 (Keyword-Only Arguments)" -#: ../../tutorial/controlflow.rst:751 +#: ../../tutorial/controlflow.rst:752 msgid "" "To mark parameters as *keyword-only*, indicating the parameters must be " "passed by keyword argument, place an ``*`` in the arguments list just before " @@ -907,11 +907,11 @@ msgstr "" "要把參數標記為\\ *僅限關鍵字*\\ ,表明參數必須以關鍵字引數傳遞,必須在引數列" "表中第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``\\ 。" -#: ../../tutorial/controlflow.rst:757 +#: ../../tutorial/controlflow.rst:758 msgid "Function Examples" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:759 +#: ../../tutorial/controlflow.rst:760 msgid "" "Consider the following example function definitions paying close attention " "to the markers ``/`` and ``*``::" @@ -920,7 +920,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:775 +#: ../../tutorial/controlflow.rst:776 msgid "" "The first function definition, ``standard_arg``, the most familiar form, " "places no restrictions on the calling convention and arguments may be passed " @@ -931,7 +931,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:785 +#: ../../tutorial/controlflow.rst:786 msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" @@ -940,7 +940,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:796 +#: ../../tutorial/controlflow.rst:797 msgid "" "The third function ``kwd_only_args`` only allows keyword arguments as " "indicated by a ``*`` in the function definition::" @@ -949,7 +949,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:807 +#: ../../tutorial/controlflow.rst:808 msgid "" "And the last uses all three calling conventions in the same function " "definition::" @@ -958,7 +958,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:827 +#: ../../tutorial/controlflow.rst:828 msgid "" "Finally, consider this function definition which has a potential collision " "between the positional argument ``name`` and ``**kwds`` which has ``name`` " @@ -969,7 +969,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:832 +#: ../../tutorial/controlflow.rst:833 msgid "" "There is no possible call that will make it return ``True`` as the keyword " "``'name'`` will always bind to the first parameter. For example::" @@ -979,7 +979,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:841 +#: ../../tutorial/controlflow.rst:842 msgid "" "But using ``/`` (positional only arguments), it is possible since it allows " "``name`` as a positional argument and ``'name'`` as a key in the keyword " @@ -990,17 +990,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:849 +#: ../../tutorial/controlflow.rst:850 msgid "" "In other words, the names of positional-only parameters can be used in " "``**kwds`` without ambiguity." msgstr "換句話說,僅限位置參數的名稱可以在 ``**kwds`` 中使用,而不產生歧義。" -#: ../../tutorial/controlflow.rst:854 +#: ../../tutorial/controlflow.rst:855 msgid "Recap" msgstr "回顧" -#: ../../tutorial/controlflow.rst:856 +#: ../../tutorial/controlflow.rst:857 msgid "" "The use case will determine which parameters to use in the function " "definition::" @@ -1009,11 +1009,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:860 +#: ../../tutorial/controlflow.rst:861 msgid "As guidance:" msgstr "說明:" -#: ../../tutorial/controlflow.rst:862 +#: ../../tutorial/controlflow.rst:863 msgid "" "Use positional-only if you want the name of the parameters to not be " "available to the user. This is useful when parameter names have no real " @@ -1025,7 +1025,7 @@ msgstr "" "想控制引數在函式呼叫的排列順序,或同時使用位置參數和任意關鍵字時,這種方式很" "有用。" -#: ../../tutorial/controlflow.rst:867 +#: ../../tutorial/controlflow.rst:868 msgid "" "Use keyword-only when names have meaning and the function definition is more " "understandable by being explicit with names or you want to prevent users " @@ -1034,7 +1034,7 @@ msgstr "" "當參數名稱有意義,且明確的名稱可讓函式定義更易理解,或是你不希望使用者依賴引" "數被傳遞時的位置時,請使用僅限關鍵字。" -#: ../../tutorial/controlflow.rst:870 +#: ../../tutorial/controlflow.rst:871 msgid "" "For an API, use positional-only to prevent breaking API changes if the " "parameter's name is modified in the future." @@ -1042,11 +1042,11 @@ msgstr "" "對於應用程式介面 (API),使用僅限位置,以防止未來參數名稱被修改時造成 API 的中" "斷性變更。" -#: ../../tutorial/controlflow.rst:876 +#: ../../tutorial/controlflow.rst:877 msgid "Arbitrary Argument Lists" msgstr "任意引數列表 (Arbitrary Argument Lists)" -#: ../../tutorial/controlflow.rst:881 +#: ../../tutorial/controlflow.rst:882 msgid "" "Finally, the least frequently used option is to specify that a function can " "be called with an arbitrary number of arguments. These arguments will be " @@ -1059,7 +1059,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:890 +#: ../../tutorial/controlflow.rst:891 msgid "" "Normally, these *variadic* arguments will be last in the list of formal " "parameters, because they scoop up all remaining input arguments that are " @@ -1073,11 +1073,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:907 +#: ../../tutorial/controlflow.rst:908 msgid "Unpacking Argument Lists" msgstr "拆解引數列表(Unpacking Argument Lists)" -#: ../../tutorial/controlflow.rst:909 +#: ../../tutorial/controlflow.rst:910 msgid "" "The reverse situation occurs when the arguments are already in a list or " "tuple but need to be unpacked for a function call requiring separate " @@ -1093,7 +1093,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:925 +#: ../../tutorial/controlflow.rst:926 msgid "" "In the same fashion, dictionaries can deliver keyword arguments with the " "``**``\\ -operator::" @@ -1102,11 +1102,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:941 +#: ../../tutorial/controlflow.rst:942 msgid "Lambda Expressions" msgstr "Lambda 運算式" -#: ../../tutorial/controlflow.rst:943 +#: ../../tutorial/controlflow.rst:944 msgid "" "Small anonymous functions can be created with the :keyword:`lambda` keyword. " "This function returns the sum of its two arguments: ``lambda a, b: a+b``. " @@ -1123,7 +1123,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:960 +#: ../../tutorial/controlflow.rst:961 msgid "" "The above example uses a lambda expression to return a function. Another " "use is to pass a small function as an argument::" @@ -1133,17 +1133,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:972 +#: ../../tutorial/controlflow.rst:973 msgid "Documentation Strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:979 +#: ../../tutorial/controlflow.rst:980 msgid "" "Here are some conventions about the content and formatting of documentation " "strings." msgstr "以下是關於說明文件字串內容和格式的慣例。" -#: ../../tutorial/controlflow.rst:982 +#: ../../tutorial/controlflow.rst:983 msgid "" "The first line should always be a short, concise summary of the object's " "purpose. For brevity, it should not explicitly state the object's name or " @@ -1155,7 +1155,7 @@ msgstr "" "的名稱或型別,因為有其他方法可以達到相同目的(除非該名稱剛好是一個描述函式運" "算的動詞)。這一行應以大寫字母開頭,以句號結尾。" -#: ../../tutorial/controlflow.rst:988 +#: ../../tutorial/controlflow.rst:989 msgid "" "If there are more lines in the documentation string, the second line should " "be blank, visually separating the summary from the rest of the description. " @@ -1165,7 +1165,7 @@ msgstr "" "文件字串為多行時,第二行應為空白行,在視覺上將摘要與其餘描述分開。後面幾行可" "包含一或多個段落,描述此物件的呼叫慣例、副作用等。" -#: ../../tutorial/controlflow.rst:993 +#: ../../tutorial/controlflow.rst:994 msgid "" "The Python parser does not strip indentation from multi-line string literals " "in Python, so tools that process documentation have to strip indentation if " @@ -1187,18 +1187,18 @@ msgstr "" "出現了,這些行的全部前導空白字元都應被去除。展開 tab 鍵後(通常為八個空格)," "應測試空白字元量是否等價。" -#: ../../tutorial/controlflow.rst:1005 +#: ../../tutorial/controlflow.rst:1006 msgid "Here is an example of a multi-line docstring::" msgstr "" "下面是多行說明字串的一個範例:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:1023 +#: ../../tutorial/controlflow.rst:1024 msgid "Function Annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1031 +#: ../../tutorial/controlflow.rst:1032 msgid "" ":ref:`Function annotations ` are completely optional metadata " "information about the types used by user-defined functions (see :pep:`3107` " @@ -1207,7 +1207,7 @@ msgstr "" ":ref:`函式註釋 `\\ 是選擇性的元資料(metadata)資訊,描述使用者定義" "函式所使用的型別(更多資訊詳見 :pep:`3107` 和 :pep:`484`\\ )。" -#: ../../tutorial/controlflow.rst:1035 +#: ../../tutorial/controlflow.rst:1036 msgid "" ":term:`Annotations ` are stored in the :attr:" "`__annotations__` attribute of the function as a dictionary and have no " @@ -1227,11 +1227,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:1057 +#: ../../tutorial/controlflow.rst:1058 msgid "Intermezzo: Coding Style" msgstr "間奏曲:程式碼風格 (Coding Style)" -#: ../../tutorial/controlflow.rst:1062 +#: ../../tutorial/controlflow.rst:1063 msgid "" "Now that you are about to write longer, more complex pieces of Python, it is " "a good time to talk about *coding style*. Most languages can be written (or " @@ -1244,7 +1244,7 @@ msgstr "" "式比其他的更具可讀性。能讓其他人輕鬆閱讀你的程式碼永遠是一個好主意,而使用優" "良的編碼樣式對此有極大的幫助。" -#: ../../tutorial/controlflow.rst:1068 +#: ../../tutorial/controlflow.rst:1069 msgid "" "For Python, :pep:`8` has emerged as the style guide that most projects " "adhere to; it promotes a very readable and eye-pleasing coding style. Every " @@ -1254,11 +1254,11 @@ msgstr "" "對於 Python,大多數的專案都遵循 :pep:`8` 的樣式指南;它推行的編碼樣式相當可讀" "且賞心悅目。每個 Python 開發者都應該花點時間研讀;這裡是該指南的核心重點:" -#: ../../tutorial/controlflow.rst:1073 +#: ../../tutorial/controlflow.rst:1074 msgid "Use 4-space indentation, and no tabs." msgstr "用 4 個空格縮排,不要用 tab 鍵。" -#: ../../tutorial/controlflow.rst:1075 +#: ../../tutorial/controlflow.rst:1076 msgid "" "4 spaces are a good compromise between small indentation (allows greater " "nesting depth) and large indentation (easier to read). Tabs introduce " @@ -1267,11 +1267,11 @@ msgstr "" "4 個空格是小縮排(容許更大的巢套深度)和大縮排(較易閱讀)之間的折衷方案。" "Tab 鍵會造成混亂,最好別用。" -#: ../../tutorial/controlflow.rst:1079 +#: ../../tutorial/controlflow.rst:1080 msgid "Wrap lines so that they don't exceed 79 characters." msgstr "換行,使一行不超過 79 個字元。" -#: ../../tutorial/controlflow.rst:1081 +#: ../../tutorial/controlflow.rst:1082 msgid "" "This helps users with small displays and makes it possible to have several " "code files side-by-side on larger displays." @@ -1279,21 +1279,21 @@ msgstr "" "換行能讓使用小顯示器的使用者方便閱讀,也可以在較大顯示器上並排陳列多個程式碼" "檔案。" -#: ../../tutorial/controlflow.rst:1084 +#: ../../tutorial/controlflow.rst:1085 msgid "" "Use blank lines to separate functions and classes, and larger blocks of code " "inside functions." msgstr "用空行分隔函式和 class(類別),及函式內較大塊的程式碼。" -#: ../../tutorial/controlflow.rst:1087 +#: ../../tutorial/controlflow.rst:1088 msgid "When possible, put comments on a line of their own." msgstr "如果可以,把註解放在單獨一行。" -#: ../../tutorial/controlflow.rst:1089 +#: ../../tutorial/controlflow.rst:1090 msgid "Use docstrings." msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:1091 +#: ../../tutorial/controlflow.rst:1092 msgid "" "Use spaces around operators and after commas, but not directly inside " "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." @@ -1301,7 +1301,7 @@ msgstr "" "運算子前後、逗號後要加空格,但不要直接放在括號內側:\\ ``a = f(1, 2) + g(3, " "4)``\\ 。" -#: ../../tutorial/controlflow.rst:1094 +#: ../../tutorial/controlflow.rst:1095 msgid "" "Name your classes and functions consistently; the convention is to use " "``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " @@ -1313,7 +1313,7 @@ msgstr "" "底線)。永遠用 ``self`` 作為 method 第一個引數的名稱(關於 class 和 method," "詳見 :ref:`tut-firstclasses`\\ )。" -#: ../../tutorial/controlflow.rst:1099 +#: ../../tutorial/controlflow.rst:1100 msgid "" "Don't use fancy encodings if your code is meant to be used in international " "environments. Python's default, UTF-8, or even plain ASCII work best in any " @@ -1322,7 +1322,7 @@ msgstr "" "若程式碼是為了用於國際環境時,不要用花俏的編碼。Python 預設的 UTF-8 或甚至普" "通的 ASCII,就可以勝任各種情況。" -#: ../../tutorial/controlflow.rst:1103 +#: ../../tutorial/controlflow.rst:1104 msgid "" "Likewise, don't use non-ASCII characters in identifiers if there is only the " "slightest chance people speaking a different language will read or maintain " @@ -1331,11 +1331,11 @@ msgstr "" "同樣地,若不同語言使用者閱讀或維護程式碼的可能性微乎其微,就不要在命名時使用" "非 ASCII 字元。" -#: ../../tutorial/controlflow.rst:1109 +#: ../../tutorial/controlflow.rst:1110 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/controlflow.rst:1110 +#: ../../tutorial/controlflow.rst:1111 msgid "" "Actually, *call by object reference* would be a better description, since if " "a mutable object is passed, the caller will see any changes the callee makes " @@ -1353,60 +1353,60 @@ msgstr "" msgid "for" msgstr "" -#: ../../tutorial/controlflow.rst:437 ../../tutorial/controlflow.rst:974 +#: ../../tutorial/controlflow.rst:438 ../../tutorial/controlflow.rst:975 #, fuzzy msgid "documentation strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:437 ../../tutorial/controlflow.rst:974 +#: ../../tutorial/controlflow.rst:438 ../../tutorial/controlflow.rst:975 #, fuzzy msgid "docstrings" msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:437 ../../tutorial/controlflow.rst:974 +#: ../../tutorial/controlflow.rst:438 ../../tutorial/controlflow.rst:975 msgid "strings, documentation" msgstr "" -#: ../../tutorial/controlflow.rst:878 +#: ../../tutorial/controlflow.rst:879 msgid "* (asterisk)" msgstr "" -#: ../../tutorial/controlflow.rst:878 ../../tutorial/controlflow.rst:922 +#: ../../tutorial/controlflow.rst:879 ../../tutorial/controlflow.rst:923 #, fuzzy msgid "in function calls" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:922 +#: ../../tutorial/controlflow.rst:923 msgid "**" msgstr "" -#: ../../tutorial/controlflow.rst:1026 +#: ../../tutorial/controlflow.rst:1027 #, fuzzy msgid "function" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:1026 +#: ../../tutorial/controlflow.rst:1027 #, fuzzy msgid "annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1026 +#: ../../tutorial/controlflow.rst:1027 msgid "->" msgstr "" -#: ../../tutorial/controlflow.rst:1026 +#: ../../tutorial/controlflow.rst:1027 #, fuzzy msgid "function annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1026 +#: ../../tutorial/controlflow.rst:1027 msgid ": (colon)" msgstr "" -#: ../../tutorial/controlflow.rst:1060 +#: ../../tutorial/controlflow.rst:1061 msgid "coding" msgstr "" -#: ../../tutorial/controlflow.rst:1060 +#: ../../tutorial/controlflow.rst:1061 msgid "style" msgstr "" From dcdd228b4a23cc6c3c7696b8ec3024c55aa33158 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 13 Jul 2023 00:41:41 +0000 Subject: [PATCH 125/130] sync with cpython a276ce45 --- library/crypt.po | 65 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/library/crypt.po b/library/crypt.po index 11475dfe79..cda8fe94a8 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-13 00:39+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,14 +26,15 @@ msgstr ":mod:`crypt` --- 用於檢查 Unix 密碼的函式" msgid "**Source code:** :source:`Lib/crypt.py`" msgstr "**原始碼:**\\ :source:`Lib/crypt.py`" -#: ../../library/crypt.rst:23 +#: ../../library/crypt.rst:24 msgid "" "The :mod:`crypt` module is deprecated (see :pep:`PEP 594 <594#crypt>` for " "details and alternatives). The :mod:`hashlib` module is a potential " -"replacement for certain use cases." +"replacement for certain use cases. The `passlib `_ package can replace all use cases of this module." msgstr "" -#: ../../library/crypt.rst:26 +#: ../../library/crypt.rst:27 msgid "" "This module implements an interface to the :manpage:`crypt(3)` routine, " "which is a one-way hash function based upon a modified DES algorithm; see " @@ -42,7 +43,7 @@ msgid "" "attempting to crack Unix passwords with a dictionary." msgstr "" -#: ../../library/crypt.rst:34 +#: ../../library/crypt.rst:35 msgid "" "Notice that the behavior of this module depends on the actual " "implementation of the :manpage:`crypt(3)` routine in the running system. " @@ -50,7 +51,7 @@ msgid "" "be available on this module." msgstr "" -#: ../../library/crypt.rst:39 +#: ../../library/crypt.rst:40 msgid ":ref:`Availability `: Unix, not VxWorks." msgstr ":ref:`適用 `:Unix,非 VxWorks。" @@ -65,65 +66,65 @@ msgid "" "more information." msgstr "" -#: ../../library/crypt.rst:44 +#: ../../library/crypt.rst:45 msgid "Hashing Methods" msgstr "" -#: ../../library/crypt.rst:48 +#: ../../library/crypt.rst:49 msgid "" "The :mod:`crypt` module defines the list of hashing methods (not all methods " "are available on all platforms):" msgstr "" -#: ../../library/crypt.rst:53 +#: ../../library/crypt.rst:54 msgid "" "A Modular Crypt Format method with 16 character salt and 86 character hash " "based on the SHA-512 hash function. This is the strongest method." msgstr "" -#: ../../library/crypt.rst:58 +#: ../../library/crypt.rst:59 msgid "" "Another Modular Crypt Format method with 16 character salt and 43 character " "hash based on the SHA-256 hash function." msgstr "" -#: ../../library/crypt.rst:63 +#: ../../library/crypt.rst:64 msgid "" "Another Modular Crypt Format method with 22 character salt and 31 character " "hash based on the Blowfish cipher." msgstr "" -#: ../../library/crypt.rst:70 +#: ../../library/crypt.rst:71 msgid "" "Another Modular Crypt Format method with 8 character salt and 22 character " "hash based on the MD5 hash function." msgstr "" -#: ../../library/crypt.rst:75 +#: ../../library/crypt.rst:76 msgid "" "The traditional method with a 2 character salt and 13 characters of hash. " "This is the weakest method." msgstr "" -#: ../../library/crypt.rst:80 +#: ../../library/crypt.rst:81 msgid "Module Attributes" msgstr "模組屬性" -#: ../../library/crypt.rst:86 +#: ../../library/crypt.rst:87 msgid "" "A list of available password hashing algorithms, as ``crypt.METHOD_*`` " "objects. This list is sorted from strongest to weakest." msgstr "" -#: ../../library/crypt.rst:92 +#: ../../library/crypt.rst:93 msgid "Module Functions" msgstr "模組函式" -#: ../../library/crypt.rst:94 +#: ../../library/crypt.rst:95 msgid "The :mod:`crypt` module defines the following functions:" msgstr ":mod:`crypt` 模組定義了以下函式:" -#: ../../library/crypt.rst:98 +#: ../../library/crypt.rst:99 msgid "" "*word* will usually be a user's password as typed at a prompt or in a " "graphical interface. The optional *salt* is either a string as returned " @@ -133,14 +134,14 @@ msgid "" "strongest method available in :attr:`methods` will be used." msgstr "" -#: ../../library/crypt.rst:105 +#: ../../library/crypt.rst:106 msgid "" "Checking a password is usually done by passing the plain-text password as " "*word* and the full results of a previous :func:`crypt` call, which should " "be the same as the results of this call." msgstr "" -#: ../../library/crypt.rst:109 +#: ../../library/crypt.rst:110 msgid "" "*salt* (either a random 2 or 16 character string, possibly prefixed with " "``$digit$`` to indicate the method) which will be used to perturb the " @@ -149,36 +150,36 @@ msgid "" "``$digit$``." msgstr "" -#: ../../library/crypt.rst:115 +#: ../../library/crypt.rst:116 msgid "" "Returns the hashed password as a string, which will be composed of " "characters from the same alphabet as the salt." msgstr "" -#: ../../library/crypt.rst:120 +#: ../../library/crypt.rst:121 msgid "" "Since a few :manpage:`crypt(3)` extensions allow different values, with " "different sizes in the *salt*, it is recommended to use the full crypted " "password as salt when checking for a password." msgstr "" -#: ../../library/crypt.rst:124 +#: ../../library/crypt.rst:125 msgid "Accept ``crypt.METHOD_*`` values in addition to strings for *salt*." msgstr "" -#: ../../library/crypt.rst:130 +#: ../../library/crypt.rst:131 msgid "" "Return a randomly generated salt of the specified method. If no *method* is " "given, the strongest method available in :attr:`methods` is used." msgstr "" -#: ../../library/crypt.rst:134 +#: ../../library/crypt.rst:135 msgid "" "The return value is a string suitable for passing as the *salt* argument to :" "func:`crypt`." msgstr "" -#: ../../library/crypt.rst:137 +#: ../../library/crypt.rst:138 msgid "" "*rounds* specifies the number of rounds for ``METHOD_SHA256``, " "``METHOD_SHA512`` and ``METHOD_BLOWFISH``. For ``METHOD_SHA256`` and " @@ -188,29 +189,29 @@ msgid "" "sup:`31`), the default is ``4096`` (2\\ :sup:`12`)." msgstr "" -#: ../../library/crypt.rst:147 +#: ../../library/crypt.rst:148 msgid "Added the *rounds* parameter." msgstr "新增 *rounds* 參數。" -#: ../../library/crypt.rst:152 +#: ../../library/crypt.rst:153 msgid "Examples" msgstr "範例" -#: ../../library/crypt.rst:154 +#: ../../library/crypt.rst:155 msgid "" "A simple example illustrating typical use (a constant-time comparison " "operation is needed to limit exposure to timing attacks. :func:`hmac." "compare_digest` is suitable for this purpose)::" msgstr "" -#: ../../library/crypt.rst:174 +#: ../../library/crypt.rst:175 msgid "" "To generate a hash of a password using the strongest available method and " "check it against the original::" msgstr "" -#: ../../library/crypt.rst:15 ../../library/crypt.rst:32 -#: ../../library/crypt.rst:118 +#: ../../library/crypt.rst:15 ../../library/crypt.rst:33 +#: ../../library/crypt.rst:119 msgid "crypt(3)" msgstr "" From 2f8129bca05854ffa98418e72fe0f82d1880f10a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 15 Jul 2023 00:40:12 +0000 Subject: [PATCH 126/130] sync with cpython 21862121 --- library/stdtypes.po | 763 ++++++++++++++++++++++---------------------- 1 file changed, 382 insertions(+), 381 deletions(-) diff --git a/library/stdtypes.po b/library/stdtypes.po index c8fb2bdc0f..a26f6fe68a 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-22 00:35+0000\n" +"POT-Creation-Date: 2023-07-15 00:38+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4239,53 +4239,54 @@ msgstr "" msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " -"'c'). The byte length of the result must be the same as the original length." +"'c'). The byte length of the result must be the same as the original length. " +"Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:3963 +#: ../../library/stdtypes.rst:3964 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:3986 +#: ../../library/stdtypes.rst:3987 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:3999 +#: ../../library/stdtypes.rst:4000 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4025 +#: ../../library/stdtypes.rst:4026 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4039 +#: ../../library/stdtypes.rst:4040 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4042 +#: ../../library/stdtypes.rst:4043 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4046 +#: ../../library/stdtypes.rst:4047 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4057 +#: ../../library/stdtypes.rst:4058 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " "representation. It is not necessarily equal to ``len(m)``::" msgstr "" -#: ../../library/stdtypes.rst:4076 +#: ../../library/stdtypes.rst:4077 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4093 +#: ../../library/stdtypes.rst:4094 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4097 +#: ../../library/stdtypes.rst:4098 msgid "" "A string containing the format (in :mod:`struct` module style) for each " "element in the view. A memoryview can be created from exporters with " @@ -4293,59 +4294,59 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4102 +#: ../../library/stdtypes.rst:4103 msgid "" "format ``'B'`` is now handled according to the struct module syntax. This " "means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgstr "" -#: ../../library/stdtypes.rst:4108 +#: ../../library/stdtypes.rst:4109 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4121 +#: ../../library/stdtypes.rst:4122 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4126 +#: ../../library/stdtypes.rst:4127 msgid "" "A tuple of integers the length of :attr:`ndim` giving the shape of the " "memory as an N-dimensional array." msgstr "" -#: ../../library/stdtypes.rst:4129 ../../library/stdtypes.rst:4137 +#: ../../library/stdtypes.rst:4130 ../../library/stdtypes.rst:4138 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4134 +#: ../../library/stdtypes.rst:4135 msgid "" "A tuple of integers the length of :attr:`ndim` giving the size in bytes to " "access each element for each dimension of the array." msgstr "" -#: ../../library/stdtypes.rst:4142 +#: ../../library/stdtypes.rst:4143 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4146 +#: ../../library/stdtypes.rst:4147 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4152 +#: ../../library/stdtypes.rst:4153 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4158 +#: ../../library/stdtypes.rst:4159 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4166 +#: ../../library/stdtypes.rst:4167 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4170 +#: ../../library/stdtypes.rst:4171 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -4355,7 +4356,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4177 +#: ../../library/stdtypes.rst:4178 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " @@ -4363,7 +4364,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4182 +#: ../../library/stdtypes.rst:4183 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -4375,18 +4376,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4190 +#: ../../library/stdtypes.rst:4191 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -#: ../../library/stdtypes.rst:4194 +#: ../../library/stdtypes.rst:4195 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4199 +#: ../../library/stdtypes.rst:4200 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -4394,92 +4395,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4205 +#: ../../library/stdtypes.rst:4206 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4207 +#: ../../library/stdtypes.rst:4208 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4208 +#: ../../library/stdtypes.rst:4209 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4209 +#: ../../library/stdtypes.rst:4210 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4211 +#: ../../library/stdtypes.rst:4212 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4216 +#: ../../library/stdtypes.rst:4217 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4220 +#: ../../library/stdtypes.rst:4221 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4224 +#: ../../library/stdtypes.rst:4225 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4228 +#: ../../library/stdtypes.rst:4229 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." msgstr "" -#: ../../library/stdtypes.rst:4234 +#: ../../library/stdtypes.rst:4235 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4238 +#: ../../library/stdtypes.rst:4239 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4244 +#: ../../library/stdtypes.rst:4245 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4248 +#: ../../library/stdtypes.rst:4249 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4254 +#: ../../library/stdtypes.rst:4255 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4259 +#: ../../library/stdtypes.rst:4260 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4264 +#: ../../library/stdtypes.rst:4265 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4269 +#: ../../library/stdtypes.rst:4270 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4273 +#: ../../library/stdtypes.rst:4274 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4276 +#: ../../library/stdtypes.rst:4277 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -4489,7 +4490,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4283 +#: ../../library/stdtypes.rst:4284 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -4499,14 +4500,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:4291 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " "returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." msgstr "" -#: ../../library/stdtypes.rst:4294 +#: ../../library/stdtypes.rst:4295 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -4514,71 +4515,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4299 +#: ../../library/stdtypes.rst:4300 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." msgstr "" -#: ../../library/stdtypes.rst:4302 +#: ../../library/stdtypes.rst:4303 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4304 +#: ../../library/stdtypes.rst:4305 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -#: ../../library/stdtypes.rst:4308 +#: ../../library/stdtypes.rst:4309 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4314 +#: ../../library/stdtypes.rst:4315 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4319 +#: ../../library/stdtypes.rst:4320 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4324 +#: ../../library/stdtypes.rst:4325 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4329 +#: ../../library/stdtypes.rst:4330 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4333 +#: ../../library/stdtypes.rst:4334 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4337 +#: ../../library/stdtypes.rst:4338 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4342 +#: ../../library/stdtypes.rst:4343 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4346 +#: ../../library/stdtypes.rst:4347 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4351 +#: ../../library/stdtypes.rst:4352 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4354 +#: ../../library/stdtypes.rst:4355 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4586,18 +4587,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4359 +#: ../../library/stdtypes.rst:4360 msgid "" "Note, the *elem* argument to the :meth:`__contains__`, :meth:`remove`, and :" "meth:`discard` methods may be a set. To support searching for an equivalent " "frozenset, a temporary one is created from *elem*." msgstr "" -#: ../../library/stdtypes.rst:4367 +#: ../../library/stdtypes.rst:4368 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4377 +#: ../../library/stdtypes.rst:4378 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4606,7 +4607,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4383 +#: ../../library/stdtypes.rst:4384 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4615,33 +4616,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4394 +#: ../../library/stdtypes.rst:4395 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4397 +#: ../../library/stdtypes.rst:4398 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4399 +#: ../../library/stdtypes.rst:4400 msgid "" "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " "4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4401 +#: ../../library/stdtypes.rst:4402 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4402 +#: ../../library/stdtypes.rst:4403 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4405 +#: ../../library/stdtypes.rst:4406 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it is a mapping object, a dictionary is " @@ -4653,7 +4654,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4415 +#: ../../library/stdtypes.rst:4416 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -4661,39 +4662,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4420 +#: ../../library/stdtypes.rst:4421 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4432 +#: ../../library/stdtypes.rst:4433 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." msgstr "" -#: ../../library/stdtypes.rst:4436 +#: ../../library/stdtypes.rst:4437 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:4442 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4445 +#: ../../library/stdtypes.rst:4446 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4449 +#: ../../library/stdtypes.rst:4450 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4454 +#: ../../library/stdtypes.rst:4455 msgid "" "If a subclass of dict defines a method :meth:`__missing__` and *key* is not " "present, the ``d[key]`` operation calls that method with the key *key* as " @@ -4704,51 +4705,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4472 +#: ../../library/stdtypes.rst:4473 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different ``__missing__`` method is used by :class:`collections." "defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:4478 +#: ../../library/stdtypes.rst:4479 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4482 +#: ../../library/stdtypes.rst:4483 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4487 +#: ../../library/stdtypes.rst:4488 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4491 +#: ../../library/stdtypes.rst:4492 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4495 +#: ../../library/stdtypes.rst:4496 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4500 +#: ../../library/stdtypes.rst:4501 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4504 +#: ../../library/stdtypes.rst:4505 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4508 +#: ../../library/stdtypes.rst:4509 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4510 +#: ../../library/stdtypes.rst:4511 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -4757,70 +4758,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4518 +#: ../../library/stdtypes.rst:4519 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " "raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4524 +#: ../../library/stdtypes.rst:4525 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4529 +#: ../../library/stdtypes.rst:4530 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4534 +#: ../../library/stdtypes.rst:4535 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " "*default*. If *default* is not given and *key* is not in the dictionary, a :" "exc:`KeyError` is raised." msgstr "" -#: ../../library/stdtypes.rst:4540 +#: ../../library/stdtypes.rst:4541 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -#: ../../library/stdtypes.rst:4543 +#: ../../library/stdtypes.rst:4544 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " "often used in set algorithms. If the dictionary is empty, calling :meth:" "`popitem` raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4547 +#: ../../library/stdtypes.rst:4548 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4553 +#: ../../library/stdtypes.rst:4554 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4560 +#: ../../library/stdtypes.rst:4561 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." msgstr "" -#: ../../library/stdtypes.rst:4566 +#: ../../library/stdtypes.rst:4567 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4569 +#: ../../library/stdtypes.rst:4570 msgid "" ":meth:`update` accepts either another dictionary object or an iterable of " "key/value pairs (as tuples or other iterables of length two). If keyword " @@ -4828,71 +4829,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4576 +#: ../../library/stdtypes.rst:4577 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4579 +#: ../../library/stdtypes.rst:4580 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" -#: ../../library/stdtypes.rst:4589 +#: ../../library/stdtypes.rst:4590 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4597 +#: ../../library/stdtypes.rst:4598 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4603 +#: ../../library/stdtypes.rst:4604 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " "'>') raise :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:4607 +#: ../../library/stdtypes.rst:4608 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" -#: ../../library/stdtypes.rst:4625 +#: ../../library/stdtypes.rst:4626 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4629 +#: ../../library/stdtypes.rst:4630 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4641 +#: ../../library/stdtypes.rst:4642 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4646 +#: ../../library/stdtypes.rst:4647 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4653 +#: ../../library/stdtypes.rst:4654 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4655 +#: ../../library/stdtypes.rst:4656 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -4900,23 +4901,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4660 +#: ../../library/stdtypes.rst:4661 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4665 +#: ../../library/stdtypes.rst:4666 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4669 +#: ../../library/stdtypes.rst:4670 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4672 +#: ../../library/stdtypes.rst:4673 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -4924,39 +4925,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4677 +#: ../../library/stdtypes.rst:4678 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" -#: ../../library/stdtypes.rst:4680 +#: ../../library/stdtypes.rst:4681 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4685 +#: ../../library/stdtypes.rst:4686 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" -#: ../../library/stdtypes.rst:4690 +#: ../../library/stdtypes.rst:4691 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -#: ../../library/stdtypes.rst:4693 +#: ../../library/stdtypes.rst:4694 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4698 +#: ../../library/stdtypes.rst:4699 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4703 +#: ../../library/stdtypes.rst:4704 msgid "" "Keys views are set-like since their entries are unique and :term:" "`hashable`. If all values are hashable, so that ``(key, value)`` pairs are " @@ -4967,15 +4968,15 @@ msgid "" "``<``, or ``^``)." msgstr "" -#: ../../library/stdtypes.rst:4710 +#: ../../library/stdtypes.rst:4711 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4751 +#: ../../library/stdtypes.rst:4754 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4758 +#: ../../library/stdtypes.rst:4761 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -4983,7 +4984,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4766 +#: ../../library/stdtypes.rst:4769 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -4991,14 +4992,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4771 +#: ../../library/stdtypes.rst:4774 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" "`open` to be used as the context expression in a :keyword:`with` statement." msgstr "" -#: ../../library/stdtypes.rst:4775 +#: ../../library/stdtypes.rst:4778 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -5008,7 +5009,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4785 +#: ../../library/stdtypes.rst:4788 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -5017,7 +5018,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4790 +#: ../../library/stdtypes.rst:4793 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -5028,7 +5029,7 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4797 +#: ../../library/stdtypes.rst:4800 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -5037,7 +5038,7 @@ msgid "" "method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4803 +#: ../../library/stdtypes.rst:4806 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -5046,7 +5047,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4809 +#: ../../library/stdtypes.rst:4812 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -5056,7 +5057,7 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4816 +#: ../../library/stdtypes.rst:4819 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -5065,23 +5066,23 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4824 +#: ../../library/stdtypes.rst:4827 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" msgstr "" -#: ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:4832 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." msgstr "" -#: ../../library/stdtypes.rst:4836 +#: ../../library/stdtypes.rst:4839 msgid "Generic Alias Type" msgstr "" -#: ../../library/stdtypes.rst:4842 +#: ../../library/stdtypes.rst:4845 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -5091,19 +5092,19 @@ msgid "" "are intended primarily for use with :term:`type annotations `." msgstr "" -#: ../../library/stdtypes.rst:4852 +#: ../../library/stdtypes.rst:4855 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:4855 +#: ../../library/stdtypes.rst:4858 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." msgstr "" -#: ../../library/stdtypes.rst:4858 +#: ../../library/stdtypes.rst:4861 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -5112,7 +5113,7 @@ msgid "" "`bytes`." msgstr "" -#: ../../library/stdtypes.rst:4864 +#: ../../library/stdtypes.rst:4867 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -5121,7 +5122,7 @@ msgid "" "the :class:`str` data type and the :class:`bytes` data type:" msgstr "" -#: ../../library/stdtypes.rst:4870 +#: ../../library/stdtypes.rst:4873 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -5129,7 +5130,7 @@ msgid "" "annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" -#: ../../library/stdtypes.rst:4876 +#: ../../library/stdtypes.rst:4879 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -5138,21 +5139,21 @@ msgid "" "objects>` objects with ``re.Match[bytes]``." msgstr "" -#: ../../library/stdtypes.rst:4882 +#: ../../library/stdtypes.rst:4885 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " "directly." msgstr "" -#: ../../library/stdtypes.rst:4888 +#: ../../library/stdtypes.rst:4891 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " "expecting a :class:`list` containing :class:`float` elements::" msgstr "" -#: ../../library/stdtypes.rst:4896 +#: ../../library/stdtypes.rst:4899 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " @@ -5160,13 +5161,13 @@ msgid "" "of type :class:`str` and values of type :class:`int`::" msgstr "" -#: ../../library/stdtypes.rst:4904 +#: ../../library/stdtypes.rst:4907 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" msgstr "" -#: ../../library/stdtypes.rst:4912 +#: ../../library/stdtypes.rst:4915 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -5175,331 +5176,331 @@ msgid "" "discouraged, but will run without errors::" msgstr "" -#: ../../library/stdtypes.rst:4922 +#: ../../library/stdtypes.rst:4925 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "" -#: ../../library/stdtypes.rst:4933 +#: ../../library/stdtypes.rst:4936 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -#: ../../library/stdtypes.rst:4941 +#: ../../library/stdtypes.rst:4944 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -#: ../../library/stdtypes.rst:4949 +#: ../../library/stdtypes.rst:4952 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " "items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" msgstr "" -#: ../../library/stdtypes.rst:4960 +#: ../../library/stdtypes.rst:4963 msgid "Standard Generic Classes" msgstr "" -#: ../../library/stdtypes.rst:4962 +#: ../../library/stdtypes.rst:4965 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -#: ../../library/stdtypes.rst:4965 +#: ../../library/stdtypes.rst:4968 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4969 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:4967 +#: ../../library/stdtypes.rst:4970 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:4971 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:4972 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:4970 +#: ../../library/stdtypes.rst:4973 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4974 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:4975 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:4973 +#: ../../library/stdtypes.rst:4976 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4977 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:4978 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4979 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:4980 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:4978 +#: ../../library/stdtypes.rst:4981 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4982 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:4980 +#: ../../library/stdtypes.rst:4983 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:4984 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:4985 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:4986 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:4984 +#: ../../library/stdtypes.rst:4987 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:4985 +#: ../../library/stdtypes.rst:4988 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:4986 +#: ../../library/stdtypes.rst:4989 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4990 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:4988 +#: ../../library/stdtypes.rst:4991 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:4992 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:4990 +#: ../../library/stdtypes.rst:4993 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:4994 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:4992 +#: ../../library/stdtypes.rst:4995 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:4996 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:4994 +#: ../../library/stdtypes.rst:4997 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:4998 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:4999 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:5000 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:4998 +#: ../../library/stdtypes.rst:5001 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:4999 +#: ../../library/stdtypes.rst:5002 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5000 +#: ../../library/stdtypes.rst:5003 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5001 +#: ../../library/stdtypes.rst:5004 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:5005 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5003 +#: ../../library/stdtypes.rst:5006 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5004 +#: ../../library/stdtypes.rst:5007 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5005 +#: ../../library/stdtypes.rst:5008 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5006 +#: ../../library/stdtypes.rst:5009 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5007 +#: ../../library/stdtypes.rst:5010 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5008 +#: ../../library/stdtypes.rst:5011 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5009 +#: ../../library/stdtypes.rst:5012 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5013 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5014 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5012 +#: ../../library/stdtypes.rst:5015 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5016 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5014 +#: ../../library/stdtypes.rst:5017 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5015 +#: ../../library/stdtypes.rst:5018 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5019 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5017 +#: ../../library/stdtypes.rst:5020 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5018 +#: ../../library/stdtypes.rst:5021 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5023 +#: ../../library/stdtypes.rst:5026 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "" -#: ../../library/stdtypes.rst:5025 +#: ../../library/stdtypes.rst:5028 msgid "All parameterized generics implement special read-only attributes." msgstr "" -#: ../../library/stdtypes.rst:5029 +#: ../../library/stdtypes.rst:5032 msgid "This attribute points at the non-parameterized generic class::" msgstr "" -#: ../../library/stdtypes.rst:5037 +#: ../../library/stdtypes.rst:5040 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " "class::" msgstr "" -#: ../../library/stdtypes.rst:5047 +#: ../../library/stdtypes.rst:5050 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -#: ../../library/stdtypes.rst:5058 +#: ../../library/stdtypes.rst:5061 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." "ParamSpec` is intended primarily for static type checking." msgstr "" -#: ../../library/stdtypes.rst:5065 +#: ../../library/stdtypes.rst:5068 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." msgstr "" -#: ../../library/stdtypes.rst:5074 +#: ../../library/stdtypes.rst:5077 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../library/stdtypes.rst:5074 +#: ../../library/stdtypes.rst:5077 msgid "Introducing Python's framework for type annotations." msgstr "" -#: ../../library/stdtypes.rst:5079 +#: ../../library/stdtypes.rst:5082 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/stdtypes.rst:5077 +#: ../../library/stdtypes.rst:5080 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." "__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:5082 +#: ../../library/stdtypes.rst:5085 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" msgstr "" -#: ../../library/stdtypes.rst:5082 +#: ../../library/stdtypes.rst:5085 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../library/stdtypes.rst:5091 +#: ../../library/stdtypes.rst:5094 msgid "Union Type" msgstr "" -#: ../../library/stdtypes.rst:5097 +#: ../../library/stdtypes.rst:5100 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -5508,7 +5509,7 @@ msgid "" "Union`." msgstr "" -#: ../../library/stdtypes.rst:5104 +#: ../../library/stdtypes.rst:5107 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -5516,7 +5517,7 @@ msgid "" "class:`float`::" msgstr "" -#: ../../library/stdtypes.rst:5114 +#: ../../library/stdtypes.rst:5117 msgid "" "The ``|`` operand cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " @@ -5525,76 +5526,76 @@ msgid "" "a string, e.g. ``\"int | Foo\"``." msgstr "" -#: ../../library/stdtypes.rst:5122 +#: ../../library/stdtypes.rst:5125 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5124 +#: ../../library/stdtypes.rst:5127 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5128 +#: ../../library/stdtypes.rst:5131 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5132 +#: ../../library/stdtypes.rst:5135 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5136 +#: ../../library/stdtypes.rst:5139 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5140 +#: ../../library/stdtypes.rst:5143 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5147 +#: ../../library/stdtypes.rst:5150 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5153 +#: ../../library/stdtypes.rst:5156 msgid "" -"However, union objects containing :ref:`parameterized generics ` cannot be used::" +"However, :ref:`parameterized generics ` in union objects " +"cannot be checked::" msgstr "" -#: ../../library/stdtypes.rst:5161 +#: ../../library/stdtypes.rst:5166 msgid "" "The user-exposed type for the union object can be accessed from :data:`types." "UnionType` and used for :func:`isinstance` checks. An object cannot be " "instantiated from the type::" msgstr "" -#: ../../library/stdtypes.rst:5174 +#: ../../library/stdtypes.rst:5179 msgid "" "The :meth:`__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`__or__`, the Union may override " "it::" msgstr "" -#: ../../library/stdtypes.rst:5192 +#: ../../library/stdtypes.rst:5197 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5200 +#: ../../library/stdtypes.rst:5205 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5202 +#: ../../library/stdtypes.rst:5207 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5209 +#: ../../library/stdtypes.rst:5214 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5211 +#: ../../library/stdtypes.rst:5216 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -5605,7 +5606,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5218 +#: ../../library/stdtypes.rst:5223 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5616,32 +5617,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5226 +#: ../../library/stdtypes.rst:5231 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5234 +#: ../../library/stdtypes.rst:5239 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5236 +#: ../../library/stdtypes.rst:5241 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5242 +#: ../../library/stdtypes.rst:5247 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5244 +#: ../../library/stdtypes.rst:5249 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:5247 +#: ../../library/stdtypes.rst:5252 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5649,15 +5650,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:5256 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`\\ 。" -#: ../../library/stdtypes.rst:5257 +#: ../../library/stdtypes.rst:5262 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5261 +#: ../../library/stdtypes.rst:5266 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: built-in methods (such as :meth:`append` on lists) and " @@ -5665,7 +5666,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:5266 +#: ../../library/stdtypes.rst:5271 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :dfn:" @@ -5677,7 +5678,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5275 +#: ../../library/stdtypes.rst:5280 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5687,15 +5688,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5295 ../../library/stdtypes.rst:5326 +#: ../../library/stdtypes.rst:5300 ../../library/stdtypes.rst:5331 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`\\ 。" -#: ../../library/stdtypes.rst:5303 +#: ../../library/stdtypes.rst:5308 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5309 +#: ../../library/stdtypes.rst:5314 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5705,23 +5706,23 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5316 +#: ../../library/stdtypes.rst:5321 msgid "" "Accessing ``__code__`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"__code__\"``." msgstr "" -#: ../../library/stdtypes.rst:5323 +#: ../../library/stdtypes.rst:5328 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:5332 +#: ../../library/stdtypes.rst:5337 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5338 +#: ../../library/stdtypes.rst:5343 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -5729,30 +5730,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5343 +#: ../../library/stdtypes.rst:5348 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5349 +#: ../../library/stdtypes.rst:5354 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5351 +#: ../../library/stdtypes.rst:5356 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:5355 +#: ../../library/stdtypes.rst:5360 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5362 +#: ../../library/stdtypes.rst:5367 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5364 +#: ../../library/stdtypes.rst:5369 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5760,15 +5761,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5369 +#: ../../library/stdtypes.rst:5374 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5375 +#: ../../library/stdtypes.rst:5380 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5377 +#: ../../library/stdtypes.rst:5382 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -5776,15 +5777,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5387 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5388 +#: ../../library/stdtypes.rst:5393 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:5395 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5795,81 +5796,81 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:5408 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5409 +#: ../../library/stdtypes.rst:5414 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5411 +#: ../../library/stdtypes.rst:5416 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:5423 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5420 +#: ../../library/stdtypes.rst:5425 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:5427 +#: ../../library/stdtypes.rst:5432 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5433 +#: ../../library/stdtypes.rst:5438 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5438 +#: ../../library/stdtypes.rst:5443 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5443 +#: ../../library/stdtypes.rst:5448 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5449 +#: ../../library/stdtypes.rst:5454 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5457 +#: ../../library/stdtypes.rst:5462 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5463 +#: ../../library/stdtypes.rst:5468 msgid "" "This method can be overridden by a metaclass to customize the method " "resolution order for its instances. It is called at class instantiation, " "and its result is stored in :attr:`~class.__mro__`." msgstr "" -#: ../../library/stdtypes.rst:5470 +#: ../../library/stdtypes.rst:5475 msgid "" "Each class keeps a list of weak references to its immediate subclasses. " "This method returns a list of all those references still alive. The list is " "in definition order. Example::" msgstr "" -#: ../../library/stdtypes.rst:5481 +#: ../../library/stdtypes.rst:5486 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5483 +#: ../../library/stdtypes.rst:5488 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -5877,7 +5878,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5488 +#: ../../library/stdtypes.rst:5493 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -5887,25 +5888,25 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5495 +#: ../../library/stdtypes.rst:5500 msgid "" "Limiting conversion size offers a practical way to avoid `CVE-2020-10735 " "`_." msgstr "" -#: ../../library/stdtypes.rst:5498 +#: ../../library/stdtypes.rst:5503 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " "Underscores and the sign are not counted towards the limit." msgstr "" -#: ../../library/stdtypes.rst:5502 +#: ../../library/stdtypes.rst:5507 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5524 +#: ../../library/stdtypes.rst:5529 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -5913,94 +5914,94 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5529 +#: ../../library/stdtypes.rst:5534 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5549 msgid "Affected APIs" msgstr "" -#: ../../library/stdtypes.rst:5546 +#: ../../library/stdtypes.rst:5551 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5554 msgid "``int(string)`` with default base 10." msgstr "" -#: ../../library/stdtypes.rst:5550 +#: ../../library/stdtypes.rst:5555 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5556 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5552 +#: ../../library/stdtypes.rst:5557 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5553 +#: ../../library/stdtypes.rst:5558 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5556 +#: ../../library/stdtypes.rst:5561 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5558 +#: ../../library/stdtypes.rst:5563 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5559 +#: ../../library/stdtypes.rst:5564 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr "" -#: ../../library/stdtypes.rst:5560 +#: ../../library/stdtypes.rst:5565 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr "" -#: ../../library/stdtypes.rst:5561 +#: ../../library/stdtypes.rst:5566 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5562 +#: ../../library/stdtypes.rst:5567 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5563 +#: ../../library/stdtypes.rst:5568 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5566 +#: ../../library/stdtypes.rst:5571 msgid "Configuring the limit" msgstr "" -#: ../../library/stdtypes.rst:5568 +#: ../../library/stdtypes.rst:5573 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" msgstr "" -#: ../../library/stdtypes.rst:5571 +#: ../../library/stdtypes.rst:5576 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " "the limitation." msgstr "" -#: ../../library/stdtypes.rst:5574 +#: ../../library/stdtypes.rst:5579 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" msgstr "" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5581 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -6009,38 +6010,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5582 +#: ../../library/stdtypes.rst:5587 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5585 +#: ../../library/stdtypes.rst:5590 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " "their own limit." msgstr "" -#: ../../library/stdtypes.rst:5589 +#: ../../library/stdtypes.rst:5594 msgid "" "Information about the default and minimum can be found in :attr:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5591 +#: ../../library/stdtypes.rst:5596 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5598 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:5600 +#: ../../library/stdtypes.rst:5605 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -6052,7 +6053,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5609 +#: ../../library/stdtypes.rst:5614 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -6060,11 +6061,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5615 +#: ../../library/stdtypes.rst:5620 msgid "Recommended configuration" msgstr "" -#: ../../library/stdtypes.rst:5617 +#: ../../library/stdtypes.rst:5622 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -6072,45 +6073,45 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.11." msgstr "" -#: ../../library/stdtypes.rst:5622 +#: ../../library/stdtypes.rst:5627 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:5634 +#: ../../library/stdtypes.rst:5639 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5638 +#: ../../library/stdtypes.rst:5643 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5639 +#: ../../library/stdtypes.rst:5644 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5642 +#: ../../library/stdtypes.rst:5647 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5645 +#: ../../library/stdtypes.rst:5650 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5647 +#: ../../library/stdtypes.rst:5652 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:5650 +#: ../../library/stdtypes.rst:5655 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -6124,13 +6125,13 @@ msgstr "內建型別" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:315 #: ../../library/stdtypes.rst:390 ../../library/stdtypes.rst:907 #: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:1096 -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:5339 msgid "types" msgstr "" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1111 -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4370 msgid "statement" msgstr "" @@ -6151,7 +6152,7 @@ msgid "value" msgstr "" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:80 -#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:5403 msgid "Boolean" msgstr "" @@ -6195,11 +6196,11 @@ msgstr "" "\n" "::" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5403 msgid "False" msgstr "" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5403 msgid "True" msgstr "" @@ -6258,10 +6259,10 @@ msgstr "``is not``" #: ../../library/stdtypes.rst:1295 ../../library/stdtypes.rst:1339 #: ../../library/stdtypes.rst:1461 ../../library/stdtypes.rst:1497 #: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:2485 -#: ../../library/stdtypes.rst:2592 ../../library/stdtypes.rst:4168 -#: ../../library/stdtypes.rst:4369 ../../library/stdtypes.rst:4838 -#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5259 -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:2592 ../../library/stdtypes.rst:4169 +#: ../../library/stdtypes.rst:4370 ../../library/stdtypes.rst:4841 +#: ../../library/stdtypes.rst:5096 ../../library/stdtypes.rst:5264 +#: ../../library/stdtypes.rst:5303 msgid "object" msgstr "" @@ -6354,9 +6355,9 @@ msgid "arithmetic" msgstr "" #: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:907 -#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5305 ../../library/stdtypes.rst:5319 -#: ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:5310 ../../library/stdtypes.rst:5324 +#: ../../library/stdtypes.rst:5339 msgid "built-in function" msgstr "" @@ -6415,7 +6416,7 @@ msgstr "" #: ../../library/stdtypes.rst:315 ../../library/stdtypes.rst:390 #: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:1111 -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4370 msgid "operations on" msgstr "" @@ -6424,7 +6425,7 @@ msgid "conjugate() (complex number method)" msgstr "" #: ../../library/stdtypes.rst:332 ../../library/stdtypes.rst:1563 -#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:5339 #, fuzzy msgid "module" msgstr "模組" @@ -6489,7 +6490,7 @@ msgstr "" msgid "iterator protocol" msgstr "" -#: ../../library/stdtypes.rst:804 ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:804 ../../library/stdtypes.rst:4756 msgid "protocol" msgstr "" @@ -6516,7 +6517,7 @@ msgstr "" msgid "iteration over" msgstr "" -#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:4370 msgid "len" msgstr "" @@ -6601,8 +6602,8 @@ msgstr "" msgid "bytearray" msgstr "" -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:5096 ../../library/stdtypes.rst:5339 msgid "type" msgstr "" @@ -6610,7 +6611,7 @@ msgstr "" msgid "assignment" msgstr "" -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4370 msgid "del" msgstr "" @@ -6779,98 +6780,98 @@ msgstr "" msgid "interpolation" msgstr "" -#: ../../library/stdtypes.rst:4168 +#: ../../library/stdtypes.rst:4169 msgid "set" msgstr "" -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4370 msgid "mapping" msgstr "" -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4370 msgid "dictionary" msgstr "" -#: ../../library/stdtypes.rst:4452 +#: ../../library/stdtypes.rst:4453 msgid "__missing__()" msgstr "" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4756 msgid "context manager" msgstr "" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4756 msgid "context management protocol" msgstr "" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4756 msgid "context management" msgstr "" -#: ../../library/stdtypes.rst:4826 +#: ../../library/stdtypes.rst:4829 msgid "annotation" msgstr "" -#: ../../library/stdtypes.rst:4826 +#: ../../library/stdtypes.rst:4829 msgid "type annotation; type hint" msgstr "" -#: ../../library/stdtypes.rst:4838 +#: ../../library/stdtypes.rst:4841 msgid "GenericAlias" msgstr "" -#: ../../library/stdtypes.rst:4838 +#: ../../library/stdtypes.rst:4841 msgid "Generic" msgstr "" -#: ../../library/stdtypes.rst:4838 +#: ../../library/stdtypes.rst:4841 msgid "Alias" msgstr "" -#: ../../library/stdtypes.rst:5093 +#: ../../library/stdtypes.rst:5096 msgid "Union" msgstr "" -#: ../../library/stdtypes.rst:5093 +#: ../../library/stdtypes.rst:5096 msgid "union" msgstr "" -#: ../../library/stdtypes.rst:5259 +#: ../../library/stdtypes.rst:5264 msgid "method" msgstr "" -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:5303 msgid "code" msgstr "" -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:5303 msgid "code object" msgstr "" -#: ../../library/stdtypes.rst:5305 +#: ../../library/stdtypes.rst:5310 msgid "compile" msgstr "" -#: ../../library/stdtypes.rst:5305 +#: ../../library/stdtypes.rst:5310 msgid "__code__ (function object attribute)" msgstr "" -#: ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5324 msgid "exec" msgstr "" -#: ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5324 msgid "eval" msgstr "" -#: ../../library/stdtypes.rst:5358 +#: ../../library/stdtypes.rst:5363 msgid "..." msgstr "" -#: ../../library/stdtypes.rst:5358 +#: ../../library/stdtypes.rst:5363 msgid "ellipsis literal" msgstr "" -#: ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:5403 msgid "values" msgstr "" From 3ab952e15d7bd5a6635ea3d9bc1b68a16ef0d288 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 16 Jul 2023 00:45:01 +0000 Subject: [PATCH 127/130] sync with cpython c73f9c04 --- howto/clinic.po | 864 +++++++++++++++++++++++----------------------- library/typing.po | 297 ++++++++-------- 2 files changed, 586 insertions(+), 575 deletions(-) diff --git a/howto/clinic.po b/howto/clinic.po index 168b13219b..194a29a040 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-16 00:43+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-" @@ -54,11 +54,11 @@ msgid "" "totally incompatible and break all your code." msgstr "" -#: ../../howto/clinic.rst:31 -msgid "The Goals Of Argument Clinic" +#: ../../howto/clinic.rst:32 +msgid "The goals of Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:33 +#: ../../howto/clinic.rst:34 msgid "" "Argument Clinic's primary goal is to take over responsibility for all " "argument parsing code inside CPython. This means that, when you convert a " @@ -69,7 +69,7 @@ msgid "" "*kwargs``) magically converted into the C variables and types you need." msgstr "" -#: ../../howto/clinic.rst:43 +#: ../../howto/clinic.rst:44 msgid "" "In order for Argument Clinic to accomplish its primary goal, it must be easy " "to use. Currently, working with CPython's argument parsing library is a " @@ -77,7 +77,7 @@ msgid "" "places. When you use Argument Clinic, you don't have to repeat yourself." msgstr "" -#: ../../howto/clinic.rst:49 +#: ../../howto/clinic.rst:50 msgid "" "Obviously, no one would want to use Argument Clinic unless it's solving " "their problem—and without creating new problems of its own. So it's " @@ -89,14 +89,14 @@ msgid "" "parsing library. That would make for the fastest argument parsing possible!)" msgstr "" -#: ../../howto/clinic.rst:61 +#: ../../howto/clinic.rst:62 msgid "" "Additionally, Argument Clinic must be flexible enough to work with any " "approach to argument parsing. Python has some functions with some very " "strange parsing behaviors; Argument Clinic's goal is to support all of them." msgstr "" -#: ../../howto/clinic.rst:66 +#: ../../howto/clinic.rst:67 msgid "" "Finally, the original motivation for Argument Clinic was to provide " "introspection \"signatures\" for CPython builtins. It used to be, the " @@ -104,7 +104,7 @@ msgid "" "builtin. With Argument Clinic, that's a thing of the past!" msgstr "" -#: ../../howto/clinic.rst:72 +#: ../../howto/clinic.rst:73 msgid "" "One idea you should keep in mind, as you work with Argument Clinic: the more " "information you give it, the better job it'll be able to do. Argument Clinic " @@ -113,36 +113,36 @@ msgid "" "things with all the information you give it." msgstr "" -#: ../../howto/clinic.rst:82 -msgid "Basic Concepts And Usage" +#: ../../howto/clinic.rst:83 +msgid "Basic concepts and usage" msgstr "" -#: ../../howto/clinic.rst:84 +#: ../../howto/clinic.rst:85 msgid "" "Argument Clinic ships with CPython; you'll find it in ``Tools/clinic/clinic." "py``. If you run that script, specifying a C file as an argument:" msgstr "" -#: ../../howto/clinic.rst:91 +#: ../../howto/clinic.rst:92 msgid "" "Argument Clinic will scan over the file looking for lines that look exactly " "like this:" msgstr "" -#: ../../howto/clinic.rst:98 +#: ../../howto/clinic.rst:99 msgid "" "When it finds one, it reads everything up to a line that looks exactly like " "this:" msgstr "" -#: ../../howto/clinic.rst:105 +#: ../../howto/clinic.rst:106 msgid "" "Everything in between these two lines is input for Argument Clinic. All of " "these lines, including the beginning and ending comment lines, are " "collectively called an Argument Clinic \"block\"." msgstr "" -#: ../../howto/clinic.rst:109 +#: ../../howto/clinic.rst:110 msgid "" "When Argument Clinic parses one of these blocks, it generates output. This " "output is rewritten into the C file immediately after the block, followed by " @@ -150,7 +150,7 @@ msgid "" "this:" msgstr "" -#: ../../howto/clinic.rst:122 +#: ../../howto/clinic.rst:123 msgid "" "If you run Argument Clinic on the same file a second time, Argument Clinic " "will discard the old output and write out the new output with a fresh " @@ -158,7 +158,7 @@ msgid "" "change either." msgstr "" -#: ../../howto/clinic.rst:126 +#: ../../howto/clinic.rst:127 msgid "" "You should never modify the output portion of an Argument Clinic block. " "Instead, change the input until it produces the output you want. (That's " @@ -167,38 +167,38 @@ msgid "" "output.)" msgstr "" -#: ../../howto/clinic.rst:131 +#: ../../howto/clinic.rst:132 msgid "" "For the sake of clarity, here's the terminology we'll use with Argument " "Clinic:" msgstr "" -#: ../../howto/clinic.rst:133 +#: ../../howto/clinic.rst:134 msgid "" "The first line of the comment (``/*[clinic input]``) is the *start line*." msgstr "" -#: ../../howto/clinic.rst:134 +#: ../../howto/clinic.rst:135 msgid "" "The last line of the initial comment (``[clinic start generated code]*/``) " "is the *end line*." msgstr "" -#: ../../howto/clinic.rst:135 +#: ../../howto/clinic.rst:136 msgid "" "The last line (``/*[clinic end generated code: checksum=...]*/``) is the " "*checksum line*." msgstr "" -#: ../../howto/clinic.rst:136 +#: ../../howto/clinic.rst:137 msgid "In between the start line and the end line is the *input*." msgstr "" -#: ../../howto/clinic.rst:137 +#: ../../howto/clinic.rst:138 msgid "In between the end line and the checksum line is the *output*." msgstr "" -#: ../../howto/clinic.rst:138 +#: ../../howto/clinic.rst:139 msgid "" "All the text collectively, from the start line to the checksum line " "inclusively, is the *block*. (A block that hasn't been successfully " @@ -206,11 +206,11 @@ msgid "" "it's still considered a block.)" msgstr "" -#: ../../howto/clinic.rst:145 -msgid "Converting Your First Function" +#: ../../howto/clinic.rst:146 +msgid "Converting your first function" msgstr "" -#: ../../howto/clinic.rst:147 +#: ../../howto/clinic.rst:148 msgid "" "The best way to get a sense of how Argument Clinic works is to convert a " "function to work with it. Here, then, are the bare minimum steps you'd need " @@ -221,30 +221,30 @@ msgid "" "keep it simple for this walkthrough so you can learn." msgstr "" -#: ../../howto/clinic.rst:156 +#: ../../howto/clinic.rst:157 msgid "Let's dive in!" msgstr "" -#: ../../howto/clinic.rst:158 +#: ../../howto/clinic.rst:159 msgid "" "Make sure you're working with a freshly updated checkout of the CPython " "trunk." msgstr "" -#: ../../howto/clinic.rst:161 +#: ../../howto/clinic.rst:162 msgid "" "Find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :c:" "func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " "Argument Clinic yet. For my example I'm using ``_pickle.Pickler.dump()``." msgstr "" -#: ../../howto/clinic.rst:166 +#: ../../howto/clinic.rst:167 msgid "" "If the call to the ``PyArg_Parse`` function uses any of the following format " "units:" msgstr "" -#: ../../howto/clinic.rst:178 +#: ../../howto/clinic.rst:179 msgid "" "or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should choose " "a different function. Argument Clinic *does* support all of these " @@ -252,7 +252,7 @@ msgid "" "your first function." msgstr "" -#: ../../howto/clinic.rst:183 +#: ../../howto/clinic.rst:184 msgid "" "Also, if the function has multiple calls to :c:func:`PyArg_ParseTuple` or :c:" "func:`PyArg_ParseTupleAndKeywords` where it supports different types for the " @@ -262,11 +262,11 @@ msgid "" "polymorphic parameters." msgstr "" -#: ../../howto/clinic.rst:190 +#: ../../howto/clinic.rst:191 msgid "Add the following boilerplate above the function, creating our block::" msgstr "" -#: ../../howto/clinic.rst:195 +#: ../../howto/clinic.rst:196 msgid "" "Cut the docstring and paste it in between the ``[clinic]`` lines, removing " "all the junk that makes it a properly quoted C string. When you're done you " @@ -274,7 +274,7 @@ msgid "" "80 characters. (Argument Clinic will preserve indents inside the docstring.)" msgstr "" -#: ../../howto/clinic.rst:201 +#: ../../howto/clinic.rst:202 msgid "" "If the old docstring had a first line that looked like a function signature, " "throw that line away. (The docstring doesn't need it anymore—when you use " @@ -282,14 +282,14 @@ msgid "" "automatically based on the function's signature.)" msgstr "" -#: ../../howto/clinic.rst:207 ../../howto/clinic.rst:228 -#: ../../howto/clinic.rst:252 ../../howto/clinic.rst:310 -#: ../../howto/clinic.rst:350 ../../howto/clinic.rst:377 -#: ../../howto/clinic.rst:483 ../../howto/clinic.rst:535 +#: ../../howto/clinic.rst:208 ../../howto/clinic.rst:229 +#: ../../howto/clinic.rst:253 ../../howto/clinic.rst:311 +#: ../../howto/clinic.rst:351 ../../howto/clinic.rst:378 +#: ../../howto/clinic.rst:484 ../../howto/clinic.rst:536 msgid "Sample::" msgstr "" -#: ../../howto/clinic.rst:213 +#: ../../howto/clinic.rst:214 msgid "" "If your docstring doesn't have a \"summary\" line, Argument Clinic will " "complain. So let's make sure it has one. The \"summary\" line should be a " @@ -297,13 +297,13 @@ msgid "" "docstring." msgstr "" -#: ../../howto/clinic.rst:218 +#: ../../howto/clinic.rst:219 msgid "" "(Our example docstring consists solely of a summary line, so the sample code " "doesn't have to change for this step.)" msgstr "" -#: ../../howto/clinic.rst:221 +#: ../../howto/clinic.rst:222 msgid "" "Above the docstring, enter the name of the function, followed by a blank " "line. This should be the Python name of the function, and should be the " @@ -312,7 +312,7 @@ msgid "" "it should include the class name too." msgstr "" -#: ../../howto/clinic.rst:236 +#: ../../howto/clinic.rst:237 msgid "" "If this is the first time that module or class has been used with Argument " "Clinic in this C file, you must declare the module and/or class. Proper " @@ -322,47 +322,47 @@ msgid "" "next to each other.)" msgstr "" -#: ../../howto/clinic.rst:244 +#: ../../howto/clinic.rst:245 msgid "" "The name of the class and module should be the same as the one seen by " "Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" "`PyTypeObject` as appropriate." msgstr "" -#: ../../howto/clinic.rst:248 +#: ../../howto/clinic.rst:249 msgid "" "When you declare a class, you must also specify two aspects of its type in " "C: the type declaration you'd use for a pointer to an instance of this " "class, and a pointer to the :c:type:`PyTypeObject` for this class." msgstr "" -#: ../../howto/clinic.rst:268 +#: ../../howto/clinic.rst:269 msgid "" "Declare each of the parameters to the function. Each parameter should get " "its own line. All the parameter lines should be indented from the function " "name and the docstring." msgstr "" -#: ../../howto/clinic.rst:272 +#: ../../howto/clinic.rst:273 msgid "The general form of these parameter lines is as follows:" msgstr "" -#: ../../howto/clinic.rst:278 +#: ../../howto/clinic.rst:279 msgid "If the parameter has a default value, add that after the converter:" msgstr "" -#: ../../howto/clinic.rst:285 +#: ../../howto/clinic.rst:286 msgid "" "Argument Clinic's support for \"default values\" is quite sophisticated; " "please see :ref:`the section below on default values ` for " "more information." msgstr "" -#: ../../howto/clinic.rst:289 +#: ../../howto/clinic.rst:290 msgid "Add a blank line below the parameters." msgstr "" -#: ../../howto/clinic.rst:291 +#: ../../howto/clinic.rst:292 msgid "" "What's a \"converter\"? It establishes both the type of the variable used " "in C, and the method to convert the Python value into a C value at runtime. " @@ -371,7 +371,7 @@ msgid "" "easier." msgstr "" -#: ../../howto/clinic.rst:298 +#: ../../howto/clinic.rst:299 msgid "" "For each parameter, copy the \"format unit\" for that parameter from the " "``PyArg_Parse()`` format argument and specify *that* as its converter, as a " @@ -381,58 +381,58 @@ msgid "" "For more on format units please see :ref:`arg-parsing`.)" msgstr "" -#: ../../howto/clinic.rst:307 +#: ../../howto/clinic.rst:308 msgid "" "For multicharacter format units like ``z#``, use the entire two-or-three " "character string." msgstr "" -#: ../../howto/clinic.rst:325 +#: ../../howto/clinic.rst:326 msgid "" "If your function has ``|`` in the format string, meaning some parameters " "have default values, you can ignore it. Argument Clinic infers which " "parameters are optional based on whether or not they have default values." msgstr "" -#: ../../howto/clinic.rst:330 +#: ../../howto/clinic.rst:331 msgid "" "If your function has ``$`` in the format string, meaning it takes keyword-" "only arguments, specify ``*`` on a line by itself before the first keyword-" "only argument, indented the same as the parameter lines." msgstr "" -#: ../../howto/clinic.rst:335 +#: ../../howto/clinic.rst:336 msgid "(``_pickle.Pickler.dump`` has neither, so our sample is unchanged.)" msgstr "" -#: ../../howto/clinic.rst:338 +#: ../../howto/clinic.rst:339 msgid "" "If the existing C function calls :c:func:`PyArg_ParseTuple` (as opposed to :" "c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments are positional-" "only." msgstr "" -#: ../../howto/clinic.rst:342 +#: ../../howto/clinic.rst:343 msgid "" "To mark all parameters as positional-only in Argument Clinic, add a ``/`` on " "a line by itself after the last parameter, indented the same as the " "parameter lines." msgstr "" -#: ../../howto/clinic.rst:346 +#: ../../howto/clinic.rst:347 msgid "" "Currently this is all-or-nothing; either all parameters are positional-only, " "or none of them are. (In the future Argument Clinic may relax this " "restriction.)" msgstr "" -#: ../../howto/clinic.rst:366 +#: ../../howto/clinic.rst:367 msgid "" "It's helpful to write a per-parameter docstring for each parameter. But per-" "parameter docstrings are optional; you can skip this step if you prefer." msgstr "" -#: ../../howto/clinic.rst:370 +#: ../../howto/clinic.rst:371 msgid "" "Here's how to add a per-parameter docstring. The first line of the per-" "parameter docstring must be indented further than the parameter definition. " @@ -442,34 +442,34 @@ msgid "" "you wish." msgstr "" -#: ../../howto/clinic.rst:394 +#: ../../howto/clinic.rst:395 msgid "" "Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " "luck everything worked---your block now has output, and a ``.c.h`` file has " "been generated! Reopen the file in your text editor to see::" msgstr "" -#: ../../howto/clinic.rst:413 +#: ../../howto/clinic.rst:414 msgid "" "Obviously, if Argument Clinic didn't produce any output, it's because it " "found an error in your input. Keep fixing your errors and retrying until " "Argument Clinic processes your file without complaint." msgstr "" -#: ../../howto/clinic.rst:417 +#: ../../howto/clinic.rst:418 msgid "" "For readability, most of the glue code has been generated to a ``.c.h`` " "file. You'll need to include that in your original ``.c`` file, typically " "right after the clinic module block::" msgstr "" -#: ../../howto/clinic.rst:423 +#: ../../howto/clinic.rst:424 msgid "" "Double-check that the argument-parsing code Argument Clinic generated looks " "basically the same as the existing code." msgstr "" -#: ../../howto/clinic.rst:426 +#: ../../howto/clinic.rst:427 msgid "" "First, ensure both places use the same argument-parsing function. The " "existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" @@ -477,21 +477,21 @@ msgid "" "Clinic calls the *exact* same function." msgstr "" -#: ../../howto/clinic.rst:432 +#: ../../howto/clinic.rst:433 msgid "" "Second, the format string passed in to :c:func:`PyArg_ParseTuple` or :c:func:" "`PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" "written one in the existing function, up to the colon or semi-colon." msgstr "" -#: ../../howto/clinic.rst:437 +#: ../../howto/clinic.rst:438 msgid "" "(Argument Clinic always generates its format strings with a ``:`` followed " "by the name of the function. If the existing code's format string ends with " "``;``, to provide usage help, this change is harmless—don't worry about it.)" msgstr "" -#: ../../howto/clinic.rst:442 +#: ../../howto/clinic.rst:443 msgid "" "Third, for parameters whose format units require two arguments (like a " "length variable, or an encoding string, or a pointer to a conversion " @@ -499,27 +499,27 @@ msgid "" "two invocations." msgstr "" -#: ../../howto/clinic.rst:447 +#: ../../howto/clinic.rst:448 msgid "" "Fourth, inside the output portion of the block you'll find a preprocessor " "macro defining the appropriate static :c:type:`PyMethodDef` structure for " "this builtin::" msgstr "" -#: ../../howto/clinic.rst:454 +#: ../../howto/clinic.rst:455 msgid "" "This static structure should be *exactly* the same as the existing static :c:" "type:`PyMethodDef` structure for this builtin." msgstr "" -#: ../../howto/clinic.rst:457 +#: ../../howto/clinic.rst:458 msgid "" "If any of these items differ in *any way*, adjust your Argument Clinic " "function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " "the same." msgstr "" -#: ../../howto/clinic.rst:462 +#: ../../howto/clinic.rst:463 msgid "" "Notice that the last line of its output is the declaration of your \"impl\" " "function. This is where the builtin's implementation goes. Delete the " @@ -530,20 +530,20 @@ msgid "" "used different names for these variables, fix it." msgstr "" -#: ../../howto/clinic.rst:470 +#: ../../howto/clinic.rst:471 msgid "" "Let's reiterate, just because it's kind of weird. Your code should now look " "like this::" msgstr "" -#: ../../howto/clinic.rst:479 +#: ../../howto/clinic.rst:480 msgid "" "Argument Clinic generated the checksum line and the function prototype just " "above it. You should write the opening (and closing) curly braces for the " "function, and the implementation inside." msgstr "" -#: ../../howto/clinic.rst:524 +#: ../../howto/clinic.rst:525 msgid "" "Remember the macro with the :c:type:`PyMethodDef` structure for this " "function? Find the existing :c:type:`PyMethodDef` structure for this " @@ -553,81 +553,81 @@ msgid "" "to the implementation.)" msgstr "" -#: ../../howto/clinic.rst:531 +#: ../../howto/clinic.rst:532 msgid "" "Note that the body of the macro contains a trailing comma. So when you " "replace the existing static :c:type:`PyMethodDef` structure with the macro, " "*don't* add a comma to the end." msgstr "" -#: ../../howto/clinic.rst:544 +#: ../../howto/clinic.rst:545 msgid "" "Compile, then run the relevant portions of the regression-test suite. This " "change should not introduce any new compile-time warnings or errors, and " "there should be no externally visible change to Python's behavior." msgstr "" -#: ../../howto/clinic.rst:548 +#: ../../howto/clinic.rst:549 msgid "" "Well, except for one difference: ``inspect.signature()`` run on your " "function should now provide a valid signature!" msgstr "" -#: ../../howto/clinic.rst:551 +#: ../../howto/clinic.rst:552 msgid "" "Congratulations, you've ported your first function to work with Argument " "Clinic!" msgstr "" -#: ../../howto/clinic.rst:554 -msgid "Advanced Topics" +#: ../../howto/clinic.rst:556 +msgid "Advanced topics" msgstr "" -#: ../../howto/clinic.rst:556 +#: ../../howto/clinic.rst:558 msgid "" "Now that you've had some experience working with Argument Clinic, it's time " "for some advanced topics." msgstr "" -#: ../../howto/clinic.rst:561 +#: ../../howto/clinic.rst:563 msgid "Symbolic default values" msgstr "" -#: ../../howto/clinic.rst:563 +#: ../../howto/clinic.rst:565 msgid "" "The default value you provide for a parameter can't be any arbitrary " "expression. Currently the following are explicitly supported:" msgstr "" -#: ../../howto/clinic.rst:566 +#: ../../howto/clinic.rst:568 msgid "Numeric constants (integer and float)" msgstr "" -#: ../../howto/clinic.rst:567 +#: ../../howto/clinic.rst:569 msgid "String constants" msgstr "" -#: ../../howto/clinic.rst:568 +#: ../../howto/clinic.rst:570 msgid "``True``, ``False``, and ``None``" msgstr "" -#: ../../howto/clinic.rst:569 +#: ../../howto/clinic.rst:571 msgid "" "Simple symbolic constants like ``sys.maxsize``, which must start with the " "name of the module" msgstr "" -#: ../../howto/clinic.rst:572 +#: ../../howto/clinic.rst:574 msgid "" "(In the future, this may need to get even more elaborate, to allow full " "expressions like ``CONSTANT - 1``.)" msgstr "" -#: ../../howto/clinic.rst:577 +#: ../../howto/clinic.rst:579 msgid "Renaming the C functions and variables generated by Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:579 +#: ../../howto/clinic.rst:581 msgid "" "Argument Clinic automatically names the functions it generates for you. " "Occasionally this may cause a problem, if the generated name collides with " @@ -639,19 +639,19 @@ msgid "" "impl function." msgstr "" -#: ../../howto/clinic.rst:587 +#: ../../howto/clinic.rst:589 msgid "" "For example, if we wanted to rename the C function names generated for " "``pickle.Pickler.dump``, it'd look like this::" msgstr "" -#: ../../howto/clinic.rst:595 +#: ../../howto/clinic.rst:597 msgid "" "The base function would now be named ``pickler_dumper()``, and the impl " "function would now be named ``pickler_dumper_impl()``." msgstr "" -#: ../../howto/clinic.rst:599 +#: ../../howto/clinic.rst:601 msgid "" "Similarly, you may have a problem where you want to give a parameter a " "specific Python name, but that name may be inconvenient in C. Argument " @@ -659,21 +659,21 @@ msgid "" "using the same ``\"as\"`` syntax::" msgstr "" -#: ../../howto/clinic.rst:613 +#: ../../howto/clinic.rst:615 msgid "" "Here, the name used in Python (in the signature and the ``keywords`` array) " "would be ``file``, but the C variable would be named ``file_obj``." msgstr "" -#: ../../howto/clinic.rst:616 +#: ../../howto/clinic.rst:618 msgid "You can use this to rename the ``self`` parameter too!" msgstr "" -#: ../../howto/clinic.rst:620 +#: ../../howto/clinic.rst:622 msgid "Converting functions using PyArg_UnpackTuple" msgstr "" -#: ../../howto/clinic.rst:622 +#: ../../howto/clinic.rst:624 msgid "" "To convert a function parsing its arguments with :c:func:" "`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " @@ -682,17 +682,17 @@ msgid "" "a line by itself after the last argument)." msgstr "" -#: ../../howto/clinic.rst:628 +#: ../../howto/clinic.rst:630 msgid "" "Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " "will change soon." msgstr "" -#: ../../howto/clinic.rst:632 -msgid "Optional Groups" +#: ../../howto/clinic.rst:635 +msgid "Optional groups" msgstr "" -#: ../../howto/clinic.rst:634 +#: ../../howto/clinic.rst:637 msgid "" "Some legacy functions have a tricky approach to parsing their arguments: " "they count the number of positional arguments, then use a ``switch`` " @@ -703,7 +703,7 @@ msgid "" "created." msgstr "" -#: ../../howto/clinic.rst:641 +#: ../../howto/clinic.rst:644 msgid "" "While functions using this approach can often be converted to use :c:func:" "`PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " @@ -717,7 +717,7 @@ msgid "" "pass in ``x`` you may not pass in ``y`` either.)" msgstr "" -#: ../../howto/clinic.rst:653 +#: ../../howto/clinic.rst:656 msgid "" "In any case, the goal of Argument Clinic is to support argument parsing for " "all existing CPython builtins without changing their semantics. Therefore " @@ -727,7 +727,7 @@ msgid "" "required arguments. They can *only* be used with positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:661 +#: ../../howto/clinic.rst:664 msgid "" "Optional groups are *only* intended for use when converting functions that " "make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " @@ -738,7 +738,7 @@ msgid "" "possible." msgstr "" -#: ../../howto/clinic.rst:670 +#: ../../howto/clinic.rst:673 msgid "" "To specify an optional group, add a ``[`` on a line by itself before the " "parameters you wish to group together, and a ``]`` on a line by itself after " @@ -747,11 +747,11 @@ msgid "" "optional::" msgstr "" -#: ../../howto/clinic.rst:699 +#: ../../howto/clinic.rst:702 msgid "Notes:" msgstr "註解:" -#: ../../howto/clinic.rst:701 +#: ../../howto/clinic.rst:704 msgid "" "For every optional group, one additional parameter will be passed into the " "impl function representing the group. The parameter will be an int named " @@ -764,33 +764,33 @@ msgid "" "I mean whether or not the parameters received arguments in this invocation.)" msgstr "" -#: ../../howto/clinic.rst:712 +#: ../../howto/clinic.rst:715 msgid "" "If there are no required arguments, the optional groups will behave as if " "they're to the right of the required arguments." msgstr "" -#: ../../howto/clinic.rst:715 +#: ../../howto/clinic.rst:718 msgid "" "In the case of ambiguity, the argument parsing code favors parameters on the " "left (before the required parameters)." msgstr "" -#: ../../howto/clinic.rst:718 +#: ../../howto/clinic.rst:721 msgid "Optional groups can only contain positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:720 +#: ../../howto/clinic.rst:723 msgid "" "Optional groups are *only* intended for legacy code. Please do not use " "optional groups for new code." msgstr "" -#: ../../howto/clinic.rst:725 +#: ../../howto/clinic.rst:728 msgid "Using real Argument Clinic converters, instead of \"legacy converters\"" msgstr "" -#: ../../howto/clinic.rst:727 +#: ../../howto/clinic.rst:730 msgid "" "To save time, and to minimize how much you need to learn to achieve your " "first port to Argument Clinic, the walkthrough above tells you to use " @@ -799,38 +799,38 @@ msgid "" "be clear, their use is acceptable when porting code for Python 3.4." msgstr "" -#: ../../howto/clinic.rst:734 +#: ../../howto/clinic.rst:737 msgid "" "However, in the long term we probably want all our blocks to use Argument " "Clinic's real syntax for converters. Why? A couple reasons:" msgstr "" -#: ../../howto/clinic.rst:738 +#: ../../howto/clinic.rst:741 msgid "" "The proper converters are far easier to read and clearer in their intent." msgstr "" -#: ../../howto/clinic.rst:739 +#: ../../howto/clinic.rst:742 msgid "" "There are some format units that are unsupported as \"legacy converters\", " "because they require arguments, and the legacy converter syntax doesn't " "support specifying arguments." msgstr "" -#: ../../howto/clinic.rst:742 +#: ../../howto/clinic.rst:745 msgid "" "In the future we may have a new argument parsing library that isn't " "restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " "won't be available to parameters using legacy converters." msgstr "" -#: ../../howto/clinic.rst:746 +#: ../../howto/clinic.rst:749 msgid "" "Therefore, if you don't mind a little extra effort, please use the normal " "converters instead of legacy converters." msgstr "" -#: ../../howto/clinic.rst:749 +#: ../../howto/clinic.rst:752 msgid "" "In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " "like a Python function call. However, if there are no explicit arguments to " @@ -838,17 +838,17 @@ msgid "" "parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." msgstr "" -#: ../../howto/clinic.rst:755 +#: ../../howto/clinic.rst:758 msgid "" "All arguments to Argument Clinic converters are keyword-only. All Argument " "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:763 ../../howto/clinic.rst:1328 +#: ../../howto/clinic.rst:766 ../../howto/clinic.rst:1332 msgid "``c_default``" msgstr "``c_default``" -#: ../../howto/clinic.rst:759 +#: ../../howto/clinic.rst:762 msgid "" "The default value for this parameter when defined in C. Specifically, this " "will be the initializer for the variable declared in the \"parse " @@ -856,27 +856,27 @@ msgid "" "how to use this. Specified as a string." msgstr "" -#: ../../howto/clinic.rst:768 +#: ../../howto/clinic.rst:771 msgid "``annotation``" msgstr "``annotation``" -#: ../../howto/clinic.rst:766 +#: ../../howto/clinic.rst:769 msgid "" "The annotation value for this parameter. Not currently supported, because :" "pep:`8` mandates that the Python library may not use annotations." msgstr "" -#: ../../howto/clinic.rst:770 +#: ../../howto/clinic.rst:773 msgid "" "In addition, some converters accept additional arguments. Here is a list of " "these arguments, along with their meanings:" msgstr "" -#: ../../howto/clinic.rst:779 +#: ../../howto/clinic.rst:782 msgid "``accept``" msgstr "``accept``" -#: ../../howto/clinic.rst:774 +#: ../../howto/clinic.rst:777 msgid "" "A set of Python types (and possibly pseudo-types); this restricts the " "allowable Python argument to values of these types. (This is not a general-" @@ -884,68 +884,68 @@ msgid "" "shown in the legacy converter table.)" msgstr "" -#: ../../howto/clinic.rst:779 +#: ../../howto/clinic.rst:782 msgid "To accept ``None``, add ``NoneType`` to this set." msgstr "" -#: ../../howto/clinic.rst:784 +#: ../../howto/clinic.rst:787 msgid "``bitwise``" msgstr "``bitwise``" -#: ../../howto/clinic.rst:782 +#: ../../howto/clinic.rst:785 msgid "" "Only supported for unsigned integers. The native integer value of this " "Python argument will be written to the parameter without any range checking, " "even for negative values." msgstr "" -#: ../../howto/clinic.rst:789 ../../howto/clinic.rst:1342 +#: ../../howto/clinic.rst:792 ../../howto/clinic.rst:1346 msgid "``converter``" msgstr "``converter``" -#: ../../howto/clinic.rst:787 +#: ../../howto/clinic.rst:790 msgid "" "Only supported by the ``object`` converter. Specifies the name of a :ref:`C " "\"converter function\" ` to use to convert this object to a " "native type." msgstr "" -#: ../../howto/clinic.rst:794 +#: ../../howto/clinic.rst:797 msgid "``encoding``" msgstr "``encoding``" -#: ../../howto/clinic.rst:792 +#: ../../howto/clinic.rst:795 msgid "" "Only supported for strings. Specifies the encoding to use when converting " "this string from a Python str (Unicode) value into a C ``char *`` value." msgstr "" -#: ../../howto/clinic.rst:798 +#: ../../howto/clinic.rst:801 msgid "``subclass_of``" msgstr "``subclass_of``" -#: ../../howto/clinic.rst:797 +#: ../../howto/clinic.rst:800 msgid "" "Only supported for the ``object`` converter. Requires that the Python value " "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:803 ../../howto/clinic.rst:1314 +#: ../../howto/clinic.rst:806 ../../howto/clinic.rst:1318 msgid "``type``" msgstr "``type``" -#: ../../howto/clinic.rst:801 +#: ../../howto/clinic.rst:804 msgid "" "Only supported for the ``object`` and ``self`` converters. Specifies the C " "type that will be used to declare the variable. Default value is " "``\"PyObject *\"``." msgstr "" -#: ../../howto/clinic.rst:809 +#: ../../howto/clinic.rst:812 msgid "``zeroes``" msgstr "``zeroes``" -#: ../../howto/clinic.rst:806 +#: ../../howto/clinic.rst:809 msgid "" "Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " "permitted inside the value. The length of the string will be passed in to " @@ -953,7 +953,7 @@ msgid "" "``_length``." msgstr "" -#: ../../howto/clinic.rst:811 +#: ../../howto/clinic.rst:814 msgid "" "Please note, not every possible combination of arguments will work. Usually " "these arguments are implemented by specific ``PyArg_ParseTuple`` *format " @@ -964,350 +964,350 @@ msgid "" "least, not yet.)" msgstr "" -#: ../../howto/clinic.rst:819 +#: ../../howto/clinic.rst:822 msgid "" "Below is a table showing the mapping of legacy converters into real Argument " "Clinic converters. On the left is the legacy converter, on the right is the " "text you'd replace it with." msgstr "" -#: ../../howto/clinic.rst:824 +#: ../../howto/clinic.rst:827 msgid "``'B'``" msgstr "``'B'``" -#: ../../howto/clinic.rst:824 +#: ../../howto/clinic.rst:827 msgid "``unsigned_char(bitwise=True)``" msgstr "``unsigned_char(bitwise=True)``" -#: ../../howto/clinic.rst:825 +#: ../../howto/clinic.rst:828 msgid "``'b'``" msgstr "``'b'``" -#: ../../howto/clinic.rst:825 +#: ../../howto/clinic.rst:828 msgid "``unsigned_char``" msgstr "``unsigned_char``" -#: ../../howto/clinic.rst:826 +#: ../../howto/clinic.rst:829 msgid "``'c'``" msgstr "``'c'``" -#: ../../howto/clinic.rst:826 +#: ../../howto/clinic.rst:829 msgid "``char``" msgstr "``char``" -#: ../../howto/clinic.rst:827 +#: ../../howto/clinic.rst:830 msgid "``'C'``" msgstr "``'C'``" -#: ../../howto/clinic.rst:827 +#: ../../howto/clinic.rst:830 msgid "``int(accept={str})``" msgstr "``int(accept={str})``" -#: ../../howto/clinic.rst:828 +#: ../../howto/clinic.rst:831 msgid "``'d'``" msgstr "``'d'``" -#: ../../howto/clinic.rst:828 +#: ../../howto/clinic.rst:831 msgid "``double``" msgstr "``double``" -#: ../../howto/clinic.rst:829 +#: ../../howto/clinic.rst:832 msgid "``'D'``" msgstr "``'D'``" -#: ../../howto/clinic.rst:829 +#: ../../howto/clinic.rst:832 msgid "``Py_complex``" msgstr "``Py_complex``" -#: ../../howto/clinic.rst:830 +#: ../../howto/clinic.rst:833 msgid "``'es'``" msgstr "``'es'``" -#: ../../howto/clinic.rst:830 +#: ../../howto/clinic.rst:833 msgid "``str(encoding='name_of_encoding')``" msgstr "``str(encoding='name_of_encoding')``" -#: ../../howto/clinic.rst:831 +#: ../../howto/clinic.rst:834 msgid "``'es#'``" msgstr "``'es#'``" -#: ../../howto/clinic.rst:831 +#: ../../howto/clinic.rst:834 msgid "``str(encoding='name_of_encoding', zeroes=True)``" msgstr "``str(encoding='name_of_encoding', zeroes=True)``" -#: ../../howto/clinic.rst:832 +#: ../../howto/clinic.rst:835 msgid "``'et'``" msgstr "``'et'``" -#: ../../howto/clinic.rst:832 +#: ../../howto/clinic.rst:835 msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -#: ../../howto/clinic.rst:833 +#: ../../howto/clinic.rst:836 msgid "``'et#'``" msgstr "``'et#'``" -#: ../../howto/clinic.rst:833 +#: ../../howto/clinic.rst:836 msgid "" "``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " "zeroes=True)``" msgstr "" -#: ../../howto/clinic.rst:834 +#: ../../howto/clinic.rst:837 msgid "``'f'``" msgstr "``'f'``" -#: ../../howto/clinic.rst:834 +#: ../../howto/clinic.rst:837 msgid "``float``" msgstr "``float``" -#: ../../howto/clinic.rst:835 +#: ../../howto/clinic.rst:838 msgid "``'h'``" msgstr "``'h'``" -#: ../../howto/clinic.rst:835 +#: ../../howto/clinic.rst:838 msgid "``short``" msgstr "``short``" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:839 msgid "``'H'``" msgstr "``'H'``" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:839 msgid "``unsigned_short(bitwise=True)``" msgstr "``unsigned_short(bitwise=True)``" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:840 msgid "``'i'``" msgstr "``'i'``" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:840 msgid "``int``" msgstr "``int``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:841 msgid "``'I'``" msgstr "``'I'``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:841 msgid "``unsigned_int(bitwise=True)``" msgstr "``unsigned_int(bitwise=True)``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:842 msgid "``'k'``" msgstr "``'k'``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:842 msgid "``unsigned_long(bitwise=True)``" msgstr "``unsigned_long(bitwise=True)``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:843 msgid "``'K'``" msgstr "``'K'``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:843 msgid "``unsigned_long_long(bitwise=True)``" msgstr "``unsigned_long_long(bitwise=True)``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:844 msgid "``'l'``" msgstr "``'l'``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:844 msgid "``long``" msgstr "``long``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:845 msgid "``'L'``" msgstr "``'L'``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:845 msgid "``long long``" msgstr "``long long``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:846 msgid "``'n'``" msgstr "``'n'``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:846 msgid "``Py_ssize_t``" msgstr "``Py_ssize_t``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:847 msgid "``'O'``" msgstr "``'O'``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:847 msgid "``object``" msgstr "``object``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:848 msgid "``'O!'``" msgstr "``'O!'``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:848 msgid "``object(subclass_of='&PySomething_Type')``" msgstr "``object(subclass_of='&PySomething_Type')``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:849 msgid "``'O&'``" msgstr "``'O&'``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:849 msgid "``object(converter='name_of_c_function')``" msgstr "``object(converter='name_of_c_function')``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:850 msgid "``'p'``" msgstr "``'p'``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:850 msgid "``bool``" msgstr "``bool``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:851 msgid "``'S'``" msgstr "``'S'``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:851 msgid "``PyBytesObject``" msgstr "``PyBytesObject``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:852 msgid "``'s'``" msgstr "``'s'``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:852 msgid "``str``" msgstr "``str``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:853 msgid "``'s#'``" msgstr "``'s#'``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:853 msgid "``str(zeroes=True)``" msgstr "``str(zeroes=True)``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:854 msgid "``'s*'``" msgstr "``'s*'``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:854 msgid "``Py_buffer(accept={buffer, str})``" msgstr "``Py_buffer(accept={buffer, str})``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:855 msgid "``'U'``" msgstr "``'U'``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:855 msgid "``unicode``" msgstr "``unicode``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:856 msgid "``'u'``" msgstr "``'u'``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:856 msgid "``Py_UNICODE``" msgstr "``Py_UNICODE``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:857 msgid "``'u#'``" msgstr "``'u#'``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:857 msgid "``Py_UNICODE(zeroes=True)``" msgstr "``Py_UNICODE(zeroes=True)``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:858 msgid "``'w*'``" msgstr "``'w*'``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:858 msgid "``Py_buffer(accept={rwbuffer})``" msgstr "``Py_buffer(accept={rwbuffer})``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:859 msgid "``'Y'``" msgstr "``'Y'``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:859 msgid "``PyByteArrayObject``" msgstr "``PyByteArrayObject``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:860 msgid "``'y'``" msgstr "``'y'``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:860 msgid "``str(accept={bytes})``" msgstr "``str(accept={bytes})``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:861 msgid "``'y#'``" msgstr "``'y#'``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:861 msgid "``str(accept={robuffer}, zeroes=True)``" msgstr "``str(accept={robuffer}, zeroes=True)``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:862 msgid "``'y*'``" msgstr "``'y*'``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:862 msgid "``Py_buffer``" msgstr "``Py_buffer``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:863 msgid "``'Z'``" msgstr "``'Z'``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:863 msgid "``Py_UNICODE(accept={str, NoneType})``" msgstr "``Py_UNICODE(accept={str, NoneType})``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:864 msgid "``'Z#'``" msgstr "``'Z#'``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:864 msgid "``Py_UNICODE(accept={str, NoneType}, zeroes=True)``" msgstr "``Py_UNICODE(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:865 msgid "``'z'``" msgstr "``'z'``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:865 msgid "``str(accept={str, NoneType})``" msgstr "``str(accept={str, NoneType})``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:866 msgid "``'z#'``" msgstr "``'z#'``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:866 msgid "``str(accept={str, NoneType}, zeroes=True)``" msgstr "``str(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:867 msgid "``'z*'``" msgstr "``'z*'``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:867 msgid "``Py_buffer(accept={buffer, str, NoneType})``" msgstr "``Py_buffer(accept={buffer, str, NoneType})``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:870 msgid "" "As an example, here's our sample ``pickle.Pickler.dump`` using the proper " "converter::" msgstr "" -#: ../../howto/clinic.rst:880 +#: ../../howto/clinic.rst:883 msgid "" "One advantage of real converters is that they're more flexible than legacy " "converters. For example, the ``unsigned_int`` converter (and all the " @@ -1316,7 +1316,7 @@ msgid "" "negative numbers. You just can't do that with a legacy converter!" msgstr "" -#: ../../howto/clinic.rst:886 +#: ../../howto/clinic.rst:889 msgid "" "Argument Clinic will show you all the converters it has available. For each " "converter it'll show you all the parameters it accepts, along with the " @@ -1324,11 +1324,11 @@ msgid "" "converters`` to see the full list." msgstr "" -#: ../../howto/clinic.rst:892 +#: ../../howto/clinic.rst:896 msgid "Py_buffer" msgstr "Py_buffer" -#: ../../howto/clinic.rst:894 +#: ../../howto/clinic.rst:898 msgid "" "When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " "or ``'z*'`` legacy converters), you *must* not call :c:func:" @@ -1336,17 +1336,17 @@ msgid "" "that does it for you (in the parsing function)." msgstr "" -#: ../../howto/clinic.rst:902 +#: ../../howto/clinic.rst:905 msgid "Advanced converters" msgstr "" -#: ../../howto/clinic.rst:904 +#: ../../howto/clinic.rst:907 msgid "" "Remember those format units you skipped for your first time because they " "were advanced? Here's how to handle those too." msgstr "" -#: ../../howto/clinic.rst:907 +#: ../../howto/clinic.rst:910 msgid "" "The trick is, all those format units take arguments—either conversion " "functions, or types, or strings specifying an encoding. (But \"legacy " @@ -1357,7 +1357,7 @@ msgid "" "units that start with ``e``)." msgstr "" -#: ../../howto/clinic.rst:915 +#: ../../howto/clinic.rst:918 msgid "" "When using ``subclass_of``, you may also want to use the other custom " "argument for ``object()``: ``type``, which lets you set the type actually " @@ -1366,7 +1366,7 @@ msgid "" "``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." msgstr "" -#: ../../howto/clinic.rst:921 +#: ../../howto/clinic.rst:924 msgid "" "One possible problem with using Argument Clinic: it takes away some possible " "flexibility for the format units starting with ``e``. When writing a " @@ -1379,31 +1379,31 @@ msgid "" "strings for parameters whose format units start with ``e``." msgstr "" -#: ../../howto/clinic.rst:934 +#: ../../howto/clinic.rst:937 msgid "Parameter default values" msgstr "" -#: ../../howto/clinic.rst:936 +#: ../../howto/clinic.rst:939 msgid "" "Default values for parameters can be any of a number of values. At their " "simplest, they can be string, int, or float literals:" msgstr "" -#: ../../howto/clinic.rst:945 +#: ../../howto/clinic.rst:948 msgid "They can also use any of Python's built-in constants:" msgstr "" -#: ../../howto/clinic.rst:953 +#: ../../howto/clinic.rst:956 msgid "" "There's also special support for a default value of ``NULL``, and for simple " "expressions, documented in the following sections." msgstr "" -#: ../../howto/clinic.rst:958 +#: ../../howto/clinic.rst:961 msgid "The ``NULL`` default value" msgstr "" -#: ../../howto/clinic.rst:960 +#: ../../howto/clinic.rst:963 msgid "" "For string and object parameters, you can set them to ``None`` to indicate " "that there's no default. However, that means the C variable will be " @@ -1413,11 +1413,11 @@ msgid "" "with ``NULL``." msgstr "" -#: ../../howto/clinic.rst:968 +#: ../../howto/clinic.rst:972 msgid "Expressions specified as default values" msgstr "" -#: ../../howto/clinic.rst:970 +#: ../../howto/clinic.rst:974 msgid "" "The default value for a parameter can be more than just a literal value. It " "can be an entire expression, using math operators and looking up attributes " @@ -1425,11 +1425,11 @@ msgid "" "obvious semantics." msgstr "" -#: ../../howto/clinic.rst:975 +#: ../../howto/clinic.rst:979 msgid "Consider the following example:" msgstr "" -#: ../../howto/clinic.rst:981 +#: ../../howto/clinic.rst:985 msgid "" "``sys.maxsize`` can have different values on different platforms. Therefore " "Argument Clinic can't simply evaluate that expression locally and hard-code " @@ -1437,14 +1437,14 @@ msgid "" "at runtime, when the user asks for the function's signature." msgstr "" -#: ../../howto/clinic.rst:986 +#: ../../howto/clinic.rst:990 msgid "" "What namespace is available when the expression is evaluated? It's " "evaluated in the context of the module the builtin came from. So, if your " "module has an attribute called \"``max_widgets``\", you may simply use it:" msgstr "" -#: ../../howto/clinic.rst:994 +#: ../../howto/clinic.rst:998 msgid "" "If the symbol isn't found in the current module, it fails over to looking in " "``sys.modules``. That's how it can find ``sys.maxsize`` for example. " @@ -1453,7 +1453,7 @@ msgid "" "Python itself.)" msgstr "" -#: ../../howto/clinic.rst:999 +#: ../../howto/clinic.rst:1003 msgid "" "Evaluating default values only at runtime means Argument Clinic can't " "compute the correct equivalent C default value. So you need to tell it " @@ -1461,7 +1461,7 @@ msgid "" "expression in C, using the ``c_default`` parameter to the converter:" msgstr "" -#: ../../howto/clinic.rst:1008 +#: ../../howto/clinic.rst:1012 msgid "" "Another complication: Argument Clinic can't know in advance whether or not " "the expression you supply is valid. It parses it to make sure it looks " @@ -1469,38 +1469,38 @@ msgid "" "expressions to specify values that are guaranteed to be valid at runtime!" msgstr "" -#: ../../howto/clinic.rst:1013 +#: ../../howto/clinic.rst:1017 msgid "" "Finally, because expressions must be representable as static C values, there " "are many restrictions on legal expressions. Here's a list of Python " "features you're not permitted to use:" msgstr "" -#: ../../howto/clinic.rst:1017 +#: ../../howto/clinic.rst:1021 msgid "Function calls." msgstr "" -#: ../../howto/clinic.rst:1018 +#: ../../howto/clinic.rst:1022 msgid "Inline if statements (``3 if foo else 5``)." msgstr "" -#: ../../howto/clinic.rst:1019 +#: ../../howto/clinic.rst:1023 msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." msgstr "" -#: ../../howto/clinic.rst:1020 +#: ../../howto/clinic.rst:1024 msgid "List/set/dict comprehensions and generator expressions." msgstr "" -#: ../../howto/clinic.rst:1021 +#: ../../howto/clinic.rst:1025 msgid "Tuple/list/set/dict literals." msgstr "" -#: ../../howto/clinic.rst:1026 +#: ../../howto/clinic.rst:1029 msgid "Using a return converter" msgstr "" -#: ../../howto/clinic.rst:1028 +#: ../../howto/clinic.rst:1031 msgid "" "By default, the impl function Argument Clinic generates for you returns :c:" "type:`PyObject * `. But your C function often computes some C " @@ -1510,38 +1510,38 @@ msgid "" "a Python type too?" msgstr "" -#: ../../howto/clinic.rst:1036 +#: ../../howto/clinic.rst:1039 msgid "" "That's what a \"return converter\" does. It changes your impl function to " "return some C type, then adds code to the generated (non-impl) function to " "handle converting that value into the appropriate :c:type:`!PyObject *`." msgstr "" -#: ../../howto/clinic.rst:1040 +#: ../../howto/clinic.rst:1043 msgid "" "The syntax for return converters is similar to that of parameter converters. " "You specify the return converter like it was a return annotation on the " "function itself, using ``->`` notation." msgstr "" -#: ../../howto/clinic.rst:1044 +#: ../../howto/clinic.rst:1047 msgid "For example:" msgstr "" -#: ../../howto/clinic.rst:1057 +#: ../../howto/clinic.rst:1060 msgid "" "Return converters behave much the same as parameter converters; they take " "arguments, the arguments are all keyword-only, and if you're not changing " "any of the default arguments you can omit the parentheses." msgstr "" -#: ../../howto/clinic.rst:1061 +#: ../../howto/clinic.rst:1064 msgid "" "(If you use both ``\"as\"`` *and* a return converter for your function, the " "``\"as\"`` should come before the return converter.)" msgstr "" -#: ../../howto/clinic.rst:1064 +#: ../../howto/clinic.rst:1067 msgid "" "There's one additional complication when using return converters: how do you " "indicate an error has occurred? Normally, a function returns a valid (non-" @@ -1554,17 +1554,17 @@ msgid "" "you return like normal." msgstr "" -#: ../../howto/clinic.rst:1073 +#: ../../howto/clinic.rst:1076 msgid "Currently Argument Clinic supports only a few return converters:" msgstr "" -#: ../../howto/clinic.rst:1087 +#: ../../howto/clinic.rst:1090 msgid "" "None of these take parameters. For all of these, return ``-1`` to indicate " "error." msgstr "" -#: ../../howto/clinic.rst:1090 +#: ../../howto/clinic.rst:1093 msgid "" "(There's also an experimental ``NoneType`` converter, which lets you return " "``Py_None`` on success or ``NULL`` on failure, without having to increment " @@ -1572,117 +1572,117 @@ msgid "" "be worth using.)" msgstr "" -#: ../../howto/clinic.rst:1095 +#: ../../howto/clinic.rst:1098 msgid "" "To see all the return converters Argument Clinic supports, along with their " "parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " "the full list." msgstr "" -#: ../../howto/clinic.rst:1101 +#: ../../howto/clinic.rst:1104 msgid "Cloning existing functions" msgstr "" -#: ../../howto/clinic.rst:1103 +#: ../../howto/clinic.rst:1106 msgid "" "If you have a number of functions that look similar, you may be able to use " "Clinic's \"clone\" feature. When you clone an existing function, you reuse:" msgstr "" -#: ../../howto/clinic.rst:1107 +#: ../../howto/clinic.rst:1110 msgid "its parameters, including" msgstr "" -#: ../../howto/clinic.rst:1109 +#: ../../howto/clinic.rst:1112 msgid "their names," msgstr "" -#: ../../howto/clinic.rst:1111 +#: ../../howto/clinic.rst:1114 msgid "their converters, with all parameters," msgstr "" -#: ../../howto/clinic.rst:1113 +#: ../../howto/clinic.rst:1116 msgid "their default values," msgstr "" -#: ../../howto/clinic.rst:1115 +#: ../../howto/clinic.rst:1118 msgid "their per-parameter docstrings," msgstr "" -#: ../../howto/clinic.rst:1117 +#: ../../howto/clinic.rst:1120 msgid "" "their *kind* (whether they're positional only, positional or keyword, or " "keyword only), and" msgstr "" -#: ../../howto/clinic.rst:1120 +#: ../../howto/clinic.rst:1123 msgid "its return converter." msgstr "" -#: ../../howto/clinic.rst:1122 +#: ../../howto/clinic.rst:1125 msgid "" "The only thing not copied from the original function is its docstring; the " "syntax allows you to specify a new docstring." msgstr "" -#: ../../howto/clinic.rst:1125 +#: ../../howto/clinic.rst:1128 msgid "Here's the syntax for cloning a function::" msgstr "" -#: ../../howto/clinic.rst:1133 +#: ../../howto/clinic.rst:1136 msgid "" "(The functions can be in different modules or classes. I wrote ``module." "class`` in the sample just to illustrate that you must use the full path to " "*both* functions.)" msgstr "" -#: ../../howto/clinic.rst:1137 +#: ../../howto/clinic.rst:1140 msgid "" "Sorry, there's no syntax for partially cloning a function, or cloning a " "function then modifying it. Cloning is an all-or nothing proposition." msgstr "" -#: ../../howto/clinic.rst:1140 +#: ../../howto/clinic.rst:1143 msgid "" "Also, the function you are cloning from must have been previously defined in " "the current file." msgstr "" -#: ../../howto/clinic.rst:1144 +#: ../../howto/clinic.rst:1148 msgid "Calling Python code" msgstr "" -#: ../../howto/clinic.rst:1146 +#: ../../howto/clinic.rst:1150 msgid "" "The rest of the advanced topics require you to write Python code which lives " "inside your C file and modifies Argument Clinic's runtime state. This is " "simple: you simply define a Python block." msgstr "" -#: ../../howto/clinic.rst:1150 +#: ../../howto/clinic.rst:1154 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1157 +#: ../../howto/clinic.rst:1161 msgid "" "All the code inside the Python block is executed at the time it's parsed. " "All text written to stdout inside the block is redirected into the " "\"output\" after the block." msgstr "" -#: ../../howto/clinic.rst:1161 +#: ../../howto/clinic.rst:1165 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1172 +#: ../../howto/clinic.rst:1176 msgid "Using a \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1174 +#: ../../howto/clinic.rst:1178 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " @@ -1693,13 +1693,13 @@ msgid "" "a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1183 +#: ../../howto/clinic.rst:1187 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1186 +#: ../../howto/clinic.rst:1190 msgid "" "How do you specify the custom type you want to cast ``self`` to? If you only " "have one or two functions with the same type for ``self``, you can directly " @@ -1707,18 +1707,18 @@ msgid "" "want to use as the ``type`` parameter::" msgstr "" -#: ../../howto/clinic.rst:1202 +#: ../../howto/clinic.rst:1206 msgid "" "On the other hand, if you have a lot of functions that will use the same " "type for ``self``, it's best to create your own converter, subclassing " "``self_converter`` but overwriting the ``type`` member::" msgstr "" -#: ../../howto/clinic.rst:1224 +#: ../../howto/clinic.rst:1228 msgid "Using a \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1226 +#: ../../howto/clinic.rst:1230 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1728,25 +1728,25 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1232 +#: ../../howto/clinic.rst:1236 msgid "" "Example from ``Modules/zlibmodule.c``. First, ``defining_class`` is added " "to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1244 +#: ../../howto/clinic.rst:1248 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1254 +#: ../../howto/clinic.rst:1258 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1260 +#: ../../howto/clinic.rst:1264 msgid "" "Each method may only have one argument using this converter, and it must " "appear after ``self``, or, if ``self`` is not used, as the first argument. " @@ -1754,13 +1754,13 @@ msgid "" "appear in the ``__text_signature__``." msgstr "" -#: ../../howto/clinic.rst:1265 +#: ../../howto/clinic.rst:1269 msgid "" "The ``defining_class`` converter is not compatible with ``__init__`` and " "``__new__`` methods, which cannot use the ``METH_METHOD`` convention." msgstr "" -#: ../../howto/clinic.rst:1268 +#: ../../howto/clinic.rst:1272 msgid "" "It is not possible to use ``defining_class`` with slot methods. In order to " "fetch the module state from such methods, use :c:func:" @@ -1769,15 +1769,15 @@ msgid "" "``setattro`` slot method in ``Modules/_threadmodule.c``::" msgstr "" -#: ../../howto/clinic.rst:1283 +#: ../../howto/clinic.rst:1287 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1287 +#: ../../howto/clinic.rst:1291 msgid "Writing a custom converter" msgstr "" -#: ../../howto/clinic.rst:1289 +#: ../../howto/clinic.rst:1293 msgid "" "As we hinted at in the previous section... you can write your own " "converters! A converter is simply a Python class that inherits from " @@ -1786,7 +1786,7 @@ msgid "" "a :c:func:`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1295 +#: ../../howto/clinic.rst:1299 msgid "" "Your converter class should be named ``*something*_converter``. If the name " "follows this convention, then your converter class will be automatically " @@ -1795,7 +1795,7 @@ msgid "" "metaclass.)" msgstr "" -#: ../../howto/clinic.rst:1301 +#: ../../howto/clinic.rst:1305 msgid "" "You shouldn't subclass ``CConverter.__init__``. Instead, you should write a " "``converter_init()`` function. ``converter_init()`` always accepts a " @@ -1804,50 +1804,50 @@ msgid "" "passed along to your ``converter_init()``." msgstr "" -#: ../../howto/clinic.rst:1308 +#: ../../howto/clinic.rst:1312 msgid "" "There are some additional members of ``CConverter`` you may wish to specify " "in your subclass. Here's the current list:" msgstr "" -#: ../../howto/clinic.rst:1312 +#: ../../howto/clinic.rst:1316 msgid "" "The C type to use for this variable. ``type`` should be a Python string " "specifying the type, e.g. ``int``. If this is a pointer type, the type " "string should end with ``' *'``." msgstr "" -#: ../../howto/clinic.rst:1318 +#: ../../howto/clinic.rst:1322 msgid "``default``" msgstr "``default``" -#: ../../howto/clinic.rst:1317 +#: ../../howto/clinic.rst:1321 msgid "" "The Python default value for this parameter, as a Python value. Or the magic " "value ``unspecified`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1323 +#: ../../howto/clinic.rst:1327 msgid "``py_default``" msgstr "``py_default``" -#: ../../howto/clinic.rst:1321 +#: ../../howto/clinic.rst:1325 msgid "" "``default`` as it should appear in Python code, as a string. Or ``None`` if " "there is no default." msgstr "" -#: ../../howto/clinic.rst:1326 +#: ../../howto/clinic.rst:1330 msgid "" "``default`` as it should appear in C code, as a string. Or ``None`` if there " "is no default." msgstr "" -#: ../../howto/clinic.rst:1339 +#: ../../howto/clinic.rst:1343 msgid "``c_ignored_default``" msgstr "``c_ignored_default``" -#: ../../howto/clinic.rst:1331 +#: ../../howto/clinic.rst:1335 msgid "" "The default value used to initialize the C variable when there is no " "default, but not specifying a default may result in an \"uninitialized " @@ -1858,37 +1858,37 @@ msgid "" "non-empty string." msgstr "" -#: ../../howto/clinic.rst:1342 +#: ../../howto/clinic.rst:1346 msgid "The name of the C converter function, as a string." msgstr "" -#: ../../howto/clinic.rst:1347 +#: ../../howto/clinic.rst:1351 msgid "``impl_by_reference``" msgstr "``impl_by_reference``" -#: ../../howto/clinic.rst:1345 +#: ../../howto/clinic.rst:1349 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into the impl function." msgstr "" -#: ../../howto/clinic.rst:1353 +#: ../../howto/clinic.rst:1357 msgid "``parse_by_reference``" msgstr "``parse_by_reference``" -#: ../../howto/clinic.rst:1350 +#: ../../howto/clinic.rst:1354 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into :c:func:`PyArg_ParseTuple`." msgstr "" -#: ../../howto/clinic.rst:1355 +#: ../../howto/clinic.rst:1359 msgid "" "Here's the simplest example of a custom converter, from ``Modules/zlibmodule." "c``::" msgstr "" -#: ../../howto/clinic.rst:1366 +#: ../../howto/clinic.rst:1370 msgid "" "This block adds a converter to Argument Clinic named ``ssize_t``. " "Parameters declared as ``ssize_t`` will be declared as type :c:type:" @@ -1897,25 +1897,25 @@ msgid "" "automatically support default values." msgstr "" -#: ../../howto/clinic.rst:1372 +#: ../../howto/clinic.rst:1376 msgid "" "More sophisticated custom converters can insert custom C code to handle " "initialization and cleanup. You can see more examples of custom converters " "in the CPython source tree; grep the C files for the string ``CConverter``." msgstr "" -#: ../../howto/clinic.rst:1378 +#: ../../howto/clinic.rst:1383 msgid "Writing a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1380 +#: ../../howto/clinic.rst:1385 msgid "" "Writing a custom return converter is much like writing a custom converter. " "Except it's somewhat simpler, because return converters are themselves much " "simpler." msgstr "" -#: ../../howto/clinic.rst:1384 +#: ../../howto/clinic.rst:1389 msgid "" "Return converters must subclass ``CReturnConverter``. There are no examples " "yet of custom return converters, because they are not widely used yet. If " @@ -1924,59 +1924,59 @@ msgid "" "its subclasses." msgstr "" -#: ../../howto/clinic.rst:1392 +#: ../../howto/clinic.rst:1398 msgid "METH_O and METH_NOARGS" msgstr "" -#: ../../howto/clinic.rst:1394 +#: ../../howto/clinic.rst:1400 msgid "" "To convert a function using ``METH_O``, make sure the function's single " "argument is using the ``object`` converter, and mark the arguments as " "positional-only::" msgstr "" -#: ../../howto/clinic.rst:1406 +#: ../../howto/clinic.rst:1412 msgid "" "To convert a function using ``METH_NOARGS``, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1409 +#: ../../howto/clinic.rst:1415 msgid "" "You can still use a self converter, a return converter, and specify a " "``type`` argument to the object converter for ``METH_O``." msgstr "" -#: ../../howto/clinic.rst:1413 +#: ../../howto/clinic.rst:1420 msgid "tp_new and tp_init functions" msgstr "" -#: ../../howto/clinic.rst:1415 +#: ../../howto/clinic.rst:1422 msgid "" "You can convert ``tp_new`` and ``tp_init`` functions. Just name them " "``__new__`` or ``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1418 +#: ../../howto/clinic.rst:1425 msgid "" "The function name generated for ``__new__`` doesn't end in ``__new__`` like " "it would by default. It's just the name of the class, converted into a " "valid C identifier." msgstr "" -#: ../../howto/clinic.rst:1422 +#: ../../howto/clinic.rst:1429 msgid "No ``PyMethodDef`` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1424 +#: ../../howto/clinic.rst:1431 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1426 +#: ../../howto/clinic.rst:1433 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1428 +#: ../../howto/clinic.rst:1435 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -1985,11 +1985,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1435 +#: ../../howto/clinic.rst:1443 msgid "Changing and redirecting Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1437 +#: ../../howto/clinic.rst:1445 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -1998,7 +1998,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1443 +#: ../../howto/clinic.rst:1451 msgid "" "While changing Clinic's output in this manner can be a boon to readability, " "it may result in Clinic code using types before they are defined, or your " @@ -2010,15 +2010,15 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1452 +#: ../../howto/clinic.rst:1460 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1479 +#: ../../howto/clinic.rst:1487 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1455 +#: ../../howto/clinic.rst:1463 msgid "" "A field, in this context, is a subsection of Clinic's output. For example, " "the ``#define`` for the ``PyMethodDef`` structure is a field, called " @@ -2026,7 +2026,7 @@ msgid "" "function definition:" msgstr "" -#: ../../howto/clinic.rst:1470 +#: ../../howto/clinic.rst:1478 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2039,45 +2039,45 @@ msgid "" "``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1513 +#: ../../howto/clinic.rst:1521 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1482 +#: ../../howto/clinic.rst:1490 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1487 ../../howto/clinic.rst:1562 -#: ../../howto/clinic.rst:1640 +#: ../../howto/clinic.rst:1495 ../../howto/clinic.rst:1570 +#: ../../howto/clinic.rst:1648 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1486 +#: ../../howto/clinic.rst:1494 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1493 ../../howto/clinic.rst:1589 -#: ../../howto/clinic.rst:1643 +#: ../../howto/clinic.rst:1501 ../../howto/clinic.rst:1597 +#: ../../howto/clinic.rst:1651 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1490 +#: ../../howto/clinic.rst:1498 msgid "" "A text buffer where you can save text for later. Text sent here is appended " "to the end of any existing text. It's an error to have any text left in the " "buffer when Clinic finishes processing a file." msgstr "" -#: ../../howto/clinic.rst:1504 ../../howto/clinic.rst:1575 -#: ../../howto/clinic.rst:1669 +#: ../../howto/clinic.rst:1512 ../../howto/clinic.rst:1583 +#: ../../howto/clinic.rst:1677 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1496 +#: ../../howto/clinic.rst:1504 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " @@ -2086,65 +2086,65 @@ msgid "" "for ``_pickle.c`` would be written to ``_pickle.clinic.c``.)" msgstr "" -#: ../../howto/clinic.rst:1503 +#: ../../howto/clinic.rst:1511 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1509 ../../howto/clinic.rst:1602 -#: ../../howto/clinic.rst:1673 +#: ../../howto/clinic.rst:1517 ../../howto/clinic.rst:1610 +#: ../../howto/clinic.rst:1681 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1507 +#: ../../howto/clinic.rst:1515 msgid "" "A buffer like ``buffer``. However, a two-pass buffer can only be dumped " "once, and it prints out all text sent to it during all processing, even from " "Clinic blocks *after* the dumping point." msgstr "" -#: ../../howto/clinic.rst:1513 ../../howto/clinic.rst:1636 +#: ../../howto/clinic.rst:1521 ../../howto/clinic.rst:1644 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1512 +#: ../../howto/clinic.rst:1520 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1515 +#: ../../howto/clinic.rst:1523 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1517 +#: ../../howto/clinic.rst:1525 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1523 +#: ../../howto/clinic.rst:1531 msgid "" "This dumps the current contents of the named destination into the output of " "the current block, and empties it. This only works with ``buffer`` and " "``two-pass`` destinations." msgstr "" -#: ../../howto/clinic.rst:1527 +#: ../../howto/clinic.rst:1535 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1534 +#: ../../howto/clinic.rst:1542 msgid "" "This tells Clinic to output *field* to *destination*. ``output`` also " "supports a special meta-destination, called ``everything``, which tells " "Clinic to output *all* fields to that *destination*." msgstr "" -#: ../../howto/clinic.rst:1538 +#: ../../howto/clinic.rst:1546 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1547 +#: ../../howto/clinic.rst:1555 msgid "" "``output push`` and ``output pop`` allow you to push and pop configurations " "on an internal configuration stack, so that you can temporarily modify the " @@ -2153,25 +2153,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1554 +#: ../../howto/clinic.rst:1562 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1558 +#: ../../howto/clinic.rst:1566 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1561 +#: ../../howto/clinic.rst:1569 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1565 +#: ../../howto/clinic.rst:1573 msgid "" "Designed to write everything to the \"clinic file\" that it can. You then " "``#include`` this file near the top of your file. You may need to rearrange " @@ -2179,17 +2179,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1571 +#: ../../howto/clinic.rst:1579 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1575 +#: ../../howto/clinic.rst:1583 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1578 +#: ../../howto/clinic.rst:1586 msgid "" "Save up most of the output from Clinic, to be written into your file near " "the end. For Python files implementing modules or builtin types, it's " @@ -2199,14 +2199,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1587 +#: ../../howto/clinic.rst:1595 msgid "" "Suppress the ``parser_prototype``, ``impl_prototype``, and " "``docstring_prototype``, write the ``impl_definition`` to ``block``, and " "write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1592 +#: ../../howto/clinic.rst:1600 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2215,18 +2215,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1599 +#: ../../howto/clinic.rst:1607 msgid "" "Suppresses the ``impl_prototype``, write the ``impl_definition`` to " "``block``, write ``docstring_prototype``, ``methoddef_define``, and " "``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." msgstr "" -#: ../../howto/clinic.rst:1613 +#: ../../howto/clinic.rst:1621 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1605 +#: ../../howto/clinic.rst:1613 msgid "" "Similar to the ``buffer`` preset, but writes more things to ``block``, only " "writing the really big chunks of generated code to ``buffer``. This avoids " @@ -2236,137 +2236,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1612 +#: ../../howto/clinic.rst:1620 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1615 +#: ../../howto/clinic.rst:1623 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1621 +#: ../../howto/clinic.rst:1629 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1623 +#: ../../howto/clinic.rst:1631 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1625 +#: ../../howto/clinic.rst:1633 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1631 +#: ../../howto/clinic.rst:1639 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1633 +#: ../../howto/clinic.rst:1641 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1636 +#: ../../howto/clinic.rst:1644 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1639 +#: ../../howto/clinic.rst:1647 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1643 +#: ../../howto/clinic.rst:1651 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1646 +#: ../../howto/clinic.rst:1654 msgid "" "A text file. The file destination takes an extra argument, a template to " "use for building the filename, like so:" msgstr "" -#: ../../howto/clinic.rst:1649 +#: ../../howto/clinic.rst:1657 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1651 +#: ../../howto/clinic.rst:1659 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1654 +#: ../../howto/clinic.rst:1662 msgid "{path}" msgstr "" -#: ../../howto/clinic.rst:1655 +#: ../../howto/clinic.rst:1663 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1656 +#: ../../howto/clinic.rst:1664 msgid "{dirname}" msgstr "" -#: ../../howto/clinic.rst:1657 +#: ../../howto/clinic.rst:1665 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1658 +#: ../../howto/clinic.rst:1666 msgid "{basename}" msgstr "" -#: ../../howto/clinic.rst:1659 +#: ../../howto/clinic.rst:1667 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1661 +#: ../../howto/clinic.rst:1669 msgid "{basename_root}" msgstr "" -#: ../../howto/clinic.rst:1661 +#: ../../howto/clinic.rst:1669 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1665 +#: ../../howto/clinic.rst:1673 msgid "{basename_extension}" msgstr "" -#: ../../howto/clinic.rst:1664 +#: ../../howto/clinic.rst:1672 msgid "" "The last '.' and everything after it. If the basename does not contain a " "period, this will be the empty string." msgstr "" -#: ../../howto/clinic.rst:1667 +#: ../../howto/clinic.rst:1675 msgid "" "If there are no periods in the filename, {basename} and {filename} are the " "same, and {extension} is empty. \"{basename}{extension}\" is always exactly " "the same as \"{filename}\".\"" msgstr "" -#: ../../howto/clinic.rst:1672 +#: ../../howto/clinic.rst:1680 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1675 +#: ../../howto/clinic.rst:1683 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1681 +#: ../../howto/clinic.rst:1689 msgid "" "It removes all the accumulated text up to this point in the destination. (I " "don't know what you'd need this for, but I thought maybe it'd be useful " "while someone's experimenting.)" msgstr "" -#: ../../howto/clinic.rst:1685 +#: ../../howto/clinic.rst:1693 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1692 +#: ../../howto/clinic.rst:1700 msgid "" "``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " "string that will be prepended to every line of Clinic's output; " @@ -2374,35 +2374,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1696 +#: ../../howto/clinic.rst:1704 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1699 +#: ../../howto/clinic.rst:1707 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1699 +#: ../../howto/clinic.rst:1707 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1702 +#: ../../howto/clinic.rst:1710 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1702 +#: ../../howto/clinic.rst:1710 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1704 +#: ../../howto/clinic.rst:1712 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1711 +#: ../../howto/clinic.rst:1719 msgid "" "This tells Clinic that the current contents of the output should be kept, " "unmodified. This is used internally by Clinic when dumping output into " @@ -2411,36 +2411,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1718 +#: ../../howto/clinic.rst:1726 msgid "The #ifdef trick" msgstr "" -#: ../../howto/clinic.rst:1720 +#: ../../howto/clinic.rst:1728 msgid "" "If you're converting a function that isn't available on all platforms, " "there's a trick you can use to make life a little easier. The existing code " "probably looks like this::" msgstr "" -#: ../../howto/clinic.rst:1731 +#: ../../howto/clinic.rst:1739 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1740 +#: ../../howto/clinic.rst:1748 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1754 +#: ../../howto/clinic.rst:1762 msgid "" "Then, remove those three lines from the ``PyMethodDef`` structure, replacing " "them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1761 +#: ../../howto/clinic.rst:1769 msgid "" "(You can find the real name for this macro inside the generated code. Or you " "can calculate it yourself: it's the name of your function as defined on the " @@ -2448,27 +2448,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1766 +#: ../../howto/clinic.rst:1774 msgid "" "Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " "``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" msgstr "" -#: ../../howto/clinic.rst:1769 +#: ../../howto/clinic.rst:1777 msgid "" "Here's where Argument Clinic gets very clever. It actually detects that the " "Argument Clinic block might be deactivated by the ``#ifdef``. When that " "happens, it generates a little extra code that looks like this::" msgstr "" -#: ../../howto/clinic.rst:1777 +#: ../../howto/clinic.rst:1785 msgid "" "That means the macro always works. If the function is defined, this turns " "into the correct structure, including the trailing comma. If the function " "is undefined, this turns into nothing." msgstr "" -#: ../../howto/clinic.rst:1781 +#: ../../howto/clinic.rst:1789 msgid "" "However, this causes one ticklish problem: where should Argument Clinic put " "this extra code when using the \"block\" output preset? It can't go in the " @@ -2476,24 +2476,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1785 +#: ../../howto/clinic.rst:1793 msgid "" "In this situation, Argument Clinic writes the extra code to the \"buffer\" " "destination. This may mean that you get a complaint from Argument Clinic:" msgstr "" -#: ../../howto/clinic.rst:1793 +#: ../../howto/clinic.rst:1801 msgid "" "When this happens, just open your file, find the ``dump buffer`` block that " "Argument Clinic added to your file (it'll be at the very bottom), then move " "it above the ``PyMethodDef`` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1800 +#: ../../howto/clinic.rst:1807 msgid "Using Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1802 +#: ../../howto/clinic.rst:1809 msgid "" "It's actually possible to use Argument Clinic to preprocess Python files. " "There's no point to using Argument Clinic blocks, of course, as the output " @@ -2501,7 +2501,7 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1807 +#: ../../howto/clinic.rst:1814 msgid "" "Since Python comments are different from C comments, Argument Clinic blocks " "embedded in Python files look slightly different. They look like this:" diff --git a/library/typing.po b/library/typing.po index ce0655dae9..f84abae00c 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-10 00:38+0000\n" +"POT-Creation-Date: 2023-07-16 00:43+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -412,7 +412,7 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:327 ../../library/typing.rst:3205 +#: ../../library/typing.rst:327 ../../library/typing.rst:3211 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -2498,206 +2498,212 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2750 +#: ../../library/typing.rst:2751 #, fuzzy msgid "Deprecated aliases" msgstr "棄用於" -#: ../../library/typing.rst:2752 +#: ../../library/typing.rst:2753 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " "order to support parameterizing these generic classes using ``[]``. However, " "the aliases became redundant in Python 3.9 when the corresponding pre-" -"existing classes were enhanced to support ``[]``." +"existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:2758 +#: ../../library/typing.rst:2760 msgid "" -"The redundant types are deprecated as of Python 3.9 but no deprecation " -"warnings are issued by the interpreter. It is expected that type checkers " -"will flag the deprecated types when the checked program targets Python 3.9 " -"or newer." +"The redundant types are deprecated as of Python 3.9. However, while the " +"aliases may be removed at some point, removal of these aliases is not " +"currently planned. As such, no deprecation warnings are currently issued by " +"the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:2763 +#: ../../library/typing.rst:2765 msgid "" -"The deprecated types will be removed from the :mod:`typing` module no sooner " -"than the first Python version released 5 years after the release of Python " -"3.9.0. See details in :pep:`585`—*Type Hinting Generics In Standard " -"Collections*." +"If at some point it is decided to remove these deprecated aliases, a " +"deprecation warning will be issued by the interpreter for at least two " +"releases prior to removal. The aliases are guaranteed to remain in the " +"typing module without deprecation warnings until at least Python 3.14." msgstr "" #: ../../library/typing.rst:2770 +msgid "" +"Type checkers are encouraged to flag uses of the deprecated types if the " +"program they are checking targets a minimum Python version of 3.9 or newer." +msgstr "" + +#: ../../library/typing.rst:2776 msgid "Aliases to built-in types" msgstr "" -#: ../../library/typing.rst:2774 +#: ../../library/typing.rst:2780 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2776 +#: ../../library/typing.rst:2782 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2780 ../../library/typing.rst:3020 +#: ../../library/typing.rst:2786 ../../library/typing.rst:3026 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2785 +#: ../../library/typing.rst:2791 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2791 +#: ../../library/typing.rst:2797 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2793 +#: ../../library/typing.rst:2799 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2797 +#: ../../library/typing.rst:2803 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2807 +#: ../../library/typing.rst:2813 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2813 +#: ../../library/typing.rst:2819 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2815 +#: ../../library/typing.rst:2821 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2819 +#: ../../library/typing.rst:2825 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2825 +#: ../../library/typing.rst:2831 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2827 +#: ../../library/typing.rst:2833 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2834 +#: ../../library/typing.rst:2840 msgid "Deprecated alias for :class:`tuple`." msgstr "" -#: ../../library/typing.rst:2836 +#: ../../library/typing.rst:2842 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:2839 +#: ../../library/typing.rst:2845 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2845 +#: ../../library/typing.rst:2851 msgid "Deprecated alias to :class:`type`." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2853 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:2852 +#: ../../library/typing.rst:2858 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2859 +#: ../../library/typing.rst:2865 msgid "Aliases to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2869 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2867 +#: ../../library/typing.rst:2873 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2873 +#: ../../library/typing.rst:2879 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2877 +#: ../../library/typing.rst:2883 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2889 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2888 +#: ../../library/typing.rst:2894 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2900 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2899 +#: ../../library/typing.rst:2905 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2905 +#: ../../library/typing.rst:2911 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2910 +#: ../../library/typing.rst:2916 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2917 +#: ../../library/typing.rst:2923 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:2922 +#: ../../library/typing.rst:2928 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2925 +#: ../../library/typing.rst:2931 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2705,383 +2711,383 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2933 +#: ../../library/typing.rst:2939 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2934 +#: ../../library/typing.rst:2940 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2940 +#: ../../library/typing.rst:2946 msgid "Deprecated alias for :class:`str`." msgstr "" -#: ../../library/typing.rst:2942 +#: ../../library/typing.rst:2948 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:2946 +#: ../../library/typing.rst:2952 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2954 +#: ../../library/typing.rst:2960 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2964 +#: ../../library/typing.rst:2970 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2968 +#: ../../library/typing.rst:2974 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2970 +#: ../../library/typing.rst:2976 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2976 +#: ../../library/typing.rst:2982 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2980 +#: ../../library/typing.rst:2986 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2984 +#: ../../library/typing.rst:2990 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2988 +#: ../../library/typing.rst:2994 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2994 +#: ../../library/typing.rst:3000 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2996 +#: ../../library/typing.rst:3002 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3002 +#: ../../library/typing.rst:3008 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:3004 +#: ../../library/typing.rst:3010 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3010 +#: ../../library/typing.rst:3016 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:3012 +#: ../../library/typing.rst:3018 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3018 +#: ../../library/typing.rst:3024 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:3025 +#: ../../library/typing.rst:3031 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3031 +#: ../../library/typing.rst:3037 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:3033 +#: ../../library/typing.rst:3039 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3039 +#: ../../library/typing.rst:3045 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:3041 +#: ../../library/typing.rst:3047 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3048 +#: ../../library/typing.rst:3054 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:3050 +#: ../../library/typing.rst:3056 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3057 +#: ../../library/typing.rst:3063 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:3059 +#: ../../library/typing.rst:3065 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3065 +#: ../../library/typing.rst:3071 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:3067 +#: ../../library/typing.rst:3073 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3073 +#: ../../library/typing.rst:3079 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:3075 +#: ../../library/typing.rst:3081 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3082 +#: ../../library/typing.rst:3088 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3086 +#: ../../library/typing.rst:3092 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:3088 +#: ../../library/typing.rst:3094 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3099 +#: ../../library/typing.rst:3105 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3105 +#: ../../library/typing.rst:3111 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:3107 +#: ../../library/typing.rst:3113 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3116 +#: ../../library/typing.rst:3122 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:3120 +#: ../../library/typing.rst:3126 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3128 +#: ../../library/typing.rst:3134 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3138 +#: ../../library/typing.rst:3144 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3145 +#: ../../library/typing.rst:3151 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:3149 +#: ../../library/typing.rst:3155 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3155 +#: ../../library/typing.rst:3161 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:3159 +#: ../../library/typing.rst:3165 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3165 +#: ../../library/typing.rst:3171 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:3169 +#: ../../library/typing.rst:3175 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3176 +#: ../../library/typing.rst:3182 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3180 +#: ../../library/typing.rst:3186 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:3182 +#: ../../library/typing.rst:3188 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3188 +#: ../../library/typing.rst:3194 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:3190 +#: ../../library/typing.rst:3196 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3196 +#: ../../library/typing.rst:3202 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "" -#: ../../library/typing.rst:3198 +#: ../../library/typing.rst:3204 msgid "" "See :ref:`annotating-callables` for details on how to use :class:" "`collections.abc.Callable` and ``typing.Callable`` in type annotations." msgstr "" -#: ../../library/typing.rst:3201 +#: ../../library/typing.rst:3207 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3211 +#: ../../library/typing.rst:3217 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:3213 +#: ../../library/typing.rst:3219 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3222 +#: ../../library/typing.rst:3228 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:3226 +#: ../../library/typing.rst:3232 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3234 +#: ../../library/typing.rst:3240 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3242 +#: ../../library/typing.rst:3248 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3248 +#: ../../library/typing.rst:3254 msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:3252 +#: ../../library/typing.rst:3258 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:3254 +#: ../../library/typing.rst:3260 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3260 +#: ../../library/typing.rst:3266 msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:3265 +#: ../../library/typing.rst:3271 msgid "Aliases to :mod:`contextlib` ABCs" msgstr "" -#: ../../library/typing.rst:3269 +#: ../../library/typing.rst:3275 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3274 +#: ../../library/typing.rst:3280 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3287 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3286 +#: ../../library/typing.rst:3292 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3292 +#: ../../library/typing.rst:3298 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3294 +#: ../../library/typing.rst:3300 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3089,77 +3095,82 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3299 +#: ../../library/typing.rst:3307 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3299 +#: ../../library/typing.rst:3308 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3299 +#: ../../library/typing.rst:3309 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3299 +#: ../../library/typing.rst:3310 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3301 +#: ../../library/typing.rst:3311 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3301 +#: ../../library/typing.rst:3312 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3301 +#: ../../library/typing.rst:3313 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3301 +#: ../../library/typing.rst:3314 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3304 +#: ../../library/typing.rst:3315 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3304 ../../library/typing.rst:3307 +#: ../../library/typing.rst:3316 ../../library/typing.rst:3320 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3304 ../../library/typing.rst:3309 -msgid "Undecided" +#: ../../library/typing.rst:3317 +msgid "Undecided (see :ref:`deprecated-typing-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3304 +#: ../../library/typing.rst:3318 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3307 +#: ../../library/typing.rst:3319 #, fuzzy -msgid "``typing.ByteString``" +msgid ":class:`typing.ByteString`" msgstr "``typing.Text``" -#: ../../library/typing.rst:3307 +#: ../../library/typing.rst:3321 msgid "3.14" msgstr "" -#: ../../library/typing.rst:3307 +#: ../../library/typing.rst:3322 #, fuzzy msgid ":gh:`91896`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3309 -msgid "``typing.Text``" +#: ../../library/typing.rst:3323 +#, fuzzy +msgid ":data:`typing.Text`" msgstr "``typing.Text``" -#: ../../library/typing.rst:3309 +#: ../../library/typing.rst:3324 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3309 +#: ../../library/typing.rst:3325 +msgid "Undecided" +msgstr "" + +#: ../../library/typing.rst:3326 msgid ":gh:`92332`" msgstr ":gh:`92332`" From afde90a47a25024bfd68c4a72fd147b6ba995ffc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 18 Jul 2023 00:59:57 +0000 Subject: [PATCH 128/130] sync with cpython a7acc5cb --- tutorial/controlflow.po | 243 ++++++++++++++++++++-------------------- 1 file changed, 122 insertions(+), 121 deletions(-) diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 8845024f8b..b36215aa66 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-12 00:40+0000\n" +"POT-Creation-Date: 2023-07-18 00:58+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -395,16 +395,17 @@ msgstr "" "``Point``)則永遠無法被賦值。" #: ../../tutorial/controlflow.rst:345 +#, fuzzy msgid "" "Patterns can be arbitrarily nested. For example, if we have a short list of " -"points, we could match it like this::" +"Points, with ``__match_args__`` added, we could match it like this::" msgstr "" "模式可以任意地被巢套 (nested)。例如,如果我們有一個由某些點所組成的簡短 " "list,我們就可以像這樣來對它進行匹配:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:360 +#: ../../tutorial/controlflow.rst:366 msgid "" "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " "guard is false, ``match`` goes on to try the next case block. Note that " @@ -416,11 +417,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:370 +#: ../../tutorial/controlflow.rst:376 msgid "Several other key features of this statement:" msgstr "此種陳述式的其他幾個重要特色:" -#: ../../tutorial/controlflow.rst:372 +#: ../../tutorial/controlflow.rst:378 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. An important exception is " @@ -429,7 +430,7 @@ msgstr "" "與拆解賦值的情況類似,tuple(元組)和 list 模式具有完全相同的意義,而且實際上" "可以匹配任意的序列。一個重要的例外,是它們不能匹配疊代器 (iterator) 或字串。" -#: ../../tutorial/controlflow.rst:376 +#: ../../tutorial/controlflow.rst:382 msgid "" "Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, " "*rest)`` work similar to unpacking assignments. The name after ``*`` may " @@ -441,7 +442,7 @@ msgstr "" "是 ``_``,所以 ``(x, y, *_)`` 會匹配一個至少兩項的序列,且不會連結那兩項以外" "的其餘項。" -#: ../../tutorial/controlflow.rst:381 +#: ../../tutorial/controlflow.rst:387 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " @@ -453,14 +454,14 @@ msgstr "" "模式不同,額外的鍵 (key) 會被忽略。一種像是 ``**rest`` 的拆解方式,也是可被支" "援的。(但 ``**_`` 則是多餘的做法,所以它並不被允許。)" -#: ../../tutorial/controlflow.rst:386 +#: ../../tutorial/controlflow.rst:392 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "" "使用關鍵字 ``as`` 可以擷取子模式 (subpattern):\n" "\n" "::" -#: ../../tutorial/controlflow.rst:390 +#: ../../tutorial/controlflow.rst:396 msgid "" "will capture the second element of the input as ``p2`` (as long as the input " "is a sequence of two points)" @@ -468,7 +469,7 @@ msgstr "" "將會擷取輸入的第二個元素作為 ``p2``\\ (只要該輸入是一個由兩個點所組成的序" "列)。" -#: ../../tutorial/controlflow.rst:393 +#: ../../tutorial/controlflow.rst:399 msgid "" "Most literals are compared by equality, however the singletons ``True``, " "``False`` and ``None`` are compared by identity." @@ -476,7 +477,7 @@ msgstr "" "大部分的字面值是藉由相等性 (equality) 來比較,但是單例物件 (singleton) " "``True``\\ 、\\ ``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。" -#: ../../tutorial/controlflow.rst:396 +#: ../../tutorial/controlflow.rst:402 msgid "" "Patterns may use named constants. These must be dotted names to prevent " "them from being interpreted as capture variable::" @@ -486,18 +487,18 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:415 +#: ../../tutorial/controlflow.rst:421 msgid "" "For a more detailed explanation and additional examples, you can look into :" "pep:`636` which is written in a tutorial format." msgstr "" "關於更詳細的解釋和其他範例,你可以閱讀 :pep:`636`,它是以教學的格式編寫而成。" -#: ../../tutorial/controlflow.rst:421 +#: ../../tutorial/controlflow.rst:427 msgid "Defining Functions" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:423 +#: ../../tutorial/controlflow.rst:429 msgid "" "We can create a function that writes the Fibonacci series to an arbitrary " "boundary::" @@ -506,7 +507,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:443 +#: ../../tutorial/controlflow.rst:449 msgid "" "The keyword :keyword:`def` introduces a function *definition*. It must be " "followed by the function name and the parenthesized list of formal " @@ -516,7 +517,7 @@ msgstr "" "關鍵字 :keyword:`def` 介紹一個函式的\\ *定義*\\ 。它之後必須連著該函式的名稱" "和置於括號之中的一串參數。自下一行起,所有縮排的陳述式成為該函式的主體。" -#: ../../tutorial/controlflow.rst:448 +#: ../../tutorial/controlflow.rst:454 msgid "" "The first statement of the function body can optionally be a string literal; " "this string literal is the function's documentation string, or :dfn:" @@ -532,7 +533,7 @@ msgstr "" "件,或讓使用者能以互動的方式在原始碼中瀏覽文件。在原始碼中加入 docstring 是個" "好慣例,應該養成這樣的習慣。" -#: ../../tutorial/controlflow.rst:455 +#: ../../tutorial/controlflow.rst:461 msgid "" "The *execution* of a function introduces a new symbol table used for the " "local variables of the function. More precisely, all variable assignments " @@ -553,7 +554,7 @@ msgstr "" "域變數是在 :keyword:`global` 陳述式中被定義,或外層函式變數在 :keyword:" "`nonlocal` 陳述式中被定義)。" -#: ../../tutorial/controlflow.rst:466 +#: ../../tutorial/controlflow.rst:472 msgid "" "The actual parameters (arguments) to a function call are introduced in the " "local symbol table of the called function when it is called; thus, arguments " @@ -568,7 +569,7 @@ msgstr "" "函式呼叫別的函式或遞迴呼叫它自己時,在被呼叫的函式中會建立一個新的區域符號" "表。" -#: ../../tutorial/controlflow.rst:473 +#: ../../tutorial/controlflow.rst:479 msgid "" "A function definition associates the function name with the function object " "in the current symbol table. The interpreter recognizes the object pointed " @@ -581,7 +582,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:484 +#: ../../tutorial/controlflow.rst:490 msgid "" "Coming from other languages, you might object that ``fib`` is not a function " "but a procedure since it doesn't return a value. In fact, even functions " @@ -598,7 +599,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:495 +#: ../../tutorial/controlflow.rst:501 msgid "" "It is simple to write a function that returns a list of the numbers of the " "Fibonacci series, instead of printing it::" @@ -607,11 +608,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:511 +#: ../../tutorial/controlflow.rst:517 msgid "This example, as usual, demonstrates some new Python features:" msgstr "這個例子一樣示範了一些新的 Python 特性:" -#: ../../tutorial/controlflow.rst:513 +#: ../../tutorial/controlflow.rst:519 msgid "" "The :keyword:`return` statement returns with a value from a function. :" "keyword:`!return` without an expression argument returns ``None``. Falling " @@ -621,7 +622,7 @@ msgstr "" "不外加一個運算式作為引數時會回傳 ``None``\\ 。一個函式執行到結束也會回傳 " "``None``\\ 。" -#: ../../tutorial/controlflow.rst:517 +#: ../../tutorial/controlflow.rst:523 msgid "" "The statement ``result.append(a)`` calls a *method* of the list object " "``result``. A method is a function that 'belongs' to an object and is named " @@ -643,22 +644,22 @@ msgstr "" "method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" "於 ``result = result + [a]``\\ ,但更有效率。" -#: ../../tutorial/controlflow.rst:532 +#: ../../tutorial/controlflow.rst:538 msgid "More on Defining Functions" msgstr "深入了解函式定義" -#: ../../tutorial/controlflow.rst:534 +#: ../../tutorial/controlflow.rst:540 msgid "" "It is also possible to define functions with a variable number of arguments. " "There are three forms, which can be combined." msgstr "" "定義函式時使用的引數 (argument) 數量是可變的。總共有三種可以組合使用的形式。" -#: ../../tutorial/controlflow.rst:541 +#: ../../tutorial/controlflow.rst:547 msgid "Default Argument Values" msgstr "預設引數值" -#: ../../tutorial/controlflow.rst:543 +#: ../../tutorial/controlflow.rst:549 msgid "" "The most useful form is to specify a default value for one or more " "arguments. This creates a function that can be called with fewer arguments " @@ -669,22 +670,22 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:559 +#: ../../tutorial/controlflow.rst:565 msgid "This function can be called in several ways:" msgstr "該函式可以用以下幾種方式被呼叫:" -#: ../../tutorial/controlflow.rst:561 +#: ../../tutorial/controlflow.rst:567 msgid "" "giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``" msgstr "只給必要引數:\\ ``ask_ok('Do you really want to quit?')``" -#: ../../tutorial/controlflow.rst:563 +#: ../../tutorial/controlflow.rst:569 msgid "" "giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', " "2)``" msgstr "給予一個選擇性引數:\\ ``ask_ok('OK to overwrite the file?', 2)``" -#: ../../tutorial/controlflow.rst:565 +#: ../../tutorial/controlflow.rst:571 msgid "" "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " "on, only yes or no!')``" @@ -692,14 +693,14 @@ msgstr "" "給予所有引數:\\ ``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes " "or no!')``" -#: ../../tutorial/controlflow.rst:568 +#: ../../tutorial/controlflow.rst:574 msgid "" "This example also introduces the :keyword:`in` keyword. This tests whether " "or not a sequence contains a certain value." msgstr "" "此例也使用了關鍵字 :keyword:`in`\\ ,用於測試序列中是否包含某個特定值。" -#: ../../tutorial/controlflow.rst:571 +#: ../../tutorial/controlflow.rst:577 msgid "" "The default values are evaluated at the point of function definition in the " "*defining* scope, so that ::" @@ -708,11 +709,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:582 +#: ../../tutorial/controlflow.rst:588 msgid "will print ``5``." msgstr "將會輸出 ``5``\\ 。" -#: ../../tutorial/controlflow.rst:584 +#: ../../tutorial/controlflow.rst:590 msgid "" "**Important warning:** The default value is evaluated only once. This makes " "a difference when the default is a mutable object such as a list, " @@ -725,24 +726,24 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:597 +#: ../../tutorial/controlflow.rst:603 msgid "This will print ::" msgstr "" "將會輸出:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:603 +#: ../../tutorial/controlflow.rst:609 msgid "" "If you don't want the default to be shared between subsequent calls, you can " "write the function like this instead::" msgstr "如果不想在後續呼叫之間共用預設值,應以如下方式編寫函式:" -#: ../../tutorial/controlflow.rst:616 +#: ../../tutorial/controlflow.rst:622 msgid "Keyword Arguments" msgstr "關鍵字引數" -#: ../../tutorial/controlflow.rst:618 +#: ../../tutorial/controlflow.rst:624 msgid "" "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following " @@ -753,7 +754,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:627 +#: ../../tutorial/controlflow.rst:633 msgid "" "accepts one required argument (``voltage``) and three optional arguments " "(``state``, ``action``, and ``type``). This function can be called in any " @@ -764,14 +765,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:638 +#: ../../tutorial/controlflow.rst:644 msgid "but all the following calls would be invalid::" msgstr "" "但以下呼叫方式都無效:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:645 +#: ../../tutorial/controlflow.rst:651 msgid "" "In a function call, keyword arguments must follow positional arguments. All " "the keyword arguments passed must match one of the arguments accepted by the " @@ -789,7 +790,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:661 +#: ../../tutorial/controlflow.rst:667 msgid "" "When a final formal parameter of the form ``**name`` is present, it receives " "a dictionary (see :ref:`typesmapping`) containing all keyword arguments " @@ -807,31 +808,31 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:678 +#: ../../tutorial/controlflow.rst:684 msgid "It could be called like this::" msgstr "" "它可以被如此呼叫:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:686 +#: ../../tutorial/controlflow.rst:692 msgid "and of course it would print:" msgstr "" "輸出結果如下:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:699 +#: ../../tutorial/controlflow.rst:705 msgid "" "Note that the order in which the keyword arguments are printed is guaranteed " "to match the order in which they were provided in the function call." msgstr "注意,關鍵字引數的輸出順序與呼叫函式時被提供的順序必定一致。" -#: ../../tutorial/controlflow.rst:703 +#: ../../tutorial/controlflow.rst:709 msgid "Special parameters" msgstr "特殊參數" -#: ../../tutorial/controlflow.rst:705 +#: ../../tutorial/controlflow.rst:711 msgid "" "By default, arguments may be passed to a Python function either by position " "or explicitly by keyword. For readability and performance, it makes sense to " @@ -843,11 +844,11 @@ msgstr "" "及效能,限制引數的傳遞方式是合理的,如此,開發者只需查看函式定義,即可確定各" "項目是按位置,按位置或關鍵字,還是按關鍵字傳遞。" -#: ../../tutorial/controlflow.rst:711 +#: ../../tutorial/controlflow.rst:717 msgid "A function definition may look like:" msgstr "函式定義可能如以下樣式:" -#: ../../tutorial/controlflow.rst:722 +#: ../../tutorial/controlflow.rst:728 msgid "" "where ``/`` and ``*`` are optional. If used, these symbols indicate the kind " "of parameter by how the arguments may be passed to the function: positional-" @@ -858,22 +859,22 @@ msgstr "" "類:僅限位置、位置或關鍵字、僅限關鍵字。關鍵字參數也稱為附名參數 (named " "parameters)。" -#: ../../tutorial/controlflow.rst:729 +#: ../../tutorial/controlflow.rst:735 msgid "Positional-or-Keyword Arguments" msgstr "位置或關鍵字引數 (Positional-or-Keyword Arguments)" -#: ../../tutorial/controlflow.rst:731 +#: ../../tutorial/controlflow.rst:737 msgid "" "If ``/`` and ``*`` are not present in the function definition, arguments may " "be passed to a function by position or by keyword." msgstr "" "若函式定義中未使用 ``/`` 和 ``*`` 時,引數可以按位置或關鍵字傳遞給函式。" -#: ../../tutorial/controlflow.rst:736 +#: ../../tutorial/controlflow.rst:742 msgid "Positional-Only Parameters" msgstr "僅限位置參數 (Positional-Only Parameters)" -#: ../../tutorial/controlflow.rst:738 +#: ../../tutorial/controlflow.rst:744 msgid "" "Looking at this in a bit more detail, it is possible to mark certain " "parameters as *positional-only*. If *positional-only*, the parameters' order " @@ -888,17 +889,17 @@ msgstr "" "``/``\\ (斜線)之前。\\ ``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函" "式定義中沒有 ``/``\\ ,則表示沒有任何僅限位置參數。" -#: ../../tutorial/controlflow.rst:746 +#: ../../tutorial/controlflow.rst:752 msgid "" "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" "only*." msgstr "``/`` 後面的參數可以是\\ *位置或關鍵字*\\ 或\\ *僅限關鍵字*\\ 參數。" -#: ../../tutorial/controlflow.rst:750 +#: ../../tutorial/controlflow.rst:756 msgid "Keyword-Only Arguments" msgstr "僅限關鍵字引數 (Keyword-Only Arguments)" -#: ../../tutorial/controlflow.rst:752 +#: ../../tutorial/controlflow.rst:758 msgid "" "To mark parameters as *keyword-only*, indicating the parameters must be " "passed by keyword argument, place an ``*`` in the arguments list just before " @@ -907,11 +908,11 @@ msgstr "" "要把參數標記為\\ *僅限關鍵字*\\ ,表明參數必須以關鍵字引數傳遞,必須在引數列" "表中第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``\\ 。" -#: ../../tutorial/controlflow.rst:758 +#: ../../tutorial/controlflow.rst:764 msgid "Function Examples" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:760 +#: ../../tutorial/controlflow.rst:766 msgid "" "Consider the following example function definitions paying close attention " "to the markers ``/`` and ``*``::" @@ -920,7 +921,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:776 +#: ../../tutorial/controlflow.rst:782 msgid "" "The first function definition, ``standard_arg``, the most familiar form, " "places no restrictions on the calling convention and arguments may be passed " @@ -931,7 +932,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:786 +#: ../../tutorial/controlflow.rst:792 msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" @@ -940,7 +941,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:797 +#: ../../tutorial/controlflow.rst:803 msgid "" "The third function ``kwd_only_args`` only allows keyword arguments as " "indicated by a ``*`` in the function definition::" @@ -949,7 +950,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:808 +#: ../../tutorial/controlflow.rst:814 msgid "" "And the last uses all three calling conventions in the same function " "definition::" @@ -958,7 +959,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:828 +#: ../../tutorial/controlflow.rst:834 msgid "" "Finally, consider this function definition which has a potential collision " "between the positional argument ``name`` and ``**kwds`` which has ``name`` " @@ -969,7 +970,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:833 +#: ../../tutorial/controlflow.rst:839 msgid "" "There is no possible call that will make it return ``True`` as the keyword " "``'name'`` will always bind to the first parameter. For example::" @@ -979,7 +980,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:842 +#: ../../tutorial/controlflow.rst:848 msgid "" "But using ``/`` (positional only arguments), it is possible since it allows " "``name`` as a positional argument and ``'name'`` as a key in the keyword " @@ -990,17 +991,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:850 +#: ../../tutorial/controlflow.rst:856 msgid "" "In other words, the names of positional-only parameters can be used in " "``**kwds`` without ambiguity." msgstr "換句話說,僅限位置參數的名稱可以在 ``**kwds`` 中使用,而不產生歧義。" -#: ../../tutorial/controlflow.rst:855 +#: ../../tutorial/controlflow.rst:861 msgid "Recap" msgstr "回顧" -#: ../../tutorial/controlflow.rst:857 +#: ../../tutorial/controlflow.rst:863 msgid "" "The use case will determine which parameters to use in the function " "definition::" @@ -1009,11 +1010,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:861 +#: ../../tutorial/controlflow.rst:867 msgid "As guidance:" msgstr "說明:" -#: ../../tutorial/controlflow.rst:863 +#: ../../tutorial/controlflow.rst:869 msgid "" "Use positional-only if you want the name of the parameters to not be " "available to the user. This is useful when parameter names have no real " @@ -1025,7 +1026,7 @@ msgstr "" "想控制引數在函式呼叫的排列順序,或同時使用位置參數和任意關鍵字時,這種方式很" "有用。" -#: ../../tutorial/controlflow.rst:868 +#: ../../tutorial/controlflow.rst:874 msgid "" "Use keyword-only when names have meaning and the function definition is more " "understandable by being explicit with names or you want to prevent users " @@ -1034,7 +1035,7 @@ msgstr "" "當參數名稱有意義,且明確的名稱可讓函式定義更易理解,或是你不希望使用者依賴引" "數被傳遞時的位置時,請使用僅限關鍵字。" -#: ../../tutorial/controlflow.rst:871 +#: ../../tutorial/controlflow.rst:877 msgid "" "For an API, use positional-only to prevent breaking API changes if the " "parameter's name is modified in the future." @@ -1042,11 +1043,11 @@ msgstr "" "對於應用程式介面 (API),使用僅限位置,以防止未來參數名稱被修改時造成 API 的中" "斷性變更。" -#: ../../tutorial/controlflow.rst:877 +#: ../../tutorial/controlflow.rst:883 msgid "Arbitrary Argument Lists" msgstr "任意引數列表 (Arbitrary Argument Lists)" -#: ../../tutorial/controlflow.rst:882 +#: ../../tutorial/controlflow.rst:888 msgid "" "Finally, the least frequently used option is to specify that a function can " "be called with an arbitrary number of arguments. These arguments will be " @@ -1059,7 +1060,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:891 +#: ../../tutorial/controlflow.rst:897 msgid "" "Normally, these *variadic* arguments will be last in the list of formal " "parameters, because they scoop up all remaining input arguments that are " @@ -1073,11 +1074,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:908 +#: ../../tutorial/controlflow.rst:914 msgid "Unpacking Argument Lists" msgstr "拆解引數列表(Unpacking Argument Lists)" -#: ../../tutorial/controlflow.rst:910 +#: ../../tutorial/controlflow.rst:916 msgid "" "The reverse situation occurs when the arguments are already in a list or " "tuple but need to be unpacked for a function call requiring separate " @@ -1093,7 +1094,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:926 +#: ../../tutorial/controlflow.rst:932 msgid "" "In the same fashion, dictionaries can deliver keyword arguments with the " "``**``\\ -operator::" @@ -1102,11 +1103,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:942 +#: ../../tutorial/controlflow.rst:948 msgid "Lambda Expressions" msgstr "Lambda 運算式" -#: ../../tutorial/controlflow.rst:944 +#: ../../tutorial/controlflow.rst:950 msgid "" "Small anonymous functions can be created with the :keyword:`lambda` keyword. " "This function returns the sum of its two arguments: ``lambda a, b: a+b``. " @@ -1123,7 +1124,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:961 +#: ../../tutorial/controlflow.rst:967 msgid "" "The above example uses a lambda expression to return a function. Another " "use is to pass a small function as an argument::" @@ -1133,17 +1134,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:973 +#: ../../tutorial/controlflow.rst:979 msgid "Documentation Strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:980 +#: ../../tutorial/controlflow.rst:986 msgid "" "Here are some conventions about the content and formatting of documentation " "strings." msgstr "以下是關於說明文件字串內容和格式的慣例。" -#: ../../tutorial/controlflow.rst:983 +#: ../../tutorial/controlflow.rst:989 msgid "" "The first line should always be a short, concise summary of the object's " "purpose. For brevity, it should not explicitly state the object's name or " @@ -1155,7 +1156,7 @@ msgstr "" "的名稱或型別,因為有其他方法可以達到相同目的(除非該名稱剛好是一個描述函式運" "算的動詞)。這一行應以大寫字母開頭,以句號結尾。" -#: ../../tutorial/controlflow.rst:989 +#: ../../tutorial/controlflow.rst:995 msgid "" "If there are more lines in the documentation string, the second line should " "be blank, visually separating the summary from the rest of the description. " @@ -1165,7 +1166,7 @@ msgstr "" "文件字串為多行時,第二行應為空白行,在視覺上將摘要與其餘描述分開。後面幾行可" "包含一或多個段落,描述此物件的呼叫慣例、副作用等。" -#: ../../tutorial/controlflow.rst:994 +#: ../../tutorial/controlflow.rst:1000 msgid "" "The Python parser does not strip indentation from multi-line string literals " "in Python, so tools that process documentation have to strip indentation if " @@ -1187,18 +1188,18 @@ msgstr "" "出現了,這些行的全部前導空白字元都應被去除。展開 tab 鍵後(通常為八個空格)," "應測試空白字元量是否等價。" -#: ../../tutorial/controlflow.rst:1006 +#: ../../tutorial/controlflow.rst:1012 msgid "Here is an example of a multi-line docstring::" msgstr "" "下面是多行說明字串的一個範例:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:1024 +#: ../../tutorial/controlflow.rst:1030 msgid "Function Annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1032 +#: ../../tutorial/controlflow.rst:1038 msgid "" ":ref:`Function annotations ` are completely optional metadata " "information about the types used by user-defined functions (see :pep:`3107` " @@ -1207,7 +1208,7 @@ msgstr "" ":ref:`函式註釋 `\\ 是選擇性的元資料(metadata)資訊,描述使用者定義" "函式所使用的型別(更多資訊詳見 :pep:`3107` 和 :pep:`484`\\ )。" -#: ../../tutorial/controlflow.rst:1036 +#: ../../tutorial/controlflow.rst:1042 msgid "" ":term:`Annotations ` are stored in the :attr:" "`__annotations__` attribute of the function as a dictionary and have no " @@ -1227,11 +1228,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:1058 +#: ../../tutorial/controlflow.rst:1064 msgid "Intermezzo: Coding Style" msgstr "間奏曲:程式碼風格 (Coding Style)" -#: ../../tutorial/controlflow.rst:1063 +#: ../../tutorial/controlflow.rst:1069 msgid "" "Now that you are about to write longer, more complex pieces of Python, it is " "a good time to talk about *coding style*. Most languages can be written (or " @@ -1244,7 +1245,7 @@ msgstr "" "式比其他的更具可讀性。能讓其他人輕鬆閱讀你的程式碼永遠是一個好主意,而使用優" "良的編碼樣式對此有極大的幫助。" -#: ../../tutorial/controlflow.rst:1069 +#: ../../tutorial/controlflow.rst:1075 msgid "" "For Python, :pep:`8` has emerged as the style guide that most projects " "adhere to; it promotes a very readable and eye-pleasing coding style. Every " @@ -1254,11 +1255,11 @@ msgstr "" "對於 Python,大多數的專案都遵循 :pep:`8` 的樣式指南;它推行的編碼樣式相當可讀" "且賞心悅目。每個 Python 開發者都應該花點時間研讀;這裡是該指南的核心重點:" -#: ../../tutorial/controlflow.rst:1074 +#: ../../tutorial/controlflow.rst:1080 msgid "Use 4-space indentation, and no tabs." msgstr "用 4 個空格縮排,不要用 tab 鍵。" -#: ../../tutorial/controlflow.rst:1076 +#: ../../tutorial/controlflow.rst:1082 msgid "" "4 spaces are a good compromise between small indentation (allows greater " "nesting depth) and large indentation (easier to read). Tabs introduce " @@ -1267,11 +1268,11 @@ msgstr "" "4 個空格是小縮排(容許更大的巢套深度)和大縮排(較易閱讀)之間的折衷方案。" "Tab 鍵會造成混亂,最好別用。" -#: ../../tutorial/controlflow.rst:1080 +#: ../../tutorial/controlflow.rst:1086 msgid "Wrap lines so that they don't exceed 79 characters." msgstr "換行,使一行不超過 79 個字元。" -#: ../../tutorial/controlflow.rst:1082 +#: ../../tutorial/controlflow.rst:1088 msgid "" "This helps users with small displays and makes it possible to have several " "code files side-by-side on larger displays." @@ -1279,21 +1280,21 @@ msgstr "" "換行能讓使用小顯示器的使用者方便閱讀,也可以在較大顯示器上並排陳列多個程式碼" "檔案。" -#: ../../tutorial/controlflow.rst:1085 +#: ../../tutorial/controlflow.rst:1091 msgid "" "Use blank lines to separate functions and classes, and larger blocks of code " "inside functions." msgstr "用空行分隔函式和 class(類別),及函式內較大塊的程式碼。" -#: ../../tutorial/controlflow.rst:1088 +#: ../../tutorial/controlflow.rst:1094 msgid "When possible, put comments on a line of their own." msgstr "如果可以,把註解放在單獨一行。" -#: ../../tutorial/controlflow.rst:1090 +#: ../../tutorial/controlflow.rst:1096 msgid "Use docstrings." msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:1092 +#: ../../tutorial/controlflow.rst:1098 msgid "" "Use spaces around operators and after commas, but not directly inside " "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." @@ -1301,7 +1302,7 @@ msgstr "" "運算子前後、逗號後要加空格,但不要直接放在括號內側:\\ ``a = f(1, 2) + g(3, " "4)``\\ 。" -#: ../../tutorial/controlflow.rst:1095 +#: ../../tutorial/controlflow.rst:1101 msgid "" "Name your classes and functions consistently; the convention is to use " "``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " @@ -1313,7 +1314,7 @@ msgstr "" "底線)。永遠用 ``self`` 作為 method 第一個引數的名稱(關於 class 和 method," "詳見 :ref:`tut-firstclasses`\\ )。" -#: ../../tutorial/controlflow.rst:1100 +#: ../../tutorial/controlflow.rst:1106 msgid "" "Don't use fancy encodings if your code is meant to be used in international " "environments. Python's default, UTF-8, or even plain ASCII work best in any " @@ -1322,7 +1323,7 @@ msgstr "" "若程式碼是為了用於國際環境時,不要用花俏的編碼。Python 預設的 UTF-8 或甚至普" "通的 ASCII,就可以勝任各種情況。" -#: ../../tutorial/controlflow.rst:1104 +#: ../../tutorial/controlflow.rst:1110 msgid "" "Likewise, don't use non-ASCII characters in identifiers if there is only the " "slightest chance people speaking a different language will read or maintain " @@ -1331,11 +1332,11 @@ msgstr "" "同樣地,若不同語言使用者閱讀或維護程式碼的可能性微乎其微,就不要在命名時使用" "非 ASCII 字元。" -#: ../../tutorial/controlflow.rst:1110 +#: ../../tutorial/controlflow.rst:1116 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/controlflow.rst:1111 +#: ../../tutorial/controlflow.rst:1117 msgid "" "Actually, *call by object reference* would be a better description, since if " "a mutable object is passed, the caller will see any changes the callee makes " @@ -1353,60 +1354,60 @@ msgstr "" msgid "for" msgstr "" -#: ../../tutorial/controlflow.rst:438 ../../tutorial/controlflow.rst:975 +#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 #, fuzzy msgid "documentation strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:438 ../../tutorial/controlflow.rst:975 +#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 #, fuzzy msgid "docstrings" msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:438 ../../tutorial/controlflow.rst:975 +#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 msgid "strings, documentation" msgstr "" -#: ../../tutorial/controlflow.rst:879 +#: ../../tutorial/controlflow.rst:885 msgid "* (asterisk)" msgstr "" -#: ../../tutorial/controlflow.rst:879 ../../tutorial/controlflow.rst:923 +#: ../../tutorial/controlflow.rst:885 ../../tutorial/controlflow.rst:929 #, fuzzy msgid "in function calls" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:923 +#: ../../tutorial/controlflow.rst:929 msgid "**" msgstr "" -#: ../../tutorial/controlflow.rst:1027 +#: ../../tutorial/controlflow.rst:1033 #, fuzzy msgid "function" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:1027 +#: ../../tutorial/controlflow.rst:1033 #, fuzzy msgid "annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1027 +#: ../../tutorial/controlflow.rst:1033 msgid "->" msgstr "" -#: ../../tutorial/controlflow.rst:1027 +#: ../../tutorial/controlflow.rst:1033 #, fuzzy msgid "function annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1027 +#: ../../tutorial/controlflow.rst:1033 msgid ": (colon)" msgstr "" -#: ../../tutorial/controlflow.rst:1061 +#: ../../tutorial/controlflow.rst:1067 msgid "coding" msgstr "" -#: ../../tutorial/controlflow.rst:1061 +#: ../../tutorial/controlflow.rst:1067 msgid "style" msgstr "" From 3cbf4bbaaf351d304dfcd291e25926eaaf5998d8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 18 Jul 2023 15:01:46 +0000 Subject: [PATCH 129/130] sync with cpython 38553442 --- howto/clinic.po | 752 ++++++++++++++++++++++++------------------------ 1 file changed, 375 insertions(+), 377 deletions(-) diff --git a/howto/clinic.po b/howto/clinic.po index 194a29a040..5d69bdcdd1 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-16 00:43+0000\n" +"POT-Creation-Date: 2023-07-18 14:59+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-" @@ -580,54 +580,48 @@ msgid "" msgstr "" #: ../../howto/clinic.rst:556 -msgid "Advanced topics" +msgid "How-to guides" msgstr "" -#: ../../howto/clinic.rst:558 -msgid "" -"Now that you've had some experience working with Argument Clinic, it's time " -"for some advanced topics." -msgstr "" - -#: ../../howto/clinic.rst:563 -msgid "Symbolic default values" +#: ../../howto/clinic.rst:560 +msgid "How to use symbolic default values" msgstr "" -#: ../../howto/clinic.rst:565 +#: ../../howto/clinic.rst:562 msgid "" "The default value you provide for a parameter can't be any arbitrary " "expression. Currently the following are explicitly supported:" msgstr "" -#: ../../howto/clinic.rst:568 +#: ../../howto/clinic.rst:565 msgid "Numeric constants (integer and float)" msgstr "" -#: ../../howto/clinic.rst:569 +#: ../../howto/clinic.rst:566 msgid "String constants" msgstr "" -#: ../../howto/clinic.rst:570 +#: ../../howto/clinic.rst:567 msgid "``True``, ``False``, and ``None``" msgstr "" -#: ../../howto/clinic.rst:571 +#: ../../howto/clinic.rst:568 msgid "" "Simple symbolic constants like ``sys.maxsize``, which must start with the " "name of the module" msgstr "" -#: ../../howto/clinic.rst:574 +#: ../../howto/clinic.rst:571 msgid "" "(In the future, this may need to get even more elaborate, to allow full " "expressions like ``CONSTANT - 1``.)" msgstr "" -#: ../../howto/clinic.rst:579 -msgid "Renaming the C functions and variables generated by Argument Clinic" +#: ../../howto/clinic.rst:576 +msgid "How to to rename C functions and variables generated by Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:581 +#: ../../howto/clinic.rst:578 msgid "" "Argument Clinic automatically names the functions it generates for you. " "Occasionally this may cause a problem, if the generated name collides with " @@ -639,19 +633,19 @@ msgid "" "impl function." msgstr "" -#: ../../howto/clinic.rst:589 +#: ../../howto/clinic.rst:586 msgid "" "For example, if we wanted to rename the C function names generated for " "``pickle.Pickler.dump``, it'd look like this::" msgstr "" -#: ../../howto/clinic.rst:597 +#: ../../howto/clinic.rst:594 msgid "" "The base function would now be named ``pickler_dumper()``, and the impl " "function would now be named ``pickler_dumper_impl()``." msgstr "" -#: ../../howto/clinic.rst:601 +#: ../../howto/clinic.rst:598 msgid "" "Similarly, you may have a problem where you want to give a parameter a " "specific Python name, but that name may be inconvenient in C. Argument " @@ -659,21 +653,21 @@ msgid "" "using the same ``\"as\"`` syntax::" msgstr "" -#: ../../howto/clinic.rst:615 +#: ../../howto/clinic.rst:612 msgid "" "Here, the name used in Python (in the signature and the ``keywords`` array) " "would be ``file``, but the C variable would be named ``file_obj``." msgstr "" -#: ../../howto/clinic.rst:618 +#: ../../howto/clinic.rst:615 msgid "You can use this to rename the ``self`` parameter too!" msgstr "" -#: ../../howto/clinic.rst:622 -msgid "Converting functions using PyArg_UnpackTuple" +#: ../../howto/clinic.rst:619 +msgid "How to convert functions using ``PyArg_UnpackTuple``" msgstr "" -#: ../../howto/clinic.rst:624 +#: ../../howto/clinic.rst:621 msgid "" "To convert a function parsing its arguments with :c:func:" "`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " @@ -682,17 +676,17 @@ msgid "" "a line by itself after the last argument)." msgstr "" -#: ../../howto/clinic.rst:630 +#: ../../howto/clinic.rst:627 msgid "" "Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " "will change soon." msgstr "" -#: ../../howto/clinic.rst:635 -msgid "Optional groups" +#: ../../howto/clinic.rst:632 +msgid "How to use optional groups" msgstr "" -#: ../../howto/clinic.rst:637 +#: ../../howto/clinic.rst:634 msgid "" "Some legacy functions have a tricky approach to parsing their arguments: " "they count the number of positional arguments, then use a ``switch`` " @@ -703,7 +697,7 @@ msgid "" "created." msgstr "" -#: ../../howto/clinic.rst:644 +#: ../../howto/clinic.rst:641 msgid "" "While functions using this approach can often be converted to use :c:func:" "`PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " @@ -717,7 +711,7 @@ msgid "" "pass in ``x`` you may not pass in ``y`` either.)" msgstr "" -#: ../../howto/clinic.rst:656 +#: ../../howto/clinic.rst:653 msgid "" "In any case, the goal of Argument Clinic is to support argument parsing for " "all existing CPython builtins without changing their semantics. Therefore " @@ -727,7 +721,7 @@ msgid "" "required arguments. They can *only* be used with positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:664 +#: ../../howto/clinic.rst:661 msgid "" "Optional groups are *only* intended for use when converting functions that " "make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " @@ -738,7 +732,7 @@ msgid "" "possible." msgstr "" -#: ../../howto/clinic.rst:673 +#: ../../howto/clinic.rst:670 msgid "" "To specify an optional group, add a ``[`` on a line by itself before the " "parameters you wish to group together, and a ``]`` on a line by itself after " @@ -747,11 +741,11 @@ msgid "" "optional::" msgstr "" -#: ../../howto/clinic.rst:702 +#: ../../howto/clinic.rst:699 msgid "Notes:" msgstr "註解:" -#: ../../howto/clinic.rst:704 +#: ../../howto/clinic.rst:701 msgid "" "For every optional group, one additional parameter will be passed into the " "impl function representing the group. The parameter will be an int named " @@ -764,33 +758,34 @@ msgid "" "I mean whether or not the parameters received arguments in this invocation.)" msgstr "" -#: ../../howto/clinic.rst:715 +#: ../../howto/clinic.rst:712 msgid "" "If there are no required arguments, the optional groups will behave as if " "they're to the right of the required arguments." msgstr "" -#: ../../howto/clinic.rst:718 +#: ../../howto/clinic.rst:715 msgid "" "In the case of ambiguity, the argument parsing code favors parameters on the " "left (before the required parameters)." msgstr "" -#: ../../howto/clinic.rst:721 +#: ../../howto/clinic.rst:718 msgid "Optional groups can only contain positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:723 +#: ../../howto/clinic.rst:720 msgid "" "Optional groups are *only* intended for legacy code. Please do not use " "optional groups for new code." msgstr "" -#: ../../howto/clinic.rst:728 -msgid "Using real Argument Clinic converters, instead of \"legacy converters\"" +#: ../../howto/clinic.rst:725 +msgid "" +"How to use real Argument Clinic converters, instead of \"legacy converters\"" msgstr "" -#: ../../howto/clinic.rst:730 +#: ../../howto/clinic.rst:727 msgid "" "To save time, and to minimize how much you need to learn to achieve your " "first port to Argument Clinic, the walkthrough above tells you to use " @@ -799,38 +794,38 @@ msgid "" "be clear, their use is acceptable when porting code for Python 3.4." msgstr "" -#: ../../howto/clinic.rst:737 +#: ../../howto/clinic.rst:734 msgid "" "However, in the long term we probably want all our blocks to use Argument " "Clinic's real syntax for converters. Why? A couple reasons:" msgstr "" -#: ../../howto/clinic.rst:741 +#: ../../howto/clinic.rst:738 msgid "" "The proper converters are far easier to read and clearer in their intent." msgstr "" -#: ../../howto/clinic.rst:742 +#: ../../howto/clinic.rst:739 msgid "" "There are some format units that are unsupported as \"legacy converters\", " "because they require arguments, and the legacy converter syntax doesn't " "support specifying arguments." msgstr "" -#: ../../howto/clinic.rst:745 +#: ../../howto/clinic.rst:742 msgid "" "In the future we may have a new argument parsing library that isn't " "restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " "won't be available to parameters using legacy converters." msgstr "" -#: ../../howto/clinic.rst:749 +#: ../../howto/clinic.rst:746 msgid "" "Therefore, if you don't mind a little extra effort, please use the normal " "converters instead of legacy converters." msgstr "" -#: ../../howto/clinic.rst:752 +#: ../../howto/clinic.rst:749 msgid "" "In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " "like a Python function call. However, if there are no explicit arguments to " @@ -838,17 +833,17 @@ msgid "" "parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." msgstr "" -#: ../../howto/clinic.rst:758 +#: ../../howto/clinic.rst:755 msgid "" "All arguments to Argument Clinic converters are keyword-only. All Argument " "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:766 ../../howto/clinic.rst:1332 +#: ../../howto/clinic.rst:763 ../../howto/clinic.rst:1329 msgid "``c_default``" msgstr "``c_default``" -#: ../../howto/clinic.rst:762 +#: ../../howto/clinic.rst:759 msgid "" "The default value for this parameter when defined in C. Specifically, this " "will be the initializer for the variable declared in the \"parse " @@ -856,27 +851,27 @@ msgid "" "how to use this. Specified as a string." msgstr "" -#: ../../howto/clinic.rst:771 +#: ../../howto/clinic.rst:768 msgid "``annotation``" msgstr "``annotation``" -#: ../../howto/clinic.rst:769 +#: ../../howto/clinic.rst:766 msgid "" "The annotation value for this parameter. Not currently supported, because :" "pep:`8` mandates that the Python library may not use annotations." msgstr "" -#: ../../howto/clinic.rst:773 +#: ../../howto/clinic.rst:770 msgid "" "In addition, some converters accept additional arguments. Here is a list of " "these arguments, along with their meanings:" msgstr "" -#: ../../howto/clinic.rst:782 +#: ../../howto/clinic.rst:779 msgid "``accept``" msgstr "``accept``" -#: ../../howto/clinic.rst:777 +#: ../../howto/clinic.rst:774 msgid "" "A set of Python types (and possibly pseudo-types); this restricts the " "allowable Python argument to values of these types. (This is not a general-" @@ -884,68 +879,68 @@ msgid "" "shown in the legacy converter table.)" msgstr "" -#: ../../howto/clinic.rst:782 +#: ../../howto/clinic.rst:779 msgid "To accept ``None``, add ``NoneType`` to this set." msgstr "" -#: ../../howto/clinic.rst:787 +#: ../../howto/clinic.rst:784 msgid "``bitwise``" msgstr "``bitwise``" -#: ../../howto/clinic.rst:785 +#: ../../howto/clinic.rst:782 msgid "" "Only supported for unsigned integers. The native integer value of this " "Python argument will be written to the parameter without any range checking, " "even for negative values." msgstr "" -#: ../../howto/clinic.rst:792 ../../howto/clinic.rst:1346 +#: ../../howto/clinic.rst:789 ../../howto/clinic.rst:1343 msgid "``converter``" msgstr "``converter``" -#: ../../howto/clinic.rst:790 +#: ../../howto/clinic.rst:787 msgid "" "Only supported by the ``object`` converter. Specifies the name of a :ref:`C " "\"converter function\" ` to use to convert this object to a " "native type." msgstr "" -#: ../../howto/clinic.rst:797 +#: ../../howto/clinic.rst:794 msgid "``encoding``" msgstr "``encoding``" -#: ../../howto/clinic.rst:795 +#: ../../howto/clinic.rst:792 msgid "" "Only supported for strings. Specifies the encoding to use when converting " "this string from a Python str (Unicode) value into a C ``char *`` value." msgstr "" -#: ../../howto/clinic.rst:801 +#: ../../howto/clinic.rst:798 msgid "``subclass_of``" msgstr "``subclass_of``" -#: ../../howto/clinic.rst:800 +#: ../../howto/clinic.rst:797 msgid "" "Only supported for the ``object`` converter. Requires that the Python value " "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:806 ../../howto/clinic.rst:1318 +#: ../../howto/clinic.rst:803 ../../howto/clinic.rst:1315 msgid "``type``" msgstr "``type``" -#: ../../howto/clinic.rst:804 +#: ../../howto/clinic.rst:801 msgid "" "Only supported for the ``object`` and ``self`` converters. Specifies the C " "type that will be used to declare the variable. Default value is " "``\"PyObject *\"``." msgstr "" -#: ../../howto/clinic.rst:812 +#: ../../howto/clinic.rst:809 msgid "``zeroes``" msgstr "``zeroes``" -#: ../../howto/clinic.rst:809 +#: ../../howto/clinic.rst:806 msgid "" "Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " "permitted inside the value. The length of the string will be passed in to " @@ -953,7 +948,7 @@ msgid "" "``_length``." msgstr "" -#: ../../howto/clinic.rst:814 +#: ../../howto/clinic.rst:811 msgid "" "Please note, not every possible combination of arguments will work. Usually " "these arguments are implemented by specific ``PyArg_ParseTuple`` *format " @@ -964,350 +959,350 @@ msgid "" "least, not yet.)" msgstr "" -#: ../../howto/clinic.rst:822 +#: ../../howto/clinic.rst:819 msgid "" "Below is a table showing the mapping of legacy converters into real Argument " "Clinic converters. On the left is the legacy converter, on the right is the " "text you'd replace it with." msgstr "" -#: ../../howto/clinic.rst:827 +#: ../../howto/clinic.rst:824 msgid "``'B'``" msgstr "``'B'``" -#: ../../howto/clinic.rst:827 +#: ../../howto/clinic.rst:824 msgid "``unsigned_char(bitwise=True)``" msgstr "``unsigned_char(bitwise=True)``" -#: ../../howto/clinic.rst:828 +#: ../../howto/clinic.rst:825 msgid "``'b'``" msgstr "``'b'``" -#: ../../howto/clinic.rst:828 +#: ../../howto/clinic.rst:825 msgid "``unsigned_char``" msgstr "``unsigned_char``" -#: ../../howto/clinic.rst:829 +#: ../../howto/clinic.rst:826 msgid "``'c'``" msgstr "``'c'``" -#: ../../howto/clinic.rst:829 +#: ../../howto/clinic.rst:826 msgid "``char``" msgstr "``char``" -#: ../../howto/clinic.rst:830 +#: ../../howto/clinic.rst:827 msgid "``'C'``" msgstr "``'C'``" -#: ../../howto/clinic.rst:830 +#: ../../howto/clinic.rst:827 msgid "``int(accept={str})``" msgstr "``int(accept={str})``" -#: ../../howto/clinic.rst:831 +#: ../../howto/clinic.rst:828 msgid "``'d'``" msgstr "``'d'``" -#: ../../howto/clinic.rst:831 +#: ../../howto/clinic.rst:828 msgid "``double``" msgstr "``double``" -#: ../../howto/clinic.rst:832 +#: ../../howto/clinic.rst:829 msgid "``'D'``" msgstr "``'D'``" -#: ../../howto/clinic.rst:832 +#: ../../howto/clinic.rst:829 msgid "``Py_complex``" msgstr "``Py_complex``" -#: ../../howto/clinic.rst:833 +#: ../../howto/clinic.rst:830 msgid "``'es'``" msgstr "``'es'``" -#: ../../howto/clinic.rst:833 +#: ../../howto/clinic.rst:830 msgid "``str(encoding='name_of_encoding')``" msgstr "``str(encoding='name_of_encoding')``" -#: ../../howto/clinic.rst:834 +#: ../../howto/clinic.rst:831 msgid "``'es#'``" msgstr "``'es#'``" -#: ../../howto/clinic.rst:834 +#: ../../howto/clinic.rst:831 msgid "``str(encoding='name_of_encoding', zeroes=True)``" msgstr "``str(encoding='name_of_encoding', zeroes=True)``" -#: ../../howto/clinic.rst:835 +#: ../../howto/clinic.rst:832 msgid "``'et'``" msgstr "``'et'``" -#: ../../howto/clinic.rst:835 +#: ../../howto/clinic.rst:832 msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:833 msgid "``'et#'``" msgstr "``'et#'``" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:833 msgid "" "``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " "zeroes=True)``" msgstr "" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:834 msgid "``'f'``" msgstr "``'f'``" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:834 msgid "``float``" msgstr "``float``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:835 msgid "``'h'``" msgstr "``'h'``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:835 msgid "``short``" msgstr "``short``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:836 msgid "``'H'``" msgstr "``'H'``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:836 msgid "``unsigned_short(bitwise=True)``" msgstr "``unsigned_short(bitwise=True)``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:837 msgid "``'i'``" msgstr "``'i'``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:837 msgid "``int``" msgstr "``int``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:838 msgid "``'I'``" msgstr "``'I'``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:838 msgid "``unsigned_int(bitwise=True)``" msgstr "``unsigned_int(bitwise=True)``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:839 msgid "``'k'``" msgstr "``'k'``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:839 msgid "``unsigned_long(bitwise=True)``" msgstr "``unsigned_long(bitwise=True)``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:840 msgid "``'K'``" msgstr "``'K'``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:840 msgid "``unsigned_long_long(bitwise=True)``" msgstr "``unsigned_long_long(bitwise=True)``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:841 msgid "``'l'``" msgstr "``'l'``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:841 msgid "``long``" msgstr "``long``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:842 msgid "``'L'``" msgstr "``'L'``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:842 msgid "``long long``" msgstr "``long long``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:843 msgid "``'n'``" msgstr "``'n'``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:843 msgid "``Py_ssize_t``" msgstr "``Py_ssize_t``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:844 msgid "``'O'``" msgstr "``'O'``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:844 msgid "``object``" msgstr "``object``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:845 msgid "``'O!'``" msgstr "``'O!'``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:845 msgid "``object(subclass_of='&PySomething_Type')``" msgstr "``object(subclass_of='&PySomething_Type')``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:846 msgid "``'O&'``" msgstr "``'O&'``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:846 msgid "``object(converter='name_of_c_function')``" msgstr "``object(converter='name_of_c_function')``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:847 msgid "``'p'``" msgstr "``'p'``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:847 msgid "``bool``" msgstr "``bool``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:848 msgid "``'S'``" msgstr "``'S'``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:848 msgid "``PyBytesObject``" msgstr "``PyBytesObject``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:849 msgid "``'s'``" msgstr "``'s'``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:849 msgid "``str``" msgstr "``str``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:850 msgid "``'s#'``" msgstr "``'s#'``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:850 msgid "``str(zeroes=True)``" msgstr "``str(zeroes=True)``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:851 msgid "``'s*'``" msgstr "``'s*'``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:851 msgid "``Py_buffer(accept={buffer, str})``" msgstr "``Py_buffer(accept={buffer, str})``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:852 msgid "``'U'``" msgstr "``'U'``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:852 msgid "``unicode``" msgstr "``unicode``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:853 msgid "``'u'``" msgstr "``'u'``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:853 msgid "``Py_UNICODE``" msgstr "``Py_UNICODE``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:854 msgid "``'u#'``" msgstr "``'u#'``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:854 msgid "``Py_UNICODE(zeroes=True)``" msgstr "``Py_UNICODE(zeroes=True)``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:855 msgid "``'w*'``" msgstr "``'w*'``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:855 msgid "``Py_buffer(accept={rwbuffer})``" msgstr "``Py_buffer(accept={rwbuffer})``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:856 msgid "``'Y'``" msgstr "``'Y'``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:856 msgid "``PyByteArrayObject``" msgstr "``PyByteArrayObject``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:857 msgid "``'y'``" msgstr "``'y'``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:857 msgid "``str(accept={bytes})``" msgstr "``str(accept={bytes})``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:858 msgid "``'y#'``" msgstr "``'y#'``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:858 msgid "``str(accept={robuffer}, zeroes=True)``" msgstr "``str(accept={robuffer}, zeroes=True)``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:859 msgid "``'y*'``" msgstr "``'y*'``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:859 msgid "``Py_buffer``" msgstr "``Py_buffer``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:860 msgid "``'Z'``" msgstr "``'Z'``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:860 msgid "``Py_UNICODE(accept={str, NoneType})``" msgstr "``Py_UNICODE(accept={str, NoneType})``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:861 msgid "``'Z#'``" msgstr "``'Z#'``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:861 msgid "``Py_UNICODE(accept={str, NoneType}, zeroes=True)``" msgstr "``Py_UNICODE(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:865 +#: ../../howto/clinic.rst:862 msgid "``'z'``" msgstr "``'z'``" -#: ../../howto/clinic.rst:865 +#: ../../howto/clinic.rst:862 msgid "``str(accept={str, NoneType})``" msgstr "``str(accept={str, NoneType})``" -#: ../../howto/clinic.rst:866 +#: ../../howto/clinic.rst:863 msgid "``'z#'``" msgstr "``'z#'``" -#: ../../howto/clinic.rst:866 +#: ../../howto/clinic.rst:863 msgid "``str(accept={str, NoneType}, zeroes=True)``" msgstr "``str(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:864 msgid "``'z*'``" msgstr "``'z*'``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:864 msgid "``Py_buffer(accept={buffer, str, NoneType})``" msgstr "``Py_buffer(accept={buffer, str, NoneType})``" -#: ../../howto/clinic.rst:870 +#: ../../howto/clinic.rst:867 msgid "" "As an example, here's our sample ``pickle.Pickler.dump`` using the proper " "converter::" msgstr "" -#: ../../howto/clinic.rst:883 +#: ../../howto/clinic.rst:880 msgid "" "One advantage of real converters is that they're more flexible than legacy " "converters. For example, the ``unsigned_int`` converter (and all the " @@ -1316,7 +1311,7 @@ msgid "" "negative numbers. You just can't do that with a legacy converter!" msgstr "" -#: ../../howto/clinic.rst:889 +#: ../../howto/clinic.rst:886 msgid "" "Argument Clinic will show you all the converters it has available. For each " "converter it'll show you all the parameters it accepts, along with the " @@ -1324,11 +1319,11 @@ msgid "" "converters`` to see the full list." msgstr "" -#: ../../howto/clinic.rst:896 -msgid "Py_buffer" -msgstr "Py_buffer" +#: ../../howto/clinic.rst:893 +msgid "How to use the ``Py_buffer`` converter" +msgstr "" -#: ../../howto/clinic.rst:898 +#: ../../howto/clinic.rst:895 msgid "" "When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " "or ``'z*'`` legacy converters), you *must* not call :c:func:" @@ -1336,17 +1331,17 @@ msgid "" "that does it for you (in the parsing function)." msgstr "" -#: ../../howto/clinic.rst:905 -msgid "Advanced converters" +#: ../../howto/clinic.rst:902 +msgid "How to use advanced converters" msgstr "" -#: ../../howto/clinic.rst:907 +#: ../../howto/clinic.rst:904 msgid "" "Remember those format units you skipped for your first time because they " "were advanced? Here's how to handle those too." msgstr "" -#: ../../howto/clinic.rst:910 +#: ../../howto/clinic.rst:907 msgid "" "The trick is, all those format units take arguments—either conversion " "functions, or types, or strings specifying an encoding. (But \"legacy " @@ -1357,7 +1352,7 @@ msgid "" "units that start with ``e``)." msgstr "" -#: ../../howto/clinic.rst:918 +#: ../../howto/clinic.rst:915 msgid "" "When using ``subclass_of``, you may also want to use the other custom " "argument for ``object()``: ``type``, which lets you set the type actually " @@ -1366,7 +1361,7 @@ msgid "" "``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." msgstr "" -#: ../../howto/clinic.rst:924 +#: ../../howto/clinic.rst:921 msgid "" "One possible problem with using Argument Clinic: it takes away some possible " "flexibility for the format units starting with ``e``. When writing a " @@ -1379,31 +1374,31 @@ msgid "" "strings for parameters whose format units start with ``e``." msgstr "" -#: ../../howto/clinic.rst:937 -msgid "Parameter default values" +#: ../../howto/clinic.rst:934 +msgid "How to assign default values to parameter" msgstr "" -#: ../../howto/clinic.rst:939 +#: ../../howto/clinic.rst:936 msgid "" "Default values for parameters can be any of a number of values. At their " "simplest, they can be string, int, or float literals:" msgstr "" -#: ../../howto/clinic.rst:948 +#: ../../howto/clinic.rst:945 msgid "They can also use any of Python's built-in constants:" msgstr "" -#: ../../howto/clinic.rst:956 +#: ../../howto/clinic.rst:953 msgid "" "There's also special support for a default value of ``NULL``, and for simple " "expressions, documented in the following sections." msgstr "" -#: ../../howto/clinic.rst:961 -msgid "The ``NULL`` default value" +#: ../../howto/clinic.rst:958 +msgid "How to use the ``NULL`` default value" msgstr "" -#: ../../howto/clinic.rst:963 +#: ../../howto/clinic.rst:960 msgid "" "For string and object parameters, you can set them to ``None`` to indicate " "that there's no default. However, that means the C variable will be " @@ -1413,11 +1408,11 @@ msgid "" "with ``NULL``." msgstr "" -#: ../../howto/clinic.rst:972 -msgid "Expressions specified as default values" +#: ../../howto/clinic.rst:969 +msgid "How to use expressions as default values" msgstr "" -#: ../../howto/clinic.rst:974 +#: ../../howto/clinic.rst:971 msgid "" "The default value for a parameter can be more than just a literal value. It " "can be an entire expression, using math operators and looking up attributes " @@ -1425,11 +1420,11 @@ msgid "" "obvious semantics." msgstr "" -#: ../../howto/clinic.rst:979 +#: ../../howto/clinic.rst:976 msgid "Consider the following example:" msgstr "" -#: ../../howto/clinic.rst:985 +#: ../../howto/clinic.rst:982 msgid "" "``sys.maxsize`` can have different values on different platforms. Therefore " "Argument Clinic can't simply evaluate that expression locally and hard-code " @@ -1437,14 +1432,14 @@ msgid "" "at runtime, when the user asks for the function's signature." msgstr "" -#: ../../howto/clinic.rst:990 +#: ../../howto/clinic.rst:987 msgid "" "What namespace is available when the expression is evaluated? It's " "evaluated in the context of the module the builtin came from. So, if your " "module has an attribute called \"``max_widgets``\", you may simply use it:" msgstr "" -#: ../../howto/clinic.rst:998 +#: ../../howto/clinic.rst:995 msgid "" "If the symbol isn't found in the current module, it fails over to looking in " "``sys.modules``. That's how it can find ``sys.maxsize`` for example. " @@ -1453,7 +1448,7 @@ msgid "" "Python itself.)" msgstr "" -#: ../../howto/clinic.rst:1003 +#: ../../howto/clinic.rst:1000 msgid "" "Evaluating default values only at runtime means Argument Clinic can't " "compute the correct equivalent C default value. So you need to tell it " @@ -1461,7 +1456,7 @@ msgid "" "expression in C, using the ``c_default`` parameter to the converter:" msgstr "" -#: ../../howto/clinic.rst:1012 +#: ../../howto/clinic.rst:1009 msgid "" "Another complication: Argument Clinic can't know in advance whether or not " "the expression you supply is valid. It parses it to make sure it looks " @@ -1469,38 +1464,38 @@ msgid "" "expressions to specify values that are guaranteed to be valid at runtime!" msgstr "" -#: ../../howto/clinic.rst:1017 +#: ../../howto/clinic.rst:1014 msgid "" "Finally, because expressions must be representable as static C values, there " "are many restrictions on legal expressions. Here's a list of Python " "features you're not permitted to use:" msgstr "" -#: ../../howto/clinic.rst:1021 +#: ../../howto/clinic.rst:1018 msgid "Function calls." msgstr "" -#: ../../howto/clinic.rst:1022 +#: ../../howto/clinic.rst:1019 msgid "Inline if statements (``3 if foo else 5``)." msgstr "" -#: ../../howto/clinic.rst:1023 +#: ../../howto/clinic.rst:1020 msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." msgstr "" -#: ../../howto/clinic.rst:1024 +#: ../../howto/clinic.rst:1021 msgid "List/set/dict comprehensions and generator expressions." msgstr "" -#: ../../howto/clinic.rst:1025 +#: ../../howto/clinic.rst:1022 msgid "Tuple/list/set/dict literals." msgstr "" -#: ../../howto/clinic.rst:1029 -msgid "Using a return converter" +#: ../../howto/clinic.rst:1026 +msgid "How to use return converters" msgstr "" -#: ../../howto/clinic.rst:1031 +#: ../../howto/clinic.rst:1028 msgid "" "By default, the impl function Argument Clinic generates for you returns :c:" "type:`PyObject * `. But your C function often computes some C " @@ -1510,38 +1505,38 @@ msgid "" "a Python type too?" msgstr "" -#: ../../howto/clinic.rst:1039 +#: ../../howto/clinic.rst:1036 msgid "" "That's what a \"return converter\" does. It changes your impl function to " "return some C type, then adds code to the generated (non-impl) function to " "handle converting that value into the appropriate :c:type:`!PyObject *`." msgstr "" -#: ../../howto/clinic.rst:1043 +#: ../../howto/clinic.rst:1040 msgid "" "The syntax for return converters is similar to that of parameter converters. " "You specify the return converter like it was a return annotation on the " "function itself, using ``->`` notation." msgstr "" -#: ../../howto/clinic.rst:1047 +#: ../../howto/clinic.rst:1044 msgid "For example:" msgstr "" -#: ../../howto/clinic.rst:1060 +#: ../../howto/clinic.rst:1057 msgid "" "Return converters behave much the same as parameter converters; they take " "arguments, the arguments are all keyword-only, and if you're not changing " "any of the default arguments you can omit the parentheses." msgstr "" -#: ../../howto/clinic.rst:1064 +#: ../../howto/clinic.rst:1061 msgid "" "(If you use both ``\"as\"`` *and* a return converter for your function, the " "``\"as\"`` should come before the return converter.)" msgstr "" -#: ../../howto/clinic.rst:1067 +#: ../../howto/clinic.rst:1064 msgid "" "There's one additional complication when using return converters: how do you " "indicate an error has occurred? Normally, a function returns a valid (non-" @@ -1554,17 +1549,17 @@ msgid "" "you return like normal." msgstr "" -#: ../../howto/clinic.rst:1076 +#: ../../howto/clinic.rst:1073 msgid "Currently Argument Clinic supports only a few return converters:" msgstr "" -#: ../../howto/clinic.rst:1090 +#: ../../howto/clinic.rst:1087 msgid "" "None of these take parameters. For all of these, return ``-1`` to indicate " "error." msgstr "" -#: ../../howto/clinic.rst:1093 +#: ../../howto/clinic.rst:1090 msgid "" "(There's also an experimental ``NoneType`` converter, which lets you return " "``Py_None`` on success or ``NULL`` on failure, without having to increment " @@ -1572,117 +1567,117 @@ msgid "" "be worth using.)" msgstr "" -#: ../../howto/clinic.rst:1098 +#: ../../howto/clinic.rst:1095 msgid "" "To see all the return converters Argument Clinic supports, along with their " "parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " "the full list." msgstr "" -#: ../../howto/clinic.rst:1104 -msgid "Cloning existing functions" +#: ../../howto/clinic.rst:1101 +msgid "How to clone existing functions" msgstr "" -#: ../../howto/clinic.rst:1106 +#: ../../howto/clinic.rst:1103 msgid "" "If you have a number of functions that look similar, you may be able to use " "Clinic's \"clone\" feature. When you clone an existing function, you reuse:" msgstr "" -#: ../../howto/clinic.rst:1110 +#: ../../howto/clinic.rst:1107 msgid "its parameters, including" msgstr "" -#: ../../howto/clinic.rst:1112 +#: ../../howto/clinic.rst:1109 msgid "their names," msgstr "" -#: ../../howto/clinic.rst:1114 +#: ../../howto/clinic.rst:1111 msgid "their converters, with all parameters," msgstr "" -#: ../../howto/clinic.rst:1116 +#: ../../howto/clinic.rst:1113 msgid "their default values," msgstr "" -#: ../../howto/clinic.rst:1118 +#: ../../howto/clinic.rst:1115 msgid "their per-parameter docstrings," msgstr "" -#: ../../howto/clinic.rst:1120 +#: ../../howto/clinic.rst:1117 msgid "" "their *kind* (whether they're positional only, positional or keyword, or " "keyword only), and" msgstr "" -#: ../../howto/clinic.rst:1123 +#: ../../howto/clinic.rst:1120 msgid "its return converter." msgstr "" -#: ../../howto/clinic.rst:1125 +#: ../../howto/clinic.rst:1122 msgid "" "The only thing not copied from the original function is its docstring; the " "syntax allows you to specify a new docstring." msgstr "" -#: ../../howto/clinic.rst:1128 +#: ../../howto/clinic.rst:1125 msgid "Here's the syntax for cloning a function::" msgstr "" -#: ../../howto/clinic.rst:1136 +#: ../../howto/clinic.rst:1133 msgid "" "(The functions can be in different modules or classes. I wrote ``module." "class`` in the sample just to illustrate that you must use the full path to " "*both* functions.)" msgstr "" -#: ../../howto/clinic.rst:1140 +#: ../../howto/clinic.rst:1137 msgid "" "Sorry, there's no syntax for partially cloning a function, or cloning a " "function then modifying it. Cloning is an all-or nothing proposition." msgstr "" -#: ../../howto/clinic.rst:1143 +#: ../../howto/clinic.rst:1140 msgid "" "Also, the function you are cloning from must have been previously defined in " "the current file." msgstr "" -#: ../../howto/clinic.rst:1148 -msgid "Calling Python code" +#: ../../howto/clinic.rst:1145 +msgid "How to call Python code" msgstr "" -#: ../../howto/clinic.rst:1150 +#: ../../howto/clinic.rst:1147 msgid "" "The rest of the advanced topics require you to write Python code which lives " "inside your C file and modifies Argument Clinic's runtime state. This is " "simple: you simply define a Python block." msgstr "" -#: ../../howto/clinic.rst:1154 +#: ../../howto/clinic.rst:1151 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1161 +#: ../../howto/clinic.rst:1158 msgid "" "All the code inside the Python block is executed at the time it's parsed. " "All text written to stdout inside the block is redirected into the " "\"output\" after the block." msgstr "" -#: ../../howto/clinic.rst:1165 +#: ../../howto/clinic.rst:1162 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1176 -msgid "Using a \"self converter\"" +#: ../../howto/clinic.rst:1173 +msgid "How to use the \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1178 +#: ../../howto/clinic.rst:1175 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " @@ -1693,13 +1688,13 @@ msgid "" "a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1187 +#: ../../howto/clinic.rst:1184 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1190 +#: ../../howto/clinic.rst:1187 msgid "" "How do you specify the custom type you want to cast ``self`` to? If you only " "have one or two functions with the same type for ``self``, you can directly " @@ -1707,18 +1702,18 @@ msgid "" "want to use as the ``type`` parameter::" msgstr "" -#: ../../howto/clinic.rst:1206 +#: ../../howto/clinic.rst:1203 msgid "" "On the other hand, if you have a lot of functions that will use the same " "type for ``self``, it's best to create your own converter, subclassing " "``self_converter`` but overwriting the ``type`` member::" msgstr "" -#: ../../howto/clinic.rst:1228 -msgid "Using a \"defining class\" converter" +#: ../../howto/clinic.rst:1225 +msgid "How to use the \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1230 +#: ../../howto/clinic.rst:1227 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1728,25 +1723,25 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1236 +#: ../../howto/clinic.rst:1233 msgid "" "Example from ``Modules/zlibmodule.c``. First, ``defining_class`` is added " "to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1248 +#: ../../howto/clinic.rst:1245 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1258 +#: ../../howto/clinic.rst:1255 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1264 +#: ../../howto/clinic.rst:1261 msgid "" "Each method may only have one argument using this converter, and it must " "appear after ``self``, or, if ``self`` is not used, as the first argument. " @@ -1754,13 +1749,13 @@ msgid "" "appear in the ``__text_signature__``." msgstr "" -#: ../../howto/clinic.rst:1269 +#: ../../howto/clinic.rst:1266 msgid "" "The ``defining_class`` converter is not compatible with ``__init__`` and " "``__new__`` methods, which cannot use the ``METH_METHOD`` convention." msgstr "" -#: ../../howto/clinic.rst:1272 +#: ../../howto/clinic.rst:1269 msgid "" "It is not possible to use ``defining_class`` with slot methods. In order to " "fetch the module state from such methods, use :c:func:" @@ -1769,15 +1764,15 @@ msgid "" "``setattro`` slot method in ``Modules/_threadmodule.c``::" msgstr "" -#: ../../howto/clinic.rst:1287 +#: ../../howto/clinic.rst:1284 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1291 -msgid "Writing a custom converter" +#: ../../howto/clinic.rst:1288 +msgid "How to write a custom converter" msgstr "" -#: ../../howto/clinic.rst:1293 +#: ../../howto/clinic.rst:1290 msgid "" "As we hinted at in the previous section... you can write your own " "converters! A converter is simply a Python class that inherits from " @@ -1786,7 +1781,7 @@ msgid "" "a :c:func:`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1299 +#: ../../howto/clinic.rst:1296 msgid "" "Your converter class should be named ``*something*_converter``. If the name " "follows this convention, then your converter class will be automatically " @@ -1795,7 +1790,7 @@ msgid "" "metaclass.)" msgstr "" -#: ../../howto/clinic.rst:1305 +#: ../../howto/clinic.rst:1302 msgid "" "You shouldn't subclass ``CConverter.__init__``. Instead, you should write a " "``converter_init()`` function. ``converter_init()`` always accepts a " @@ -1804,50 +1799,50 @@ msgid "" "passed along to your ``converter_init()``." msgstr "" -#: ../../howto/clinic.rst:1312 +#: ../../howto/clinic.rst:1309 msgid "" "There are some additional members of ``CConverter`` you may wish to specify " "in your subclass. Here's the current list:" msgstr "" -#: ../../howto/clinic.rst:1316 +#: ../../howto/clinic.rst:1313 msgid "" "The C type to use for this variable. ``type`` should be a Python string " "specifying the type, e.g. ``int``. If this is a pointer type, the type " "string should end with ``' *'``." msgstr "" -#: ../../howto/clinic.rst:1322 +#: ../../howto/clinic.rst:1319 msgid "``default``" msgstr "``default``" -#: ../../howto/clinic.rst:1321 +#: ../../howto/clinic.rst:1318 msgid "" "The Python default value for this parameter, as a Python value. Or the magic " "value ``unspecified`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1327 +#: ../../howto/clinic.rst:1324 msgid "``py_default``" msgstr "``py_default``" -#: ../../howto/clinic.rst:1325 +#: ../../howto/clinic.rst:1322 msgid "" "``default`` as it should appear in Python code, as a string. Or ``None`` if " "there is no default." msgstr "" -#: ../../howto/clinic.rst:1330 +#: ../../howto/clinic.rst:1327 msgid "" "``default`` as it should appear in C code, as a string. Or ``None`` if there " "is no default." msgstr "" -#: ../../howto/clinic.rst:1343 +#: ../../howto/clinic.rst:1340 msgid "``c_ignored_default``" msgstr "``c_ignored_default``" -#: ../../howto/clinic.rst:1335 +#: ../../howto/clinic.rst:1332 msgid "" "The default value used to initialize the C variable when there is no " "default, but not specifying a default may result in an \"uninitialized " @@ -1858,37 +1853,37 @@ msgid "" "non-empty string." msgstr "" -#: ../../howto/clinic.rst:1346 +#: ../../howto/clinic.rst:1343 msgid "The name of the C converter function, as a string." msgstr "" -#: ../../howto/clinic.rst:1351 +#: ../../howto/clinic.rst:1348 msgid "``impl_by_reference``" msgstr "``impl_by_reference``" -#: ../../howto/clinic.rst:1349 +#: ../../howto/clinic.rst:1346 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into the impl function." msgstr "" -#: ../../howto/clinic.rst:1357 +#: ../../howto/clinic.rst:1354 msgid "``parse_by_reference``" msgstr "``parse_by_reference``" -#: ../../howto/clinic.rst:1354 +#: ../../howto/clinic.rst:1351 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into :c:func:`PyArg_ParseTuple`." msgstr "" -#: ../../howto/clinic.rst:1359 +#: ../../howto/clinic.rst:1356 msgid "" "Here's the simplest example of a custom converter, from ``Modules/zlibmodule." "c``::" msgstr "" -#: ../../howto/clinic.rst:1370 +#: ../../howto/clinic.rst:1367 msgid "" "This block adds a converter to Argument Clinic named ``ssize_t``. " "Parameters declared as ``ssize_t`` will be declared as type :c:type:" @@ -1897,25 +1892,25 @@ msgid "" "automatically support default values." msgstr "" -#: ../../howto/clinic.rst:1376 +#: ../../howto/clinic.rst:1373 msgid "" "More sophisticated custom converters can insert custom C code to handle " "initialization and cleanup. You can see more examples of custom converters " "in the CPython source tree; grep the C files for the string ``CConverter``." msgstr "" -#: ../../howto/clinic.rst:1383 -msgid "Writing a custom return converter" +#: ../../howto/clinic.rst:1380 +msgid "How to write a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1385 +#: ../../howto/clinic.rst:1382 msgid "" "Writing a custom return converter is much like writing a custom converter. " "Except it's somewhat simpler, because return converters are themselves much " "simpler." msgstr "" -#: ../../howto/clinic.rst:1389 +#: ../../howto/clinic.rst:1386 msgid "" "Return converters must subclass ``CReturnConverter``. There are no examples " "yet of custom return converters, because they are not widely used yet. If " @@ -1924,59 +1919,59 @@ msgid "" "its subclasses." msgstr "" -#: ../../howto/clinic.rst:1398 -msgid "METH_O and METH_NOARGS" +#: ../../howto/clinic.rst:1395 +msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" msgstr "" -#: ../../howto/clinic.rst:1400 +#: ../../howto/clinic.rst:1397 msgid "" "To convert a function using ``METH_O``, make sure the function's single " "argument is using the ``object`` converter, and mark the arguments as " "positional-only::" msgstr "" -#: ../../howto/clinic.rst:1412 +#: ../../howto/clinic.rst:1409 msgid "" "To convert a function using ``METH_NOARGS``, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1415 +#: ../../howto/clinic.rst:1412 msgid "" "You can still use a self converter, a return converter, and specify a " "``type`` argument to the object converter for ``METH_O``." msgstr "" -#: ../../howto/clinic.rst:1420 -msgid "tp_new and tp_init functions" +#: ../../howto/clinic.rst:1417 +msgid "How to convert ``tp_new`` and ``tp_init`` functions" msgstr "" -#: ../../howto/clinic.rst:1422 +#: ../../howto/clinic.rst:1419 msgid "" "You can convert ``tp_new`` and ``tp_init`` functions. Just name them " "``__new__`` or ``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1425 +#: ../../howto/clinic.rst:1422 msgid "" "The function name generated for ``__new__`` doesn't end in ``__new__`` like " "it would by default. It's just the name of the class, converted into a " "valid C identifier." msgstr "" -#: ../../howto/clinic.rst:1429 +#: ../../howto/clinic.rst:1426 msgid "No ``PyMethodDef`` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1431 +#: ../../howto/clinic.rst:1428 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1433 +#: ../../howto/clinic.rst:1430 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1435 +#: ../../howto/clinic.rst:1432 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -1985,11 +1980,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1443 -msgid "Changing and redirecting Clinic's output" +#: ../../howto/clinic.rst:1440 +msgid "How to change and redirect Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1445 +#: ../../howto/clinic.rst:1442 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -1998,7 +1993,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1451 +#: ../../howto/clinic.rst:1448 msgid "" "While changing Clinic's output in this manner can be a boon to readability, " "it may result in Clinic code using types before they are defined, or your " @@ -2010,15 +2005,15 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1460 +#: ../../howto/clinic.rst:1457 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1487 +#: ../../howto/clinic.rst:1484 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1463 +#: ../../howto/clinic.rst:1460 msgid "" "A field, in this context, is a subsection of Clinic's output. For example, " "the ``#define`` for the ``PyMethodDef`` structure is a field, called " @@ -2026,7 +2021,7 @@ msgid "" "function definition:" msgstr "" -#: ../../howto/clinic.rst:1478 +#: ../../howto/clinic.rst:1475 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2039,45 +2034,45 @@ msgid "" "``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1521 +#: ../../howto/clinic.rst:1518 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1490 +#: ../../howto/clinic.rst:1487 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1495 ../../howto/clinic.rst:1570 -#: ../../howto/clinic.rst:1648 +#: ../../howto/clinic.rst:1492 ../../howto/clinic.rst:1567 +#: ../../howto/clinic.rst:1645 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1494 +#: ../../howto/clinic.rst:1491 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1501 ../../howto/clinic.rst:1597 -#: ../../howto/clinic.rst:1651 +#: ../../howto/clinic.rst:1498 ../../howto/clinic.rst:1594 +#: ../../howto/clinic.rst:1648 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1498 +#: ../../howto/clinic.rst:1495 msgid "" "A text buffer where you can save text for later. Text sent here is appended " "to the end of any existing text. It's an error to have any text left in the " "buffer when Clinic finishes processing a file." msgstr "" -#: ../../howto/clinic.rst:1512 ../../howto/clinic.rst:1583 -#: ../../howto/clinic.rst:1677 +#: ../../howto/clinic.rst:1509 ../../howto/clinic.rst:1580 +#: ../../howto/clinic.rst:1674 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1504 +#: ../../howto/clinic.rst:1501 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " @@ -2086,65 +2081,65 @@ msgid "" "for ``_pickle.c`` would be written to ``_pickle.clinic.c``.)" msgstr "" -#: ../../howto/clinic.rst:1511 +#: ../../howto/clinic.rst:1508 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1517 ../../howto/clinic.rst:1610 -#: ../../howto/clinic.rst:1681 +#: ../../howto/clinic.rst:1514 ../../howto/clinic.rst:1607 +#: ../../howto/clinic.rst:1678 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1515 +#: ../../howto/clinic.rst:1512 msgid "" "A buffer like ``buffer``. However, a two-pass buffer can only be dumped " "once, and it prints out all text sent to it during all processing, even from " "Clinic blocks *after* the dumping point." msgstr "" -#: ../../howto/clinic.rst:1521 ../../howto/clinic.rst:1644 +#: ../../howto/clinic.rst:1518 ../../howto/clinic.rst:1641 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1520 +#: ../../howto/clinic.rst:1517 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1523 +#: ../../howto/clinic.rst:1520 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1525 +#: ../../howto/clinic.rst:1522 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1531 +#: ../../howto/clinic.rst:1528 msgid "" "This dumps the current contents of the named destination into the output of " "the current block, and empties it. This only works with ``buffer`` and " "``two-pass`` destinations." msgstr "" -#: ../../howto/clinic.rst:1535 +#: ../../howto/clinic.rst:1532 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1542 +#: ../../howto/clinic.rst:1539 msgid "" "This tells Clinic to output *field* to *destination*. ``output`` also " "supports a special meta-destination, called ``everything``, which tells " "Clinic to output *all* fields to that *destination*." msgstr "" -#: ../../howto/clinic.rst:1546 +#: ../../howto/clinic.rst:1543 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1555 +#: ../../howto/clinic.rst:1552 msgid "" "``output push`` and ``output pop`` allow you to push and pop configurations " "on an internal configuration stack, so that you can temporarily modify the " @@ -2153,25 +2148,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1562 +#: ../../howto/clinic.rst:1559 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1566 +#: ../../howto/clinic.rst:1563 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1569 +#: ../../howto/clinic.rst:1566 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1573 +#: ../../howto/clinic.rst:1570 msgid "" "Designed to write everything to the \"clinic file\" that it can. You then " "``#include`` this file near the top of your file. You may need to rearrange " @@ -2179,17 +2174,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1579 +#: ../../howto/clinic.rst:1576 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1583 +#: ../../howto/clinic.rst:1580 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1586 +#: ../../howto/clinic.rst:1583 msgid "" "Save up most of the output from Clinic, to be written into your file near " "the end. For Python files implementing modules or builtin types, it's " @@ -2199,14 +2194,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1595 +#: ../../howto/clinic.rst:1592 msgid "" "Suppress the ``parser_prototype``, ``impl_prototype``, and " "``docstring_prototype``, write the ``impl_definition`` to ``block``, and " "write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1600 +#: ../../howto/clinic.rst:1597 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2215,18 +2210,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1607 +#: ../../howto/clinic.rst:1604 msgid "" "Suppresses the ``impl_prototype``, write the ``impl_definition`` to " "``block``, write ``docstring_prototype``, ``methoddef_define``, and " "``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." msgstr "" -#: ../../howto/clinic.rst:1621 +#: ../../howto/clinic.rst:1618 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1613 +#: ../../howto/clinic.rst:1610 msgid "" "Similar to the ``buffer`` preset, but writes more things to ``block``, only " "writing the really big chunks of generated code to ``buffer``. This avoids " @@ -2236,137 +2231,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1620 +#: ../../howto/clinic.rst:1617 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1623 +#: ../../howto/clinic.rst:1620 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1629 +#: ../../howto/clinic.rst:1626 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1631 +#: ../../howto/clinic.rst:1628 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1633 +#: ../../howto/clinic.rst:1630 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1639 +#: ../../howto/clinic.rst:1636 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1641 +#: ../../howto/clinic.rst:1638 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1644 +#: ../../howto/clinic.rst:1641 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1647 +#: ../../howto/clinic.rst:1644 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1651 +#: ../../howto/clinic.rst:1648 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1654 +#: ../../howto/clinic.rst:1651 msgid "" "A text file. The file destination takes an extra argument, a template to " "use for building the filename, like so:" msgstr "" -#: ../../howto/clinic.rst:1657 +#: ../../howto/clinic.rst:1654 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1659 +#: ../../howto/clinic.rst:1656 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1662 +#: ../../howto/clinic.rst:1659 msgid "{path}" msgstr "" -#: ../../howto/clinic.rst:1663 +#: ../../howto/clinic.rst:1660 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1664 +#: ../../howto/clinic.rst:1661 msgid "{dirname}" msgstr "" -#: ../../howto/clinic.rst:1665 +#: ../../howto/clinic.rst:1662 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1666 +#: ../../howto/clinic.rst:1663 msgid "{basename}" msgstr "" -#: ../../howto/clinic.rst:1667 +#: ../../howto/clinic.rst:1664 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1669 +#: ../../howto/clinic.rst:1666 msgid "{basename_root}" msgstr "" -#: ../../howto/clinic.rst:1669 +#: ../../howto/clinic.rst:1666 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1673 +#: ../../howto/clinic.rst:1670 msgid "{basename_extension}" msgstr "" -#: ../../howto/clinic.rst:1672 +#: ../../howto/clinic.rst:1669 msgid "" "The last '.' and everything after it. If the basename does not contain a " "period, this will be the empty string." msgstr "" -#: ../../howto/clinic.rst:1675 +#: ../../howto/clinic.rst:1672 msgid "" "If there are no periods in the filename, {basename} and {filename} are the " "same, and {extension} is empty. \"{basename}{extension}\" is always exactly " "the same as \"{filename}\".\"" msgstr "" -#: ../../howto/clinic.rst:1680 +#: ../../howto/clinic.rst:1677 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1683 +#: ../../howto/clinic.rst:1680 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1689 +#: ../../howto/clinic.rst:1686 msgid "" "It removes all the accumulated text up to this point in the destination. (I " "don't know what you'd need this for, but I thought maybe it'd be useful " "while someone's experimenting.)" msgstr "" -#: ../../howto/clinic.rst:1693 +#: ../../howto/clinic.rst:1690 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1700 +#: ../../howto/clinic.rst:1697 msgid "" "``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " "string that will be prepended to every line of Clinic's output; " @@ -2374,35 +2369,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1704 +#: ../../howto/clinic.rst:1701 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1707 +#: ../../howto/clinic.rst:1704 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1707 +#: ../../howto/clinic.rst:1704 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1710 +#: ../../howto/clinic.rst:1707 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1710 +#: ../../howto/clinic.rst:1707 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1712 +#: ../../howto/clinic.rst:1709 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1719 +#: ../../howto/clinic.rst:1716 msgid "" "This tells Clinic that the current contents of the output should be kept, " "unmodified. This is used internally by Clinic when dumping output into " @@ -2411,36 +2406,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1726 -msgid "The #ifdef trick" +#: ../../howto/clinic.rst:1723 +msgid "How to use the ``#ifdef`` trick" msgstr "" -#: ../../howto/clinic.rst:1728 +#: ../../howto/clinic.rst:1725 msgid "" "If you're converting a function that isn't available on all platforms, " "there's a trick you can use to make life a little easier. The existing code " "probably looks like this::" msgstr "" -#: ../../howto/clinic.rst:1739 +#: ../../howto/clinic.rst:1736 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1748 +#: ../../howto/clinic.rst:1745 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1762 +#: ../../howto/clinic.rst:1759 msgid "" "Then, remove those three lines from the ``PyMethodDef`` structure, replacing " "them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1769 +#: ../../howto/clinic.rst:1766 msgid "" "(You can find the real name for this macro inside the generated code. Or you " "can calculate it yourself: it's the name of your function as defined on the " @@ -2448,27 +2443,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1774 +#: ../../howto/clinic.rst:1771 msgid "" "Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " "``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" msgstr "" -#: ../../howto/clinic.rst:1777 +#: ../../howto/clinic.rst:1774 msgid "" "Here's where Argument Clinic gets very clever. It actually detects that the " "Argument Clinic block might be deactivated by the ``#ifdef``. When that " "happens, it generates a little extra code that looks like this::" msgstr "" -#: ../../howto/clinic.rst:1785 +#: ../../howto/clinic.rst:1782 msgid "" "That means the macro always works. If the function is defined, this turns " "into the correct structure, including the trailing comma. If the function " "is undefined, this turns into nothing." msgstr "" -#: ../../howto/clinic.rst:1789 +#: ../../howto/clinic.rst:1786 msgid "" "However, this causes one ticklish problem: where should Argument Clinic put " "this extra code when using the \"block\" output preset? It can't go in the " @@ -2476,24 +2471,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1793 +#: ../../howto/clinic.rst:1790 msgid "" "In this situation, Argument Clinic writes the extra code to the \"buffer\" " "destination. This may mean that you get a complaint from Argument Clinic:" msgstr "" -#: ../../howto/clinic.rst:1801 +#: ../../howto/clinic.rst:1798 msgid "" "When this happens, just open your file, find the ``dump buffer`` block that " "Argument Clinic added to your file (it'll be at the very bottom), then move " "it above the ``PyMethodDef`` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1807 -msgid "Using Argument Clinic in Python files" +#: ../../howto/clinic.rst:1804 +msgid "How to use Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1809 +#: ../../howto/clinic.rst:1806 msgid "" "It's actually possible to use Argument Clinic to preprocess Python files. " "There's no point to using Argument Clinic blocks, of course, as the output " @@ -2501,8 +2496,11 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1814 +#: ../../howto/clinic.rst:1811 msgid "" "Since Python comments are different from C comments, Argument Clinic blocks " "embedded in Python files look slightly different. They look like this:" msgstr "" + +#~ msgid "Py_buffer" +#~ msgstr "Py_buffer" From f4c40db8628fddf1c091988e1d1c2fd466dde0af Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 26 Jul 2023 19:02:49 +0000 Subject: [PATCH 130/130] sync with cpython bd0def00 --- c-api/arg.po | 8 +- c-api/buffer.po | 8 +- c-api/call.po | 22 +- c-api/complex.po | 6 +- c-api/exceptions.po | 26 +- c-api/file.po | 8 +- c-api/float.po | 14 +- c-api/gcsupport.po | 102 +- c-api/import.po | 8 +- c-api/init.po | 49 +- c-api/iterator.po | 10 +- c-api/long.po | 18 +- c-api/mapping.po | 17 +- c-api/memory.po | 31 +- c-api/method.po | 7 +- c-api/module.po | 8 +- c-api/object.po | 30 +- c-api/refcounting.po | 18 +- c-api/sequence.po | 8 +- c-api/slice.po | 4 +- c-api/stable.po | 4 +- c-api/structures.po | 264 ++-- c-api/sys.po | 12 +- c-api/type.po | 21 +- c-api/typeobj.po | 695 +++++----- c-api/unicode.po | 26 +- c-api/veryhigh.po | 12 +- extending/extending.po | 21 +- extending/newtypes_tutorial.po | 12 +- howto/argparse.po | 59 +- howto/clinic.po | 1275 +++++++++--------- howto/functional.po | 6 +- howto/instrumentation.po | 22 +- howto/isolating-extensions.po | 29 +- howto/regex.po | 348 ++--- howto/sorting.po | 8 +- howto/unicode.po | 16 +- install/index.po | 6 +- library/__main__.po | 6 +- library/_thread.po | 24 +- library/array.po | 7 +- library/asyncio-dev.po | 16 +- library/asyncio-eventloop.po | 123 +- library/asyncio-platforms.po | 14 +- library/asyncio-subprocess.po | 6 +- library/codeop.po | 18 +- library/compileall.po | 6 +- library/constants.po | 19 +- library/ctypes.po | 15 +- library/curses.po | 794 ++++++------ library/devmode.po | 4 +- library/dis.po | 6 +- library/exceptions.po | 42 +- library/fcntl.po | 10 +- library/filecmp.po | 4 +- library/ftplib.po | 8 +- library/functions.po | 6 +- library/gc.po | 4 +- library/gettext.po | 88 +- library/gzip.po | 4 +- library/http.client.po | 4 +- library/imaplib.po | 6 +- library/importlib.po | 20 +- library/importlib.resources.abc.po | 4 +- library/io.po | 8 +- library/json.po | 8 +- library/logging.handlers.po | 117 +- library/mailbox.po | 8 +- library/multiprocessing.po | 4 +- library/multiprocessing.shared_memory.po | 48 +- library/optparse.po | 10 +- library/os.path.po | 4 +- library/os.po | 150 ++- library/platform.po | 34 +- library/poplib.po | 6 +- library/random.po | 5 +- library/re.po | 501 ++++---- library/select.po | 53 +- library/shelve.po | 16 +- library/shutil.po | 187 +-- library/signal.po | 6 +- library/smtplib.po | 6 +- library/socket.po | 4 +- library/sqlite3.po | 8 +- library/ssl.po | 12 +- library/stdtypes.po | 4 +- library/struct.po | 8 +- library/subprocess.po | 6 +- library/sys.po | 702 +++++----- library/tarfile.po | 14 +- library/tempfile.po | 10 +- library/test.po | 6 +- library/tkinter.po | 4 +- library/tkinter.ttk.po | 4 +- library/turtle.po | 1202 ++++++++++------- library/unittest.mock.po | 4 +- library/unittest.po | 6 +- library/urllib.request.po | 5 +- library/venv.po | 14 +- library/xml.po | 4 +- reference/compound_stmts.po | 6 +- reference/datamodel.po | 6 +- sphinx.po | 12 +- tutorial/controlflow.po | 340 ++--- tutorial/errors.po | 10 +- tutorial/introduction.po | 86 +- tutorial/modules.po | 36 +- using/cmdline.po | 10 +- using/configure.po | 6 +- using/windows.po | 4 +- whatsnew/2.2.po | 8 +- whatsnew/2.3.po | 12 +- whatsnew/2.4.po | 4 +- whatsnew/2.5.po | 8 +- whatsnew/2.6.po | 19 +- whatsnew/2.7.po | 10 +- whatsnew/3.1.po | 6 +- whatsnew/3.10.po | 38 +- whatsnew/3.11.po | 1500 +++++++++++----------- whatsnew/3.2.po | 40 +- whatsnew/3.3.po | 54 +- whatsnew/3.4.po | 55 +- whatsnew/3.5.po | 25 +- whatsnew/3.6.po | 22 +- whatsnew/3.7.po | 20 +- whatsnew/3.8.po | 10 +- whatsnew/3.9.po | 35 +- 127 files changed, 5355 insertions(+), 4711 deletions(-) diff --git a/c-api/arg.po b/c-api/arg.po index d00a73959f..b3c8c2cdcc 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-24 00:13+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-10-16 03:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -711,7 +711,7 @@ msgstr "" #: ../../c-api/arg.rst:382 msgid "" "It is possible to pass \"long\" integers (integers whose value exceeds the " -"platform's :const:`LONG_MAX`) however no proper range checking is done --- " +"platform's :c:macro:`LONG_MAX`) however no proper range checking is done --- " "the most significant bits are silently truncated when the receiving field is " "too small to receive the value (actually, the semantics are inherited from " "downcasts in C --- your mileage may vary)." @@ -856,7 +856,7 @@ msgstr "" msgid "" "A simpler form of parameter retrieval which does not use a format string to " "specify the types of the arguments. Functions which use this method to " -"retrieve their parameters should be declared as :const:`METH_VARARGS` in " +"retrieve their parameters should be declared as :c:macro:`METH_VARARGS` in " "function or method tables. The tuple containing the actual parameters " "should be passed as *args*; it must actually be a tuple. The length of the " "tuple must be at least *min* and no more than *max*; *min* and *max* may be " @@ -992,7 +992,7 @@ msgstr "``u`` (:class:`str`) [const wchar_t \\*]" #: ../../c-api/arg.rst:587 msgid "" -"Convert a null-terminated :c:expr:`wchar_t` buffer of Unicode (UTF-16 or " +"Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or " "UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is " "``NULL``, ``None`` is returned." msgstr "" diff --git a/c-api/buffer.po b/c-api/buffer.po index 8a579f15df..0ea1e21743 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -321,7 +321,7 @@ msgstr "" #: ../../c-api/buffer.rst:228 msgid "" -"All :c:data:`Py_buffer` fields are unambiguously defined by the request type." +"All :c:type:`Py_buffer` fields are unambiguously defined by the request type." msgstr "" #: ../../c-api/buffer.rst:232 @@ -606,8 +606,8 @@ msgstr "" #: ../../c-api/buffer.rst:467 msgid "" -"Return the implied :c:data:`~Py_buffer.itemsize` from :c:data:`~Py_buffer." -"format`. On error, raise an exception and return -1." +"Return the implied :c:member:`~Py_buffer.itemsize` from :c:member:" +"`~Py_buffer.format`. On error, raise an exception and return -1." msgstr "" #: ../../c-api/buffer.rst:475 diff --git a/c-api/call.po b/c-api/call.po index eea2f85bc5..65632e32a5 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -121,8 +121,9 @@ msgstr "" "典),那麼實作 vectorcall 就沒有意義。" #: ../../c-api/call.rst:65 +#, fuzzy msgid "" -"Classes can implement the vectorcall protocol by enabling the :const:" +"Classes can implement the vectorcall protocol by enabling the :c:macro:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag and setting :c:member:`~PyTypeObject." "tp_vectorcall_offset` to the offset inside the object structure where a " "*vectorcallfunc* appears. This is a pointer to a function with the following " @@ -152,8 +153,9 @@ msgid "*nargsf* is the number of positional arguments plus possibly the" msgstr "*nargsf* 是位置引數的數量加上可能會有的" #: ../../c-api/call.rst:78 +#, fuzzy msgid "" -":const:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " +":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " "positional arguments from *nargsf*, use :c:func:`PyVectorcall_NARGS`." msgstr "" ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET` 旗標。如果要從 *nargsf* 獲得實際的位" @@ -193,9 +195,10 @@ msgstr "" "``args[0]`` 被改變。" #: ../../c-api/call.rst:97 +#, fuzzy msgid "" "Whenever they can do so cheaply (without additional allocation), callers are " -"encouraged to use :const:`PY_VECTORCALL_ARGUMENTS_OFFSET`. Doing so will " +"encouraged to use :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`. Doing so will " "allow callables such as bound methods to make their onward calls (which " "include a prepended *self* argument) very efficiently." msgstr "" @@ -302,10 +305,11 @@ msgstr "" "tuple 和 dict 格式給定。" #: ../../c-api/call.rst:166 +#, fuzzy msgid "" "This is a specialized function, intended to be put in the :c:member:" "`~PyTypeObject.tp_call` slot or be used in an implementation of ``tp_call``. " -"It does not check the :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag and it does " +"It does not check the :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag and it does " "not fall back to ``tp_call``." msgstr "" "這是一個專門函式,其目的是被放入 :c:member:`~PyTypeObject.tp_call` 擴充槽或是" @@ -639,13 +643,14 @@ msgstr "" "方已經擁有一個要作為關鍵字引數的字典、但沒有作為位置引數的 tuple 時才被使用。" #: ../../c-api/call.rst:381 +#, fuzzy msgid "" "Call a method using the vectorcall calling convention. The name of the " "method is given as a Python string *name*. The object whose method is called " "is *args[0]*, and the *args* array starting at *args[1]* represents the " "arguments of the call. There must be at least one positional argument. " -"*nargsf* is the number of positional arguments including *args[0]*, plus :" -"const:`PY_VECTORCALL_ARGUMENTS_OFFSET` if the value of ``args[0]`` may " +"*nargsf* is the number of positional arguments including *args[0]*, plus :c:" +"macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` if the value of ``args[0]`` may " "temporarily be changed. Keyword arguments can be passed just like in :c:func:" "`PyObject_Vectorcall`." msgstr "" @@ -657,8 +662,9 @@ msgstr "" "`PyObject_Vectorcall` 中一樣被傳入。" #: ../../c-api/call.rst:390 +#, fuzzy msgid "" -"If the object has the :const:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " +"If the object has the :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " "will call the unbound method object with the full *args* vector as arguments." msgstr "" "如果物件具有 :const:`Py_TPFLAGS_METHOD_DESCRIPTOR` 特性,這將以完整的 *args* " diff --git a/c-api/complex.po b/c-api/complex.po index fe532b9ca4..3a3df8cd17 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-30 20:18+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -82,7 +82,7 @@ msgstr "" #: ../../c-api/complex.rst:66 msgid "" "If *divisor* is null, this method returns zero and sets :c:data:`errno` to :" -"c:data:`EDOM`." +"c:macro:`EDOM`." msgstr "" #: ../../c-api/complex.rst:72 @@ -94,7 +94,7 @@ msgstr "" #: ../../c-api/complex.rst:75 msgid "" "If *num* is null and *exp* is not a positive real number, this method " -"returns zero and sets :c:data:`errno` to :c:data:`EDOM`." +"returns zero and sets :c:data:`errno` to :c:macro:`EDOM`." msgstr "" #: ../../c-api/complex.rst:80 diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 368a060951..bd331fae9e 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -190,8 +190,8 @@ msgid "" "function has returned an error and set the C variable :c:data:`errno`. It " "constructs a tuple object whose first item is the integer :c:data:`errno` " "value and whose second item is the corresponding error message (gotten from :" -"c:func:`strerror`), and then calls ``PyErr_SetObject(type, object)``. On " -"Unix, when the :c:data:`errno` value is :const:`EINTR`, indicating an " +"c:func:`!strerror`), and then calls ``PyErr_SetObject(type, object)``. On " +"Unix, when the :c:data:`errno` value is :c:macro:`EINTR`, indicating an " "interrupted system call, this calls :c:func:`PyErr_CheckSignals`, and if " "that set the error indicator, leaves it set to that. The function always " "returns ``NULL``, so a wrapper function around a system call can write " @@ -592,14 +592,14 @@ msgstr "" #: ../../c-api/exceptions.rst:570 msgid "" -"The default Python signal handler for :const:`SIGINT` raises the :exc:" +"The default Python signal handler for :c:macro:`SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" #: ../../c-api/exceptions.rst:581 msgid "" -"Simulate the effect of a :const:`SIGINT` signal arriving. This is equivalent " -"to ``PyErr_SetInterruptEx(SIGINT)``." +"Simulate the effect of a :c:macro:`SIGINT` signal arriving. This is " +"equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" #: ../../c-api/exceptions.rst:585 ../../c-api/exceptions.rst:612 @@ -625,8 +625,8 @@ msgstr "" #: ../../c-api/exceptions.rst:604 msgid "" -"If the given signal isn't handled by Python (it was set to :data:`signal." -"SIG_DFL` or :data:`signal.SIG_IGN`), it will be ignored." +"If the given signal isn't handled by Python (it was set to :py:const:`signal." +"SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." msgstr "" #: ../../c-api/exceptions.rst:607 @@ -719,7 +719,7 @@ msgstr "" #: ../../c-api/exceptions.rst:693 msgid "" -"Return the cause (either an exception instance, or :const:`None`, set by " +"Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " "accessible from Python through :attr:`__cause__`." msgstr "" @@ -728,7 +728,7 @@ msgstr "" msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " -"exception instance or :const:`None`. This steals a reference to *cause*." +"exception instance or ``None``. This steals a reference to *cause*." msgstr "" #: ../../c-api/exceptions.rst:704 @@ -817,9 +817,9 @@ msgstr "" #: ../../c-api/exceptions.rst:791 msgid "" -"If :const:`USE_STACKCHECK` is defined, this function checks if the OS stack " -"overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it sets a :" -"exc:`MemoryError` and returns a nonzero value." +"If :c:macro:`USE_STACKCHECK` is defined, this function checks if the OS " +"stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it " +"sets a :exc:`MemoryError` and returns a nonzero value." msgstr "" #: ../../c-api/exceptions.rst:795 diff --git a/c-api/file.po b/c-api/file.po index ba13045f8f..413853b371 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,9 +125,9 @@ msgstr "" #: ../../c-api/file.rst:95 msgid "" "Write object *obj* to file object *p*. The only supported flag for *flags* " -"is :const:`Py_PRINT_RAW`; if given, the :func:`str` of the object is written " -"instead of the :func:`repr`. Return ``0`` on success or ``-1`` on failure; " -"the appropriate exception will be set." +"is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of the object is " +"written instead of the :func:`repr`. Return ``0`` on success or ``-1`` on " +"failure; the appropriate exception will be set." msgstr "" #: ../../c-api/file.rst:103 diff --git a/c-api/float.po b/c-api/float.po index 3491309c57..3138ee29b9 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-30 20:18+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -138,9 +138,9 @@ msgid "" "The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an :c:expr:" "`int` argument, non-zero if you want the bytes string in little-endian " "format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` ``p+7``), zero if you " -"want big-endian format (exponent first, at *p*). The :c:data:`PY_BIG_ENDIAN` " -"constant can be used to use the native endian: it is equal to ``1`` on big " -"endian processor, or ``0`` on little endian processor." +"want big-endian format (exponent first, at *p*). The :c:macro:" +"`PY_BIG_ENDIAN` constant can be used to use the native endian: it is equal " +"to ``1`` on big endian processor, or ``0`` on little endian processor." msgstr "" #: ../../c-api/float.rst:116 @@ -182,9 +182,9 @@ msgid "" "The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an :c:" "expr:`int` argument, non-zero if the bytes string is in little-endian format " "(exponent last, at ``p+1``, ``p+3`` or ``p+6`` and ``p+7``), zero if big-" -"endian (exponent first, at *p*). The :c:data:`PY_BIG_ENDIAN` constant can be " -"used to use the native endian: it is equal to ``1`` on big endian processor, " -"or ``0`` on little endian processor." +"endian (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant can " +"be used to use the native endian: it is equal to ``1`` on big endian " +"processor, or ``0`` on little endian processor." msgstr "" #: ../../c-api/float.rst:147 diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index b72a71fa7d..e6d631b526 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-29 00:08+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:31+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,70 +25,74 @@ msgstr "" #: ../../c-api/gcsupport.rst:8 msgid "" "Python's support for detecting and collecting garbage which involves " -"circular references requires support from object types which are \"containers" -"\" for other objects which may also be containers. Types which do not store " -"references to other objects, or which only store references to atomic types " -"(such as numbers or strings), do not need to provide any explicit support " -"for garbage collection." +"circular references requires support from object types which are " +"\"containers\" for other objects which may also be containers. Types which " +"do not store references to other objects, or which only store references to " +"atomic types (such as numbers or strings), do not need to provide any " +"explicit support for garbage collection." msgstr "" #: ../../c-api/gcsupport.rst:15 msgid "" "To create a container type, the :c:member:`~PyTypeObject.tp_flags` field of " -"the type object must include the :const:`Py_TPFLAGS_HAVE_GC` and provide an " -"implementation of the :c:member:`~PyTypeObject.tp_traverse` handler. If " +"the type object must include the :c:macro:`Py_TPFLAGS_HAVE_GC` and provide " +"an implementation of the :c:member:`~PyTypeObject.tp_traverse` handler. If " "instances of the type are mutable, a :c:member:`~PyTypeObject.tp_clear` " "implementation must also be provided." msgstr "" #: ../../c-api/gcsupport.rst:24 +msgid ":c:macro:`Py_TPFLAGS_HAVE_GC`" +msgstr "" + +#: ../../c-api/gcsupport.rst:22 msgid "" "Objects with a type with this flag set must conform with the rules " "documented here. For convenience these objects will be referred to as " "container objects." msgstr "" -#: ../../c-api/gcsupport.rst:28 +#: ../../c-api/gcsupport.rst:26 msgid "Constructors for container types must conform to two rules:" msgstr "" -#: ../../c-api/gcsupport.rst:30 +#: ../../c-api/gcsupport.rst:28 msgid "" "The memory for the object must be allocated using :c:func:`PyObject_GC_New` " "or :c:func:`PyObject_GC_NewVar`." msgstr "" -#: ../../c-api/gcsupport.rst:33 +#: ../../c-api/gcsupport.rst:31 msgid "" "Once all the fields which may contain references to other containers are " "initialized, it must call :c:func:`PyObject_GC_Track`." msgstr "" -#: ../../c-api/gcsupport.rst:36 +#: ../../c-api/gcsupport.rst:34 msgid "" "Similarly, the deallocator for the object must conform to a similar pair of " "rules:" msgstr "" -#: ../../c-api/gcsupport.rst:39 +#: ../../c-api/gcsupport.rst:37 msgid "" "Before fields which refer to other containers are invalidated, :c:func:" "`PyObject_GC_UnTrack` must be called." msgstr "" -#: ../../c-api/gcsupport.rst:42 +#: ../../c-api/gcsupport.rst:40 msgid "" "The object's memory must be deallocated using :c:func:`PyObject_GC_Del`." msgstr "" -#: ../../c-api/gcsupport.rst:45 +#: ../../c-api/gcsupport.rst:43 msgid "" "If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least a :" "c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one from its " "subclass or subclasses." msgstr "" -#: ../../c-api/gcsupport.rst:49 +#: ../../c-api/gcsupport.rst:47 msgid "" "When calling :c:func:`PyType_Ready` or some of the APIs that indirectly call " "it like :c:func:`PyType_FromSpecWithBases` or :c:func:`PyType_FromSpec` the " @@ -96,29 +100,29 @@ msgid "" "tp_flags`, :c:member:`~PyTypeObject.tp_traverse` and :c:member:" "`~PyTypeObject.tp_clear` fields if the type inherits from a class that " "implements the garbage collector protocol and the child class does *not* " -"include the :const:`Py_TPFLAGS_HAVE_GC` flag." +"include the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." msgstr "" -#: ../../c-api/gcsupport.rst:59 +#: ../../c-api/gcsupport.rst:57 msgid "" -"Analogous to :c:func:`PyObject_New` but for container objects with the :" -"const:`Py_TPFLAGS_HAVE_GC` flag set." +"Analogous to :c:func:`PyObject_New` but for container objects with the :c:" +"macro:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" -#: ../../c-api/gcsupport.rst:65 +#: ../../c-api/gcsupport.rst:63 msgid "" -"Analogous to :c:func:`PyObject_NewVar` but for container objects with the :" -"const:`Py_TPFLAGS_HAVE_GC` flag set." +"Analogous to :c:func:`PyObject_NewVar` but for container objects with the :c:" +"macro:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" -#: ../../c-api/gcsupport.rst:71 +#: ../../c-api/gcsupport.rst:69 msgid "" "Resize an object allocated by :c:func:`PyObject_NewVar`. Returns the " "resized object or ``NULL`` on failure. *op* must not be tracked by the " "collector yet." msgstr "" -#: ../../c-api/gcsupport.rst:77 +#: ../../c-api/gcsupport.rst:75 msgid "" "Adds the object *op* to the set of container objects tracked by the " "collector. The collector can run at unexpected times so objects must be " @@ -127,45 +131,45 @@ msgid "" "usually near the end of the constructor." msgstr "" -#: ../../c-api/gcsupport.rst:86 +#: ../../c-api/gcsupport.rst:84 msgid "" "Returns non-zero if the object implements the garbage collector protocol, " "otherwise returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:89 +#: ../../c-api/gcsupport.rst:87 msgid "" "The object cannot be tracked by the garbage collector if this function " "returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:94 +#: ../../c-api/gcsupport.rst:92 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* is " "being currently tracked by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:97 +#: ../../c-api/gcsupport.rst:95 msgid "This is analogous to the Python function :func:`gc.is_tracked`." msgstr "" -#: ../../c-api/gcsupport.rst:104 +#: ../../c-api/gcsupport.rst:102 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* has " "been already finalized by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:107 +#: ../../c-api/gcsupport.rst:105 msgid "This is analogous to the Python function :func:`gc.is_finalized`." msgstr "" -#: ../../c-api/gcsupport.rst:114 +#: ../../c-api/gcsupport.rst:112 msgid "" "Releases memory allocated to an object using :c:func:`PyObject_GC_New` or :c:" "func:`PyObject_GC_NewVar`." msgstr "" -#: ../../c-api/gcsupport.rst:120 +#: ../../c-api/gcsupport.rst:118 msgid "" "Remove the object *op* from the set of container objects tracked by the " "collector. Note that :c:func:`PyObject_GC_Track` can be called again on " @@ -175,19 +179,19 @@ msgid "" "handler become invalid." msgstr "" -#: ../../c-api/gcsupport.rst:129 +#: ../../c-api/gcsupport.rst:127 msgid "" "The :c:func:`_PyObject_GC_TRACK` and :c:func:`_PyObject_GC_UNTRACK` macros " "have been removed from the public C API." msgstr "" -#: ../../c-api/gcsupport.rst:132 +#: ../../c-api/gcsupport.rst:130 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function " "parameter of this type:" msgstr "" -#: ../../c-api/gcsupport.rst:137 +#: ../../c-api/gcsupport.rst:135 msgid "" "Type of the visitor function passed to the :c:member:`~PyTypeObject." "tp_traverse` handler. The function should be called with an object to " @@ -197,13 +201,13 @@ msgid "" "users will need to write their own visitor functions." msgstr "" -#: ../../c-api/gcsupport.rst:144 +#: ../../c-api/gcsupport.rst:142 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler must have the following " "type:" msgstr "" -#: ../../c-api/gcsupport.rst:149 +#: ../../c-api/gcsupport.rst:147 msgid "" "Traversal function for a container object. Implementations must call the " "*visit* function for each object directly contained by *self*, with the " @@ -213,7 +217,7 @@ msgid "" "returned immediately." msgstr "" -#: ../../c-api/gcsupport.rst:156 +#: ../../c-api/gcsupport.rst:154 msgid "" "To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a :c:" "func:`Py_VISIT` macro is provided. In order to use this macro, the :c:" @@ -221,20 +225,20 @@ msgid "" "exactly *visit* and *arg*:" msgstr "" -#: ../../c-api/gcsupport.rst:163 +#: ../../c-api/gcsupport.rst:161 msgid "" "If *o* is not ``NULL``, call the *visit* callback, with arguments *o* and " "*arg*. If *visit* returns a non-zero value, then return it. Using this " "macro, :c:member:`~PyTypeObject.tp_traverse` handlers look like::" msgstr "" -#: ../../c-api/gcsupport.rst:176 +#: ../../c-api/gcsupport.rst:174 msgid "" "The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:" "`inquiry` type, or ``NULL`` if the object is immutable." msgstr "" -#: ../../c-api/gcsupport.rst:182 +#: ../../c-api/gcsupport.rst:180 msgid "" "Drop references that may have created reference cycles. Immutable objects " "do not have to define this method since they can never directly create " @@ -244,23 +248,23 @@ msgid "" "in a reference cycle." msgstr "" -#: ../../c-api/gcsupport.rst:191 +#: ../../c-api/gcsupport.rst:189 msgid "Controlling the Garbage Collector State" msgstr "" -#: ../../c-api/gcsupport.rst:193 +#: ../../c-api/gcsupport.rst:191 msgid "" "The C-API provides the following functions for controlling garbage " "collection runs." msgstr "" -#: ../../c-api/gcsupport.rst:198 +#: ../../c-api/gcsupport.rst:196 msgid "" "Perform a full garbage collection, if the garbage collector is enabled. " "(Note that :func:`gc.collect` runs it unconditionally.)" msgstr "" -#: ../../c-api/gcsupport.rst:201 +#: ../../c-api/gcsupport.rst:199 msgid "" "Returns the number of collected + unreachable objects which cannot be " "collected. If the garbage collector is disabled or already collecting, " @@ -268,19 +272,19 @@ msgid "" "data:`sys.unraisablehook`. This function does not raise exceptions." msgstr "" -#: ../../c-api/gcsupport.rst:211 +#: ../../c-api/gcsupport.rst:209 msgid "" "Enable the garbage collector: similar to :func:`gc.enable`. Returns the " "previous state, 0 for disabled and 1 for enabled." msgstr "" -#: ../../c-api/gcsupport.rst:219 +#: ../../c-api/gcsupport.rst:217 msgid "" "Disable the garbage collector: similar to :func:`gc.disable`. Returns the " "previous state, 0 for disabled and 1 for enabled." msgstr "" -#: ../../c-api/gcsupport.rst:227 +#: ../../c-api/gcsupport.rst:225 msgid "" "Query the state of the garbage collector: similar to :func:`gc.isenabled`. " "Returns the current state, 0 for disabled and 1 for enabled." diff --git a/c-api/import.po b/c-api/import.po index f5caeb7201..ba34c89cfa 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -135,10 +135,10 @@ msgid "" "object read from a Python bytecode file or obtained from the built-in " "function :func:`compile`, load the module. Return a new reference to the " "module object, or ``NULL`` with an exception set if an error occurred. " -"*name* is removed from :attr:`sys.modules` in error cases, even if *name* " -"was already in :attr:`sys.modules` on entry to :c:func:" +"*name* is removed from :data:`sys.modules` in error cases, even if *name* " +"was already in :data:`sys.modules` on entry to :c:func:" "`PyImport_ExecCodeModule`. Leaving incompletely initialized modules in :" -"attr:`sys.modules` is dangerous, as imports of such modules have no way to " +"data:`sys.modules` is dangerous, as imports of such modules have no way to " "know that the module object is an unknown (and probably damaged with respect " "to the module author's intents) state." msgstr "" diff --git a/c-api/init.po b/c-api/init.po index 185285d931..69aea56ac2 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1446,8 +1446,8 @@ msgid "" "This function does not steal any references to *exc*. To prevent naive " "misuse, you must write your own C extension to call this. Must be called " "with the GIL held. Returns the number of thread states modified; this is " -"normally one, but will be zero if the thread id isn't found. If *exc* is :" -"const:`NULL`, the pending exception (if any) for the thread is cleared. This " +"normally one, but will be zero if the thread id isn't found. If *exc* is " +"``NULL``, the pending exception (if any) for the thread is cleared. This " "raises no exceptions." msgstr "" @@ -1758,10 +1758,11 @@ msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " "the registration function as *obj*, *frame* is the frame object to which the " -"event pertains, *what* is one of the constants :const:`PyTrace_CALL`, :const:" -"`PyTrace_EXCEPTION`, :const:`PyTrace_LINE`, :const:`PyTrace_RETURN`, :const:" -"`PyTrace_C_CALL`, :const:`PyTrace_C_EXCEPTION`, :const:`PyTrace_C_RETURN`, " -"or :const:`PyTrace_OPCODE`, and *arg* depends on the value of *what*:" +"event pertains, *what* is one of the constants :c:data:`PyTrace_CALL`, :c:" +"data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :" +"c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:" +"`PyTrace_C_RETURN`, or :c:data:`PyTrace_OPCODE`, and *arg* depends on the " +"value of *what*:" msgstr "" #: ../../c-api/init.rst:1575 @@ -1773,7 +1774,8 @@ msgid "Meaning of *arg*" msgstr "" #: ../../c-api/init.rst:1577 -msgid ":const:`PyTrace_CALL`" +#, fuzzy +msgid ":c:data:`PyTrace_CALL`" msgstr ":const:`PyTrace_CALL`" #: ../../c-api/init.rst:1577 ../../c-api/init.rst:1582 @@ -1782,7 +1784,8 @@ msgid "Always :c:data:`Py_None`." msgstr "" #: ../../c-api/init.rst:1579 -msgid ":const:`PyTrace_EXCEPTION`" +#, fuzzy +msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":const:`PyTrace_EXCEPTION`" #: ../../c-api/init.rst:1579 @@ -1790,11 +1793,13 @@ msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" #: ../../c-api/init.rst:1582 -msgid ":const:`PyTrace_LINE`" +#, fuzzy +msgid ":c:data:`PyTrace_LINE`" msgstr ":const:`PyTrace_LINE`" #: ../../c-api/init.rst:1584 -msgid ":const:`PyTrace_RETURN`" +#, fuzzy +msgid ":c:data:`PyTrace_RETURN`" msgstr ":const:`PyTrace_RETURN`" #: ../../c-api/init.rst:1584 @@ -1803,7 +1808,8 @@ msgid "" msgstr "" #: ../../c-api/init.rst:1587 -msgid ":const:`PyTrace_C_CALL`" +#, fuzzy +msgid ":c:data:`PyTrace_C_CALL`" msgstr ":const:`PyTrace_C_CALL`" #: ../../c-api/init.rst:1587 ../../c-api/init.rst:1589 @@ -1812,15 +1818,18 @@ msgid "Function object being called." msgstr "" #: ../../c-api/init.rst:1589 -msgid ":const:`PyTrace_C_EXCEPTION`" +#, fuzzy +msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":const:`PyTrace_C_EXCEPTION`" #: ../../c-api/init.rst:1591 -msgid ":const:`PyTrace_C_RETURN`" +#, fuzzy +msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":const:`PyTrace_C_RETURN`" #: ../../c-api/init.rst:1593 -msgid ":const:`PyTrace_OPCODE`" +#, fuzzy +msgid ":c:data:`PyTrace_OPCODE`" msgstr ":const:`PyTrace_OPCODE`" #: ../../c-api/init.rst:1598 @@ -1890,8 +1899,8 @@ msgid "" "function as its first parameter, and may be any Python object, or ``NULL``. " "If the profile function needs to maintain state, using a different value for " "*obj* for each thread provides a convenient and thread-safe place to store " -"it. The profile function is called for all monitored events except :const:" -"`PyTrace_LINE` :const:`PyTrace_OPCODE` and :const:`PyTrace_EXCEPTION`." +"it. The profile function is called for all monitored events except :c:data:" +"`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" #: ../../c-api/init.rst:1664 @@ -1908,9 +1917,9 @@ msgid "" "`PyEval_SetProfile`, except the tracing function does receive line-number " "events and per-opcode events, but does not receive any event related to C " "function objects being called. Any trace function registered using :c:func:" -"`PyEval_SetTrace` will not receive :const:`PyTrace_C_CALL`, :const:" -"`PyTrace_C_EXCEPTION` or :const:`PyTrace_C_RETURN` as a value for the *what* " -"parameter." +"`PyEval_SetTrace` will not receive :c:data:`PyTrace_C_CALL`, :c:data:" +"`PyTrace_C_EXCEPTION` or :c:data:`PyTrace_C_RETURN` as a value for the " +"*what* parameter." msgstr "" #: ../../c-api/init.rst:1678 diff --git a/c-api/iterator.po b/c-api/iterator.po index 9d42bec5a6..72d284a13b 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,10 +26,10 @@ msgstr "疊代器(Iterator)物件" #: ../../c-api/iterator.rst:8 msgid "" "Python provides two general-purpose iterator objects. The first, a sequence " -"iterator, works with an arbitrary sequence supporting the :meth:" -"`__getitem__` method. The second works with a callable object and a " -"sentinel value, calling the callable for each item in the sequence, and " -"ending the iteration when the sentinel value is returned." +"iterator, works with an arbitrary sequence supporting the :meth:`~object." +"__getitem__` method. The second works with a callable object and a sentinel " +"value, calling the callable for each item in the sequence, and ending the " +"iteration when the sentinel value is returned." msgstr "" #: ../../c-api/iterator.rst:17 diff --git a/c-api/long.po b/c-api/long.po index 6a84e38b6e..32a19ce484 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-30 20:18+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -167,10 +167,10 @@ msgstr "" #: ../../c-api/long.rst:144 msgid "" -"If the value of *obj* is greater than :const:`LONG_MAX` or less than :const:" -"`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " -"``-1``; otherwise, set *\\*overflow* to ``0``. If any other exception " -"occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." +"If the value of *obj* is greater than :c:macro:`LONG_MAX` or less than :c:" +"macro:`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and " +"return ``-1``; otherwise, set *\\*overflow* to ``0``. If any other " +"exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" #: ../../c-api/long.rst:163 ../../c-api/long.rst:181 @@ -188,10 +188,10 @@ msgstr "" #: ../../c-api/long.rst:185 msgid "" -"If the value of *obj* is greater than :const:`LLONG_MAX` or less than :const:" -"`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " -"``-1``; otherwise, set *\\*overflow* to ``0``. If any other exception " -"occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." +"If the value of *obj* is greater than :c:macro:`LLONG_MAX` or less than :c:" +"macro:`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and " +"return ``-1``; otherwise, set *\\*overflow* to ``0``. If any other " +"exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" #: ../../c-api/long.rst:207 diff --git a/c-api/mapping.po b/c-api/mapping.po index 4f06e262b7..c8244ba813 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,8 +32,8 @@ msgstr "" msgid "" "Return ``1`` if the object provides the mapping protocol or supports " "slicing, and ``0`` otherwise. Note that it returns ``1`` for Python classes " -"with a :meth:`__getitem__` method, since in general it is impossible to " -"determine what type of keys the class supports. This function always " +"with a :meth:`~object.__getitem__` method, since in general it is impossible " +"to determine what type of keys the class supports. This function always " "succeeds." msgstr "" @@ -80,16 +80,17 @@ msgstr "" #: ../../c-api/mapping.rst:63 msgid "" -"Note that exceptions which occur while calling the :meth:`__getitem__` " -"method will get suppressed. To get error reporting use :c:func:" +"Note that exceptions which occur while calling the :meth:`~object." +"__getitem__` method will get suppressed. To get error reporting use :c:func:" "`PyObject_GetItem()` instead." msgstr "" #: ../../c-api/mapping.rst:74 msgid "" -"Note that exceptions which occur while calling the :meth:`__getitem__` " -"method and creating a temporary string object will get suppressed. To get " -"error reporting use :c:func:`PyMapping_GetItemString()` instead." +"Note that exceptions which occur while calling the :meth:`~object." +"__getitem__` method and creating a temporary string object will get " +"suppressed. To get error reporting use :c:func:`PyMapping_GetItemString()` " +"instead." msgstr "" #: ../../c-api/mapping.rst:81 diff --git a/c-api/memory.po b/c-api/memory.po index 2559680691..3c446793fa 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -684,7 +684,7 @@ msgstr "" #: ../../c-api/memory.rst:473 msgid "" -"For the :c:data:`PYMEM_DOMAIN_RAW` domain, the allocator must be thread-" +"For the :c:macro:`PYMEM_DOMAIN_RAW` domain, the allocator must be thread-" "safe: the :term:`GIL ` is not held when the " "allocator is called." msgstr "" @@ -785,8 +785,9 @@ msgstr "" #: ../../c-api/memory.rst:538 msgid "" "Check that the :term:`GIL ` is held when allocator " -"functions of :c:data:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) and :" -"c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are called." +"functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " +"and :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are " +"called." msgstr "" #: ../../c-api/memory.rst:543 @@ -826,15 +827,15 @@ msgid "API identifier (ASCII character):" msgstr "" #: ../../c-api/memory.rst:560 -msgid "``'r'`` for :c:data:`PYMEM_DOMAIN_RAW`." +msgid "``'r'`` for :c:macro:`PYMEM_DOMAIN_RAW`." msgstr "" #: ../../c-api/memory.rst:561 -msgid "``'m'`` for :c:data:`PYMEM_DOMAIN_MEM`." +msgid "``'m'`` for :c:macro:`PYMEM_DOMAIN_MEM`." msgstr "" #: ../../c-api/memory.rst:562 -msgid "``'o'`` for :c:data:`PYMEM_DOMAIN_OBJ`." +msgid "``'o'`` for :c:macro:`PYMEM_DOMAIN_OBJ`." msgstr "" #: ../../c-api/memory.rst:565 @@ -881,11 +882,11 @@ msgstr "" #: ../../c-api/memory.rst:583 msgid "" "A serial number, incremented by 1 on each call to a malloc-like or realloc-" -"like function. Big-endian ``size_t``. If \"bad memory\" is detected later, " -"the serial number gives an excellent way to set a breakpoint on the next " -"run, to capture the instant at which this block was passed out. The static " -"function bumpserialno() in obmalloc.c is the only place the serial number is " -"incremented, and exists so you can set such a breakpoint easily." +"like function. Big-endian :c:type:`size_t`. If \"bad memory\" is detected " +"later, the serial number gives an excellent way to set a breakpoint on the " +"next run, to capture the instant at which this block was passed out. The " +"static function bumpserialno() in obmalloc.c is the only place the serial " +"number is incremented, and exists so you can set such a breakpoint easily." msgstr "" #: ../../c-api/memory.rst:590 @@ -906,8 +907,8 @@ msgid "" "The :c:func:`PyMem_SetupDebugHooks` function now also works on Python " "compiled in release mode. On error, the debug hooks now use :mod:" "`tracemalloc` to get the traceback where a memory block was allocated. The " -"debug hooks now also check if the GIL is held when functions of :c:data:" -"`PYMEM_DOMAIN_OBJ` and :c:data:`PYMEM_DOMAIN_MEM` domains are called." +"debug hooks now also check if the GIL is held when functions of :c:macro:" +"`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` domains are called." msgstr "" #: ../../c-api/memory.rst:607 @@ -934,7 +935,7 @@ msgstr "" #: ../../c-api/memory.rst:624 msgid "" "*pymalloc* is the :ref:`default allocator ` of " -"the :c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:data:" +"the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:" "`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" diff --git a/c-api/method.po b/c-api/method.po index 1bd663854d..0c67aa6fd3 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-01-24 22:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,9 +25,10 @@ msgid "Instance Method Objects" msgstr "實例方法物件 (Instance Method Objects)" #: ../../c-api/method.rst:10 +#, fuzzy msgid "" -"An instance method is a wrapper for a :c:data:`PyCFunction` and the new way " -"to bind a :c:data:`PyCFunction` to a class object. It replaces the former " +"An instance method is a wrapper for a :c:type:`PyCFunction` and the new way " +"to bind a :c:type:`PyCFunction` to a class object. It replaces the former " "call ``PyMethod_New(func, NULL, class)``." msgstr "" "實例方法是 :c:data:`PyCFunction` 的包裝器 (wrapper),也是將 :c:data:" diff --git a/c-api/module.po b/c-api/module.po index 9f8d4f0161..15622bf9a9 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -148,7 +148,7 @@ msgid "" msgstr "" #: ../../c-api/module.rst:148 -msgid "Always initialize this member to :const:`PyModuleDef_HEAD_INIT`." +msgid "Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`." msgstr "" #: ../../c-api/module.rst:152 @@ -269,7 +269,7 @@ msgstr "" #: ../../c-api/module.rst:257 msgid "" "Create a new module object, given the definition in *def*. This behaves " -"like :c:func:`PyModule_Create2` with *module_api_version* set to :const:" +"like :c:func:`PyModule_Create2` with *module_api_version* set to :c:macro:" "`PYTHON_API_VERSION`." msgstr "" @@ -446,7 +446,7 @@ msgstr "" msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with " -"*module_api_version* set to :const:`PYTHON_API_VERSION`." +"*module_api_version* set to :c:macro:`PYTHON_API_VERSION`." msgstr "" #: ../../c-api/module.rst:399 diff --git a/c-api/object.po b/c-api/object.po index fc39593f95..7651d348a1 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-25 00:42+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,7 +39,7 @@ msgstr "" msgid "" "Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags " "argument is used to enable certain printing options. The only option " -"currently supported is :const:`Py_PRINT_RAW`; if given, the :func:`str` of " +"currently supported is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of " "the object is written instead of the :func:`repr`." msgstr "" @@ -168,29 +168,29 @@ msgstr "" #: ../../c-api/object.rst:164 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " -"which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:" -"`Py_NE`, :const:`Py_GT`, or :const:`Py_GE`, corresponding to ``<``, ``<=``, " -"``==``, ``!=``, ``>``, or ``>=`` respectively. This is the equivalent of the " -"Python expression ``o1 op o2``, where ``op`` is the operator corresponding " -"to *opid*. Returns the value of the comparison on success, or ``NULL`` on " -"failure." +"which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :" +"c:macro:`Py_NE`, :c:macro:`Py_GT`, or :c:macro:`Py_GE`, corresponding to " +"``<``, ``<=``, ``==``, ``!=``, ``>``, or ``>=`` respectively. This is the " +"equivalent of the Python expression ``o1 op o2``, where ``op`` is the " +"operator corresponding to *opid*. Returns the value of the comparison on " +"success, or ``NULL`` on failure." msgstr "" #: ../../c-api/object.rst:174 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " -"which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:" -"`Py_NE`, :const:`Py_GT`, or :const:`Py_GE`, corresponding to ``<``, ``<=``, " -"``==``, ``!=``, ``>``, or ``>=`` respectively. Returns ``-1`` on error, " -"``0`` if the result is false, ``1`` otherwise. This is the equivalent of the " -"Python expression ``o1 op o2``, where ``op`` is the operator corresponding " -"to *opid*." +"which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :" +"c:macro:`Py_NE`, :c:macro:`Py_GT`, or :c:macro:`Py_GE`, corresponding to " +"``<``, ``<=``, ``==``, ``!=``, ``>``, or ``>=`` respectively. Returns ``-1`` " +"on error, ``0`` if the result is false, ``1`` otherwise. This is the " +"equivalent of the Python expression ``o1 op o2``, where ``op`` is the " +"operator corresponding to *opid*." msgstr "" #: ../../c-api/object.rst:183 msgid "" "If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` " -"will always return ``1`` for :const:`Py_EQ` and ``0`` for :const:`Py_NE`." +"will always return ``1`` for :c:macro:`Py_EQ` and ``0`` for :c:macro:`Py_NE`." msgstr "" #: ../../c-api/object.rst:188 diff --git a/c-api/refcounting.po b/c-api/refcounting.po index f714e213f5..4b839297e1 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,14 +125,14 @@ msgstr "" #: ../../c-api/refcounting.rst:83 msgid "" "The deallocation function can cause arbitrary Python code to be invoked (e." -"g. when a class instance with a :meth:`__del__` method is deallocated). " -"While exceptions in such code are not propagated, the executed code has free " -"access to all Python global variables. This means that any object that is " -"reachable from a global variable should be in a consistent state before :c:" -"func:`Py_DECREF` is invoked. For example, code to delete an object from a " -"list should copy a reference to the deleted object in a temporary variable, " -"update the list data structure, and then call :c:func:`Py_DECREF` for the " -"temporary variable." +"g. when a class instance with a :meth:`~object.__del__` method is " +"deallocated). While exceptions in such code are not propagated, the " +"executed code has free access to all Python global variables. This means " +"that any object that is reachable from a global variable should be in a " +"consistent state before :c:func:`Py_DECREF` is invoked. For example, code " +"to delete an object from a list should copy a reference to the deleted " +"object in a temporary variable, update the list data structure, and then " +"call :c:func:`Py_DECREF` for the temporary variable." msgstr "" #: ../../c-api/refcounting.rst:95 diff --git a/c-api/sequence.po b/c-api/sequence.po index ff27449584..7a85c580d8 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,9 +26,9 @@ msgstr "" msgid "" "Return ``1`` if the object provides the sequence protocol, and ``0`` " "otherwise. Note that it returns ``1`` for Python classes with a :meth:" -"`__getitem__` method, unless they are :class:`dict` subclasses, since in " -"general it is impossible to determine what type of keys the class supports. " -"This function always succeeds." +"`~object.__getitem__` method, unless they are :class:`dict` subclasses, " +"since in general it is impossible to determine what type of keys the class " +"supports. This function always succeeds." msgstr "" #: ../../c-api/sequence.rst:23 diff --git a/c-api/slice.po b/c-api/slice.po index 0fc9b0940c..30f9289937 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -54,7 +54,7 @@ msgstr "" #: ../../c-api/slice.rst:36 msgid "" "Returns ``0`` on success and ``-1`` on error with no exception set (unless " -"one of the indices was not :const:`None` and failed to be converted to an " +"one of the indices was not ``None`` and failed to be converted to an " "integer, in which case ``-1`` is returned with an exception set)." msgstr "" diff --git a/c-api/stable.po b/c-api/stable.po index 23a92c8ab7..404287afa2 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2016-11-19 00:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -81,7 +81,7 @@ msgstr "" #: ../../c-api/stable.rst:47 msgid "" -"Define ``Py_LIMITED_API`` to the value of :c:data:`PY_VERSION_HEX` " +"Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` " "corresponding to the lowest Python version your extension supports. The " "extension will work without recompilation with all Python 3 releases from " "the specified one onward, and can use Limited API introduced up to that " diff --git a/c-api/structures.po b/c-api/structures.po index 421b1bf503..49e8d0786d 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -208,26 +208,28 @@ msgstr "" #: ../../c-api/structures.rst:200 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :const:`METH_VARARGS | METH_KEYWORDS`. The function signature is::" +"signature :ref:`METH_VARARGS | METH_KEYWORDS `. " +"The function signature is::" msgstr "" #: ../../c-api/structures.rst:211 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :const:`METH_FASTCALL`. The function signature is::" +"signature :c:macro:`METH_FASTCALL`. The function signature is::" msgstr "" #: ../../c-api/structures.rst:221 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :const:`METH_FASTCALL | METH_KEYWORDS`. The function signature is::" +"signature :ref:`METH_FASTCALL | METH_KEYWORDS `. The function signature is::" msgstr "" #: ../../c-api/structures.rst:232 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :const:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`. The function " -"signature is::" +"signature :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `. The function signature is::" msgstr "" #: ../../c-api/structures.rst:247 @@ -248,7 +250,7 @@ msgstr "" msgid "flags bits indicating how the call should be constructed" msgstr "" -#: ../../c-api/structures.rst:264 ../../c-api/structures.rst:426 +#: ../../c-api/structures.rst:264 ../../c-api/structures.rst:444 msgid "points to the contents of the docstring" msgstr "" @@ -285,6 +287,19 @@ msgstr "" #: ../../c-api/structures.rst:291 msgid "" +"Can only be used in certain combinations with other flags: :ref:" +"`METH_VARARGS | METH_KEYWORDS `, :ref:" +"`METH_FASTCALL | METH_KEYWORDS ` and :ref:" +"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `." +msgstr "" + +#: ../../c-api/structures.rst:305 +msgid ":c:expr:`METH_VARARGS | METH_KEYWORDS`" +msgstr "" + +#: ../../c-api/structures.rst:300 +msgid "" "Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`. " "The function expects three parameters: *self*, *args*, *kwargs* where " "*kwargs* is a dictionary of all the keyword arguments or possibly ``NULL`` " @@ -292,7 +307,7 @@ msgid "" "using :c:func:`PyArg_ParseTupleAndKeywords`." msgstr "" -#: ../../c-api/structures.rst:300 +#: ../../c-api/structures.rst:309 msgid "" "Fast calling convention supporting only positional arguments. The methods " "have the type :c:type:`_PyCFunctionFast`. The first parameter is *self*, the " @@ -301,61 +316,76 @@ msgid "" "the array)." msgstr "" -#: ../../c-api/structures.rst:310 +#: ../../c-api/structures.rst:319 msgid "``METH_FASTCALL`` is now part of the stable ABI." msgstr "" -#: ../../c-api/structures.rst:315 +#: ../../c-api/structures.rst:336 +msgid ":c:expr:`METH_FASTCALL | METH_KEYWORDS`" +msgstr "" + +#: ../../c-api/structures.rst:325 +msgid "" +"Extension of :c:macro:`METH_FASTCALL` supporting also keyword arguments, " +"with methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword " +"arguments are passed the same way as in the :ref:`vectorcall protocol " +"`: there is an additional fourth :c:expr:`PyObject*` parameter " +"which is a tuple representing the names of the keyword arguments (which are " +"guaranteed to be strings) or possibly ``NULL`` if there are no keywords. " +"The values of the keyword arguments are stored in the *args* array, after " +"the positional arguments." +msgstr "" + +#: ../../c-api/structures.rst:340 msgid "" -"Extension of :const:`METH_FASTCALL` supporting also keyword arguments, with " -"methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword arguments " -"are passed the same way as in the :ref:`vectorcall protocol `: " -"there is an additional fourth :c:expr:`PyObject*` parameter which is a tuple " -"representing the names of the keyword arguments (which are guaranteed to be " -"strings) or possibly ``NULL`` if there are no keywords. The values of the " -"keyword arguments are stored in the *args* array, after the positional " -"arguments." +"Can only be used in the combination with other flags: :ref:`METH_METHOD | " +"METH_FASTCALL | METH_KEYWORDS `." msgstr "" -#: ../../c-api/structures.rst:330 +#: ../../c-api/structures.rst:357 +msgid ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`" +msgstr "" + +#: ../../c-api/structures.rst:347 msgid "" -"Extension of :const:`METH_FASTCALL | METH_KEYWORDS` supporting the *defining " -"class*, that is, the class that contains the method in question. The " -"defining class might be a superclass of ``Py_TYPE(self)``." +"Extension of :ref:`METH_FASTCALL | METH_KEYWORDS ` supporting the *defining class*, that is, the class that " +"contains the method in question. The defining class might be a superclass of " +"``Py_TYPE(self)``." msgstr "" -#: ../../c-api/structures.rst:334 +#: ../../c-api/structures.rst:352 msgid "" "The method needs to be of type :c:type:`PyCMethod`, the same as for " "``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added " "after ``self``." msgstr "" -#: ../../c-api/structures.rst:343 +#: ../../c-api/structures.rst:361 msgid "" "Methods without parameters don't need to check whether arguments are given " -"if they are listed with the :const:`METH_NOARGS` flag. They need to be of " +"if they are listed with the :c:macro:`METH_NOARGS` flag. They need to be of " "type :c:type:`PyCFunction`. The first parameter is typically named *self* " "and will hold a reference to the module or object instance. In all cases " "the second parameter will be ``NULL``." msgstr "" -#: ../../c-api/structures.rst:349 +#: ../../c-api/structures.rst:367 msgid "" "The function must have 2 parameters. Since the second parameter is unused, :" "c:macro:`Py_UNUSED` can be used to prevent a compiler warning." msgstr "" -#: ../../c-api/structures.rst:355 +#: ../../c-api/structures.rst:373 msgid "" -"Methods with a single object argument can be listed with the :const:`METH_O` " -"flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``\"O\"`` " -"argument. They have the type :c:type:`PyCFunction`, with the *self* " -"parameter, and a :c:expr:`PyObject*` parameter representing the single " -"argument." +"Methods with a single object argument can be listed with the :c:macro:" +"`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` with a " +"``\"O\"`` argument. They have the type :c:type:`PyCFunction`, with the " +"*self* parameter, and a :c:expr:`PyObject*` parameter representing the " +"single argument." msgstr "" -#: ../../c-api/structures.rst:361 +#: ../../c-api/structures.rst:379 msgid "" "These two constants are not used to indicate the calling convention but the " "binding when use with methods of classes. These may not be used for " @@ -363,27 +393,27 @@ msgid "" "any given method." msgstr "" -#: ../../c-api/structures.rst:371 +#: ../../c-api/structures.rst:389 msgid "" "The method will be passed the type object as the first parameter rather than " "an instance of the type. This is used to create *class methods*, similar to " "what is created when using the :func:`classmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:381 +#: ../../c-api/structures.rst:399 msgid "" "The method will be passed ``NULL`` as the first parameter rather than an " "instance of the type. This is used to create *static methods*, similar to " "what is created when using the :func:`staticmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:385 +#: ../../c-api/structures.rst:403 msgid "" "One other constant controls whether a method is loaded in place of another " "definition with the same method name." msgstr "" -#: ../../c-api/structures.rst:391 +#: ../../c-api/structures.rst:409 msgid "" "The method will be loaded in place of existing definitions. Without " "*METH_COEXIST*, the default is to skip repeated definitions. Since slot " @@ -396,217 +426,217 @@ msgid "" "calls." msgstr "" -#: ../../c-api/structures.rst:403 +#: ../../c-api/structures.rst:421 msgid "Accessing attributes of extension types" msgstr "" -#: ../../c-api/structures.rst:407 +#: ../../c-api/structures.rst:425 msgid "" "Structure which describes an attribute of a type which corresponds to a C " "struct member. Its fields are:" msgstr "" -#: ../../c-api/structures.rst:411 ../../c-api/structures.rst:507 +#: ../../c-api/structures.rst:429 ../../c-api/structures.rst:525 msgid "Field" msgstr "" -#: ../../c-api/structures.rst:411 ../../c-api/structures.rst:507 +#: ../../c-api/structures.rst:429 ../../c-api/structures.rst:525 msgid "C Type" msgstr "C Type" -#: ../../c-api/structures.rst:411 ../../c-api/structures.rst:507 +#: ../../c-api/structures.rst:429 ../../c-api/structures.rst:525 msgid "Meaning" msgstr "" -#: ../../c-api/structures.rst:413 +#: ../../c-api/structures.rst:431 msgid ":attr:`name`" msgstr ":attr:`name`" -#: ../../c-api/structures.rst:413 ../../c-api/structures.rst:426 -#: ../../c-api/structures.rst:442 ../../c-api/structures.rst:509 -#: ../../c-api/structures.rst:517 +#: ../../c-api/structures.rst:431 ../../c-api/structures.rst:444 +#: ../../c-api/structures.rst:460 ../../c-api/structures.rst:527 +#: ../../c-api/structures.rst:535 msgid "const char \\*" msgstr "const char \\*" -#: ../../c-api/structures.rst:413 +#: ../../c-api/structures.rst:431 msgid "name of the member" msgstr "" -#: ../../c-api/structures.rst:415 +#: ../../c-api/structures.rst:433 msgid ":attr:`!type`" msgstr ":attr:`!type`" -#: ../../c-api/structures.rst:415 ../../c-api/structures.rst:422 -#: ../../c-api/structures.rst:438 +#: ../../c-api/structures.rst:433 ../../c-api/structures.rst:440 +#: ../../c-api/structures.rst:456 msgid "int" msgstr "int" -#: ../../c-api/structures.rst:415 +#: ../../c-api/structures.rst:433 msgid "the type of the member in the C struct" msgstr "" -#: ../../c-api/structures.rst:418 +#: ../../c-api/structures.rst:436 msgid ":attr:`offset`" msgstr ":attr:`offset`" -#: ../../c-api/structures.rst:418 ../../c-api/structures.rst:454 +#: ../../c-api/structures.rst:436 ../../c-api/structures.rst:472 msgid "Py_ssize_t" msgstr "Py_ssize_t" -#: ../../c-api/structures.rst:418 +#: ../../c-api/structures.rst:436 msgid "" "the offset in bytes that the member is located on the type's object struct" msgstr "" -#: ../../c-api/structures.rst:422 +#: ../../c-api/structures.rst:440 msgid ":attr:`flags`" msgstr ":attr:`flags`" -#: ../../c-api/structures.rst:422 +#: ../../c-api/structures.rst:440 msgid "flag bits indicating if the field should be read-only or writable" msgstr "" -#: ../../c-api/structures.rst:426 +#: ../../c-api/structures.rst:444 msgid ":attr:`doc`" msgstr ":attr:`doc`" -#: ../../c-api/structures.rst:430 +#: ../../c-api/structures.rst:448 msgid "" ":attr:`!type` can be one of many ``T_`` macros corresponding to various C " "types. When the member is accessed in Python, it will be converted to the " "equivalent Python type." msgstr "" -#: ../../c-api/structures.rst:435 +#: ../../c-api/structures.rst:453 msgid "Macro name" msgstr "" -#: ../../c-api/structures.rst:435 +#: ../../c-api/structures.rst:453 msgid "C type" msgstr "" -#: ../../c-api/structures.rst:437 +#: ../../c-api/structures.rst:455 msgid "T_SHORT" msgstr "T_SHORT" -#: ../../c-api/structures.rst:437 +#: ../../c-api/structures.rst:455 msgid "short" msgstr "" -#: ../../c-api/structures.rst:438 +#: ../../c-api/structures.rst:456 msgid "T_INT" msgstr "T_INT" -#: ../../c-api/structures.rst:439 +#: ../../c-api/structures.rst:457 msgid "T_LONG" msgstr "T_LONG" -#: ../../c-api/structures.rst:439 +#: ../../c-api/structures.rst:457 msgid "long" msgstr "long" -#: ../../c-api/structures.rst:440 +#: ../../c-api/structures.rst:458 msgid "T_FLOAT" msgstr "T_FLOAT" -#: ../../c-api/structures.rst:440 +#: ../../c-api/structures.rst:458 msgid "float" msgstr "float" -#: ../../c-api/structures.rst:441 +#: ../../c-api/structures.rst:459 msgid "T_DOUBLE" msgstr "T_DOUBLE" -#: ../../c-api/structures.rst:441 +#: ../../c-api/structures.rst:459 msgid "double" msgstr "double" -#: ../../c-api/structures.rst:442 +#: ../../c-api/structures.rst:460 msgid "T_STRING" msgstr "T_STRING" -#: ../../c-api/structures.rst:443 +#: ../../c-api/structures.rst:461 msgid "T_OBJECT" msgstr "T_OBJECT" -#: ../../c-api/structures.rst:443 ../../c-api/structures.rst:444 +#: ../../c-api/structures.rst:461 ../../c-api/structures.rst:462 msgid "PyObject \\*" msgstr "PyObject \\*" -#: ../../c-api/structures.rst:444 +#: ../../c-api/structures.rst:462 msgid "T_OBJECT_EX" msgstr "T_OBJECT_EX" -#: ../../c-api/structures.rst:445 +#: ../../c-api/structures.rst:463 msgid "T_CHAR" msgstr "T_CHAR" -#: ../../c-api/structures.rst:445 ../../c-api/structures.rst:446 -#: ../../c-api/structures.rst:451 +#: ../../c-api/structures.rst:463 ../../c-api/structures.rst:464 +#: ../../c-api/structures.rst:469 msgid "char" msgstr "char" -#: ../../c-api/structures.rst:446 +#: ../../c-api/structures.rst:464 msgid "T_BYTE" msgstr "T_BYTE" -#: ../../c-api/structures.rst:447 +#: ../../c-api/structures.rst:465 msgid "T_UBYTE" msgstr "T_UBYTE" -#: ../../c-api/structures.rst:447 +#: ../../c-api/structures.rst:465 msgid "unsigned char" msgstr "unsigned char" -#: ../../c-api/structures.rst:448 +#: ../../c-api/structures.rst:466 msgid "T_UINT" msgstr "T_UINT" -#: ../../c-api/structures.rst:448 +#: ../../c-api/structures.rst:466 msgid "unsigned int" msgstr "unsigned int" -#: ../../c-api/structures.rst:449 +#: ../../c-api/structures.rst:467 msgid "T_USHORT" msgstr "T_USHORT" -#: ../../c-api/structures.rst:449 +#: ../../c-api/structures.rst:467 msgid "unsigned short" msgstr "unsigned short" -#: ../../c-api/structures.rst:450 +#: ../../c-api/structures.rst:468 msgid "T_ULONG" msgstr "T_ULONG" -#: ../../c-api/structures.rst:450 +#: ../../c-api/structures.rst:468 msgid "unsigned long" msgstr "unsigned long" -#: ../../c-api/structures.rst:451 +#: ../../c-api/structures.rst:469 msgid "T_BOOL" msgstr "T_BOOL" -#: ../../c-api/structures.rst:452 +#: ../../c-api/structures.rst:470 msgid "T_LONGLONG" msgstr "T_LONGLONG" -#: ../../c-api/structures.rst:452 +#: ../../c-api/structures.rst:470 msgid "long long" msgstr "long long" -#: ../../c-api/structures.rst:453 +#: ../../c-api/structures.rst:471 msgid "T_ULONGLONG" msgstr "T_ULONGLONG" -#: ../../c-api/structures.rst:453 +#: ../../c-api/structures.rst:471 msgid "unsigned long long" msgstr "unsigned long long" -#: ../../c-api/structures.rst:454 +#: ../../c-api/structures.rst:472 msgid "T_PYSSIZET" msgstr "T_PYSSIZET" -#: ../../c-api/structures.rst:457 +#: ../../c-api/structures.rst:475 msgid "" ":c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` differ in that :c:macro:" "`T_OBJECT` returns ``None`` if the member is ``NULL`` and :c:macro:" @@ -616,7 +646,7 @@ msgid "" "than :c:macro:`T_OBJECT`." msgstr "" -#: ../../c-api/structures.rst:464 +#: ../../c-api/structures.rst:482 msgid "" ":attr:`flags` can be ``0`` for write and read access or :c:macro:`READONLY` " "for read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies :c:" @@ -625,7 +655,7 @@ msgid "" "are set to ``NULL``)." msgstr "" -#: ../../c-api/structures.rst:472 +#: ../../c-api/structures.rst:490 msgid "" "Heap allocated types (created using :c:func:`PyType_FromSpec` or similar), " "``PyMemberDef`` may contain definitions for the special members " @@ -636,112 +666,112 @@ msgid "" "``T_PYSSIZET`` and ``READONLY``, for example::" msgstr "" -#: ../../c-api/structures.rst:489 +#: ../../c-api/structures.rst:507 msgid "" "Get an attribute belonging to the object at address *obj_addr*. The " "attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" -#: ../../c-api/structures.rst:496 +#: ../../c-api/structures.rst:514 msgid "" "Set an attribute belonging to the object at address *obj_addr* to object " "*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " "``0`` if successful and a negative value on failure." msgstr "" -#: ../../c-api/structures.rst:503 +#: ../../c-api/structures.rst:521 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:509 +#: ../../c-api/structures.rst:527 msgid "name" msgstr "" -#: ../../c-api/structures.rst:509 +#: ../../c-api/structures.rst:527 msgid "attribute name" msgstr "" -#: ../../c-api/structures.rst:511 +#: ../../c-api/structures.rst:529 msgid "get" msgstr "" -#: ../../c-api/structures.rst:511 +#: ../../c-api/structures.rst:529 msgid "getter" msgstr "" -#: ../../c-api/structures.rst:511 +#: ../../c-api/structures.rst:529 msgid "C function to get the attribute" msgstr "" -#: ../../c-api/structures.rst:513 +#: ../../c-api/structures.rst:531 msgid "set" msgstr "" -#: ../../c-api/structures.rst:513 +#: ../../c-api/structures.rst:531 msgid "setter" msgstr "" -#: ../../c-api/structures.rst:513 +#: ../../c-api/structures.rst:531 msgid "" "optional C function to set or delete the attribute, if omitted the attribute " "is readonly" msgstr "" -#: ../../c-api/structures.rst:517 +#: ../../c-api/structures.rst:535 msgid "doc" msgstr "" -#: ../../c-api/structures.rst:517 +#: ../../c-api/structures.rst:535 msgid "optional docstring" msgstr "" -#: ../../c-api/structures.rst:519 +#: ../../c-api/structures.rst:537 msgid "closure" msgstr "" -#: ../../c-api/structures.rst:519 +#: ../../c-api/structures.rst:537 msgid "void \\*" msgstr "void \\*" -#: ../../c-api/structures.rst:519 +#: ../../c-api/structures.rst:537 msgid "" "optional function pointer, providing additional data for getter and setter" msgstr "" -#: ../../c-api/structures.rst:524 +#: ../../c-api/structures.rst:542 msgid "" "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " "and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:529 +#: ../../c-api/structures.rst:547 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:532 +#: ../../c-api/structures.rst:550 msgid "" "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " "the value to be set) and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:537 +#: ../../c-api/structures.rst:555 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." msgstr "" -#: ../../c-api/structures.rst:369 ../../c-api/structures.rst:379 +#: ../../c-api/structures.rst:387 ../../c-api/structures.rst:397 msgid "built-in function" msgstr "" -#: ../../c-api/structures.rst:369 +#: ../../c-api/structures.rst:387 msgid "classmethod" msgstr "" -#: ../../c-api/structures.rst:379 +#: ../../c-api/structures.rst:397 msgid "staticmethod" msgstr "" diff --git a/c-api/sys.po b/c-api/sys.po index 44af86d370..f24cb3b560 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -114,16 +114,16 @@ msgstr "" #: ../../c-api/sys.rst:97 msgid "" "Return true when the interpreter runs out of stack space. This is a " -"reliable check, but is only available when :const:`USE_STACKCHECK` is " +"reliable check, but is only available when :c:macro:`USE_STACKCHECK` is " "defined (currently on certain versions of Windows using the Microsoft Visual " -"C++ compiler). :const:`USE_STACKCHECK` will be defined automatically; you " +"C++ compiler). :c:macro:`USE_STACKCHECK` will be defined automatically; you " "should never change the definition in your own code." msgstr "" #: ../../c-api/sys.rst:106 msgid "" "Return the current signal handler for signal *i*. This is a thin wrapper " -"around either :c:func:`sigaction` or :c:func:`signal`. Do not call those " +"around either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those " "functions directly! :c:type:`PyOS_sighandler_t` is a typedef alias for :c:" "expr:`void (\\*)(int)`." msgstr "" @@ -131,8 +131,8 @@ msgstr "" #: ../../c-api/sys.rst:114 msgid "" "Set the signal handler for signal *i* to be *h*; return the old signal " -"handler. This is a thin wrapper around either :c:func:`sigaction` or :c:func:" -"`signal`. Do not call those functions directly! :c:type:" +"handler. This is a thin wrapper around either :c:func:`!sigaction` or :c:" +"func:`!signal`. Do not call those functions directly! :c:type:" "`PyOS_sighandler_t` is a typedef alias for :c:expr:`void (\\*)(int)`." msgstr "" diff --git a/c-api/type.po b/c-api/type.po index 8e9e1dc266..e3cca88c99 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -78,7 +78,7 @@ msgstr "" #: ../../c-api/type.rst:68 msgid "" "Return true if the type object includes support for the cycle detector; this " -"tests the type flag :const:`Py_TPFLAGS_HAVE_GC`." +"tests the type flag :c:macro:`Py_TPFLAGS_HAVE_GC`." msgstr "" #: ../../c-api/type.rst:74 @@ -117,11 +117,12 @@ msgstr "" #: ../../c-api/type.rst:101 msgid "" "If some of the base classes implements the GC protocol and the provided type " -"does not include the :const:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " +"does not include the :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " "protocol will be automatically implemented from its parents. On the " -"contrary, if the type being created does include :const:`Py_TPFLAGS_HAVE_GC` " -"in its flags then it **must** implement the GC protocol itself by at least " -"implementing the :c:member:`~PyTypeObject.tp_traverse` handle." +"contrary, if the type being created does include :c:macro:" +"`Py_TPFLAGS_HAVE_GC` in its flags then it **must** implement the GC protocol " +"itself by at least implementing the :c:member:`~PyTypeObject.tp_traverse` " +"handle." msgstr "" #: ../../c-api/type.rst:111 @@ -174,8 +175,8 @@ msgid "" "not return the intended result. ``Py_TYPE(self)`` may be a *subclass* of the " "intended class, and subclasses are not necessarily defined in the same " "module as their superclass. See :c:type:`PyCMethod` to get the class that " -"defines the method. See :c:func:`PyType_GetModuleByDef` for cases when " -"``PyCMethod`` cannot be used." +"defines the method. See :c:func:`PyType_GetModuleByDef` for cases when :c:" +"type:`!PyCMethod` cannot be used." msgstr "" #: ../../c-api/type.rst:159 @@ -223,8 +224,8 @@ msgstr "" #: ../../c-api/type.rst:195 msgid "" -"Creates and returns a :ref:`heap type ` from the *spec* (:const:" -"`Py_TPFLAGS_HEAPTYPE`)." +"Creates and returns a :ref:`heap type ` from the *spec* (:c:" +"macro:`Py_TPFLAGS_HEAPTYPE`)." msgstr "" #: ../../c-api/type.rst:198 diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 55fe6f6c18..50cd5381e3 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1184,26 +1184,26 @@ msgstr "" #: ../../c-api/typeobj.rst:914 ../../c-api/typeobj.rst:934 #: ../../c-api/typeobj.rst:955 ../../c-api/typeobj.rst:981 #: ../../c-api/typeobj.rst:1000 ../../c-api/typeobj.rst:1016 -#: ../../c-api/typeobj.rst:1053 ../../c-api/typeobj.rst:1064 -#: ../../c-api/typeobj.rst:1074 ../../c-api/typeobj.rst:1084 -#: ../../c-api/typeobj.rst:1098 ../../c-api/typeobj.rst:1116 -#: ../../c-api/typeobj.rst:1139 ../../c-api/typeobj.rst:1186 -#: ../../c-api/typeobj.rst:1201 ../../c-api/typeobj.rst:1220 -#: ../../c-api/typeobj.rst:1250 ../../c-api/typeobj.rst:1272 -#: ../../c-api/typeobj.rst:1288 ../../c-api/typeobj.rst:1356 -#: ../../c-api/typeobj.rst:1423 ../../c-api/typeobj.rst:1482 -#: ../../c-api/typeobj.rst:1512 ../../c-api/typeobj.rst:1544 -#: ../../c-api/typeobj.rst:1567 ../../c-api/typeobj.rst:1580 -#: ../../c-api/typeobj.rst:1595 ../../c-api/typeobj.rst:1609 -#: ../../c-api/typeobj.rst:1639 ../../c-api/typeobj.rst:1659 -#: ../../c-api/typeobj.rst:1685 ../../c-api/typeobj.rst:1703 -#: ../../c-api/typeobj.rst:1736 ../../c-api/typeobj.rst:1787 -#: ../../c-api/typeobj.rst:1804 ../../c-api/typeobj.rst:1845 -#: ../../c-api/typeobj.rst:1867 ../../c-api/typeobj.rst:1899 -#: ../../c-api/typeobj.rst:1927 ../../c-api/typeobj.rst:1940 -#: ../../c-api/typeobj.rst:1950 ../../c-api/typeobj.rst:1959 -#: ../../c-api/typeobj.rst:1969 ../../c-api/typeobj.rst:1983 -#: ../../c-api/typeobj.rst:2029 ../../c-api/typeobj.rst:2052 +#: ../../c-api/typeobj.rst:1055 ../../c-api/typeobj.rst:1066 +#: ../../c-api/typeobj.rst:1076 ../../c-api/typeobj.rst:1086 +#: ../../c-api/typeobj.rst:1100 ../../c-api/typeobj.rst:1118 +#: ../../c-api/typeobj.rst:1141 ../../c-api/typeobj.rst:1188 +#: ../../c-api/typeobj.rst:1203 ../../c-api/typeobj.rst:1222 +#: ../../c-api/typeobj.rst:1252 ../../c-api/typeobj.rst:1274 +#: ../../c-api/typeobj.rst:1290 ../../c-api/typeobj.rst:1358 +#: ../../c-api/typeobj.rst:1425 ../../c-api/typeobj.rst:1484 +#: ../../c-api/typeobj.rst:1514 ../../c-api/typeobj.rst:1546 +#: ../../c-api/typeobj.rst:1569 ../../c-api/typeobj.rst:1582 +#: ../../c-api/typeobj.rst:1597 ../../c-api/typeobj.rst:1611 +#: ../../c-api/typeobj.rst:1641 ../../c-api/typeobj.rst:1661 +#: ../../c-api/typeobj.rst:1687 ../../c-api/typeobj.rst:1705 +#: ../../c-api/typeobj.rst:1738 ../../c-api/typeobj.rst:1789 +#: ../../c-api/typeobj.rst:1806 ../../c-api/typeobj.rst:1847 +#: ../../c-api/typeobj.rst:1869 ../../c-api/typeobj.rst:1901 +#: ../../c-api/typeobj.rst:1929 ../../c-api/typeobj.rst:1942 +#: ../../c-api/typeobj.rst:1952 ../../c-api/typeobj.rst:1961 +#: ../../c-api/typeobj.rst:1971 ../../c-api/typeobj.rst:1985 +#: ../../c-api/typeobj.rst:2031 ../../c-api/typeobj.rst:2054 msgid "**Inheritance:**" msgstr "" @@ -1234,10 +1234,10 @@ msgstr "" #: ../../c-api/typeobj.rst:526 ../../c-api/typeobj.rst:707 #: ../../c-api/typeobj.rst:824 ../../c-api/typeobj.rst:916 -#: ../../c-api/typeobj.rst:936 ../../c-api/typeobj.rst:1546 -#: ../../c-api/typeobj.rst:1569 ../../c-api/typeobj.rst:1687 -#: ../../c-api/typeobj.rst:1705 ../../c-api/typeobj.rst:1789 -#: ../../c-api/typeobj.rst:1901 ../../c-api/typeobj.rst:2031 +#: ../../c-api/typeobj.rst:936 ../../c-api/typeobj.rst:1548 +#: ../../c-api/typeobj.rst:1571 ../../c-api/typeobj.rst:1689 +#: ../../c-api/typeobj.rst:1707 ../../c-api/typeobj.rst:1791 +#: ../../c-api/typeobj.rst:1903 ../../c-api/typeobj.rst:2033 msgid "This field is inherited by subtypes." msgstr "" @@ -1416,25 +1416,25 @@ msgid "" "all memory buffers owned by the instance (using the freeing function " "corresponding to the allocation function used to allocate the buffer), and " "call the type's :c:member:`~PyTypeObject.tp_free` function. If the type is " -"not subtypable (doesn't have the :const:`Py_TPFLAGS_BASETYPE` flag bit set), " -"it is permissible to call the object deallocator directly instead of via :c:" -"member:`~PyTypeObject.tp_free`. The object deallocator should be the one " -"used to allocate the instance; this is normally :c:func:`PyObject_Del` if " -"the instance was allocated using :c:func:`PyObject_New` or :c:func:" +"not subtypable (doesn't have the :c:macro:`Py_TPFLAGS_BASETYPE` flag bit " +"set), it is permissible to call the object deallocator directly instead of " +"via :c:member:`~PyTypeObject.tp_free`. The object deallocator should be the " +"one used to allocate the instance; this is normally :c:func:`PyObject_Del` " +"if the instance was allocated using :c:func:`PyObject_New` or :c:func:" "`PyObject_VarNew`, or :c:func:`PyObject_GC_Del` if the instance was " "allocated using :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`." msgstr "" #: ../../c-api/typeobj.rst:678 msgid "" -"If the type supports garbage collection (has the :const:`Py_TPFLAGS_HAVE_GC` " -"flag bit set), the destructor should call :c:func:`PyObject_GC_UnTrack` " -"before clearing any member fields." +"If the type supports garbage collection (has the :c:macro:" +"`Py_TPFLAGS_HAVE_GC` flag bit set), the destructor should call :c:func:" +"`PyObject_GC_UnTrack` before clearing any member fields." msgstr "" #: ../../c-api/typeobj.rst:690 msgid "" -"Finally, if the type is heap allocated (:const:`Py_TPFLAGS_HEAPTYPE`), the " +"Finally, if the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the " "deallocator should decrement the reference count for its type object after " "calling the type deallocator. In order to avoid dangling pointers, the " "recommended way to achieve this is:" @@ -1449,7 +1449,7 @@ msgstr "" #: ../../c-api/typeobj.rst:717 msgid "" -"This field is only used if the flag :const:`Py_TPFLAGS_HAVE_VECTORCALL` is " +"This field is only used if the flag :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` is " "set. If so, this must be a positive integer containing the offset in the " "instance of a :c:type:`vectorcallfunc` pointer." msgstr "" @@ -1457,7 +1457,7 @@ msgstr "" #: ../../c-api/typeobj.rst:721 msgid "" "The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " -"behaves as if :const:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " +"behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " "instance falls back to :c:member:`~PyTypeObject.tp_call`." msgstr "" @@ -1485,11 +1485,11 @@ msgstr "" #: ../../c-api/typeobj.rst:745 msgid "" -"This field is always inherited. However, the :const:" +"This field is always inherited. However, the :c:macro:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not, then " "the subclass won't use :ref:`vectorcall `, except when :c:func:" "`PyVectorcall_Call` is explicitly called. This is in particular the case for " -"types without the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag set (including " +"types without the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag set (including " "subclasses defined in Python)." msgstr "" @@ -1582,11 +1582,11 @@ msgstr "" #: ../../c-api/typeobj.rst:826 ../../c-api/typeobj.rst:938 #: ../../c-api/typeobj.rst:963 ../../c-api/typeobj.rst:989 -#: ../../c-api/typeobj.rst:1031 ../../c-api/typeobj.rst:1491 -#: ../../c-api/typeobj.rst:1643 ../../c-api/typeobj.rst:1664 -#: ../../c-api/typeobj.rst:1755 ../../c-api/typeobj.rst:1791 -#: ../../c-api/typeobj.rst:1809 ../../c-api/typeobj.rst:1851 -#: ../../c-api/typeobj.rst:1872 ../../c-api/typeobj.rst:1903 +#: ../../c-api/typeobj.rst:1031 ../../c-api/typeobj.rst:1493 +#: ../../c-api/typeobj.rst:1645 ../../c-api/typeobj.rst:1666 +#: ../../c-api/typeobj.rst:1757 ../../c-api/typeobj.rst:1793 +#: ../../c-api/typeobj.rst:1811 ../../c-api/typeobj.rst:1853 +#: ../../c-api/typeobj.rst:1874 ../../c-api/typeobj.rst:1905 msgid "**Default:**" msgstr "**預設:**" @@ -1671,7 +1671,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:898 ../../c-api/typeobj.rst:1484 +#: ../../c-api/typeobj.rst:898 ../../c-api/typeobj.rst:1486 msgid "Group: :attr:`tp_hash`, :attr:`tp_richcompare`" msgstr "" @@ -1803,9 +1803,9 @@ msgid "" "this flag bit. The flag bits that pertain to extension structures are " "strictly inherited if the extension structure is inherited, i.e. the base " "type's value of the flag bit is copied into the subtype together with a " -"pointer to the extension structure. The :const:`Py_TPFLAGS_HAVE_GC` flag " +"pointer to the extension structure. The :c:macro:`Py_TPFLAGS_HAVE_GC` flag " "bit is inherited together with the :c:member:`~PyTypeObject.tp_traverse` " -"and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :const:" +"and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :c:member:" "`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields in " "the subtype exist and have ``NULL`` values." @@ -1821,7 +1821,7 @@ msgstr "" msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1038 +#: ../../c-api/typeobj.rst:1040 msgid "" "The following bit masks are currently defined; these can be ORed together " "using the ``|`` operator to form the value of the :c:member:`~PyTypeObject." @@ -1830,7 +1830,7 @@ msgid "" "zero." msgstr "" -#: ../../c-api/typeobj.rst:1045 +#: ../../c-api/typeobj.rst:1047 msgid "" "This bit is set when the type object itself is allocated on the heap, for " "example, types created dynamically using :c:func:`PyType_FromSpec`. In this " @@ -1841,32 +1841,32 @@ msgid "" "gets INCREF'ed or DECREF'ed)." msgstr "" -#: ../../c-api/typeobj.rst:1055 ../../c-api/typeobj.rst:1066 -#: ../../c-api/typeobj.rst:1076 ../../c-api/typeobj.rst:1086 -#: ../../c-api/typeobj.rst:1118 +#: ../../c-api/typeobj.rst:1057 ../../c-api/typeobj.rst:1068 +#: ../../c-api/typeobj.rst:1078 ../../c-api/typeobj.rst:1088 +#: ../../c-api/typeobj.rst:1120 msgid "???" msgstr "" -#: ../../c-api/typeobj.rst:1060 +#: ../../c-api/typeobj.rst:1062 msgid "" "This bit is set when the type can be used as the base type of another type. " "If this bit is clear, the type cannot be subtyped (similar to a \"final\" " "class in Java)." msgstr "" -#: ../../c-api/typeobj.rst:1071 +#: ../../c-api/typeobj.rst:1073 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1081 +#: ../../c-api/typeobj.rst:1083 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: ../../c-api/typeobj.rst:1091 +#: ../../c-api/typeobj.rst:1093 msgid "" "This bit is set when the object supports garbage collection. If this bit is " "set, instances must be created using :c:func:`PyObject_GC_New` and destroyed " @@ -1876,63 +1876,63 @@ msgid "" "tp_clear` are present in the type object." msgstr "" -#: ../../c-api/typeobj.rst:1100 ../../c-api/typeobj.rst:1358 -#: ../../c-api/typeobj.rst:1425 +#: ../../c-api/typeobj.rst:1102 ../../c-api/typeobj.rst:1360 +#: ../../c-api/typeobj.rst:1427 msgid "" -"Group: :const:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" +"Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1102 +#: ../../c-api/typeobj.rst:1104 msgid "" -"The :const:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :" -"attr:`tp_traverse` and :attr:`tp_clear` fields, i.e. if the :const:" +"The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :" +"attr:`tp_traverse` and :attr:`tp_clear` fields, i.e. if the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :attr:" "`tp_traverse` and :attr:`tp_clear` fields in the subtype exist and have " "``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1112 +#: ../../c-api/typeobj.rst:1114 msgid "" "This is a bitmask of all the bits that pertain to the existence of certain " "fields in the type object and its extension structures. Currently, it " -"includes the following bits: :const:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." +"includes the following bits: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgstr "" -#: ../../c-api/typeobj.rst:1123 +#: ../../c-api/typeobj.rst:1125 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1125 +#: ../../c-api/typeobj.rst:1127 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: ../../c-api/typeobj.rst:1127 +#: ../../c-api/typeobj.rst:1129 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1130 +#: ../../c-api/typeobj.rst:1132 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1133 +#: ../../c-api/typeobj.rst:1135 msgid "" "This flag enables an optimization for typical method calls like ``obj." "meth()``: it avoids creating a temporary \"bound method\" object for ``obj." "meth``." msgstr "" -#: ../../c-api/typeobj.rst:1141 +#: ../../c-api/typeobj.rst:1143 msgid "" -"This flag is never inherited by types without the :const:" +"This flag is never inherited by types without the :c:macro:" "`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited " "whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1158 +#: ../../c-api/typeobj.rst:1160 msgid "" "These flags are used by functions such as :c:func:`PyLong_Check` to quickly " "determine if a type is a subclass of a built-in type; such specific checks " @@ -1942,81 +1942,81 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: ../../c-api/typeobj.rst:1169 +#: ../../c-api/typeobj.rst:1171 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1174 +#: ../../c-api/typeobj.rst:1176 msgid "" "This flag isn't necessary anymore, as the interpreter assumes the :c:member:" "`~PyTypeObject.tp_finalize` slot is always present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1182 +#: ../../c-api/typeobj.rst:1184 msgid "" "This bit is set when the class implements the :ref:`vectorcall protocol " "`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for " "details." msgstr "" -#: ../../c-api/typeobj.rst:1188 +#: ../../c-api/typeobj.rst:1190 msgid "" -"This bit is inherited for types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` " +"This bit is inherited for types with the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` " "flag set, if :c:member:`~PyTypeObject.tp_call` is also inherited." msgstr "" -#: ../../c-api/typeobj.rst:1196 +#: ../../c-api/typeobj.rst:1198 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: ../../c-api/typeobj.rst:1198 +#: ../../c-api/typeobj.rst:1200 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: ../../c-api/typeobj.rst:1203 +#: ../../c-api/typeobj.rst:1205 msgid "This flag is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1209 +#: ../../c-api/typeobj.rst:1211 msgid "" "Disallow creating instances of the type: set :c:member:`~PyTypeObject." "tp_new` to NULL and don't create the ``__new__`` key in the type dictionary." msgstr "" -#: ../../c-api/typeobj.rst:1213 +#: ../../c-api/typeobj.rst:1215 msgid "" "The flag must be set before creating the type, not after. For example, it " "must be set before :c:func:`PyType_Ready` is called on the type." msgstr "" -#: ../../c-api/typeobj.rst:1216 +#: ../../c-api/typeobj.rst:1218 msgid "" "The flag is set automatically on :ref:`static types ` if :c:" "member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:" "member:`~PyTypeObject.tp_new` is NULL." msgstr "" -#: ../../c-api/typeobj.rst:1222 +#: ../../c-api/typeobj.rst:1224 msgid "" "This flag is not inherited. However, subclasses will not be instantiable " "unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " "only possible via the C API)." msgstr "" -#: ../../c-api/typeobj.rst:1229 +#: ../../c-api/typeobj.rst:1231 msgid "" "To disallow instantiating a class directly but allow instantiating its " "subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " "Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1240 +#: ../../c-api/typeobj.rst:1242 msgid "" "This bit indicates that instances of the class may match mapping patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2024,23 +2024,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: ../../c-api/typeobj.rst:1247 ../../c-api/typeobj.rst:1269 +#: ../../c-api/typeobj.rst:1249 ../../c-api/typeobj.rst:1271 msgid "" -":const:`Py_TPFLAGS_MAPPING` and :const:`Py_TPFLAGS_SEQUENCE` are mutually " -"exclusive; it is an error to enable both flags simultaneously." +":c:macro:`Py_TPFLAGS_MAPPING` and :c:macro:`Py_TPFLAGS_SEQUENCE` are " +"mutually exclusive; it is an error to enable both flags simultaneously." msgstr "" -#: ../../c-api/typeobj.rst:1252 +#: ../../c-api/typeobj.rst:1254 msgid "" -"This flag is inherited by types that do not already set :const:" +"This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: ../../c-api/typeobj.rst:1255 ../../c-api/typeobj.rst:1277 +#: ../../c-api/typeobj.rst:1257 ../../c-api/typeobj.rst:1279 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../c-api/typeobj.rst:1262 +#: ../../c-api/typeobj.rst:1264 msgid "" "This bit indicates that instances of the class may match sequence patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2048,37 +2048,37 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: ../../c-api/typeobj.rst:1274 +#: ../../c-api/typeobj.rst:1276 msgid "" -"This flag is inherited by types that do not already set :const:" +"This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: ../../c-api/typeobj.rst:1284 +#: ../../c-api/typeobj.rst:1286 msgid "" "An optional pointer to a NUL-terminated C string giving the docstring for " "this type object. This is exposed as the :attr:`__doc__` attribute on the " "type and instances of the type." msgstr "" -#: ../../c-api/typeobj.rst:1290 +#: ../../c-api/typeobj.rst:1292 msgid "This field is *not* inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:1295 +#: ../../c-api/typeobj.rst:1297 msgid "" "An optional pointer to a traversal function for the garbage collector. This " -"is only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " +"is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1300 ../../c-api/typeobj.rst:1420 +#: ../../c-api/typeobj.rst:1302 ../../c-api/typeobj.rst:1422 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1303 +#: ../../c-api/typeobj.rst:1305 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2088,7 +2088,7 @@ msgid "" "`_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1318 +#: ../../c-api/typeobj.rst:1320 msgid "" "Note that :c:func:`Py_VISIT` is called only on those members that can " "participate in reference cycles. Although there is also a ``self->key`` " @@ -2096,14 +2096,14 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../c-api/typeobj.rst:1322 +#: ../../c-api/typeobj.rst:1324 msgid "" "On the other hand, even if you know a member can never be part of a cycle, " "as a debugging aid you may want to visit it anyway just so the :mod:`gc` " "module's :func:`~gc.get_referents` function will include it." msgstr "" -#: ../../c-api/typeobj.rst:1327 +#: ../../c-api/typeobj.rst:1329 msgid "" "When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members " "that the instance *owns* (by having :term:`strong references ` hold a reference to " "their type. Their traversal function must therefore either visit :c:func:" @@ -2132,29 +2132,29 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1351 +#: ../../c-api/typeobj.rst:1353 msgid "" "Heap-allocated types are expected to visit ``Py_TYPE(self)`` in " "``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1360 +#: ../../c-api/typeobj.rst:1362 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." -"tp_clear` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" +"tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" "member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` " "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1368 +#: ../../c-api/typeobj.rst:1370 msgid "" "An optional pointer to a clear function for the garbage collector. This is " -"only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The signature " -"is::" +"only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " +"signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1373 +#: ../../c-api/typeobj.rst:1375 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " "reference cycles in cyclic garbage detected by the garbage collector. Taken " @@ -2169,7 +2169,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1383 +#: ../../c-api/typeobj.rst:1385 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2177,7 +2177,7 @@ msgid "" "example::" msgstr "" -#: ../../c-api/typeobj.rst:1397 +#: ../../c-api/typeobj.rst:1399 msgid "" "The :c:func:`Py_CLEAR` macro should be used, because clearing references is " "delicate: the reference to the contained object must not be decremented " @@ -2192,7 +2192,7 @@ msgid "" "in a safe order." msgstr "" -#: ../../c-api/typeobj.rst:1408 +#: ../../c-api/typeobj.rst:1410 msgid "" "Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " "an instance is deallocated. For example, when reference counting is enough " @@ -2200,7 +2200,7 @@ msgid "" "is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." msgstr "" -#: ../../c-api/typeobj.rst:1414 +#: ../../c-api/typeobj.rst:1416 msgid "" "Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break " "reference cycles, it's not necessary to clear contained objects like Python " @@ -2210,26 +2210,26 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1427 +#: ../../c-api/typeobj.rst:1429 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." -"tp_traverse` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" -"member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` " +"tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :" +"c:member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` " "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1435 +#: ../../c-api/typeobj.rst:1437 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1439 +#: ../../c-api/typeobj.rst:1441 msgid "" "The first parameter is guaranteed to be an instance of the type that is " "defined by :c:type:`PyTypeObject`." msgstr "" -#: ../../c-api/typeobj.rst:1442 +#: ../../c-api/typeobj.rst:1444 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2237,74 +2237,80 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1447 +#: ../../c-api/typeobj.rst:1449 msgid "" "The following constants are defined to be used as the third argument for :c:" "member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" msgstr "" -#: ../../c-api/typeobj.rst:1451 +#: ../../c-api/typeobj.rst:1453 msgid "Constant" msgstr "常數" -#: ../../c-api/typeobj.rst:1451 +#: ../../c-api/typeobj.rst:1453 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1453 -msgid ":const:`Py_LT`" +#: ../../c-api/typeobj.rst:1455 +#, fuzzy +msgid ":c:macro:`Py_LT`" msgstr ":const:`Py_LT`" -#: ../../c-api/typeobj.rst:1453 +#: ../../c-api/typeobj.rst:1455 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1455 -msgid ":const:`Py_LE`" +#: ../../c-api/typeobj.rst:1457 +#, fuzzy +msgid ":c:macro:`Py_LE`" msgstr ":const:`Py_LE`" -#: ../../c-api/typeobj.rst:1455 +#: ../../c-api/typeobj.rst:1457 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1457 -msgid ":const:`Py_EQ`" +#: ../../c-api/typeobj.rst:1459 +#, fuzzy +msgid ":c:macro:`Py_EQ`" msgstr ":const:`Py_EQ`" -#: ../../c-api/typeobj.rst:1457 +#: ../../c-api/typeobj.rst:1459 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1459 -msgid ":const:`Py_NE`" +#: ../../c-api/typeobj.rst:1461 +#, fuzzy +msgid ":c:macro:`Py_NE`" msgstr ":const:`Py_NE`" -#: ../../c-api/typeobj.rst:1459 +#: ../../c-api/typeobj.rst:1461 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1461 -msgid ":const:`Py_GT`" +#: ../../c-api/typeobj.rst:1463 +#, fuzzy +msgid ":c:macro:`Py_GT`" msgstr ":const:`Py_GT`" -#: ../../c-api/typeobj.rst:1461 +#: ../../c-api/typeobj.rst:1463 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1463 -msgid ":const:`Py_GE`" +#: ../../c-api/typeobj.rst:1465 +#, fuzzy +msgid ":c:macro:`Py_GE`" msgstr ":const:`Py_GE`" -#: ../../c-api/typeobj.rst:1463 +#: ../../c-api/typeobj.rst:1465 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1466 +#: ../../c-api/typeobj.rst:1468 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1470 +#: ../../c-api/typeobj.rst:1472 msgid "" "Return ``Py_True`` or ``Py_False`` from the function, depending on the " "result of a comparison. VAL_A and VAL_B must be orderable by C comparison " @@ -2312,15 +2318,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1476 +#: ../../c-api/typeobj.rst:1478 msgid "The return value's reference count is properly incremented." msgstr "" -#: ../../c-api/typeobj.rst:1478 +#: ../../c-api/typeobj.rst:1480 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1486 +#: ../../c-api/typeobj.rst:1488 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2328,7 +2334,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1493 +#: ../../c-api/typeobj.rst:1495 msgid "" ":c:type:`PyBaseObject_Type` provides a :attr:`tp_richcompare` " "implementation, which may be inherited. However, if only :attr:`tp_hash` is " @@ -2336,7 +2342,7 @@ msgid "" "will not be able to participate in any comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1502 +#: ../../c-api/typeobj.rst:1504 msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " @@ -2346,13 +2352,13 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1509 +#: ../../c-api/typeobj.rst:1511 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " "is the list head for weak references to the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1514 +#: ../../c-api/typeobj.rst:1516 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype uses a " @@ -2361,7 +2367,7 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1519 +#: ../../c-api/typeobj.rst:1521 msgid "" "When a type defined by a class statement has no :attr:`~object.__slots__` " "declaration, and none of its base types are weakly referenceable, the type " @@ -2370,7 +2376,7 @@ msgid "" "tp_weaklistoffset` of that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1524 +#: ../../c-api/typeobj.rst:1526 msgid "" "When a type's :attr:`__slots__` declaration contains a slot named :attr:" "`__weakref__`, that slot becomes the weak reference list head for instances " @@ -2378,31 +2384,31 @@ msgid "" "`~PyTypeObject.tp_weaklistoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1529 +#: ../../c-api/typeobj.rst:1531 msgid "" "When a type's :attr:`__slots__` declaration does not contain a slot named :" "attr:`__weakref__`, the type inherits its :c:member:`~PyTypeObject." "tp_weaklistoffset` from its base type." msgstr "" -#: ../../c-api/typeobj.rst:1536 +#: ../../c-api/typeobj.rst:1538 msgid "" "An optional pointer to a function that returns an :term:`iterator` for the " "object. Its presence normally signals that the instances of this type are :" "term:`iterable` (although sequences may be iterable without this function)." msgstr "" -#: ../../c-api/typeobj.rst:1540 +#: ../../c-api/typeobj.rst:1542 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1551 +#: ../../c-api/typeobj.rst:1553 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1556 +#: ../../c-api/typeobj.rst:1558 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2410,74 +2416,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1561 +#: ../../c-api/typeobj.rst:1563 msgid "" "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " "function, and that function should return the iterator instance itself (not " "a new iterator instance)." msgstr "" -#: ../../c-api/typeobj.rst:1565 +#: ../../c-api/typeobj.rst:1567 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1574 +#: ../../c-api/typeobj.rst:1576 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMethodDef` structures, declaring regular methods of this type." msgstr "" -#: ../../c-api/typeobj.rst:1577 +#: ../../c-api/typeobj.rst:1579 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1582 +#: ../../c-api/typeobj.rst:1584 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1588 +#: ../../c-api/typeobj.rst:1590 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMemberDef` structures, declaring regular data members (fields or slots) " "of instances of this type." msgstr "" -#: ../../c-api/typeobj.rst:1592 +#: ../../c-api/typeobj.rst:1594 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1597 +#: ../../c-api/typeobj.rst:1599 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1603 +#: ../../c-api/typeobj.rst:1605 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyGetSetDef` structures, declaring computed attributes of instances of this " "type." msgstr "" -#: ../../c-api/typeobj.rst:1606 +#: ../../c-api/typeobj.rst:1608 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1611 +#: ../../c-api/typeobj.rst:1613 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1617 +#: ../../c-api/typeobj.rst:1619 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2485,7 +2491,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1625 +#: ../../c-api/typeobj.rst:1627 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2493,7 +2499,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1630 +#: ../../c-api/typeobj.rst:1632 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "func:`PyBaseObject_Type` is not required to produce an address constant. " @@ -2501,27 +2507,27 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1636 +#: ../../c-api/typeobj.rst:1638 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1641 +#: ../../c-api/typeobj.rst:1643 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1645 +#: ../../c-api/typeobj.rst:1647 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1651 +#: ../../c-api/typeobj.rst:1653 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1653 +#: ../../c-api/typeobj.rst:1655 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -2530,45 +2536,45 @@ msgid "" "they don't correspond to overloaded operations (like :meth:`__add__`)." msgstr "" -#: ../../c-api/typeobj.rst:1661 +#: ../../c-api/typeobj.rst:1663 msgid "" "This field is not inherited by subtypes (though the attributes defined in " "here are inherited through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1666 +#: ../../c-api/typeobj.rst:1668 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1671 +#: ../../c-api/typeobj.rst:1673 msgid "" "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" "member:`~PyTypeObject.tp_dict` with the dictionary C-API." msgstr "" -#: ../../c-api/typeobj.rst:1677 +#: ../../c-api/typeobj.rst:1679 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1679 ../../c-api/typeobj.rst:1695 -#: ../../c-api/typeobj.rst:1770 ../../c-api/typeobj.rst:1800 -#: ../../c-api/typeobj.rst:1824 +#: ../../c-api/typeobj.rst:1681 ../../c-api/typeobj.rst:1697 +#: ../../c-api/typeobj.rst:1772 ../../c-api/typeobj.rst:1802 +#: ../../c-api/typeobj.rst:1826 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1692 +#: ../../c-api/typeobj.rst:1694 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1699 +#: ../../c-api/typeobj.rst:1701 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1710 +#: ../../c-api/typeobj.rst:1712 msgid "" "If the instances of this type have a dictionary containing instance " "variables, this field is non-zero and contains the offset in the instances " @@ -2576,13 +2582,13 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1715 +#: ../../c-api/typeobj.rst:1717 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " "the dictionary for attributes of the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1718 +#: ../../c-api/typeobj.rst:1720 msgid "" "If the value of this field is greater than zero, it specifies the offset " "from the start of the instance structure. If the value is less than zero, " @@ -2598,7 +2604,7 @@ msgid "" "the very end of the structure." msgstr "" -#: ../../c-api/typeobj.rst:1730 +#: ../../c-api/typeobj.rst:1732 msgid "" "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" "only. To get the pointer to the dictionary call :c:func:" @@ -2607,7 +2613,7 @@ msgid "" "to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." msgstr "" -#: ../../c-api/typeobj.rst:1738 +#: ../../c-api/typeobj.rst:1740 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype instances " @@ -2616,7 +2622,7 @@ msgid "" "should not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1743 +#: ../../c-api/typeobj.rst:1745 msgid "" "When a type defined by a class statement has no :attr:`~object.__slots__` " "declaration, and none of its base types has an instance variable dictionary, " @@ -2624,14 +2630,14 @@ msgid "" "`~PyTypeObject.tp_dictoffset` is set to that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1748 +#: ../../c-api/typeobj.rst:1750 msgid "" "When a type defined by a class statement has a :attr:`__slots__` " "declaration, the type inherits its :c:member:`~PyTypeObject.tp_dictoffset` " "from its base type." msgstr "" -#: ../../c-api/typeobj.rst:1751 +#: ../../c-api/typeobj.rst:1753 msgid "" "(Adding a slot named :attr:`~object.__dict__` to the :attr:`__slots__` " "declaration does not have the expected effect, it just causes confusion. " @@ -2639,17 +2645,17 @@ msgid "" "though.)" msgstr "" -#: ../../c-api/typeobj.rst:1757 +#: ../../c-api/typeobj.rst:1759 msgid "" "This slot has no default. For :ref:`static types `, if the " "field is ``NULL`` then no :attr:`__dict__` gets created for instances." msgstr "" -#: ../../c-api/typeobj.rst:1763 +#: ../../c-api/typeobj.rst:1765 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1765 +#: ../../c-api/typeobj.rst:1767 msgid "" "This function corresponds to the :meth:`__init__` method of classes. Like :" "meth:`__init__`, it is possible to create an instance without calling :meth:" @@ -2657,14 +2663,14 @@ msgid "" "meth:`__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1774 +#: ../../c-api/typeobj.rst:1776 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " "arguments represent positional and keyword arguments of the call to :meth:" "`__init__`." msgstr "" -#: ../../c-api/typeobj.rst:1778 +#: ../../c-api/typeobj.rst:1780 msgid "" "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " "when an instance is created normally by calling its type, after the type's :" @@ -2676,43 +2682,43 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1785 +#: ../../c-api/typeobj.rst:1787 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1793 +#: ../../c-api/typeobj.rst:1795 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1798 +#: ../../c-api/typeobj.rst:1800 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1806 +#: ../../c-api/typeobj.rst:1808 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1811 +#: ../../c-api/typeobj.rst:1813 msgid "" "For dynamic subtypes, this field is always set to :c:func:" "`PyType_GenericAlloc`, to force a standard heap allocation strategy." msgstr "" -#: ../../c-api/typeobj.rst:1815 +#: ../../c-api/typeobj.rst:1817 msgid "" "For static subtypes, :c:type:`PyBaseObject_Type` uses :c:func:" "`PyType_GenericAlloc`. That is the recommended value for all statically " "defined types." msgstr "" -#: ../../c-api/typeobj.rst:1822 +#: ../../c-api/typeobj.rst:1824 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1828 +#: ../../c-api/typeobj.rst:1830 msgid "" "The *subtype* argument is the type of the object being created; the *args* " "and *kwds* arguments represent positional and keyword arguments of the call " @@ -2721,7 +2727,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1834 +#: ../../c-api/typeobj.rst:1836 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -2733,20 +2739,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1842 +#: ../../c-api/typeobj.rst:1844 msgid "" -"Set the :const:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow creating " -"instances of the type in Python." +"Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow " +"creating instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:1847 +#: ../../c-api/typeobj.rst:1849 msgid "" "This field is inherited by subtypes, except it is not inherited by :ref:" "`static types ` whose :c:member:`~PyTypeObject.tp_base` is " "``NULL`` or ``&PyBaseObject_Type``." msgstr "" -#: ../../c-api/typeobj.rst:1853 +#: ../../c-api/typeobj.rst:1855 msgid "" "For :ref:`static types ` this field has no default. This means " "if the slot is defined as ``NULL``, the type cannot be called to create new " @@ -2754,43 +2760,43 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:1861 +#: ../../c-api/typeobj.rst:1863 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1865 +#: ../../c-api/typeobj.rst:1867 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1869 +#: ../../c-api/typeobj.rst:1871 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1874 +#: ../../c-api/typeobj.rst:1876 msgid "" "In dynamic subtypes, this field is set to a deallocator suitable to match :c:" -"func:`PyType_GenericAlloc` and the value of the :const:`Py_TPFLAGS_HAVE_GC` " -"flag bit." +"func:`PyType_GenericAlloc` and the value of the :c:macro:" +"`Py_TPFLAGS_HAVE_GC` flag bit." msgstr "" -#: ../../c-api/typeobj.rst:1878 +#: ../../c-api/typeobj.rst:1880 msgid "For static subtypes, :c:type:`PyBaseObject_Type` uses PyObject_Del." msgstr "" -#: ../../c-api/typeobj.rst:1883 +#: ../../c-api/typeobj.rst:1885 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1885 +#: ../../c-api/typeobj.rst:1887 msgid "" "The garbage collector needs to know whether a particular object is " "collectible or not. Normally, it is sufficient to look at the object's " -"type's :c:member:`~PyTypeObject.tp_flags` field, and check the :const:" +"type's :c:member:`~PyTypeObject.tp_flags` field, and check the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit. But some types have a mixture of statically " "and dynamically allocated instances, and the statically allocated instances " "are not collectible. Such types should define this function; it should " @@ -2798,90 +2804,90 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1895 +#: ../../c-api/typeobj.rst:1897 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" "`PyType_Type`, defines this function to distinguish between statically and :" "ref:`dynamically allocated types `.)" msgstr "" -#: ../../c-api/typeobj.rst:1905 +#: ../../c-api/typeobj.rst:1907 msgid "" -"This slot has no default. If this field is ``NULL``, :const:" +"This slot has no default. If this field is ``NULL``, :c:macro:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: ../../c-api/typeobj.rst:1911 +#: ../../c-api/typeobj.rst:1913 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1913 ../../c-api/typeobj.rst:1937 +#: ../../c-api/typeobj.rst:1915 ../../c-api/typeobj.rst:1939 msgid "" "This field should be set to ``NULL`` and treated as read-only. Python will " "fill it in when the type is :c:func:`initialized `." msgstr "" -#: ../../c-api/typeobj.rst:1916 +#: ../../c-api/typeobj.rst:1918 msgid "" "For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " "` can be used instead of the *bases* argument of :c:func:" "`PyType_FromSpecWithBases`. The argument form is preferred." msgstr "" -#: ../../c-api/typeobj.rst:1923 +#: ../../c-api/typeobj.rst:1925 msgid "" "Multiple inheritance does not work well for statically defined types. If you " "set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " "will only be inherited from the first base." msgstr "" -#: ../../c-api/typeobj.rst:1929 ../../c-api/typeobj.rst:1952 -#: ../../c-api/typeobj.rst:1961 ../../c-api/typeobj.rst:1971 -#: ../../c-api/typeobj.rst:1985 +#: ../../c-api/typeobj.rst:1931 ../../c-api/typeobj.rst:1954 +#: ../../c-api/typeobj.rst:1963 ../../c-api/typeobj.rst:1973 +#: ../../c-api/typeobj.rst:1987 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1934 +#: ../../c-api/typeobj.rst:1936 msgid "" "Tuple containing the expanded set of base types, starting with the type " "itself and ending with :class:`object`, in Method Resolution Order." msgstr "" -#: ../../c-api/typeobj.rst:1942 +#: ../../c-api/typeobj.rst:1944 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1948 +#: ../../c-api/typeobj.rst:1950 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1957 +#: ../../c-api/typeobj.rst:1959 msgid "List of weak references to subclasses. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1966 +#: ../../c-api/typeobj.rst:1968 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1976 +#: ../../c-api/typeobj.rst:1978 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:1981 +#: ../../c-api/typeobj.rst:1983 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1990 +#: ../../c-api/typeobj.rst:1992 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1994 +#: ../../c-api/typeobj.rst:1996 msgid "" "If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " "once when finalizing an instance. It is called either from the garbage " @@ -2891,14 +2897,14 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:2001 +#: ../../c-api/typeobj.rst:2003 msgid "" ":c:member:`~PyTypeObject.tp_finalize` should not mutate the current " "exception status; therefore, a recommended way to write a non-trivial " "finalizer is::" msgstr "" -#: ../../c-api/typeobj.rst:2018 +#: ../../c-api/typeobj.rst:2020 msgid "" "Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." "tp_dealloc` may be called from any Python thread, not just the thread which " @@ -2911,18 +2917,18 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:2037 +#: ../../c-api/typeobj.rst:2039 msgid "" -"Before version 3.8 it was necessary to set the :const:" +"Before version 3.8 it was necessary to set the :c:macro:" "`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " "This is no longer required." msgstr "" -#: ../../c-api/typeobj.rst:2041 +#: ../../c-api/typeobj.rst:2043 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2046 +#: ../../c-api/typeobj.rst:2048 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -2930,91 +2936,91 @@ msgid "" "attr:`__new__` and :attr:`__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2054 +#: ../../c-api/typeobj.rst:2056 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2056 +#: ../../c-api/typeobj.rst:2058 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2062 +#: ../../c-api/typeobj.rst:2064 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2064 +#: ../../c-api/typeobj.rst:2066 msgid "" "Traditionally, types defined in C code are *static*, that is, a static :c:" "type:`PyTypeObject` structure is defined directly in code and initialized " "using :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2068 +#: ../../c-api/typeobj.rst:2070 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2070 +#: ../../c-api/typeobj.rst:2072 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2072 +#: ../../c-api/typeobj.rst:2074 msgid "" "Static type objects (but not necessarily their instances) are immutable. It " "is not possible to add or modify the type object's attributes from Python." msgstr "" -#: ../../c-api/typeobj.rst:2074 +#: ../../c-api/typeobj.rst:2076 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2078 +#: ../../c-api/typeobj.rst:2080 msgid "" "Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " "` as an opaque struct, any extension modules using static types must " "be compiled for a specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2086 +#: ../../c-api/typeobj.rst:2088 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2088 +#: ../../c-api/typeobj.rst:2090 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " -"created by Python's ``class`` statement. Heap types have the :const:" +"created by Python's ``class`` statement. Heap types have the :c:macro:" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2093 +#: ../../c-api/typeobj.rst:2095 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" "func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, or :c:func:" "`PyType_FromModuleAndSpec`." msgstr "" -#: ../../c-api/typeobj.rst:2101 +#: ../../c-api/typeobj.rst:2103 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2108 +#: ../../c-api/typeobj.rst:2110 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the number protocol. Each function is used by the function of " "similar name documented in the :ref:`number` section." msgstr "" -#: ../../c-api/typeobj.rst:2114 ../../c-api/typeobj.rst:2438 +#: ../../c-api/typeobj.rst:2116 ../../c-api/typeobj.rst:2440 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2161 +#: ../../c-api/typeobj.rst:2163 msgid "" "Binary and ternary functions must check the type of all their operands, and " "implement the necessary conversions (at least one of the operands is an " @@ -3024,30 +3030,31 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2170 +#: ../../c-api/typeobj.rst:2172 msgid "" -"The :c:data:`nb_reserved` field should always be ``NULL``. It was " -"previously called :c:data:`nb_long`, and was renamed in Python 3.0.1." +"The :c:member:`~PyNumberMethods.nb_reserved` field should always be " +"``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in " +"Python 3.0.1." msgstr "" -#: ../../c-api/typeobj.rst:2215 +#: ../../c-api/typeobj.rst:2217 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2222 +#: ../../c-api/typeobj.rst:2224 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the mapping protocol. It has three members:" msgstr "" -#: ../../c-api/typeobj.rst:2227 +#: ../../c-api/typeobj.rst:2229 msgid "" "This function is used by :c:func:`PyMapping_Size` and :c:func:" "`PyObject_Size`, and has the same signature. This slot may be set to " "``NULL`` if the object has no defined length." msgstr "" -#: ../../c-api/typeobj.rst:2233 +#: ../../c-api/typeobj.rst:2235 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3055,7 +3062,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2241 +#: ../../c-api/typeobj.rst:2243 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PyObject_SetSlice` and :c:func:" @@ -3065,17 +3072,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2252 +#: ../../c-api/typeobj.rst:2254 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2259 +#: ../../c-api/typeobj.rst:2261 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2264 +#: ../../c-api/typeobj.rst:2266 msgid "" "This function is used by :c:func:`PySequence_Size` and :c:func:" "`PyObject_Size`, and has the same signature. It is also used for handling " @@ -3083,21 +3090,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2271 +#: ../../c-api/typeobj.rst:2273 msgid "" "This function is used by :c:func:`PySequence_Concat` and has the same " "signature. It is also used by the ``+`` operator, after trying the numeric " "addition via the :c:member:`~PyNumberMethods.nb_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2277 +#: ../../c-api/typeobj.rst:2279 msgid "" "This function is used by :c:func:`PySequence_Repeat` and has the same " "signature. It is also used by the ``*`` operator, after trying numeric " "multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2283 +#: ../../c-api/typeobj.rst:2285 msgid "" "This function is used by :c:func:`PySequence_GetItem` and has the same " "signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " @@ -3106,7 +3113,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2289 +#: ../../c-api/typeobj.rst:2291 msgid "" "Negative indexes are handled as follows: if the :attr:`sq_length` slot is " "filled, it is called and the sequence length is used to compute a positive " @@ -3114,7 +3121,7 @@ msgid "" "the index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2296 +#: ../../c-api/typeobj.rst:2298 msgid "" "This function is used by :c:func:`PySequence_SetItem` and has the same " "signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" @@ -3123,14 +3130,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2305 +#: ../../c-api/typeobj.rst:2307 msgid "" "This function may be used by :c:func:`PySequence_Contains` and has the same " "signature. This slot may be left to ``NULL``, in this case :c:func:`!" "PySequence_Contains` simply traverses the sequence until it finds a match." msgstr "" -#: ../../c-api/typeobj.rst:2312 +#: ../../c-api/typeobj.rst:2314 msgid "" "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3140,7 +3147,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2321 +#: ../../c-api/typeobj.rst:2323 msgid "" "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3150,72 +3157,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2332 +#: ../../c-api/typeobj.rst:2334 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2340 +#: ../../c-api/typeobj.rst:2342 msgid "" "This structure holds pointers to the functions required by the :ref:`Buffer " "protocol `. The protocol defines how an exporter object can " "expose its internal data to consumer objects." msgstr "" -#: ../../c-api/typeobj.rst:2346 ../../c-api/typeobj.rst:2395 -#: ../../c-api/typeobj.rst:2449 ../../c-api/typeobj.rst:2460 -#: ../../c-api/typeobj.rst:2472 ../../c-api/typeobj.rst:2481 +#: ../../c-api/typeobj.rst:2348 ../../c-api/typeobj.rst:2397 +#: ../../c-api/typeobj.rst:2451 ../../c-api/typeobj.rst:2462 +#: ../../c-api/typeobj.rst:2474 ../../c-api/typeobj.rst:2483 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2350 +#: ../../c-api/typeobj.rst:2352 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " "Except for point (3), an implementation of this function MUST take these " "steps:" msgstr "" -#: ../../c-api/typeobj.rst:2354 +#: ../../c-api/typeobj.rst:2356 msgid "" "Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " "set :c:expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2357 +#: ../../c-api/typeobj.rst:2359 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2359 +#: ../../c-api/typeobj.rst:2361 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2361 +#: ../../c-api/typeobj.rst:2363 msgid "" "Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2363 +#: ../../c-api/typeobj.rst:2365 msgid "Return ``0``." msgstr "" -#: ../../c-api/typeobj.rst:2365 +#: ../../c-api/typeobj.rst:2367 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2368 +#: ../../c-api/typeobj.rst:2370 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "expr:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2371 +#: ../../c-api/typeobj.rst:2373 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:expr:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2375 +#: ../../c-api/typeobj.rst:2377 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3223,7 +3230,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2380 +#: ../../c-api/typeobj.rst:2382 msgid "" "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " "exporter and must remain valid until there are no consumers left. :c:member:" @@ -3232,19 +3239,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2387 +#: ../../c-api/typeobj.rst:2389 msgid "" ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " "buffer while dealing correctly with all request types." msgstr "" -#: ../../c-api/typeobj.rst:2390 +#: ../../c-api/typeobj.rst:2392 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2399 +#: ../../c-api/typeobj.rst:2401 msgid "" "Handle a request to release the resources of the buffer. If no resources " "need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " @@ -3252,15 +3259,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2404 +#: ../../c-api/typeobj.rst:2406 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2406 +#: ../../c-api/typeobj.rst:2408 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2408 +#: ../../c-api/typeobj.rst:2410 msgid "" "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " "track of buffer-specific resources. This field is guaranteed to remain " @@ -3268,68 +3275,68 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2414 +#: ../../c-api/typeobj.rst:2416 msgid "" "This function MUST NOT decrement :c:expr:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2419 +#: ../../c-api/typeobj.rst:2421 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2427 +#: ../../c-api/typeobj.rst:2429 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2435 +#: ../../c-api/typeobj.rst:2437 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2453 +#: ../../c-api/typeobj.rst:2455 msgid "" "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " "must return ``1`` for it." msgstr "" -#: ../../c-api/typeobj.rst:2456 +#: ../../c-api/typeobj.rst:2458 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2464 +#: ../../c-api/typeobj.rst:2466 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`__anext__` " "for details." msgstr "" -#: ../../c-api/typeobj.rst:2467 +#: ../../c-api/typeobj.rst:2469 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2476 +#: ../../c-api/typeobj.rst:2478 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " "This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2485 +#: ../../c-api/typeobj.rst:2487 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2494 +#: ../../c-api/typeobj.rst:2496 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2498 +#: ../../c-api/typeobj.rst:2500 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " @@ -3343,80 +3350,80 @@ msgid "" "member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2508 +#: ../../c-api/typeobj.rst:2510 msgid "" "This function should not do any other instance initialization, not even to " "allocate additional memory; that should be done by :c:member:`~PyTypeObject." "tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2515 +#: ../../c-api/typeobj.rst:2517 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`。" -#: ../../c-api/typeobj.rst:2519 +#: ../../c-api/typeobj.rst:2521 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`。" -#: ../../c-api/typeobj.rst:2523 +#: ../../c-api/typeobj.rst:2525 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" -#: ../../c-api/typeobj.rst:2527 +#: ../../c-api/typeobj.rst:2529 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。" -#: ../../c-api/typeobj.rst:2531 ../../c-api/typeobj.rst:2540 +#: ../../c-api/typeobj.rst:2533 ../../c-api/typeobj.rst:2542 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2535 ../../c-api/typeobj.rst:2546 +#: ../../c-api/typeobj.rst:2537 ../../c-api/typeobj.rst:2548 msgid "" "Set the value of the named attribute for the object. The value argument is " "set to ``NULL`` to delete the attribute." msgstr "" -#: ../../c-api/typeobj.rst:2542 +#: ../../c-api/typeobj.rst:2544 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。" -#: ../../c-api/typeobj.rst:2549 +#: ../../c-api/typeobj.rst:2551 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。" -#: ../../c-api/typeobj.rst:2553 +#: ../../c-api/typeobj.rst:2555 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。" -#: ../../c-api/typeobj.rst:2557 +#: ../../c-api/typeobj.rst:2559 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。" -#: ../../c-api/typeobj.rst:2561 +#: ../../c-api/typeobj.rst:2563 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。" -#: ../../c-api/typeobj.rst:2565 +#: ../../c-api/typeobj.rst:2567 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。" -#: ../../c-api/typeobj.rst:2569 +#: ../../c-api/typeobj.rst:2571 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。" -#: ../../c-api/typeobj.rst:2573 +#: ../../c-api/typeobj.rst:2575 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。" -#: ../../c-api/typeobj.rst:2587 +#: ../../c-api/typeobj.rst:2589 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。" -#: ../../c-api/typeobj.rst:2603 +#: ../../c-api/typeobj.rst:2605 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2605 +#: ../../c-api/typeobj.rst:2607 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3424,33 +3431,33 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2610 +#: ../../c-api/typeobj.rst:2612 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2627 +#: ../../c-api/typeobj.rst:2629 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2671 +#: ../../c-api/typeobj.rst:2673 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2698 +#: ../../c-api/typeobj.rst:2700 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " -"instances (e.g. uses a separate factory func) using :c:data:" +"instances (e.g. uses a separate factory func) using :c:macro:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: ../../c-api/typeobj.rst:2717 +#: ../../c-api/typeobj.rst:2719 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2728 +#: ../../c-api/typeobj.rst:2730 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" diff --git a/c-api/unicode.po b/c-api/unicode.po index b443595f14..8f5c0ddbec 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-28 00:31+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -92,7 +92,7 @@ msgstr "" #: ../../c-api/unicode.rst:61 msgid "" -"This is a typedef of :c:expr:`wchar_t`, which is a 16-bit type or 32-bit " +"This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit " "type depending on the platform." msgstr "" @@ -1118,21 +1118,21 @@ msgid "wchar_t Support" msgstr "" #: ../../c-api/unicode.rst:938 -msgid ":c:expr:`wchar_t` support for platforms which support it:" +msgid ":c:type:`wchar_t` support for platforms which support it:" msgstr "" #: ../../c-api/unicode.rst:942 msgid "" -"Create a Unicode object from the :c:expr:`wchar_t` buffer *w* of the given " +"Create a Unicode object from the :c:type:`wchar_t` buffer *w* of the given " "*size*. Passing ``-1`` as the *size* indicates that the function must itself " "compute the length, using wcslen. Return ``NULL`` on failure." msgstr "" #: ../../c-api/unicode.rst:950 msgid "" -"Copy the Unicode object contents into the :c:expr:`wchar_t` buffer *w*. At " -"most *size* :c:expr:`wchar_t` characters are copied (excluding a possibly " -"trailing null termination character). Return the number of :c:expr:" +"Copy the Unicode object contents into the :c:type:`wchar_t` buffer *w*. At " +"most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " +"trailing null termination character). Return the number of :c:type:" "`wchar_t` characters copied or ``-1`` in case of an error. Note that the " "resulting :c:expr:`wchar_t*` string may or may not be null-terminated. It " "is the responsibility of the caller to make sure that the :c:expr:`wchar_t*` " @@ -1146,7 +1146,7 @@ msgid "" "Convert the Unicode object to a wide character string. The output string " "always ends with a null character. If *size* is not ``NULL``, write the " "number of wide characters (excluding the trailing null termination " -"character) into *\\*size*. Note that the resulting :c:expr:`wchar_t` string " +"character) into *\\*size*. Note that the resulting :c:type:`wchar_t` string " "might contain null characters, which would cause the string to be truncated " "when used with most C functions. If *size* is ``NULL`` and the :c:expr:" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." @@ -1631,7 +1631,7 @@ msgstr "" msgid "" "Encode the Unicode object using the specified code page and return a Python " "bytes object. Return ``NULL`` if an exception was raised by the codec. Use :" -"c:data:`CP_ACP` code page to get the MBCS encoder." +"c:macro:`CP_ACP` code page to get the MBCS encoder." msgstr "" #: ../../c-api/unicode.rst:1400 @@ -1754,17 +1754,17 @@ msgid "``NULL`` in case an exception was raised" msgstr "" #: ../../c-api/unicode.rst:1513 -msgid ":const:`Py_True` or :const:`Py_False` for successful comparisons" +msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" msgstr "" #: ../../c-api/unicode.rst:1514 -msgid ":const:`Py_NotImplemented` in case the type combination is unknown" +msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" msgstr "" #: ../../c-api/unicode.rst:1516 msgid "" -"Possible values for *op* are :const:`Py_GT`, :const:`Py_GE`, :const:" -"`Py_EQ`, :const:`Py_NE`, :const:`Py_LT`, and :const:`Py_LE`." +"Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:" +"`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`." msgstr "" #: ../../c-api/unicode.rst:1522 diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index e77cdab3ab..cc83c399d7 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,15 +32,15 @@ msgstr "" #: ../../c-api/veryhigh.rst:14 msgid "" "Several of these functions accept a start symbol from the grammar as a " -"parameter. The available start symbols are :const:`Py_eval_input`, :const:" -"`Py_file_input`, and :const:`Py_single_input`. These are described " +"parameter. The available start symbols are :c:data:`Py_eval_input`, :c:data:" +"`Py_file_input`, and :c:data:`Py_single_input`. These are described " "following the functions which accept them as parameters." msgstr "" #: ../../c-api/veryhigh.rst:19 msgid "" "Note also that several of these functions take :c:expr:`FILE*` parameters. " -"One particular issue which needs to be handled carefully is that the :c:expr:" +"One particular issue which needs to be handled carefully is that the :c:type:" "`FILE` structure for different C libraries can be different and " "incompatible. Under Windows (at least), it is possible for dynamically " "linked extensions to actually use different libraries, so care should be " @@ -287,8 +287,8 @@ msgstr "" msgid "" "Parse and compile the Python source code in *str*, returning the resulting " "code object. The start token is given by *start*; this can be used to " -"constrain the code which can be compiled and should be :const:" -"`Py_eval_input`, :const:`Py_file_input`, or :const:`Py_single_input`. The " +"constrain the code which can be compiled and should be :c:data:" +"`Py_eval_input`, :c:data:`Py_file_input`, or :c:data:`Py_single_input`. The " "filename specified by *filename* is used to construct the code object and " "may appear in tracebacks or :exc:`SyntaxError` exception messages. This " "returns ``NULL`` if the code cannot be parsed or compiled." diff --git a/extending/extending.po b/extending/extending.po index 83258b224c..0d12a7e6af 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -296,11 +296,11 @@ msgstr "" #: ../../extending/extending.rst:238 msgid "" -"Note also that the :c:data:`SpamError` variable retains a reference to the " +"Note also that the :c:data:`!SpamError` variable retains a reference to the " "newly created exception class; this is intentional! Since the exception " "could be removed from the module by external code, an owned reference to the " -"class is needed to ensure that it will not be discarded, causing :c:data:" -"`SpamError` to become a dangling pointer. Should it become a dangling " +"class is needed to ensure that it will not be discarded, causing :c:data:`!" +"SpamError` to become a dangling pointer. Should it become a dangling " "pointer, C code which raises the exception could cause a core dump or other " "unintended side effects." msgstr "" @@ -332,9 +332,9 @@ msgid "" "It returns ``NULL`` (the error indicator for functions returning object " "pointers) if an error is detected in the argument list, relying on the " "exception set by :c:func:`PyArg_ParseTuple`. Otherwise the string value of " -"the argument has been copied to the local variable :c:data:`command`. This " +"the argument has been copied to the local variable :c:data:`!command`. This " "is a pointer assignment and you are not supposed to modify the string to " -"which it points (so in Standard C, the variable :c:data:`command` should " +"which it points (so in Standard C, the variable :c:data:`!command` should " "properly be declared as ``const char *command``)." msgstr "" @@ -346,8 +346,9 @@ msgstr "" #: ../../extending/extending.rst:292 msgid "" -"Our :func:`spam.system` function must return the value of :c:data:`sts` as a " -"Python object. This is done using the function :c:func:`PyLong_FromLong`. ::" +"Our :func:`!spam.system` function must return the value of :c:data:`!sts` as " +"a Python object. This is done using the function :c:func:" +"`PyLong_FromLong`. ::" msgstr "" #: ../../extending/extending.rst:297 @@ -399,7 +400,7 @@ msgstr "" #: ../../extending/extending.rst:338 msgid "" -"The :const:`METH_KEYWORDS` bit may be set in the third field if keyword " +"The :c:macro:`METH_KEYWORDS` bit may be set in the third field if keyword " "arguments should be passed to the function. In this case, the C function " "should accept a third ``PyObject *`` parameter which will be a dictionary of " "keywords. Use :c:func:`PyArg_ParseTupleAndKeywords` to parse the arguments " @@ -547,7 +548,7 @@ msgstr "" #: ../../extending/extending.rst:529 msgid "" -"This function must be registered with the interpreter using the :const:" +"This function must be registered with the interpreter using the :c:macro:" "`METH_VARARGS` flag; this is described in section :ref:`methodtable`. The :" "c:func:`PyArg_ParseTuple` function and its arguments are documented in " "section :ref:`parsetuple`." diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index 71a39814a0..b6f99527ea 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-07 00:27+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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" @@ -184,7 +184,7 @@ msgid "" msgstr "" #: ../../extending/newtypes_tutorial.rst:154 -msgid "We set the class flags to :const:`Py_TPFLAGS_DEFAULT`. ::" +msgid "We set the class flags to :c:macro:`Py_TPFLAGS_DEFAULT`. ::" msgstr "" #: ../../extending/newtypes_tutorial.rst:158 @@ -526,8 +526,8 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:508 msgid "" -"(note that we used the :const:`METH_NOARGS` flag to indicate that the method " -"is expecting no arguments other than *self*)" +"(note that we used the :c:macro:`METH_NOARGS` flag to indicate that the " +"method is expecting no arguments other than *self*)" msgstr "" #: ../../extending/newtypes_tutorial.rst:511 @@ -539,7 +539,7 @@ msgid "" "Finally, we'll make our type usable as a base class for subclassing. We've " "written our methods carefully so far so that they don't make any assumptions " "about the type of the object being created or used, so all we need to do is " -"to add the :const:`Py_TPFLAGS_BASETYPE` to our class flag definition::" +"to add the :c:macro:`Py_TPFLAGS_BASETYPE` to our class flag definition::" msgstr "" #: ../../extending/newtypes_tutorial.rst:522 @@ -736,7 +736,7 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:784 msgid "" -"Finally, we add the :const:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" +"Finally, we add the :c:macro:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" msgstr "" #: ../../extending/newtypes_tutorial.rst:788 diff --git a/howto/argparse.po b/howto/argparse.po index 1f409343bd..a8fec7fe00 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-25 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-01-31 17:33+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -559,10 +559,65 @@ msgid "" msgstr "" #: ../../howto/argparse.rst:763 +msgid "How to translate the argparse output" +msgstr "" + +#: ../../howto/argparse.rst:765 +msgid "" +"The output of the :mod:`argparse` module such as its help text and error " +"messages are all made translatable using the :mod:`gettext` module. This " +"allows applications to easily localize messages produced by :mod:`argparse`. " +"See also :ref:`i18n-howto`." +msgstr "" + +#: ../../howto/argparse.rst:770 +msgid "For instance, in this :mod:`argparse` output:" +msgstr "" + +#: ../../howto/argparse.rst:788 +msgid "" +"The strings ``usage:``, ``positional arguments:``, ``options:`` and ``show " +"this help message and exit`` are all translatable." +msgstr "" + +#: ../../howto/argparse.rst:791 +msgid "" +"In order to translate these strings, they must first be extracted into a ``." +"po`` file. For example, using `Babel `__, run this " +"command:" +msgstr "" + +#: ../../howto/argparse.rst:799 +msgid "" +"This command will extract all translatable strings from the :mod:`argparse` " +"module and output them into a file named ``messages.po``. This command " +"assumes that your Python installation is in ``/usr/lib``." +msgstr "" + +#: ../../howto/argparse.rst:803 +msgid "" +"You can find out the location of the :mod:`argparse` module on your system " +"using this script::" +msgstr "" + +#: ../../howto/argparse.rst:809 +msgid "" +"Once the messages in the ``.po`` file are translated and the translations " +"are installed using :mod:`gettext`, :mod:`argparse` will be able to display " +"the translated messages." +msgstr "" + +#: ../../howto/argparse.rst:813 +msgid "" +"To translate your own strings in the :mod:`argparse` output, use :mod:" +"`gettext`." +msgstr "" + +#: ../../howto/argparse.rst:816 msgid "Conclusion" msgstr "結論" -#: ../../howto/argparse.rst:765 +#: ../../howto/argparse.rst:818 msgid "" "The :mod:`argparse` module offers a lot more than shown here. Its docs are " "quite detailed and thorough, and full of examples. Having gone through this " diff --git a/howto/clinic.po b/howto/clinic.po index 5d69bdcdd1..21b4e7b0a2 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-18 14:59+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -30,7 +30,7 @@ msgstr "作者" msgid "Larry Hastings" msgstr "Larry Hastings" -#: ../../howto/clinic.rst:-1 +#: ../../howto/clinic.rst:7 msgid "Abstract" msgstr "摘要" @@ -38,27 +38,46 @@ msgstr "摘要" msgid "" "Argument Clinic is a preprocessor for CPython C files. Its purpose is to " "automate all the boilerplate involved with writing argument parsing code for " -"\"builtins\". This document shows you how to convert your first C function " -"to work with Argument Clinic, and then introduces some advanced topics on " -"Argument Clinic usage." +"\"builtins\", module level functions, and class methods. This document is " +"divided in three major sections:" +msgstr "" + +#: ../../howto/clinic.rst:20 +msgid "" +":ref:`clinic-background` talks about the basic concepts and goals of " +"Argument Clinic." msgstr "" -#: ../../howto/clinic.rst:21 +#: ../../howto/clinic.rst:22 msgid "" -"Currently Argument Clinic is considered internal-only for CPython. Its use " -"is not supported for files outside CPython, and no guarantees are made " -"regarding backwards compatibility for future versions. In other words: if " -"you maintain an external C extension for CPython, you're welcome to " -"experiment with Argument Clinic in your own code. But the version of " -"Argument Clinic that ships with the next version of CPython *could* be " -"totally incompatible and break all your code." +":ref:`clinic-tutorial` guides you through all the steps required to adapt an " +"existing C function to Argument Clinic." +msgstr "" + +#: ../../howto/clinic.rst:24 +msgid ":ref:`clinic-howtos` details how to handle specific tasks." +msgstr "" + +#: ../../howto/clinic.rst:29 +msgid "" +"Argument Clinic is considered internal-only for CPython. Its use is not " +"supported for files outside CPython, and no guarantees are made regarding " +"backwards compatibility for future versions. In other words: if you " +"maintain an external C extension for CPython, you're welcome to experiment " +"with Argument Clinic in your own code. But the version of Argument Clinic " +"that ships with the next version of CPython *could* be totally incompatible " +"and break all your code." +msgstr "" + +#: ../../howto/clinic.rst:42 +msgid "Background" msgstr "" -#: ../../howto/clinic.rst:32 +#: ../../howto/clinic.rst:46 msgid "The goals of Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:34 +#: ../../howto/clinic.rst:48 msgid "" "Argument Clinic's primary goal is to take over responsibility for all " "argument parsing code inside CPython. This means that, when you convert a " @@ -69,7 +88,7 @@ msgid "" "*kwargs``) magically converted into the C variables and types you need." msgstr "" -#: ../../howto/clinic.rst:44 +#: ../../howto/clinic.rst:58 msgid "" "In order for Argument Clinic to accomplish its primary goal, it must be easy " "to use. Currently, working with CPython's argument parsing library is a " @@ -77,7 +96,7 @@ msgid "" "places. When you use Argument Clinic, you don't have to repeat yourself." msgstr "" -#: ../../howto/clinic.rst:50 +#: ../../howto/clinic.rst:64 msgid "" "Obviously, no one would want to use Argument Clinic unless it's solving " "their problem—and without creating new problems of its own. So it's " @@ -89,14 +108,14 @@ msgid "" "parsing library. That would make for the fastest argument parsing possible!)" msgstr "" -#: ../../howto/clinic.rst:62 +#: ../../howto/clinic.rst:76 msgid "" "Additionally, Argument Clinic must be flexible enough to work with any " "approach to argument parsing. Python has some functions with some very " "strange parsing behaviors; Argument Clinic's goal is to support all of them." msgstr "" -#: ../../howto/clinic.rst:67 +#: ../../howto/clinic.rst:81 msgid "" "Finally, the original motivation for Argument Clinic was to provide " "introspection \"signatures\" for CPython builtins. It used to be, the " @@ -104,7 +123,7 @@ msgid "" "builtin. With Argument Clinic, that's a thing of the past!" msgstr "" -#: ../../howto/clinic.rst:73 +#: ../../howto/clinic.rst:87 msgid "" "One idea you should keep in mind, as you work with Argument Clinic: the more " "information you give it, the better job it'll be able to do. Argument Clinic " @@ -113,36 +132,36 @@ msgid "" "things with all the information you give it." msgstr "" -#: ../../howto/clinic.rst:83 +#: ../../howto/clinic.rst:97 msgid "Basic concepts and usage" msgstr "" -#: ../../howto/clinic.rst:85 +#: ../../howto/clinic.rst:99 msgid "" -"Argument Clinic ships with CPython; you'll find it in ``Tools/clinic/clinic." -"py``. If you run that script, specifying a C file as an argument:" +"Argument Clinic ships with CPython; you'll find it in :source:`Tools/clinic/" +"clinic.py`. If you run that script, specifying a C file as an argument:" msgstr "" -#: ../../howto/clinic.rst:92 +#: ../../howto/clinic.rst:107 msgid "" "Argument Clinic will scan over the file looking for lines that look exactly " "like this:" msgstr "" -#: ../../howto/clinic.rst:99 +#: ../../howto/clinic.rst:114 msgid "" "When it finds one, it reads everything up to a line that looks exactly like " "this:" msgstr "" -#: ../../howto/clinic.rst:106 +#: ../../howto/clinic.rst:121 msgid "" "Everything in between these two lines is input for Argument Clinic. All of " "these lines, including the beginning and ending comment lines, are " "collectively called an Argument Clinic \"block\"." msgstr "" -#: ../../howto/clinic.rst:110 +#: ../../howto/clinic.rst:125 msgid "" "When Argument Clinic parses one of these blocks, it generates output. This " "output is rewritten into the C file immediately after the block, followed by " @@ -150,7 +169,7 @@ msgid "" "this:" msgstr "" -#: ../../howto/clinic.rst:123 +#: ../../howto/clinic.rst:138 msgid "" "If you run Argument Clinic on the same file a second time, Argument Clinic " "will discard the old output and write out the new output with a fresh " @@ -158,7 +177,7 @@ msgid "" "change either." msgstr "" -#: ../../howto/clinic.rst:127 +#: ../../howto/clinic.rst:142 msgid "" "You should never modify the output portion of an Argument Clinic block. " "Instead, change the input until it produces the output you want. (That's " @@ -167,38 +186,38 @@ msgid "" "output.)" msgstr "" -#: ../../howto/clinic.rst:132 +#: ../../howto/clinic.rst:147 msgid "" "For the sake of clarity, here's the terminology we'll use with Argument " "Clinic:" msgstr "" -#: ../../howto/clinic.rst:134 +#: ../../howto/clinic.rst:149 msgid "" "The first line of the comment (``/*[clinic input]``) is the *start line*." msgstr "" -#: ../../howto/clinic.rst:135 +#: ../../howto/clinic.rst:150 msgid "" "The last line of the initial comment (``[clinic start generated code]*/``) " "is the *end line*." msgstr "" -#: ../../howto/clinic.rst:136 +#: ../../howto/clinic.rst:151 msgid "" "The last line (``/*[clinic end generated code: checksum=...]*/``) is the " "*checksum line*." msgstr "" -#: ../../howto/clinic.rst:137 +#: ../../howto/clinic.rst:152 msgid "In between the start line and the end line is the *input*." msgstr "" -#: ../../howto/clinic.rst:138 +#: ../../howto/clinic.rst:153 msgid "In between the end line and the checksum line is the *output*." msgstr "" -#: ../../howto/clinic.rst:139 +#: ../../howto/clinic.rst:154 msgid "" "All the text collectively, from the start line to the checksum line " "inclusively, is the *block*. (A block that hasn't been successfully " @@ -206,11 +225,11 @@ msgid "" "it's still considered a block.)" msgstr "" -#: ../../howto/clinic.rst:146 -msgid "Converting your first function" +#: ../../howto/clinic.rst:163 +msgid "Tutorial" msgstr "" -#: ../../howto/clinic.rst:148 +#: ../../howto/clinic.rst:165 msgid "" "The best way to get a sense of how Argument Clinic works is to convert a " "function to work with it. Here, then, are the bare minimum steps you'd need " @@ -221,30 +240,31 @@ msgid "" "keep it simple for this walkthrough so you can learn." msgstr "" -#: ../../howto/clinic.rst:157 +#: ../../howto/clinic.rst:174 msgid "Let's dive in!" msgstr "" -#: ../../howto/clinic.rst:159 +#: ../../howto/clinic.rst:176 msgid "" "Make sure you're working with a freshly updated checkout of the CPython " "trunk." msgstr "" -#: ../../howto/clinic.rst:162 +#: ../../howto/clinic.rst:179 msgid "" "Find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :c:" "func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " -"Argument Clinic yet. For my example I'm using ``_pickle.Pickler.dump()``." +"Argument Clinic yet. For my example I'm using :py:meth:`_pickle.Pickler.dump " +"`." msgstr "" -#: ../../howto/clinic.rst:167 +#: ../../howto/clinic.rst:185 msgid "" -"If the call to the ``PyArg_Parse`` function uses any of the following format " -"units:" +"If the call to the :c:func:`!PyArg_Parse*` function uses any of the " +"following format units:" msgstr "" -#: ../../howto/clinic.rst:179 +#: ../../howto/clinic.rst:197 msgid "" "or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should choose " "a different function. Argument Clinic *does* support all of these " @@ -252,21 +272,21 @@ msgid "" "your first function." msgstr "" -#: ../../howto/clinic.rst:184 +#: ../../howto/clinic.rst:202 msgid "" -"Also, if the function has multiple calls to :c:func:`PyArg_ParseTuple` or :c:" -"func:`PyArg_ParseTupleAndKeywords` where it supports different types for the " -"same argument, or if the function uses something besides PyArg_Parse " -"functions to parse its arguments, it probably isn't suitable for conversion " -"to Argument Clinic. Argument Clinic doesn't support generic functions or " -"polymorphic parameters." +"Also, if the function has multiple calls to :c:func:`!PyArg_ParseTuple` or :" +"c:func:`PyArg_ParseTupleAndKeywords` where it supports different types for " +"the same argument, or if the function uses something besides :c:func:`!" +"PyArg_Parse*` functions to parse its arguments, it probably isn't suitable " +"for conversion to Argument Clinic. Argument Clinic doesn't support generic " +"functions or polymorphic parameters." msgstr "" -#: ../../howto/clinic.rst:191 +#: ../../howto/clinic.rst:209 msgid "Add the following boilerplate above the function, creating our block::" msgstr "" -#: ../../howto/clinic.rst:196 +#: ../../howto/clinic.rst:214 msgid "" "Cut the docstring and paste it in between the ``[clinic]`` lines, removing " "all the junk that makes it a properly quoted C string. When you're done you " @@ -274,22 +294,22 @@ msgid "" "80 characters. (Argument Clinic will preserve indents inside the docstring.)" msgstr "" -#: ../../howto/clinic.rst:202 +#: ../../howto/clinic.rst:220 msgid "" "If the old docstring had a first line that looked like a function signature, " -"throw that line away. (The docstring doesn't need it anymore—when you use " -"``help()`` on your builtin in the future, the first line will be built " +"throw that line away. (The docstring doesn't need it anymore—when you use :" +"py:func:`help` on your builtin in the future, the first line will be built " "automatically based on the function's signature.)" msgstr "" -#: ../../howto/clinic.rst:208 ../../howto/clinic.rst:229 -#: ../../howto/clinic.rst:253 ../../howto/clinic.rst:311 -#: ../../howto/clinic.rst:351 ../../howto/clinic.rst:378 -#: ../../howto/clinic.rst:484 ../../howto/clinic.rst:536 +#: ../../howto/clinic.rst:226 ../../howto/clinic.rst:247 +#: ../../howto/clinic.rst:271 ../../howto/clinic.rst:329 +#: ../../howto/clinic.rst:369 ../../howto/clinic.rst:396 +#: ../../howto/clinic.rst:502 ../../howto/clinic.rst:554 msgid "Sample::" msgstr "" -#: ../../howto/clinic.rst:214 +#: ../../howto/clinic.rst:232 msgid "" "If your docstring doesn't have a \"summary\" line, Argument Clinic will " "complain. So let's make sure it has one. The \"summary\" line should be a " @@ -297,13 +317,13 @@ msgid "" "docstring." msgstr "" -#: ../../howto/clinic.rst:219 +#: ../../howto/clinic.rst:237 msgid "" "(Our example docstring consists solely of a summary line, so the sample code " "doesn't have to change for this step.)" msgstr "" -#: ../../howto/clinic.rst:222 +#: ../../howto/clinic.rst:240 msgid "" "Above the docstring, enter the name of the function, followed by a blank " "line. This should be the Python name of the function, and should be the " @@ -312,7 +332,7 @@ msgid "" "it should include the class name too." msgstr "" -#: ../../howto/clinic.rst:237 +#: ../../howto/clinic.rst:255 msgid "" "If this is the first time that module or class has been used with Argument " "Clinic in this C file, you must declare the module and/or class. Proper " @@ -322,47 +342,47 @@ msgid "" "next to each other.)" msgstr "" -#: ../../howto/clinic.rst:245 +#: ../../howto/clinic.rst:263 msgid "" "The name of the class and module should be the same as the one seen by " "Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" "`PyTypeObject` as appropriate." msgstr "" -#: ../../howto/clinic.rst:249 +#: ../../howto/clinic.rst:267 msgid "" "When you declare a class, you must also specify two aspects of its type in " "C: the type declaration you'd use for a pointer to an instance of this " -"class, and a pointer to the :c:type:`PyTypeObject` for this class." +"class, and a pointer to the :c:type:`!PyTypeObject` for this class." msgstr "" -#: ../../howto/clinic.rst:269 +#: ../../howto/clinic.rst:287 msgid "" "Declare each of the parameters to the function. Each parameter should get " "its own line. All the parameter lines should be indented from the function " "name and the docstring." msgstr "" -#: ../../howto/clinic.rst:273 +#: ../../howto/clinic.rst:291 msgid "The general form of these parameter lines is as follows:" msgstr "" -#: ../../howto/clinic.rst:279 +#: ../../howto/clinic.rst:297 msgid "If the parameter has a default value, add that after the converter:" msgstr "" -#: ../../howto/clinic.rst:286 +#: ../../howto/clinic.rst:304 msgid "" "Argument Clinic's support for \"default values\" is quite sophisticated; " "please see :ref:`the section below on default values ` for " "more information." msgstr "" -#: ../../howto/clinic.rst:290 +#: ../../howto/clinic.rst:308 msgid "Add a blank line below the parameters." msgstr "" -#: ../../howto/clinic.rst:292 +#: ../../howto/clinic.rst:310 msgid "" "What's a \"converter\"? It establishes both the type of the variable used " "in C, and the method to convert the Python value into a C value at runtime. " @@ -371,68 +391,69 @@ msgid "" "easier." msgstr "" -#: ../../howto/clinic.rst:299 +#: ../../howto/clinic.rst:317 msgid "" -"For each parameter, copy the \"format unit\" for that parameter from the " -"``PyArg_Parse()`` format argument and specify *that* as its converter, as a " +"For each parameter, copy the \"format unit\" for that parameter from the :c:" +"func:`PyArg_Parse` format argument and specify *that* as its converter, as a " "quoted string. (\"format unit\" is the formal name for the one-to-three " -"character substring of the ``format`` parameter that tells the argument " +"character substring of the *format* parameter that tells the argument " "parsing function what the type of the variable is and how to convert it. " "For more on format units please see :ref:`arg-parsing`.)" msgstr "" -#: ../../howto/clinic.rst:308 +#: ../../howto/clinic.rst:326 msgid "" "For multicharacter format units like ``z#``, use the entire two-or-three " "character string." msgstr "" -#: ../../howto/clinic.rst:326 +#: ../../howto/clinic.rst:344 msgid "" "If your function has ``|`` in the format string, meaning some parameters " "have default values, you can ignore it. Argument Clinic infers which " "parameters are optional based on whether or not they have default values." msgstr "" -#: ../../howto/clinic.rst:331 +#: ../../howto/clinic.rst:349 msgid "" "If your function has ``$`` in the format string, meaning it takes keyword-" "only arguments, specify ``*`` on a line by itself before the first keyword-" "only argument, indented the same as the parameter lines." msgstr "" -#: ../../howto/clinic.rst:336 -msgid "(``_pickle.Pickler.dump`` has neither, so our sample is unchanged.)" +#: ../../howto/clinic.rst:354 +msgid "" +"(:py:meth:`!_pickle.Pickler.dump` has neither, so our sample is unchanged.)" msgstr "" -#: ../../howto/clinic.rst:339 +#: ../../howto/clinic.rst:357 msgid "" "If the existing C function calls :c:func:`PyArg_ParseTuple` (as opposed to :" "c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments are positional-" "only." msgstr "" -#: ../../howto/clinic.rst:343 +#: ../../howto/clinic.rst:361 msgid "" "To mark all parameters as positional-only in Argument Clinic, add a ``/`` on " "a line by itself after the last parameter, indented the same as the " "parameter lines." msgstr "" -#: ../../howto/clinic.rst:347 +#: ../../howto/clinic.rst:365 msgid "" "Currently this is all-or-nothing; either all parameters are positional-only, " "or none of them are. (In the future Argument Clinic may relax this " "restriction.)" msgstr "" -#: ../../howto/clinic.rst:367 +#: ../../howto/clinic.rst:385 msgid "" "It's helpful to write a per-parameter docstring for each parameter. But per-" "parameter docstrings are optional; you can skip this step if you prefer." msgstr "" -#: ../../howto/clinic.rst:371 +#: ../../howto/clinic.rst:389 msgid "" "Here's how to add a per-parameter docstring. The first line of the per-" "parameter docstring must be indented further than the parameter definition. " @@ -442,34 +463,34 @@ msgid "" "you wish." msgstr "" -#: ../../howto/clinic.rst:395 +#: ../../howto/clinic.rst:413 msgid "" "Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " -"luck everything worked---your block now has output, and a ``.c.h`` file has " -"been generated! Reopen the file in your text editor to see::" +"luck everything worked---your block now has output, and a :file:`.c.h` file " +"has been generated! Reopen the file in your text editor to see::" msgstr "" -#: ../../howto/clinic.rst:414 +#: ../../howto/clinic.rst:432 msgid "" "Obviously, if Argument Clinic didn't produce any output, it's because it " "found an error in your input. Keep fixing your errors and retrying until " "Argument Clinic processes your file without complaint." msgstr "" -#: ../../howto/clinic.rst:418 +#: ../../howto/clinic.rst:436 msgid "" -"For readability, most of the glue code has been generated to a ``.c.h`` " -"file. You'll need to include that in your original ``.c`` file, typically " -"right after the clinic module block::" +"For readability, most of the glue code has been generated to a :file:`.c.h` " +"file. You'll need to include that in your original :file:`.c` file, " +"typically right after the clinic module block::" msgstr "" -#: ../../howto/clinic.rst:424 +#: ../../howto/clinic.rst:442 msgid "" "Double-check that the argument-parsing code Argument Clinic generated looks " "basically the same as the existing code." msgstr "" -#: ../../howto/clinic.rst:427 +#: ../../howto/clinic.rst:445 msgid "" "First, ensure both places use the same argument-parsing function. The " "existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" @@ -477,21 +498,21 @@ msgid "" "Clinic calls the *exact* same function." msgstr "" -#: ../../howto/clinic.rst:433 +#: ../../howto/clinic.rst:451 msgid "" -"Second, the format string passed in to :c:func:`PyArg_ParseTuple` or :c:func:" -"`PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" +"Second, the format string passed in to :c:func:`!PyArg_ParseTuple` or :c:" +"func:`!PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" "written one in the existing function, up to the colon or semi-colon." msgstr "" -#: ../../howto/clinic.rst:438 +#: ../../howto/clinic.rst:456 msgid "" "(Argument Clinic always generates its format strings with a ``:`` followed " "by the name of the function. If the existing code's format string ends with " "``;``, to provide usage help, this change is harmless—don't worry about it.)" msgstr "" -#: ../../howto/clinic.rst:443 +#: ../../howto/clinic.rst:461 msgid "" "Third, for parameters whose format units require two arguments (like a " "length variable, or an encoding string, or a pointer to a conversion " @@ -499,27 +520,27 @@ msgid "" "two invocations." msgstr "" -#: ../../howto/clinic.rst:448 +#: ../../howto/clinic.rst:466 msgid "" "Fourth, inside the output portion of the block you'll find a preprocessor " "macro defining the appropriate static :c:type:`PyMethodDef` structure for " "this builtin::" msgstr "" -#: ../../howto/clinic.rst:455 +#: ../../howto/clinic.rst:473 msgid "" "This static structure should be *exactly* the same as the existing static :c:" -"type:`PyMethodDef` structure for this builtin." +"type:`!PyMethodDef` structure for this builtin." msgstr "" -#: ../../howto/clinic.rst:458 +#: ../../howto/clinic.rst:476 msgid "" "If any of these items differ in *any way*, adjust your Argument Clinic " "function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " "the same." msgstr "" -#: ../../howto/clinic.rst:463 +#: ../../howto/clinic.rst:481 msgid "" "Notice that the last line of its output is the declaration of your \"impl\" " "function. This is where the builtin's implementation goes. Delete the " @@ -530,98 +551,64 @@ msgid "" "used different names for these variables, fix it." msgstr "" -#: ../../howto/clinic.rst:471 +#: ../../howto/clinic.rst:489 msgid "" "Let's reiterate, just because it's kind of weird. Your code should now look " "like this::" msgstr "" -#: ../../howto/clinic.rst:480 +#: ../../howto/clinic.rst:498 msgid "" "Argument Clinic generated the checksum line and the function prototype just " "above it. You should write the opening (and closing) curly braces for the " "function, and the implementation inside." msgstr "" -#: ../../howto/clinic.rst:525 +#: ../../howto/clinic.rst:543 msgid "" "Remember the macro with the :c:type:`PyMethodDef` structure for this " -"function? Find the existing :c:type:`PyMethodDef` structure for this " +"function? Find the existing :c:type:`!PyMethodDef` structure for this " "function and replace it with a reference to the macro. (If the builtin is " "at module scope, this will probably be very near the end of the file; if the " "builtin is a class method, this will probably be below but relatively near " "to the implementation.)" msgstr "" -#: ../../howto/clinic.rst:532 +#: ../../howto/clinic.rst:550 msgid "" "Note that the body of the macro contains a trailing comma. So when you " -"replace the existing static :c:type:`PyMethodDef` structure with the macro, " +"replace the existing static :c:type:`!PyMethodDef` structure with the macro, " "*don't* add a comma to the end." msgstr "" -#: ../../howto/clinic.rst:545 +#: ../../howto/clinic.rst:563 msgid "" "Compile, then run the relevant portions of the regression-test suite. This " "change should not introduce any new compile-time warnings or errors, and " "there should be no externally visible change to Python's behavior." msgstr "" -#: ../../howto/clinic.rst:549 +#: ../../howto/clinic.rst:567 msgid "" -"Well, except for one difference: ``inspect.signature()`` run on your " +"Well, except for one difference: :py:func:`inspect.signature` run on your " "function should now provide a valid signature!" msgstr "" -#: ../../howto/clinic.rst:552 +#: ../../howto/clinic.rst:570 msgid "" "Congratulations, you've ported your first function to work with Argument " "Clinic!" msgstr "" -#: ../../howto/clinic.rst:556 +#: ../../howto/clinic.rst:576 msgid "How-to guides" msgstr "" -#: ../../howto/clinic.rst:560 -msgid "How to use symbolic default values" +#: ../../howto/clinic.rst:580 +msgid "How to rename C functions and variables generated by Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:562 -msgid "" -"The default value you provide for a parameter can't be any arbitrary " -"expression. Currently the following are explicitly supported:" -msgstr "" - -#: ../../howto/clinic.rst:565 -msgid "Numeric constants (integer and float)" -msgstr "" - -#: ../../howto/clinic.rst:566 -msgid "String constants" -msgstr "" - -#: ../../howto/clinic.rst:567 -msgid "``True``, ``False``, and ``None``" -msgstr "" - -#: ../../howto/clinic.rst:568 -msgid "" -"Simple symbolic constants like ``sys.maxsize``, which must start with the " -"name of the module" -msgstr "" - -#: ../../howto/clinic.rst:571 -msgid "" -"(In the future, this may need to get even more elaborate, to allow full " -"expressions like ``CONSTANT - 1``.)" -msgstr "" - -#: ../../howto/clinic.rst:576 -msgid "How to to rename C functions and variables generated by Argument Clinic" -msgstr "" - -#: ../../howto/clinic.rst:578 +#: ../../howto/clinic.rst:582 msgid "" "Argument Clinic automatically names the functions it generates for you. " "Occasionally this may cause a problem, if the generated name collides with " @@ -633,19 +620,19 @@ msgid "" "impl function." msgstr "" -#: ../../howto/clinic.rst:586 +#: ../../howto/clinic.rst:590 msgid "" -"For example, if we wanted to rename the C function names generated for " -"``pickle.Pickler.dump``, it'd look like this::" +"For example, if we wanted to rename the C function names generated for :py:" +"meth:`pickle.Pickler.dump`, it'd look like this::" msgstr "" -#: ../../howto/clinic.rst:594 +#: ../../howto/clinic.rst:598 msgid "" -"The base function would now be named ``pickler_dumper()``, and the impl " -"function would now be named ``pickler_dumper_impl()``." +"The base function would now be named :c:func:`!pickler_dumper`, and the impl " +"function would now be named :c:func:`!pickler_dumper_impl`." msgstr "" -#: ../../howto/clinic.rst:598 +#: ../../howto/clinic.rst:602 msgid "" "Similarly, you may have a problem where you want to give a parameter a " "specific Python name, but that name may be inconvenient in C. Argument " @@ -653,40 +640,40 @@ msgid "" "using the same ``\"as\"`` syntax::" msgstr "" -#: ../../howto/clinic.rst:612 +#: ../../howto/clinic.rst:616 msgid "" "Here, the name used in Python (in the signature and the ``keywords`` array) " -"would be ``file``, but the C variable would be named ``file_obj``." +"would be *file*, but the C variable would be named ``file_obj``." msgstr "" -#: ../../howto/clinic.rst:615 -msgid "You can use this to rename the ``self`` parameter too!" +#: ../../howto/clinic.rst:619 +msgid "You can use this to rename the *self* parameter too!" msgstr "" -#: ../../howto/clinic.rst:619 +#: ../../howto/clinic.rst:623 msgid "How to convert functions using ``PyArg_UnpackTuple``" msgstr "" -#: ../../howto/clinic.rst:621 +#: ../../howto/clinic.rst:625 msgid "" "To convert a function parsing its arguments with :c:func:" "`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " -"an ``object``. You may specify the ``type`` argument to cast the type as " +"an ``object``. You may specify the *type* argument to cast the type as " "appropriate. All arguments should be marked positional-only (add a ``/`` on " "a line by itself after the last argument)." msgstr "" -#: ../../howto/clinic.rst:627 +#: ../../howto/clinic.rst:631 msgid "" "Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " "will change soon." msgstr "" -#: ../../howto/clinic.rst:632 +#: ../../howto/clinic.rst:636 msgid "How to use optional groups" msgstr "" -#: ../../howto/clinic.rst:634 +#: ../../howto/clinic.rst:638 msgid "" "Some legacy functions have a tricky approach to parsing their arguments: " "they count the number of positional arguments, then use a ``switch`` " @@ -697,21 +684,21 @@ msgid "" "created." msgstr "" -#: ../../howto/clinic.rst:641 +#: ../../howto/clinic.rst:645 msgid "" -"While functions using this approach can often be converted to use :c:func:" -"`PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " +"While functions using this approach can often be converted to use :c:func:`!" +"PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " "not always possible. Some of these legacy functions have behaviors :c:func:" -"`PyArg_ParseTupleAndKeywords` doesn't directly support. The most obvious " -"example is the builtin function ``range()``, which has an optional argument " -"on the *left* side of its required argument! Another example is ``curses." -"window.addch()``, which has a group of two arguments that must always be " -"specified together. (The arguments are called ``x`` and ``y``; if you call " -"the function passing in ``x``, you must also pass in ``y``—and if you don't " -"pass in ``x`` you may not pass in ``y`` either.)" +"`!PyArg_ParseTupleAndKeywords` doesn't directly support. The most obvious " +"example is the builtin function :py:func:`range`, which has an optional " +"argument on the *left* side of its required argument! Another example is :py:" +"meth:`curses.window.addch`, which has a group of two arguments that must " +"always be specified together. (The arguments are called *x* and *y*; if you " +"call the function passing in *x*, you must also pass in *y* — and if you " +"don't pass in *x* you may not pass in *y* either.)" msgstr "" -#: ../../howto/clinic.rst:653 +#: ../../howto/clinic.rst:657 msgid "" "In any case, the goal of Argument Clinic is to support argument parsing for " "all existing CPython builtins without changing their semantics. Therefore " @@ -721,7 +708,7 @@ msgid "" "required arguments. They can *only* be used with positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:661 +#: ../../howto/clinic.rst:665 msgid "" "Optional groups are *only* intended for use when converting functions that " "make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " @@ -732,20 +719,20 @@ msgid "" "possible." msgstr "" -#: ../../howto/clinic.rst:670 +#: ../../howto/clinic.rst:674 msgid "" "To specify an optional group, add a ``[`` on a line by itself before the " "parameters you wish to group together, and a ``]`` on a line by itself after " -"these parameters. As an example, here's how ``curses.window.addch`` uses " -"optional groups to make the first two parameters and the last parameter " +"these parameters. As an example, here's how :py:meth:`curses.window.addch` " +"uses optional groups to make the first two parameters and the last parameter " "optional::" msgstr "" -#: ../../howto/clinic.rst:699 +#: ../../howto/clinic.rst:703 msgid "Notes:" msgstr "註解:" -#: ../../howto/clinic.rst:701 +#: ../../howto/clinic.rst:705 msgid "" "For every optional group, one additional parameter will be passed into the " "impl function representing the group. The parameter will be an int named " @@ -758,34 +745,34 @@ msgid "" "I mean whether or not the parameters received arguments in this invocation.)" msgstr "" -#: ../../howto/clinic.rst:712 +#: ../../howto/clinic.rst:716 msgid "" "If there are no required arguments, the optional groups will behave as if " "they're to the right of the required arguments." msgstr "" -#: ../../howto/clinic.rst:715 +#: ../../howto/clinic.rst:719 msgid "" "In the case of ambiguity, the argument parsing code favors parameters on the " "left (before the required parameters)." msgstr "" -#: ../../howto/clinic.rst:718 +#: ../../howto/clinic.rst:722 msgid "Optional groups can only contain positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:720 +#: ../../howto/clinic.rst:724 msgid "" "Optional groups are *only* intended for legacy code. Please do not use " "optional groups for new code." msgstr "" -#: ../../howto/clinic.rst:725 +#: ../../howto/clinic.rst:729 msgid "" "How to use real Argument Clinic converters, instead of \"legacy converters\"" msgstr "" -#: ../../howto/clinic.rst:727 +#: ../../howto/clinic.rst:731 msgid "" "To save time, and to minimize how much you need to learn to achieve your " "first port to Argument Clinic, the walkthrough above tells you to use " @@ -794,38 +781,38 @@ msgid "" "be clear, their use is acceptable when porting code for Python 3.4." msgstr "" -#: ../../howto/clinic.rst:734 +#: ../../howto/clinic.rst:738 msgid "" "However, in the long term we probably want all our blocks to use Argument " "Clinic's real syntax for converters. Why? A couple reasons:" msgstr "" -#: ../../howto/clinic.rst:738 +#: ../../howto/clinic.rst:742 msgid "" "The proper converters are far easier to read and clearer in their intent." msgstr "" -#: ../../howto/clinic.rst:739 +#: ../../howto/clinic.rst:743 msgid "" "There are some format units that are unsupported as \"legacy converters\", " "because they require arguments, and the legacy converter syntax doesn't " "support specifying arguments." msgstr "" -#: ../../howto/clinic.rst:742 +#: ../../howto/clinic.rst:746 msgid "" "In the future we may have a new argument parsing library that isn't " "restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " "won't be available to parameters using legacy converters." msgstr "" -#: ../../howto/clinic.rst:746 +#: ../../howto/clinic.rst:750 msgid "" "Therefore, if you don't mind a little extra effort, please use the normal " "converters instead of legacy converters." msgstr "" -#: ../../howto/clinic.rst:749 +#: ../../howto/clinic.rst:753 msgid "" "In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " "like a Python function call. However, if there are no explicit arguments to " @@ -833,17 +820,18 @@ msgid "" "parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." msgstr "" -#: ../../howto/clinic.rst:755 +#: ../../howto/clinic.rst:759 msgid "" "All arguments to Argument Clinic converters are keyword-only. All Argument " "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:763 ../../howto/clinic.rst:1329 -msgid "``c_default``" +#: ../../howto/clinic.rst:767 +#, fuzzy +msgid "*c_default*" msgstr "``c_default``" -#: ../../howto/clinic.rst:759 +#: ../../howto/clinic.rst:763 msgid "" "The default value for this parameter when defined in C. Specifically, this " "will be the initializer for the variable declared in the \"parse " @@ -851,27 +839,29 @@ msgid "" "how to use this. Specified as a string." msgstr "" -#: ../../howto/clinic.rst:768 -msgid "``annotation``" +#: ../../howto/clinic.rst:772 +#, fuzzy +msgid "*annotation*" msgstr "``annotation``" -#: ../../howto/clinic.rst:766 +#: ../../howto/clinic.rst:770 msgid "" "The annotation value for this parameter. Not currently supported, because :" "pep:`8` mandates that the Python library may not use annotations." msgstr "" -#: ../../howto/clinic.rst:770 +#: ../../howto/clinic.rst:774 msgid "" "In addition, some converters accept additional arguments. Here is a list of " "these arguments, along with their meanings:" msgstr "" -#: ../../howto/clinic.rst:779 -msgid "``accept``" +#: ../../howto/clinic.rst:783 +#, fuzzy +msgid "*accept*" msgstr "``accept``" -#: ../../howto/clinic.rst:774 +#: ../../howto/clinic.rst:778 msgid "" "A set of Python types (and possibly pseudo-types); this restricts the " "allowable Python argument to values of these types. (This is not a general-" @@ -879,68 +869,73 @@ msgid "" "shown in the legacy converter table.)" msgstr "" -#: ../../howto/clinic.rst:779 +#: ../../howto/clinic.rst:783 msgid "To accept ``None``, add ``NoneType`` to this set." msgstr "" -#: ../../howto/clinic.rst:784 -msgid "``bitwise``" +#: ../../howto/clinic.rst:788 +#, fuzzy +msgid "*bitwise*" msgstr "``bitwise``" -#: ../../howto/clinic.rst:782 +#: ../../howto/clinic.rst:786 msgid "" "Only supported for unsigned integers. The native integer value of this " "Python argument will be written to the parameter without any range checking, " "even for negative values." msgstr "" -#: ../../howto/clinic.rst:789 ../../howto/clinic.rst:1343 -msgid "``converter``" +#: ../../howto/clinic.rst:793 +#, fuzzy +msgid "*converter*" msgstr "``converter``" -#: ../../howto/clinic.rst:787 +#: ../../howto/clinic.rst:791 msgid "" "Only supported by the ``object`` converter. Specifies the name of a :ref:`C " "\"converter function\" ` to use to convert this object to a " "native type." msgstr "" -#: ../../howto/clinic.rst:794 -msgid "``encoding``" +#: ../../howto/clinic.rst:798 +#, fuzzy +msgid "*encoding*" msgstr "``encoding``" -#: ../../howto/clinic.rst:792 +#: ../../howto/clinic.rst:796 msgid "" "Only supported for strings. Specifies the encoding to use when converting " "this string from a Python str (Unicode) value into a C ``char *`` value." msgstr "" -#: ../../howto/clinic.rst:798 -msgid "``subclass_of``" +#: ../../howto/clinic.rst:802 +#, fuzzy +msgid "*subclass_of*" msgstr "``subclass_of``" -#: ../../howto/clinic.rst:797 +#: ../../howto/clinic.rst:801 msgid "" "Only supported for the ``object`` converter. Requires that the Python value " "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:803 ../../howto/clinic.rst:1315 -msgid "``type``" -msgstr "``type``" +#: ../../howto/clinic.rst:807 +msgid "*type*" +msgstr "" -#: ../../howto/clinic.rst:801 +#: ../../howto/clinic.rst:805 msgid "" "Only supported for the ``object`` and ``self`` converters. Specifies the C " "type that will be used to declare the variable. Default value is " "``\"PyObject *\"``." msgstr "" -#: ../../howto/clinic.rst:809 -msgid "``zeroes``" +#: ../../howto/clinic.rst:813 +#, fuzzy +msgid "*zeroes*" msgstr "``zeroes``" -#: ../../howto/clinic.rst:806 +#: ../../howto/clinic.rst:810 msgid "" "Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " "permitted inside the value. The length of the string will be passed in to " @@ -948,361 +943,361 @@ msgid "" "``_length``." msgstr "" -#: ../../howto/clinic.rst:811 +#: ../../howto/clinic.rst:815 msgid "" "Please note, not every possible combination of arguments will work. Usually " -"these arguments are implemented by specific ``PyArg_ParseTuple`` *format " -"units*, with specific behavior. For example, currently you cannot call " -"``unsigned_short`` without also specifying ``bitwise=True``. Although it's " -"perfectly reasonable to think this would work, these semantics don't map to " -"any existing format unit. So Argument Clinic doesn't support it. (Or, at " -"least, not yet.)" +"these arguments are implemented by specific :c:func:`PyArg_ParseTuple` " +"*format units*, with specific behavior. For example, currently you cannot " +"call ``unsigned_short`` without also specifying ``bitwise=True``. Although " +"it's perfectly reasonable to think this would work, these semantics don't " +"map to any existing format unit. So Argument Clinic doesn't support it. " +"(Or, at least, not yet.)" msgstr "" -#: ../../howto/clinic.rst:819 +#: ../../howto/clinic.rst:823 msgid "" "Below is a table showing the mapping of legacy converters into real Argument " "Clinic converters. On the left is the legacy converter, on the right is the " "text you'd replace it with." msgstr "" -#: ../../howto/clinic.rst:824 +#: ../../howto/clinic.rst:828 msgid "``'B'``" msgstr "``'B'``" -#: ../../howto/clinic.rst:824 +#: ../../howto/clinic.rst:828 msgid "``unsigned_char(bitwise=True)``" msgstr "``unsigned_char(bitwise=True)``" -#: ../../howto/clinic.rst:825 +#: ../../howto/clinic.rst:829 msgid "``'b'``" msgstr "``'b'``" -#: ../../howto/clinic.rst:825 +#: ../../howto/clinic.rst:829 msgid "``unsigned_char``" msgstr "``unsigned_char``" -#: ../../howto/clinic.rst:826 +#: ../../howto/clinic.rst:830 msgid "``'c'``" msgstr "``'c'``" -#: ../../howto/clinic.rst:826 +#: ../../howto/clinic.rst:830 msgid "``char``" msgstr "``char``" -#: ../../howto/clinic.rst:827 +#: ../../howto/clinic.rst:831 msgid "``'C'``" msgstr "``'C'``" -#: ../../howto/clinic.rst:827 +#: ../../howto/clinic.rst:831 msgid "``int(accept={str})``" msgstr "``int(accept={str})``" -#: ../../howto/clinic.rst:828 +#: ../../howto/clinic.rst:832 msgid "``'d'``" msgstr "``'d'``" -#: ../../howto/clinic.rst:828 +#: ../../howto/clinic.rst:832 msgid "``double``" msgstr "``double``" -#: ../../howto/clinic.rst:829 +#: ../../howto/clinic.rst:833 msgid "``'D'``" msgstr "``'D'``" -#: ../../howto/clinic.rst:829 +#: ../../howto/clinic.rst:833 msgid "``Py_complex``" msgstr "``Py_complex``" -#: ../../howto/clinic.rst:830 +#: ../../howto/clinic.rst:834 msgid "``'es'``" msgstr "``'es'``" -#: ../../howto/clinic.rst:830 +#: ../../howto/clinic.rst:834 msgid "``str(encoding='name_of_encoding')``" msgstr "``str(encoding='name_of_encoding')``" -#: ../../howto/clinic.rst:831 +#: ../../howto/clinic.rst:835 msgid "``'es#'``" msgstr "``'es#'``" -#: ../../howto/clinic.rst:831 +#: ../../howto/clinic.rst:835 msgid "``str(encoding='name_of_encoding', zeroes=True)``" msgstr "``str(encoding='name_of_encoding', zeroes=True)``" -#: ../../howto/clinic.rst:832 +#: ../../howto/clinic.rst:836 msgid "``'et'``" msgstr "``'et'``" -#: ../../howto/clinic.rst:832 +#: ../../howto/clinic.rst:836 msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -#: ../../howto/clinic.rst:833 +#: ../../howto/clinic.rst:837 msgid "``'et#'``" msgstr "``'et#'``" -#: ../../howto/clinic.rst:833 +#: ../../howto/clinic.rst:837 msgid "" "``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " "zeroes=True)``" msgstr "" -#: ../../howto/clinic.rst:834 +#: ../../howto/clinic.rst:838 msgid "``'f'``" msgstr "``'f'``" -#: ../../howto/clinic.rst:834 +#: ../../howto/clinic.rst:838 msgid "``float``" msgstr "``float``" -#: ../../howto/clinic.rst:835 +#: ../../howto/clinic.rst:839 msgid "``'h'``" msgstr "``'h'``" -#: ../../howto/clinic.rst:835 +#: ../../howto/clinic.rst:839 msgid "``short``" msgstr "``short``" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:840 msgid "``'H'``" msgstr "``'H'``" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:840 msgid "``unsigned_short(bitwise=True)``" msgstr "``unsigned_short(bitwise=True)``" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:841 msgid "``'i'``" msgstr "``'i'``" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:841 msgid "``int``" msgstr "``int``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:842 msgid "``'I'``" msgstr "``'I'``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:842 msgid "``unsigned_int(bitwise=True)``" msgstr "``unsigned_int(bitwise=True)``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:843 msgid "``'k'``" msgstr "``'k'``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:843 msgid "``unsigned_long(bitwise=True)``" msgstr "``unsigned_long(bitwise=True)``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:844 msgid "``'K'``" msgstr "``'K'``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:844 msgid "``unsigned_long_long(bitwise=True)``" msgstr "``unsigned_long_long(bitwise=True)``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:845 msgid "``'l'``" msgstr "``'l'``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:845 msgid "``long``" msgstr "``long``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:846 msgid "``'L'``" msgstr "``'L'``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:846 msgid "``long long``" msgstr "``long long``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:847 msgid "``'n'``" msgstr "``'n'``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:847 msgid "``Py_ssize_t``" msgstr "``Py_ssize_t``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:848 msgid "``'O'``" msgstr "``'O'``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:848 msgid "``object``" msgstr "``object``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:849 msgid "``'O!'``" msgstr "``'O!'``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:849 msgid "``object(subclass_of='&PySomething_Type')``" msgstr "``object(subclass_of='&PySomething_Type')``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:850 msgid "``'O&'``" msgstr "``'O&'``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:850 msgid "``object(converter='name_of_c_function')``" msgstr "``object(converter='name_of_c_function')``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:851 msgid "``'p'``" msgstr "``'p'``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:851 msgid "``bool``" msgstr "``bool``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:852 msgid "``'S'``" msgstr "``'S'``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:852 msgid "``PyBytesObject``" msgstr "``PyBytesObject``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:853 msgid "``'s'``" msgstr "``'s'``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:853 msgid "``str``" msgstr "``str``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:854 msgid "``'s#'``" msgstr "``'s#'``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:854 msgid "``str(zeroes=True)``" msgstr "``str(zeroes=True)``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:855 msgid "``'s*'``" msgstr "``'s*'``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:855 msgid "``Py_buffer(accept={buffer, str})``" msgstr "``Py_buffer(accept={buffer, str})``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:856 msgid "``'U'``" msgstr "``'U'``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:856 msgid "``unicode``" msgstr "``unicode``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:857 msgid "``'u'``" msgstr "``'u'``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:857 msgid "``Py_UNICODE``" msgstr "``Py_UNICODE``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:858 msgid "``'u#'``" msgstr "``'u#'``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:858 msgid "``Py_UNICODE(zeroes=True)``" msgstr "``Py_UNICODE(zeroes=True)``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:859 msgid "``'w*'``" msgstr "``'w*'``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:859 msgid "``Py_buffer(accept={rwbuffer})``" msgstr "``Py_buffer(accept={rwbuffer})``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:860 msgid "``'Y'``" msgstr "``'Y'``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:860 msgid "``PyByteArrayObject``" msgstr "``PyByteArrayObject``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:861 msgid "``'y'``" msgstr "``'y'``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:861 msgid "``str(accept={bytes})``" msgstr "``str(accept={bytes})``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:862 msgid "``'y#'``" msgstr "``'y#'``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:862 msgid "``str(accept={robuffer}, zeroes=True)``" msgstr "``str(accept={robuffer}, zeroes=True)``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:863 msgid "``'y*'``" msgstr "``'y*'``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:863 msgid "``Py_buffer``" msgstr "``Py_buffer``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:864 msgid "``'Z'``" msgstr "``'Z'``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:864 msgid "``Py_UNICODE(accept={str, NoneType})``" msgstr "``Py_UNICODE(accept={str, NoneType})``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:865 msgid "``'Z#'``" msgstr "``'Z#'``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:865 msgid "``Py_UNICODE(accept={str, NoneType}, zeroes=True)``" msgstr "``Py_UNICODE(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:866 msgid "``'z'``" msgstr "``'z'``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:866 msgid "``str(accept={str, NoneType})``" msgstr "``str(accept={str, NoneType})``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:867 msgid "``'z#'``" msgstr "``'z#'``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:867 msgid "``str(accept={str, NoneType}, zeroes=True)``" msgstr "``str(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:868 msgid "``'z*'``" msgstr "``'z*'``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:868 msgid "``Py_buffer(accept={buffer, str, NoneType})``" msgstr "``Py_buffer(accept={buffer, str, NoneType})``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:871 msgid "" "As an example, here's our sample ``pickle.Pickler.dump`` using the proper " "converter::" msgstr "" -#: ../../howto/clinic.rst:880 +#: ../../howto/clinic.rst:884 msgid "" "One advantage of real converters is that they're more flexible than legacy " "converters. For example, the ``unsigned_int`` converter (and all the " @@ -1311,7 +1306,7 @@ msgid "" "negative numbers. You just can't do that with a legacy converter!" msgstr "" -#: ../../howto/clinic.rst:886 +#: ../../howto/clinic.rst:890 msgid "" "Argument Clinic will show you all the converters it has available. For each " "converter it'll show you all the parameters it accepts, along with the " @@ -1319,11 +1314,11 @@ msgid "" "converters`` to see the full list." msgstr "" -#: ../../howto/clinic.rst:893 +#: ../../howto/clinic.rst:897 msgid "How to use the ``Py_buffer`` converter" msgstr "" -#: ../../howto/clinic.rst:895 +#: ../../howto/clinic.rst:899 msgid "" "When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " "or ``'z*'`` legacy converters), you *must* not call :c:func:" @@ -1331,74 +1326,74 @@ msgid "" "that does it for you (in the parsing function)." msgstr "" -#: ../../howto/clinic.rst:902 +#: ../../howto/clinic.rst:906 msgid "How to use advanced converters" msgstr "" -#: ../../howto/clinic.rst:904 +#: ../../howto/clinic.rst:908 msgid "" "Remember those format units you skipped for your first time because they " "were advanced? Here's how to handle those too." msgstr "" -#: ../../howto/clinic.rst:907 +#: ../../howto/clinic.rst:911 msgid "" "The trick is, all those format units take arguments—either conversion " "functions, or types, or strings specifying an encoding. (But \"legacy " "converters\" don't support arguments. That's why we skipped them for your " "first function.) The argument you specified to the format unit is now an " -"argument to the converter; this argument is either ``converter`` (for " -"``O&``), ``subclass_of`` (for ``O!``), or ``encoding`` (for all the format " -"units that start with ``e``)." +"argument to the converter; this argument is either *converter* (for ``O&``), " +"*subclass_of* (for ``O!``), or *encoding* (for all the format units that " +"start with ``e``)." msgstr "" -#: ../../howto/clinic.rst:915 +#: ../../howto/clinic.rst:919 msgid "" -"When using ``subclass_of``, you may also want to use the other custom " -"argument for ``object()``: ``type``, which lets you set the type actually " -"used for the parameter. For example, if you want to ensure that the object " -"is a subclass of ``PyUnicode_Type``, you probably want to use the converter " +"When using *subclass_of*, you may also want to use the other custom argument " +"for ``object()``: *type*, which lets you set the type actually used for the " +"parameter. For example, if you want to ensure that the object is a subclass " +"of :c:var:`PyUnicode_Type`, you probably want to use the converter " "``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." msgstr "" -#: ../../howto/clinic.rst:921 +#: ../../howto/clinic.rst:925 msgid "" "One possible problem with using Argument Clinic: it takes away some possible " -"flexibility for the format units starting with ``e``. When writing a " -"``PyArg_Parse`` call by hand, you could theoretically decide at runtime what " -"encoding string to pass in to :c:func:`PyArg_ParseTuple`. But now this " -"string must be hard-coded at Argument-Clinic-preprocessing-time. This " -"limitation is deliberate; it made supporting this format unit much easier, " -"and may allow for future optimizations. This restriction doesn't seem " -"unreasonable; CPython itself always passes in static hard-coded encoding " -"strings for parameters whose format units start with ``e``." +"flexibility for the format units starting with ``e``. When writing a :c:" +"func:`!PyArg_Parse*` call by hand, you could theoretically decide at runtime " +"what encoding string to pass to that call. But now this string must be " +"hard-coded at Argument-Clinic-preprocessing-time. This limitation is " +"deliberate; it made supporting this format unit much easier, and may allow " +"for future optimizations. This restriction doesn't seem unreasonable; " +"CPython itself always passes in static hard-coded encoding strings for " +"parameters whose format units start with ``e``." msgstr "" -#: ../../howto/clinic.rst:934 +#: ../../howto/clinic.rst:938 msgid "How to assign default values to parameter" msgstr "" -#: ../../howto/clinic.rst:936 +#: ../../howto/clinic.rst:940 msgid "" "Default values for parameters can be any of a number of values. At their " "simplest, they can be string, int, or float literals:" msgstr "" -#: ../../howto/clinic.rst:945 +#: ../../howto/clinic.rst:949 msgid "They can also use any of Python's built-in constants:" msgstr "" -#: ../../howto/clinic.rst:953 +#: ../../howto/clinic.rst:957 msgid "" "There's also special support for a default value of ``NULL``, and for simple " "expressions, documented in the following sections." msgstr "" -#: ../../howto/clinic.rst:958 -msgid "How to use the ``NULL`` default value" +#: ../../howto/clinic.rst:962 +msgid "The ``NULL`` default value" msgstr "" -#: ../../howto/clinic.rst:960 +#: ../../howto/clinic.rst:964 msgid "" "For string and object parameters, you can set them to ``None`` to indicate " "that there's no default. However, that means the C variable will be " @@ -1408,11 +1403,45 @@ msgid "" "with ``NULL``." msgstr "" -#: ../../howto/clinic.rst:969 -msgid "How to use expressions as default values" +#: ../../howto/clinic.rst:973 +msgid "Symbolic default values" +msgstr "" + +#: ../../howto/clinic.rst:975 +msgid "" +"The default value you provide for a parameter can't be any arbitrary " +"expression. Currently the following are explicitly supported:" +msgstr "" + +#: ../../howto/clinic.rst:978 +msgid "Numeric constants (integer and float)" +msgstr "" + +#: ../../howto/clinic.rst:979 +msgid "String constants" +msgstr "" + +#: ../../howto/clinic.rst:980 +msgid "``True``, ``False``, and ``None``" +msgstr "" + +#: ../../howto/clinic.rst:981 +msgid "" +"Simple symbolic constants like :py:data:`sys.maxsize`, which must start with " +"the name of the module" msgstr "" -#: ../../howto/clinic.rst:971 +#: ../../howto/clinic.rst:984 +msgid "" +"(In the future, this may need to get even more elaborate, to allow full " +"expressions like ``CONSTANT - 1``.)" +msgstr "" + +#: ../../howto/clinic.rst:989 +msgid "Expressions as default values" +msgstr "" + +#: ../../howto/clinic.rst:991 msgid "" "The default value for a parameter can be more than just a literal value. It " "can be an entire expression, using math operators and looking up attributes " @@ -1420,43 +1449,44 @@ msgid "" "obvious semantics." msgstr "" -#: ../../howto/clinic.rst:976 +#: ../../howto/clinic.rst:996 msgid "Consider the following example:" msgstr "" -#: ../../howto/clinic.rst:982 +#: ../../howto/clinic.rst:1002 msgid "" -"``sys.maxsize`` can have different values on different platforms. Therefore " -"Argument Clinic can't simply evaluate that expression locally and hard-code " -"it in C. So it stores the default in such a way that it will get evaluated " -"at runtime, when the user asks for the function's signature." +":py:data:`sys.maxsize` can have different values on different platforms. " +"Therefore Argument Clinic can't simply evaluate that expression locally and " +"hard-code it in C. So it stores the default in such a way that it will get " +"evaluated at runtime, when the user asks for the function's signature." msgstr "" -#: ../../howto/clinic.rst:987 +#: ../../howto/clinic.rst:1007 msgid "" "What namespace is available when the expression is evaluated? It's " "evaluated in the context of the module the builtin came from. So, if your " -"module has an attribute called \"``max_widgets``\", you may simply use it:" +"module has an attribute called :py:attr:`!max_widgets`, you may simply use " +"it:" msgstr "" -#: ../../howto/clinic.rst:995 +#: ../../howto/clinic.rst:1015 msgid "" -"If the symbol isn't found in the current module, it fails over to looking in " -"``sys.modules``. That's how it can find ``sys.maxsize`` for example. " -"(Since you don't know in advance what modules the user will load into their " -"interpreter, it's best to restrict yourself to modules that are preloaded by " -"Python itself.)" +"If the symbol isn't found in the current module, it fails over to looking " +"in :py:data:`sys.modules`. That's how it can find :py:data:`sys.maxsize` " +"for example. (Since you don't know in advance what modules the user will " +"load into their interpreter, it's best to restrict yourself to modules that " +"are preloaded by Python itself.)" msgstr "" -#: ../../howto/clinic.rst:1000 +#: ../../howto/clinic.rst:1020 msgid "" "Evaluating default values only at runtime means Argument Clinic can't " "compute the correct equivalent C default value. So you need to tell it " "explicitly. When you use an expression, you must also specify the equivalent " -"expression in C, using the ``c_default`` parameter to the converter:" +"expression in C, using the *c_default* parameter to the converter:" msgstr "" -#: ../../howto/clinic.rst:1009 +#: ../../howto/clinic.rst:1029 msgid "" "Another complication: Argument Clinic can't know in advance whether or not " "the expression you supply is valid. It parses it to make sure it looks " @@ -1464,38 +1494,38 @@ msgid "" "expressions to specify values that are guaranteed to be valid at runtime!" msgstr "" -#: ../../howto/clinic.rst:1014 +#: ../../howto/clinic.rst:1034 msgid "" "Finally, because expressions must be representable as static C values, there " "are many restrictions on legal expressions. Here's a list of Python " "features you're not permitted to use:" msgstr "" -#: ../../howto/clinic.rst:1018 +#: ../../howto/clinic.rst:1038 msgid "Function calls." msgstr "" -#: ../../howto/clinic.rst:1019 +#: ../../howto/clinic.rst:1039 msgid "Inline if statements (``3 if foo else 5``)." msgstr "" -#: ../../howto/clinic.rst:1020 +#: ../../howto/clinic.rst:1040 msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." msgstr "" -#: ../../howto/clinic.rst:1021 +#: ../../howto/clinic.rst:1041 msgid "List/set/dict comprehensions and generator expressions." msgstr "" -#: ../../howto/clinic.rst:1022 +#: ../../howto/clinic.rst:1042 msgid "Tuple/list/set/dict literals." msgstr "" -#: ../../howto/clinic.rst:1026 +#: ../../howto/clinic.rst:1046 msgid "How to use return converters" msgstr "" -#: ../../howto/clinic.rst:1028 +#: ../../howto/clinic.rst:1048 msgid "" "By default, the impl function Argument Clinic generates for you returns :c:" "type:`PyObject * `. But your C function often computes some C " @@ -1505,38 +1535,38 @@ msgid "" "a Python type too?" msgstr "" -#: ../../howto/clinic.rst:1036 +#: ../../howto/clinic.rst:1056 msgid "" "That's what a \"return converter\" does. It changes your impl function to " "return some C type, then adds code to the generated (non-impl) function to " "handle converting that value into the appropriate :c:type:`!PyObject *`." msgstr "" -#: ../../howto/clinic.rst:1040 +#: ../../howto/clinic.rst:1060 msgid "" "The syntax for return converters is similar to that of parameter converters. " "You specify the return converter like it was a return annotation on the " "function itself, using ``->`` notation." msgstr "" -#: ../../howto/clinic.rst:1044 +#: ../../howto/clinic.rst:1064 msgid "For example:" msgstr "" -#: ../../howto/clinic.rst:1057 +#: ../../howto/clinic.rst:1077 msgid "" "Return converters behave much the same as parameter converters; they take " "arguments, the arguments are all keyword-only, and if you're not changing " "any of the default arguments you can omit the parentheses." msgstr "" -#: ../../howto/clinic.rst:1061 +#: ../../howto/clinic.rst:1081 msgid "" "(If you use both ``\"as\"`` *and* a return converter for your function, the " "``\"as\"`` should come before the return converter.)" msgstr "" -#: ../../howto/clinic.rst:1064 +#: ../../howto/clinic.rst:1084 msgid "" "There's one additional complication when using return converters: how do you " "indicate an error has occurred? Normally, a function returns a valid (non-" @@ -1544,22 +1574,22 @@ msgid "" "integer return converter, all integers are valid. How can Argument Clinic " "detect an error? Its solution: each return converter implicitly looks for a " "special value that indicates an error. If you return that value, and an " -"error has been set (``PyErr_Occurred()`` returns a true value), then the " +"error has been set (c:func:`PyErr_Occurred` returns a true value), then the " "generated code will propagate the error. Otherwise it will encode the value " "you return like normal." msgstr "" -#: ../../howto/clinic.rst:1073 +#: ../../howto/clinic.rst:1093 msgid "Currently Argument Clinic supports only a few return converters:" msgstr "" -#: ../../howto/clinic.rst:1087 +#: ../../howto/clinic.rst:1107 msgid "" "None of these take parameters. For all of these, return ``-1`` to indicate " "error." msgstr "" -#: ../../howto/clinic.rst:1090 +#: ../../howto/clinic.rst:1110 msgid "" "(There's also an experimental ``NoneType`` converter, which lets you return " "``Py_None`` on success or ``NULL`` on failure, without having to increment " @@ -1567,153 +1597,153 @@ msgid "" "be worth using.)" msgstr "" -#: ../../howto/clinic.rst:1095 +#: ../../howto/clinic.rst:1115 msgid "" "To see all the return converters Argument Clinic supports, along with their " "parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " "the full list." msgstr "" -#: ../../howto/clinic.rst:1101 +#: ../../howto/clinic.rst:1121 msgid "How to clone existing functions" msgstr "" -#: ../../howto/clinic.rst:1103 +#: ../../howto/clinic.rst:1123 msgid "" "If you have a number of functions that look similar, you may be able to use " "Clinic's \"clone\" feature. When you clone an existing function, you reuse:" msgstr "" -#: ../../howto/clinic.rst:1107 +#: ../../howto/clinic.rst:1127 msgid "its parameters, including" msgstr "" -#: ../../howto/clinic.rst:1109 +#: ../../howto/clinic.rst:1129 msgid "their names," msgstr "" -#: ../../howto/clinic.rst:1111 +#: ../../howto/clinic.rst:1131 msgid "their converters, with all parameters," msgstr "" -#: ../../howto/clinic.rst:1113 +#: ../../howto/clinic.rst:1133 msgid "their default values," msgstr "" -#: ../../howto/clinic.rst:1115 +#: ../../howto/clinic.rst:1135 msgid "their per-parameter docstrings," msgstr "" -#: ../../howto/clinic.rst:1117 +#: ../../howto/clinic.rst:1137 msgid "" "their *kind* (whether they're positional only, positional or keyword, or " "keyword only), and" msgstr "" -#: ../../howto/clinic.rst:1120 +#: ../../howto/clinic.rst:1140 msgid "its return converter." msgstr "" -#: ../../howto/clinic.rst:1122 +#: ../../howto/clinic.rst:1142 msgid "" "The only thing not copied from the original function is its docstring; the " "syntax allows you to specify a new docstring." msgstr "" -#: ../../howto/clinic.rst:1125 +#: ../../howto/clinic.rst:1145 msgid "Here's the syntax for cloning a function::" msgstr "" -#: ../../howto/clinic.rst:1133 +#: ../../howto/clinic.rst:1153 msgid "" "(The functions can be in different modules or classes. I wrote ``module." "class`` in the sample just to illustrate that you must use the full path to " "*both* functions.)" msgstr "" -#: ../../howto/clinic.rst:1137 +#: ../../howto/clinic.rst:1157 msgid "" "Sorry, there's no syntax for partially cloning a function, or cloning a " "function then modifying it. Cloning is an all-or nothing proposition." msgstr "" -#: ../../howto/clinic.rst:1140 +#: ../../howto/clinic.rst:1160 msgid "" "Also, the function you are cloning from must have been previously defined in " "the current file." msgstr "" -#: ../../howto/clinic.rst:1145 +#: ../../howto/clinic.rst:1165 msgid "How to call Python code" msgstr "" -#: ../../howto/clinic.rst:1147 +#: ../../howto/clinic.rst:1167 msgid "" "The rest of the advanced topics require you to write Python code which lives " "inside your C file and modifies Argument Clinic's runtime state. This is " "simple: you simply define a Python block." msgstr "" -#: ../../howto/clinic.rst:1151 +#: ../../howto/clinic.rst:1171 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1158 +#: ../../howto/clinic.rst:1178 msgid "" "All the code inside the Python block is executed at the time it's parsed. " "All text written to stdout inside the block is redirected into the " "\"output\" after the block." msgstr "" -#: ../../howto/clinic.rst:1162 +#: ../../howto/clinic.rst:1182 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1173 +#: ../../howto/clinic.rst:1193 msgid "How to use the \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1175 +#: ../../howto/clinic.rst:1195 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " "the \"pointer to an instance\" you specified when you declared the type. " "However, you can override Argument Clinic's converter and specify one " -"yourself. Just add your own ``self`` parameter as the first parameter in a " -"block, and ensure that its converter is an instance of ``self_converter`` or " -"a subclass thereof." +"yourself. Just add your own *self* parameter as the first parameter in a " +"block, and ensure that its converter is an instance of :class:`!" +"self_converter` or a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1184 +#: ../../howto/clinic.rst:1204 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1187 +#: ../../howto/clinic.rst:1207 msgid "" "How do you specify the custom type you want to cast ``self`` to? If you only " "have one or two functions with the same type for ``self``, you can directly " "use Argument Clinic's existing ``self`` converter, passing in the type you " -"want to use as the ``type`` parameter::" +"want to use as the *type* parameter::" msgstr "" -#: ../../howto/clinic.rst:1203 +#: ../../howto/clinic.rst:1223 msgid "" "On the other hand, if you have a lot of functions that will use the same " -"type for ``self``, it's best to create your own converter, subclassing " -"``self_converter`` but overwriting the ``type`` member::" +"type for ``self``, it's best to create your own converter, subclassing :" +"class:`!self_converter` but overwriting the :py:attr:`!type` member::" msgstr "" -#: ../../howto/clinic.rst:1225 +#: ../../howto/clinic.rst:1245 msgid "How to use the \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1227 +#: ../../howto/clinic.rst:1247 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1723,65 +1753,66 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1233 +#: ../../howto/clinic.rst:1253 msgid "" -"Example from ``Modules/zlibmodule.c``. First, ``defining_class`` is added " -"to the clinic input::" +"Example from :source:`Modules/zlibmodule.c`. First, ``defining_class`` is " +"added to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1245 +#: ../../howto/clinic.rst:1265 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1255 +#: ../../howto/clinic.rst:1275 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1261 +#: ../../howto/clinic.rst:1281 msgid "" "Each method may only have one argument using this converter, and it must " "appear after ``self``, or, if ``self`` is not used, as the first argument. " "The argument will be of type ``PyTypeObject *``. The argument will not " -"appear in the ``__text_signature__``." +"appear in the :py:attr:`!__text_signature__`." msgstr "" -#: ../../howto/clinic.rst:1266 +#: ../../howto/clinic.rst:1286 msgid "" -"The ``defining_class`` converter is not compatible with ``__init__`` and " -"``__new__`` methods, which cannot use the ``METH_METHOD`` convention." +"The ``defining_class`` converter is not compatible with :py:meth:`!__init__` " +"and :py:meth:`!__new__` methods, which cannot use the :c:macro:`METH_METHOD` " +"convention." msgstr "" -#: ../../howto/clinic.rst:1269 +#: ../../howto/clinic.rst:1290 msgid "" "It is not possible to use ``defining_class`` with slot methods. In order to " "fetch the module state from such methods, use :c:func:" "`PyType_GetModuleByDef` to look up the module and then :c:func:" "`PyModule_GetState` to fetch the module state. Example from the " -"``setattro`` slot method in ``Modules/_threadmodule.c``::" +"``setattro`` slot method in :source:`Modules/_threadmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1284 +#: ../../howto/clinic.rst:1305 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1288 +#: ../../howto/clinic.rst:1309 msgid "How to write a custom converter" msgstr "" -#: ../../howto/clinic.rst:1290 +#: ../../howto/clinic.rst:1311 msgid "" "As we hinted at in the previous section... you can write your own " -"converters! A converter is simply a Python class that inherits from " -"``CConverter``. The main purpose of a custom converter is if you have a " +"converters! A converter is simply a Python class that inherits from :py:" +"class:`!CConverter`. The main purpose of a custom converter is if you have a " "parameter using the ``O&`` format unit—parsing this parameter means calling " "a :c:func:`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1296 +#: ../../howto/clinic.rst:1317 msgid "" "Your converter class should be named ``*something*_converter``. If the name " "follows this convention, then your converter class will be automatically " @@ -1790,59 +1821,47 @@ msgid "" "metaclass.)" msgstr "" -#: ../../howto/clinic.rst:1302 +#: ../../howto/clinic.rst:1323 msgid "" -"You shouldn't subclass ``CConverter.__init__``. Instead, you should write a " -"``converter_init()`` function. ``converter_init()`` always accepts a " -"``self`` parameter; after that, all additional parameters *must* be keyword-" -"only. Any arguments passed in to the converter in Argument Clinic will be " -"passed along to your ``converter_init()``." +"You shouldn't subclass :py:meth:`!CConverter.__init__`. Instead, you should " +"write a :py:meth:`!converter_init` function. :py:meth:`!converter_init` " +"always accepts a *self* parameter; after that, all additional parameters " +"*must* be keyword-only. Any arguments passed in to the converter in " +"Argument Clinic will be passed along to your :py:meth:`!converter_init`." msgstr "" -#: ../../howto/clinic.rst:1309 +#: ../../howto/clinic.rst:1330 msgid "" -"There are some additional members of ``CConverter`` you may wish to specify " -"in your subclass. Here's the current list:" +"There are some additional members of :py:class:`!CConverter` you may wish to " +"specify in your subclass. Here's the current list:" msgstr "" -#: ../../howto/clinic.rst:1313 +#: ../../howto/clinic.rst:1339 msgid "" -"The C type to use for this variable. ``type`` should be a Python string " -"specifying the type, e.g. ``int``. If this is a pointer type, the type " +"The C type to use for this variable. :attr:`!type` should be a Python string " +"specifying the type, e.g. ``'int'``. If this is a pointer type, the type " "string should end with ``' *'``." msgstr "" -#: ../../howto/clinic.rst:1319 -msgid "``default``" -msgstr "``default``" - -#: ../../howto/clinic.rst:1318 +#: ../../howto/clinic.rst:1346 msgid "" "The Python default value for this parameter, as a Python value. Or the magic " "value ``unspecified`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1324 -msgid "``py_default``" -msgstr "``py_default``" - -#: ../../howto/clinic.rst:1322 +#: ../../howto/clinic.rst:1351 msgid "" -"``default`` as it should appear in Python code, as a string. Or ``None`` if " -"there is no default." +":attr:`!default` as it should appear in Python code, as a string. Or " +"``None`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1327 +#: ../../howto/clinic.rst:1357 msgid "" -"``default`` as it should appear in C code, as a string. Or ``None`` if there " -"is no default." +":attr:`!default` as it should appear in C code, as a string. Or ``None`` if " +"there is no default." msgstr "" -#: ../../howto/clinic.rst:1340 -msgid "``c_ignored_default``" -msgstr "``c_ignored_default``" - -#: ../../howto/clinic.rst:1332 +#: ../../howto/clinic.rst:1363 msgid "" "The default value used to initialize the C variable when there is no " "default, but not specifying a default may result in an \"uninitialized " @@ -1853,37 +1872,29 @@ msgid "" "non-empty string." msgstr "" -#: ../../howto/clinic.rst:1343 +#: ../../howto/clinic.rst:1375 msgid "The name of the C converter function, as a string." msgstr "" -#: ../../howto/clinic.rst:1348 -msgid "``impl_by_reference``" -msgstr "``impl_by_reference``" - -#: ../../howto/clinic.rst:1346 +#: ../../howto/clinic.rst:1379 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into the impl function." msgstr "" -#: ../../howto/clinic.rst:1354 -msgid "``parse_by_reference``" -msgstr "``parse_by_reference``" - -#: ../../howto/clinic.rst:1351 +#: ../../howto/clinic.rst:1385 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into :c:func:`PyArg_ParseTuple`." msgstr "" -#: ../../howto/clinic.rst:1356 +#: ../../howto/clinic.rst:1390 msgid "" -"Here's the simplest example of a custom converter, from ``Modules/zlibmodule." -"c``::" +"Here's the simplest example of a custom converter, from :source:`Modules/" +"zlibmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1367 +#: ../../howto/clinic.rst:1401 msgid "" "This block adds a converter to Argument Clinic named ``ssize_t``. " "Parameters declared as ``ssize_t`` will be declared as type :c:type:" @@ -1892,86 +1903,88 @@ msgid "" "automatically support default values." msgstr "" -#: ../../howto/clinic.rst:1373 +#: ../../howto/clinic.rst:1407 msgid "" "More sophisticated custom converters can insert custom C code to handle " "initialization and cleanup. You can see more examples of custom converters " -"in the CPython source tree; grep the C files for the string ``CConverter``." +"in the CPython source tree; grep the C files for the string :py:class:`!" +"CConverter`." msgstr "" -#: ../../howto/clinic.rst:1380 +#: ../../howto/clinic.rst:1414 msgid "How to write a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1382 +#: ../../howto/clinic.rst:1416 msgid "" "Writing a custom return converter is much like writing a custom converter. " "Except it's somewhat simpler, because return converters are themselves much " "simpler." msgstr "" -#: ../../howto/clinic.rst:1386 +#: ../../howto/clinic.rst:1420 msgid "" -"Return converters must subclass ``CReturnConverter``. There are no examples " -"yet of custom return converters, because they are not widely used yet. If " -"you wish to write your own return converter, please read ``Tools/clinic/" -"clinic.py``, specifically the implementation of ``CReturnConverter`` and all " -"its subclasses." +"Return converters must subclass :py:class:`!CReturnConverter`. There are no " +"examples yet of custom return converters, because they are not widely used " +"yet. If you wish to write your own return converter, please read :source:" +"`Tools/clinic/clinic.py`, specifically the implementation of :py:class:`!" +"CReturnConverter` and all its subclasses." msgstr "" -#: ../../howto/clinic.rst:1395 +#: ../../howto/clinic.rst:1429 msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" msgstr "" -#: ../../howto/clinic.rst:1397 +#: ../../howto/clinic.rst:1431 msgid "" -"To convert a function using ``METH_O``, make sure the function's single " -"argument is using the ``object`` converter, and mark the arguments as " +"To convert a function using :c:macro:`METH_O`, make sure the function's " +"single argument is using the ``object`` converter, and mark the arguments as " "positional-only::" msgstr "" -#: ../../howto/clinic.rst:1409 +#: ../../howto/clinic.rst:1443 msgid "" -"To convert a function using ``METH_NOARGS``, just don't specify any " +"To convert a function using :c:macro:`METH_NOARGS`, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1412 +#: ../../howto/clinic.rst:1446 msgid "" -"You can still use a self converter, a return converter, and specify a " -"``type`` argument to the object converter for ``METH_O``." +"You can still use a self converter, a return converter, and specify a *type* " +"argument to the object converter for :c:macro:`METH_O`." msgstr "" -#: ../../howto/clinic.rst:1417 +#: ../../howto/clinic.rst:1451 msgid "How to convert ``tp_new`` and ``tp_init`` functions" msgstr "" -#: ../../howto/clinic.rst:1419 +#: ../../howto/clinic.rst:1453 msgid "" -"You can convert ``tp_new`` and ``tp_init`` functions. Just name them " -"``__new__`` or ``__init__`` as appropriate. Notes:" +"You can convert :c:member:`~PyTypeObject.tp_new` and :c:member:" +"`~PyTypeObject.tp_init` functions. Just name them ``__new__`` or " +"``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1422 +#: ../../howto/clinic.rst:1457 msgid "" "The function name generated for ``__new__`` doesn't end in ``__new__`` like " "it would by default. It's just the name of the class, converted into a " "valid C identifier." msgstr "" -#: ../../howto/clinic.rst:1426 -msgid "No ``PyMethodDef`` ``#define`` is generated for these functions." +#: ../../howto/clinic.rst:1461 +msgid "No :c:type:`PyMethodDef` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1428 +#: ../../howto/clinic.rst:1463 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1430 +#: ../../howto/clinic.rst:1465 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1432 +#: ../../howto/clinic.rst:1467 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -1980,11 +1993,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1440 +#: ../../howto/clinic.rst:1475 msgid "How to change and redirect Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1442 +#: ../../howto/clinic.rst:1477 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -1993,7 +2006,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1448 +#: ../../howto/clinic.rst:1483 msgid "" "While changing Clinic's output in this manner can be a boon to readability, " "it may result in Clinic code using types before they are defined, or your " @@ -2005,23 +2018,23 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1457 +#: ../../howto/clinic.rst:1492 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1484 +#: ../../howto/clinic.rst:1519 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1460 +#: ../../howto/clinic.rst:1495 msgid "" "A field, in this context, is a subsection of Clinic's output. For example, " -"the ``#define`` for the ``PyMethodDef`` structure is a field, called " +"the ``#define`` for the :c:type:`PyMethodDef` structure is a field, called " "``methoddef_define``. Clinic has seven different fields it can output per " "function definition:" msgstr "" -#: ../../howto/clinic.rst:1475 +#: ../../howto/clinic.rst:1510 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2034,112 +2047,112 @@ msgid "" "``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1518 +#: ../../howto/clinic.rst:1553 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1487 +#: ../../howto/clinic.rst:1522 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1492 ../../howto/clinic.rst:1567 -#: ../../howto/clinic.rst:1645 +#: ../../howto/clinic.rst:1527 ../../howto/clinic.rst:1602 +#: ../../howto/clinic.rst:1680 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1491 +#: ../../howto/clinic.rst:1526 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1498 ../../howto/clinic.rst:1594 -#: ../../howto/clinic.rst:1648 +#: ../../howto/clinic.rst:1533 ../../howto/clinic.rst:1629 +#: ../../howto/clinic.rst:1683 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1495 +#: ../../howto/clinic.rst:1530 msgid "" "A text buffer where you can save text for later. Text sent here is appended " "to the end of any existing text. It's an error to have any text left in the " "buffer when Clinic finishes processing a file." msgstr "" -#: ../../howto/clinic.rst:1509 ../../howto/clinic.rst:1580 -#: ../../howto/clinic.rst:1674 +#: ../../howto/clinic.rst:1544 ../../howto/clinic.rst:1615 +#: ../../howto/clinic.rst:1709 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1501 +#: ../../howto/clinic.rst:1536 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " "``basename`` and ``extension`` were assigned the output from ``os.path." "splitext()`` run on the current file. (Example: the ``file`` destination " -"for ``_pickle.c`` would be written to ``_pickle.clinic.c``.)" +"for :file:`_pickle.c` would be written to :file:`_pickle.clinic.c`.)" msgstr "" -#: ../../howto/clinic.rst:1508 +#: ../../howto/clinic.rst:1543 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1514 ../../howto/clinic.rst:1607 -#: ../../howto/clinic.rst:1678 +#: ../../howto/clinic.rst:1549 ../../howto/clinic.rst:1642 +#: ../../howto/clinic.rst:1713 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1512 +#: ../../howto/clinic.rst:1547 msgid "" "A buffer like ``buffer``. However, a two-pass buffer can only be dumped " "once, and it prints out all text sent to it during all processing, even from " "Clinic blocks *after* the dumping point." msgstr "" -#: ../../howto/clinic.rst:1518 ../../howto/clinic.rst:1641 +#: ../../howto/clinic.rst:1553 ../../howto/clinic.rst:1676 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1517 +#: ../../howto/clinic.rst:1552 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1520 +#: ../../howto/clinic.rst:1555 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1522 +#: ../../howto/clinic.rst:1557 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1528 +#: ../../howto/clinic.rst:1563 msgid "" "This dumps the current contents of the named destination into the output of " "the current block, and empties it. This only works with ``buffer`` and " "``two-pass`` destinations." msgstr "" -#: ../../howto/clinic.rst:1532 +#: ../../howto/clinic.rst:1567 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1539 +#: ../../howto/clinic.rst:1574 msgid "" "This tells Clinic to output *field* to *destination*. ``output`` also " "supports a special meta-destination, called ``everything``, which tells " "Clinic to output *all* fields to that *destination*." msgstr "" -#: ../../howto/clinic.rst:1543 +#: ../../howto/clinic.rst:1578 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1552 +#: ../../howto/clinic.rst:1587 msgid "" "``output push`` and ``output pop`` allow you to push and pop configurations " "on an internal configuration stack, so that you can temporarily modify the " @@ -2148,25 +2161,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1559 +#: ../../howto/clinic.rst:1594 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1563 +#: ../../howto/clinic.rst:1598 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1566 +#: ../../howto/clinic.rst:1601 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1570 +#: ../../howto/clinic.rst:1605 msgid "" "Designed to write everything to the \"clinic file\" that it can. You then " "``#include`` this file near the top of your file. You may need to rearrange " @@ -2174,17 +2187,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1576 +#: ../../howto/clinic.rst:1611 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1580 +#: ../../howto/clinic.rst:1615 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1583 +#: ../../howto/clinic.rst:1618 msgid "" "Save up most of the output from Clinic, to be written into your file near " "the end. For Python files implementing modules or builtin types, it's " @@ -2194,14 +2207,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1592 +#: ../../howto/clinic.rst:1627 msgid "" "Suppress the ``parser_prototype``, ``impl_prototype``, and " "``docstring_prototype``, write the ``impl_definition`` to ``block``, and " "write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1597 +#: ../../howto/clinic.rst:1632 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2210,18 +2223,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1604 +#: ../../howto/clinic.rst:1639 msgid "" "Suppresses the ``impl_prototype``, write the ``impl_definition`` to " "``block``, write ``docstring_prototype``, ``methoddef_define``, and " "``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." msgstr "" -#: ../../howto/clinic.rst:1618 +#: ../../howto/clinic.rst:1653 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1610 +#: ../../howto/clinic.rst:1645 msgid "" "Similar to the ``buffer`` preset, but writes more things to ``block``, only " "writing the really big chunks of generated code to ``buffer``. This avoids " @@ -2231,137 +2244,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1617 +#: ../../howto/clinic.rst:1652 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1620 +#: ../../howto/clinic.rst:1655 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1626 +#: ../../howto/clinic.rst:1661 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1628 +#: ../../howto/clinic.rst:1663 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1630 +#: ../../howto/clinic.rst:1665 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1636 +#: ../../howto/clinic.rst:1671 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1638 +#: ../../howto/clinic.rst:1673 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1641 +#: ../../howto/clinic.rst:1676 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1644 +#: ../../howto/clinic.rst:1679 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1648 +#: ../../howto/clinic.rst:1683 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1651 +#: ../../howto/clinic.rst:1686 msgid "" "A text file. The file destination takes an extra argument, a template to " "use for building the filename, like so:" msgstr "" -#: ../../howto/clinic.rst:1654 +#: ../../howto/clinic.rst:1689 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1656 +#: ../../howto/clinic.rst:1691 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1659 +#: ../../howto/clinic.rst:1694 msgid "{path}" msgstr "" -#: ../../howto/clinic.rst:1660 +#: ../../howto/clinic.rst:1695 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1661 +#: ../../howto/clinic.rst:1696 msgid "{dirname}" msgstr "" -#: ../../howto/clinic.rst:1662 +#: ../../howto/clinic.rst:1697 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1663 +#: ../../howto/clinic.rst:1698 msgid "{basename}" msgstr "" -#: ../../howto/clinic.rst:1664 +#: ../../howto/clinic.rst:1699 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1666 +#: ../../howto/clinic.rst:1701 msgid "{basename_root}" msgstr "" -#: ../../howto/clinic.rst:1666 +#: ../../howto/clinic.rst:1701 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1670 +#: ../../howto/clinic.rst:1705 msgid "{basename_extension}" msgstr "" -#: ../../howto/clinic.rst:1669 +#: ../../howto/clinic.rst:1704 msgid "" "The last '.' and everything after it. If the basename does not contain a " "period, this will be the empty string." msgstr "" -#: ../../howto/clinic.rst:1672 +#: ../../howto/clinic.rst:1707 msgid "" "If there are no periods in the filename, {basename} and {filename} are the " "same, and {extension} is empty. \"{basename}{extension}\" is always exactly " "the same as \"{filename}\".\"" msgstr "" -#: ../../howto/clinic.rst:1677 +#: ../../howto/clinic.rst:1712 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1680 +#: ../../howto/clinic.rst:1715 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1686 +#: ../../howto/clinic.rst:1721 msgid "" "It removes all the accumulated text up to this point in the destination. (I " "don't know what you'd need this for, but I thought maybe it'd be useful " "while someone's experimenting.)" msgstr "" -#: ../../howto/clinic.rst:1690 +#: ../../howto/clinic.rst:1725 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1697 +#: ../../howto/clinic.rst:1732 msgid "" "``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " "string that will be prepended to every line of Clinic's output; " @@ -2369,35 +2382,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1701 +#: ../../howto/clinic.rst:1736 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1704 +#: ../../howto/clinic.rst:1739 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1704 +#: ../../howto/clinic.rst:1739 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1707 +#: ../../howto/clinic.rst:1742 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1707 +#: ../../howto/clinic.rst:1742 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1709 +#: ../../howto/clinic.rst:1744 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1716 +#: ../../howto/clinic.rst:1751 msgid "" "This tells Clinic that the current contents of the output should be kept, " "unmodified. This is used internally by Clinic when dumping output into " @@ -2406,36 +2419,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1723 +#: ../../howto/clinic.rst:1758 msgid "How to use the ``#ifdef`` trick" msgstr "" -#: ../../howto/clinic.rst:1725 +#: ../../howto/clinic.rst:1760 msgid "" "If you're converting a function that isn't available on all platforms, " "there's a trick you can use to make life a little easier. The existing code " "probably looks like this::" msgstr "" -#: ../../howto/clinic.rst:1736 +#: ../../howto/clinic.rst:1771 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1745 +#: ../../howto/clinic.rst:1780 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1759 +#: ../../howto/clinic.rst:1794 msgid "" -"Then, remove those three lines from the ``PyMethodDef`` structure, replacing " -"them with the macro Argument Clinic generated:" +"Then, remove those three lines from the :c:type:`PyMethodDef` structure, " +"replacing them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1766 +#: ../../howto/clinic.rst:1801 msgid "" "(You can find the real name for this macro inside the generated code. Or you " "can calculate it yourself: it's the name of your function as defined on the " @@ -2443,27 +2456,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1771 +#: ../../howto/clinic.rst:1806 msgid "" "Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " "``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" msgstr "" -#: ../../howto/clinic.rst:1774 +#: ../../howto/clinic.rst:1809 msgid "" "Here's where Argument Clinic gets very clever. It actually detects that the " "Argument Clinic block might be deactivated by the ``#ifdef``. When that " "happens, it generates a little extra code that looks like this::" msgstr "" -#: ../../howto/clinic.rst:1782 +#: ../../howto/clinic.rst:1817 msgid "" "That means the macro always works. If the function is defined, this turns " "into the correct structure, including the trailing comma. If the function " "is undefined, this turns into nothing." msgstr "" -#: ../../howto/clinic.rst:1786 +#: ../../howto/clinic.rst:1821 msgid "" "However, this causes one ticklish problem: where should Argument Clinic put " "this extra code when using the \"block\" output preset? It can't go in the " @@ -2471,24 +2484,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1790 +#: ../../howto/clinic.rst:1825 msgid "" "In this situation, Argument Clinic writes the extra code to the \"buffer\" " "destination. This may mean that you get a complaint from Argument Clinic:" msgstr "" -#: ../../howto/clinic.rst:1798 +#: ../../howto/clinic.rst:1833 msgid "" "When this happens, just open your file, find the ``dump buffer`` block that " "Argument Clinic added to your file (it'll be at the very bottom), then move " -"it above the ``PyMethodDef`` structure where that macro is used." +"it above the :c:type:`PyMethodDef` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1804 +#: ../../howto/clinic.rst:1839 msgid "How to use Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1806 +#: ../../howto/clinic.rst:1841 msgid "" "It's actually possible to use Argument Clinic to preprocess Python files. " "There's no point to using Argument Clinic blocks, of course, as the output " @@ -2496,11 +2509,29 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1811 +#: ../../howto/clinic.rst:1846 msgid "" "Since Python comments are different from C comments, Argument Clinic blocks " "embedded in Python files look slightly different. They look like this:" msgstr "" +#~ msgid "``type``" +#~ msgstr "``type``" + +#~ msgid "``default``" +#~ msgstr "``default``" + +#~ msgid "``py_default``" +#~ msgstr "``py_default``" + +#~ msgid "``c_ignored_default``" +#~ msgstr "``c_ignored_default``" + +#~ msgid "``impl_by_reference``" +#~ msgstr "``impl_by_reference``" + +#~ msgid "``parse_by_reference``" +#~ msgstr "``parse_by_reference``" + #~ msgid "Py_buffer" #~ msgstr "Py_buffer" diff --git a/howto/functional.po b/howto/functional.po index dd42913c98..d765ff10cb 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -1110,8 +1110,8 @@ msgstr "" msgid "" "A related function is :func:`itertools.accumulate(iterable, func=operator." "add) `. It performs the same calculation, but instead " -"of returning only the final result, :func:`accumulate` returns an iterator " -"that also yields each partial result::" +"of returning only the final result, :func:`~itertools.accumulate` returns an " +"iterator that also yields each partial result::" msgstr "" #: ../../howto/functional.rst:1086 diff --git a/howto/instrumentation.po b/howto/instrumentation.po index 2d7e11922d..7d60b7c53d 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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" @@ -210,8 +210,8 @@ msgstr "" #: ../../howto/instrumentation.rst:282 msgid "" "The filename, function name, and line number are provided back to the " -"tracing script as positional arguments, which must be accessed using ``" -"$arg1``, ``$arg2``, ``$arg3``:" +"tracing script as positional arguments, which must be accessed using " +"``$arg1``, ``$arg2``, ``$arg3``:" msgstr "" #: ../../howto/instrumentation.rst:286 @@ -232,13 +232,13 @@ msgstr "" #: ../../howto/instrumentation.rst:295 msgid "" -"This marker is the converse of :c:func:`function__entry`, and indicates that " -"execution of a Python function has ended (either via ``return``, or via an " -"exception). It is only triggered for pure-Python (bytecode) functions." +"This marker is the converse of :c:func:`!function__entry`, and indicates " +"that execution of a Python function has ended (either via ``return``, or via " +"an exception). It is only triggered for pure-Python (bytecode) functions." msgstr "" #: ../../howto/instrumentation.rst:299 -msgid "The arguments are the same as for :c:func:`function__entry`" +msgid "The arguments are the same as for :c:func:`!function__entry`" msgstr "" #: ../../howto/instrumentation.rst:303 @@ -249,7 +249,7 @@ msgid "" msgstr "" #: ../../howto/instrumentation.rst:307 -msgid "The arguments are the same as for :c:func:`function__entry`." +msgid "The arguments are the same as for :c:func:`!function__entry`." msgstr "" #: ../../howto/instrumentation.rst:311 @@ -289,9 +289,9 @@ msgstr "" #: ../../howto/instrumentation.rst:347 msgid "" -"The higher-level way to use the SystemTap integration is to use a \"tapset" -"\": SystemTap's equivalent of a library, which hides some of the lower-level " -"details of the static markers." +"The higher-level way to use the SystemTap integration is to use a " +"\"tapset\": SystemTap's equivalent of a library, which hides some of the " +"lower-level details of the static markers." msgstr "" #: ../../howto/instrumentation.rst:351 diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 4b6128f27b..42d68f8bf9 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -381,14 +381,14 @@ msgstr "" #: ../../howto/isolating-extensions.rst:300 msgid "" "Unlike static types, heap type objects are mutable by default. Use the :c:" -"data:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." +"macro:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." msgstr "" #: ../../howto/isolating-extensions.rst:302 msgid "" "Heap types inherit :c:member:`~PyTypeObject.tp_new` by default, so it may " "become possible to instantiate them from Python code. You can prevent this " -"with the :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." +"with the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." msgstr "" #: ../../howto/isolating-extensions.rst:308 @@ -433,7 +433,7 @@ msgid "" msgstr "" #: ../../howto/isolating-extensions.rst:336 -msgid "Have the :c:data:`Py_TPFLAGS_HAVE_GC` flag." +msgid "Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." msgstr "" #: ../../howto/isolating-extensions.rst:337 @@ -444,7 +444,7 @@ msgstr "" #: ../../howto/isolating-extensions.rst:340 msgid "" -"Please refer to the :ref:`the documentation ` of :c:data:" +"Please refer to the :ref:`the documentation ` of :c:macro:" "`Py_TPFLAGS_HAVE_GC` and :c:member:`~PyTypeObject.tp_traverse` for " "additional considerations." msgstr "" @@ -521,9 +521,10 @@ msgstr "" #: ../../howto/isolating-extensions.rst:413 msgid "" -"For a method to get its \"defining class\", it must use the :data:" -"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS` :c:type:`calling convention " -"` and the corresponding :c:type:`PyCMethod` signature::" +"For a method to get its \"defining class\", it must use the :ref:" +"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS ` :c:type:`calling convention ` and the " +"corresponding :c:type:`PyCMethod` signature::" msgstr "" #: ../../howto/isolating-extensions.rst:425 @@ -562,17 +563,17 @@ msgstr "" #: ../../howto/isolating-extensions.rst:486 msgid "" -"``PyType_GetModuleByDef`` works by searching the :term:`method resolution " -"order` (i.e. all superclasses) for the first superclass that has a " -"corresponding module." +":c:func:`!PyType_GetModuleByDef` works by searching the :term:`method " +"resolution order` (i.e. all superclasses) for the first superclass that has " +"a corresponding module." msgstr "" #: ../../howto/isolating-extensions.rst:492 msgid "" "In very exotic cases (inheritance chains spanning multiple modules created " -"from the same definition), ``PyType_GetModuleByDef`` might not return the " -"module of the true defining class. However, it will always return a module " -"with the same definition, ensuring a compatible C memory layout." +"from the same definition), :c:func:`!PyType_GetModuleByDef` might not return " +"the module of the true defining class. However, it will always return a " +"module with the same definition, ensuring a compatible C memory layout." msgstr "" #: ../../howto/isolating-extensions.rst:500 diff --git a/howto/regex.po b/howto/regex.po index 8790db2968..520daa6f80 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -225,8 +225,8 @@ msgstr "``\\s``" #: ../../howto/regex.rst:137 msgid "" -"Matches any whitespace character; this is equivalent to the class ``[ \\t\\n" -"\\r\\f\\v]``." +"Matches any whitespace character; this is equivalent to the class " +"``[ \\t\\n\\r\\f\\v]``." msgstr "" #: ../../howto/regex.rst:142 @@ -634,12 +634,12 @@ msgid "" msgstr "" #: ../../howto/regex.rst:360 ../../howto/regex.rst:418 -#: ../../howto/regex.rst:1064 +#: ../../howto/regex.rst:1066 msgid "Method/Attribute" msgstr "" #: ../../howto/regex.rst:360 ../../howto/regex.rst:418 -#: ../../howto/regex.rst:1064 +#: ../../howto/regex.rst:1066 msgid "Purpose" msgstr "" @@ -836,7 +836,7 @@ msgstr "" msgid "Compilation Flags" msgstr "" -#: ../../howto/regex.rst:525 +#: ../../howto/regex.rst:527 msgid "" "Compilation flags let you modify some aspects of how regular expressions " "work. Flags are available in the :mod:`re` module under two names, a long " @@ -848,72 +848,72 @@ msgid "" "example." msgstr "" -#: ../../howto/regex.rst:533 +#: ../../howto/regex.rst:535 msgid "" "Here's a table of the available flags, followed by a more detailed " "explanation of each one." msgstr "" -#: ../../howto/regex.rst:537 +#: ../../howto/regex.rst:539 msgid "Flag" msgstr "" -#: ../../howto/regex.rst:537 +#: ../../howto/regex.rst:539 msgid "Meaning" msgstr "" -#: ../../howto/regex.rst:539 +#: ../../howto/regex.rst:541 msgid ":const:`ASCII`, :const:`A`" msgstr ":const:`ASCII`, :const:`A`" -#: ../../howto/regex.rst:539 +#: ../../howto/regex.rst:541 msgid "" "Makes several escapes like ``\\w``, ``\\b``, ``\\s`` and ``\\d`` match only " "on ASCII characters with the respective property." msgstr "" -#: ../../howto/regex.rst:543 +#: ../../howto/regex.rst:545 msgid ":const:`DOTALL`, :const:`S`" msgstr ":const:`DOTALL`, :const:`S`" -#: ../../howto/regex.rst:543 +#: ../../howto/regex.rst:545 msgid "Make ``.`` match any character, including newlines." msgstr "" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:548 msgid ":const:`IGNORECASE`, :const:`I`" msgstr ":const:`IGNORECASE`, :const:`I`" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:548 msgid "Do case-insensitive matches." msgstr "" -#: ../../howto/regex.rst:548 +#: ../../howto/regex.rst:550 msgid ":const:`LOCALE`, :const:`L`" msgstr ":const:`LOCALE`, :const:`L`" -#: ../../howto/regex.rst:548 +#: ../../howto/regex.rst:550 msgid "Do a locale-aware match." msgstr "" -#: ../../howto/regex.rst:550 +#: ../../howto/regex.rst:552 msgid ":const:`MULTILINE`, :const:`M`" msgstr ":const:`MULTILINE`, :const:`M`" -#: ../../howto/regex.rst:550 +#: ../../howto/regex.rst:552 msgid "Multi-line matching, affecting ``^`` and ``$``." msgstr "" -#: ../../howto/regex.rst:553 +#: ../../howto/regex.rst:555 msgid ":const:`VERBOSE`, :const:`X` (for 'extended')" msgstr "" -#: ../../howto/regex.rst:553 +#: ../../howto/regex.rst:555 msgid "" "Enable verbose REs, which can be organized more cleanly and understandably." msgstr "" -#: ../../howto/regex.rst:562 +#: ../../howto/regex.rst:564 msgid "" "Perform case-insensitive matching; character class and literal strings will " "match letters by ignoring case. For example, ``[A-Z]`` will match lowercase " @@ -922,20 +922,20 @@ msgid "" "z]`` or ``[A-Z]`` are used in combination with the :const:`IGNORECASE` flag, " "they will match the 52 ASCII letters and 4 additional non-ASCII letters: " "'İ' (U+0130, Latin capital letter I with dot above), 'ı' (U+0131, Latin " -"small letter dotless i), 'ſ' (U+017F, Latin small letter long s) and 'K' (U" -"+212A, Kelvin sign). ``Spam`` will match ``'Spam'``, ``'spam'``, " +"small letter dotless i), 'ſ' (U+017F, Latin small letter long s) and " +"'K' (U+212A, Kelvin sign). ``Spam`` will match ``'Spam'``, ``'spam'``, " "``'spAM'``, or ``'ſpam'`` (the latter is matched only in Unicode mode). This " "lowercasing doesn't take the current locale into account; it will if you " "also set the :const:`LOCALE` flag." msgstr "" -#: ../../howto/regex.rst:580 +#: ../../howto/regex.rst:582 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale instead of the Unicode database." msgstr "" -#: ../../howto/regex.rst:583 +#: ../../howto/regex.rst:585 msgid "" "Locales are a feature of the C library intended to help in writing programs " "that take account of language differences. For example, if you're " @@ -954,13 +954,13 @@ msgid "" "patterns, and it is able to handle different locales/languages." msgstr "" -#: ../../howto/regex.rst:605 +#: ../../howto/regex.rst:607 msgid "" "(``^`` and ``$`` haven't been explained yet; they'll be introduced in " "section :ref:`more-metacharacters`.)" msgstr "" -#: ../../howto/regex.rst:608 +#: ../../howto/regex.rst:610 msgid "" "Usually ``^`` matches only at the beginning of the string, and ``$`` matches " "only at the end of the string and immediately before the newline (if any) at " @@ -971,20 +971,20 @@ msgid "" "(immediately preceding each newline)." msgstr "" -#: ../../howto/regex.rst:621 +#: ../../howto/regex.rst:623 msgid "" "Makes the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" -#: ../../howto/regex.rst:629 +#: ../../howto/regex.rst:631 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` perform ASCII-" "only matching instead of full Unicode matching. This is only meaningful for " "Unicode patterns, and is ignored for byte patterns." msgstr "" -#: ../../howto/regex.rst:638 +#: ../../howto/regex.rst:640 msgid "" "This flag allows you to write regular expressions that are more readable by " "granting you more flexibility in how you can format them. When this flag " @@ -996,45 +996,45 @@ msgid "" "preceded by an unescaped backslash." msgstr "" -#: ../../howto/regex.rst:647 +#: ../../howto/regex.rst:649 msgid "" "For example, here's a RE that uses :const:`re.VERBOSE`; see how much easier " "it is to read? ::" msgstr "" -#: ../../howto/regex.rst:660 +#: ../../howto/regex.rst:662 msgid "Without the verbose setting, the RE would look like this::" msgstr "" -#: ../../howto/regex.rst:666 +#: ../../howto/regex.rst:668 msgid "" "In the above example, Python's automatic concatenation of string literals " "has been used to break up the RE into smaller pieces, but it's still more " "difficult to understand than the version using :const:`re.VERBOSE`." msgstr "" -#: ../../howto/regex.rst:672 +#: ../../howto/regex.rst:674 msgid "More Pattern Power" msgstr "" -#: ../../howto/regex.rst:674 +#: ../../howto/regex.rst:676 msgid "" "So far we've only covered a part of the features of regular expressions. In " "this section, we'll cover some new metacharacters, and how to use groups to " "retrieve portions of the text that was matched." msgstr "" -#: ../../howto/regex.rst:682 +#: ../../howto/regex.rst:684 msgid "More Metacharacters" msgstr "" -#: ../../howto/regex.rst:684 +#: ../../howto/regex.rst:686 msgid "" "There are some metacharacters that we haven't covered yet. Most of them " "will be covered in this section." msgstr "" -#: ../../howto/regex.rst:687 +#: ../../howto/regex.rst:689 msgid "" "Some of the remaining metacharacters to be discussed are :dfn:`zero-width " "assertions`. They don't cause the engine to advance through the string; " @@ -1046,11 +1046,11 @@ msgid "" "of times." msgstr "" -#: ../../howto/regex.rst:703 +#: ../../howto/regex.rst:705 msgid "``|``" msgstr "``|``" -#: ../../howto/regex.rst:696 +#: ../../howto/regex.rst:698 msgid "" "Alternation, or the \"or\" operator. If *A* and *B* are regular " "expressions, ``A|B`` will match any string that matches either *A* or *B*. " @@ -1060,17 +1060,17 @@ msgid "" "``'ervo'``." msgstr "" -#: ../../howto/regex.rst:702 +#: ../../howto/regex.rst:704 msgid "" "To match a literal ``'|'``, use ``\\|``, or enclose it inside a character " "class, as in ``[|]``." msgstr "" -#: ../../howto/regex.rst:718 +#: ../../howto/regex.rst:720 msgid "``^``" msgstr "``^``" -#: ../../howto/regex.rst:706 +#: ../../howto/regex.rst:708 msgid "" "Matches at the beginning of lines. Unless the :const:`MULTILINE` flag has " "been set, this will only match at the beginning of the string. In :const:" @@ -1078,37 +1078,37 @@ msgid "" "the string." msgstr "" -#: ../../howto/regex.rst:710 +#: ../../howto/regex.rst:712 msgid "" "For example, if you wish to match the word ``From`` only at the beginning of " "a line, the RE to use is ``^From``. ::" msgstr "" -#: ../../howto/regex.rst:718 +#: ../../howto/regex.rst:720 msgid "To match a literal ``'^'``, use ``\\^``." msgstr "" -#: ../../howto/regex.rst:732 +#: ../../howto/regex.rst:734 msgid "``$``" msgstr "``$``" -#: ../../howto/regex.rst:721 +#: ../../howto/regex.rst:723 msgid "" "Matches at the end of a line, which is defined as either the end of the " "string, or any location followed by a newline character. ::" msgstr "" -#: ../../howto/regex.rst:731 +#: ../../howto/regex.rst:733 msgid "" "To match a literal ``'$'``, use ``\\$`` or enclose it inside a character " "class, as in ``[$]``." msgstr "" -#: ../../howto/regex.rst:738 +#: ../../howto/regex.rst:740 msgid "``\\A``" msgstr "``\\A``" -#: ../../howto/regex.rst:735 +#: ../../howto/regex.rst:737 msgid "" "Matches only at the start of the string. When not in :const:`MULTILINE` " "mode, ``\\A`` and ``^`` are effectively the same. In :const:`MULTILINE` " @@ -1117,19 +1117,19 @@ msgid "" "newline character." msgstr "" -#: ../../howto/regex.rst:741 +#: ../../howto/regex.rst:743 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../howto/regex.rst:741 +#: ../../howto/regex.rst:743 msgid "Matches only at the end of the string." msgstr "" -#: ../../howto/regex.rst:776 +#: ../../howto/regex.rst:778 msgid "``\\b``" msgstr "``\\b``" -#: ../../howto/regex.rst:744 +#: ../../howto/regex.rst:746 msgid "" "Word boundary. This is a zero-width assertion that matches only at the " "beginning or end of a word. A word is defined as a sequence of alphanumeric " @@ -1137,45 +1137,45 @@ msgid "" "alphanumeric character." msgstr "" -#: ../../howto/regex.rst:749 +#: ../../howto/regex.rst:751 msgid "" "The following example matches ``class`` only when it's a complete word; it " "won't match when it's contained inside another word. ::" msgstr "" -#: ../../howto/regex.rst:760 +#: ../../howto/regex.rst:762 msgid "" "There are two subtleties you should remember when using this special " "sequence. First, this is the worst collision between Python's string " -"literals and regular expression sequences. In Python's string literals, ``" -"\\b`` is the backspace character, ASCII value 8. If you're not using raw " +"literals and regular expression sequences. In Python's string literals, " +"``\\b`` is the backspace character, ASCII value 8. If you're not using raw " "strings, then Python will convert the ``\\b`` to a backspace, and your RE " "won't match as you expect it to. The following example looks the same as our " "previous RE, but omits the ``'r'`` in front of the RE string. ::" msgstr "" -#: ../../howto/regex.rst:774 +#: ../../howto/regex.rst:776 msgid "" -"Second, inside a character class, where there's no use for this assertion, ``" -"\\b`` represents the backspace character, for compatibility with Python's " +"Second, inside a character class, where there's no use for this assertion, " +"``\\b`` represents the backspace character, for compatibility with Python's " "string literals." msgstr "" -#: ../../howto/regex.rst:781 +#: ../../howto/regex.rst:783 msgid "``\\B``" msgstr "``\\B``" -#: ../../howto/regex.rst:779 +#: ../../howto/regex.rst:781 msgid "" "Another zero-width assertion, this is the opposite of ``\\b``, only matching " "when the current position is not at a word boundary." msgstr "" -#: ../../howto/regex.rst:784 +#: ../../howto/regex.rst:786 msgid "Grouping" msgstr "" -#: ../../howto/regex.rst:786 +#: ../../howto/regex.rst:788 msgid "" "Frequently you need to obtain more information than just whether the RE " "matched or not. Regular expressions are often used to dissect strings by " @@ -1184,14 +1184,14 @@ msgid "" "name and a value, separated by a ``':'``, like this:" msgstr "" -#: ../../howto/regex.rst:799 +#: ../../howto/regex.rst:801 msgid "" "This can be handled by writing a regular expression which matches an entire " "header line, and has one group which matches the header name, and another " "group which matches the header's value." msgstr "" -#: ../../howto/regex.rst:803 +#: ../../howto/regex.rst:805 msgid "" "Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and " "``')'`` have much the same meaning as they do in mathematical expressions; " @@ -1201,7 +1201,7 @@ msgid "" "repetitions of ``ab``. ::" msgstr "" -#: ../../howto/regex.rst:814 +#: ../../howto/regex.rst:816 msgid "" "Groups indicated with ``'('``, ``')'`` also capture the starting and ending " "index of the text that they match; this can be retrieved by passing an " @@ -1213,27 +1213,27 @@ msgid "" "they match. ::" msgstr "" -#: ../../howto/regex.rst:830 +#: ../../howto/regex.rst:832 msgid "" "Subgroups are numbered from left to right, from 1 upward. Groups can be " "nested; to determine the number, just count the opening parenthesis " "characters, going from left to right. ::" msgstr "" -#: ../../howto/regex.rst:843 +#: ../../howto/regex.rst:845 msgid "" ":meth:`~re.Match.group` can be passed multiple group numbers at a time, in " "which case it will return a tuple containing the corresponding values for " "those groups. ::" msgstr "" -#: ../../howto/regex.rst:849 +#: ../../howto/regex.rst:851 msgid "" "The :meth:`~re.Match.groups` method returns a tuple containing the strings " "for all the subgroups, from 1 up to however many there are. ::" msgstr "" -#: ../../howto/regex.rst:855 +#: ../../howto/regex.rst:857 msgid "" "Backreferences in a pattern allow you to specify that the contents of an " "earlier capturing group must also be found at the current location in the " @@ -1244,11 +1244,11 @@ msgid "" "when incorporating backreferences in a RE." msgstr "" -#: ../../howto/regex.rst:863 +#: ../../howto/regex.rst:865 msgid "For example, the following RE detects doubled words in a string. ::" msgstr "" -#: ../../howto/regex.rst:869 +#: ../../howto/regex.rst:871 msgid "" "Backreferences like this aren't often useful for just searching through a " "string --- there are few text formats which repeat data in this way --- but " @@ -1256,11 +1256,11 @@ msgid "" "substitutions." msgstr "" -#: ../../howto/regex.rst:875 +#: ../../howto/regex.rst:877 msgid "Non-capturing and Named Groups" msgstr "" -#: ../../howto/regex.rst:877 +#: ../../howto/regex.rst:879 msgid "" "Elaborate REs may use many groups, both to capture substrings of interest, " "and to group and structure the RE itself. In complex REs, it becomes " @@ -1269,18 +1269,18 @@ msgid "" "expression extensions, so we'll look at that first." msgstr "" -#: ../../howto/regex.rst:883 +#: ../../howto/regex.rst:885 msgid "" "Perl 5 is well known for its powerful additions to standard regular " "expressions. For these new features the Perl developers couldn't choose new " -"single-keystroke metacharacters or new special sequences beginning with ``" -"\\`` without making Perl's regular expressions confusingly different from " +"single-keystroke metacharacters or new special sequences beginning with " +"``\\`` without making Perl's regular expressions confusingly different from " "standard REs. If they chose ``&`` as a new metacharacter, for example, old " "expressions would be assuming that ``&`` was a regular character and " "wouldn't have escaped it by writing ``\\&`` or ``[&]``." msgstr "" -#: ../../howto/regex.rst:890 +#: ../../howto/regex.rst:892 msgid "" "The solution chosen by the Perl developers was to use ``(?...)`` as the " "extension syntax. ``?`` immediately after a parenthesis was a syntax error " @@ -1291,20 +1291,20 @@ msgid "" "capturing group containing the subexpression ``foo``)." msgstr "" -#: ../../howto/regex.rst:898 +#: ../../howto/regex.rst:900 msgid "" "Python supports several of Perl's extensions and adds an extension syntax to " "Perl's extension syntax. If the first character after the question mark is " "a ``P``, you know that it's an extension that's specific to Python." msgstr "" -#: ../../howto/regex.rst:903 +#: ../../howto/regex.rst:905 msgid "" "Now that we've looked at the general extension syntax, we can return to the " "features that simplify working with groups in complex REs." msgstr "" -#: ../../howto/regex.rst:906 +#: ../../howto/regex.rst:908 msgid "" "Sometimes you'll want to use a group to denote a part of a regular " "expression, but aren't interested in retrieving the group's contents. You " @@ -1312,7 +1312,7 @@ msgid "" "where you can replace the ``...`` with any other regular expression. ::" msgstr "" -#: ../../howto/regex.rst:918 +#: ../../howto/regex.rst:920 msgid "" "Except for the fact that you can't retrieve the contents of what the group " "matched, a non-capturing group behaves exactly the same as a capturing " @@ -1325,13 +1325,13 @@ msgid "" "groups; neither form is any faster than the other." msgstr "" -#: ../../howto/regex.rst:927 +#: ../../howto/regex.rst:929 msgid "" "A more significant feature is named groups: instead of referring to them by " "numbers, groups can be referenced by a name." msgstr "" -#: ../../howto/regex.rst:930 +#: ../../howto/regex.rst:932 msgid "" "The syntax for a named group is one of the Python-specific extensions: ``(?" "P...)``. *name* is, obviously, the name of the group. Named groups " @@ -1343,52 +1343,52 @@ msgid "" "ways::" msgstr "" -#: ../../howto/regex.rst:945 +#: ../../howto/regex.rst:947 msgid "" "Additionally, you can retrieve named groups as a dictionary with :meth:`~re." "Match.groupdict`::" msgstr "" -#: ../../howto/regex.rst:952 +#: ../../howto/regex.rst:954 msgid "" "Named groups are handy because they let you use easily remembered names, " "instead of having to remember numbers. Here's an example RE from the :mod:" "`imaplib` module::" msgstr "" -#: ../../howto/regex.rst:963 +#: ../../howto/regex.rst:965 msgid "" "It's obviously much easier to retrieve ``m.group('zonem')``, instead of " "having to remember to retrieve group 9." msgstr "" -#: ../../howto/regex.rst:966 +#: ../../howto/regex.rst:968 msgid "" "The syntax for backreferences in an expression such as ``(...)\\1`` refers " "to the number of the group. There's naturally a variant that uses the group " "name instead of the number. This is another Python extension: ``(?P=name)`` " "indicates that the contents of the group called *name* should again be " "matched at the current point. The regular expression for finding doubled " -"words, ``\\b(\\w+)\\s+\\1\\b`` can also be written as ``\\b(?P\\w+)\\s" -"+(?P=word)\\b``::" +"words, ``\\b(\\w+)\\s+\\1\\b`` can also be written as ``\\b(?" +"P\\w+)\\s+(?P=word)\\b``::" msgstr "" -#: ../../howto/regex.rst:979 +#: ../../howto/regex.rst:981 msgid "Lookahead Assertions" msgstr "" -#: ../../howto/regex.rst:981 +#: ../../howto/regex.rst:983 msgid "" "Another zero-width assertion is the lookahead assertion. Lookahead " "assertions are available in both positive and negative form, and look like " "this:" msgstr "" -#: ../../howto/regex.rst:989 +#: ../../howto/regex.rst:991 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../howto/regex.rst:985 +#: ../../howto/regex.rst:987 msgid "" "Positive lookahead assertion. This succeeds if the contained regular " "expression, represented here by ``...``, successfully matches at the current " @@ -1397,18 +1397,18 @@ msgid "" "is tried right where the assertion started." msgstr "" -#: ../../howto/regex.rst:994 +#: ../../howto/regex.rst:996 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../howto/regex.rst:992 +#: ../../howto/regex.rst:994 msgid "" "Negative lookahead assertion. This is the opposite of the positive " "assertion; it succeeds if the contained expression *doesn't* match at the " "current position in the string." msgstr "" -#: ../../howto/regex.rst:996 +#: ../../howto/regex.rst:998 msgid "" "To make this concrete, let's look at a case where a lookahead is useful. " "Consider a simple pattern to match a filename and split it apart into a base " @@ -1416,15 +1416,15 @@ msgid "" "``news`` is the base name, and ``rc`` is the filename's extension." msgstr "" -#: ../../howto/regex.rst:1001 +#: ../../howto/regex.rst:1003 msgid "The pattern to match this is quite simple:" msgstr "" -#: ../../howto/regex.rst:1003 +#: ../../howto/regex.rst:1005 msgid "``.*[.].*$``" msgstr "``.*[.].*$``" -#: ../../howto/regex.rst:1005 +#: ../../howto/regex.rst:1007 msgid "" "Notice that the ``.`` needs to be treated specially because it's a " "metacharacter, so it's inside a character class to only match that specific " @@ -1434,24 +1434,24 @@ msgid "" "``printers.conf``." msgstr "" -#: ../../howto/regex.rst:1012 +#: ../../howto/regex.rst:1014 msgid "" "Now, consider complicating the problem a bit; what if you want to match " "filenames where the extension is not ``bat``? Some incorrect attempts:" msgstr "" -#: ../../howto/regex.rst:1015 +#: ../../howto/regex.rst:1017 msgid "" "``.*[.][^b].*$`` The first attempt above tries to exclude ``bat`` by " "requiring that the first character of the extension is not a ``b``. This is " "wrong, because the pattern also doesn't match ``foo.bar``." msgstr "" -#: ../../howto/regex.rst:1019 +#: ../../howto/regex.rst:1021 msgid "``.*[.]([^b]..|.[^a].|..[^t])$``" msgstr "``.*[.]([^b]..|.[^a].|..[^t])$``" -#: ../../howto/regex.rst:1021 +#: ../../howto/regex.rst:1023 msgid "" "The expression gets messier when you try to patch up the first solution by " "requiring one of the following cases to match: the first character of the " @@ -1462,18 +1462,18 @@ msgid "" "pattern again in an effort to fix it." msgstr "" -#: ../../howto/regex.rst:1029 +#: ../../howto/regex.rst:1031 msgid "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" msgstr "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" -#: ../../howto/regex.rst:1031 +#: ../../howto/regex.rst:1033 msgid "" "In the third attempt, the second and third letters are all made optional in " "order to allow matching extensions shorter than three characters, such as " "``sendmail.cf``." msgstr "" -#: ../../howto/regex.rst:1035 +#: ../../howto/regex.rst:1037 msgid "" "The pattern's getting really complicated now, which makes it hard to read " "and understand. Worse, if the problem changes and you want to exclude both " @@ -1481,75 +1481,75 @@ msgid "" "complicated and confusing." msgstr "" -#: ../../howto/regex.rst:1040 +#: ../../howto/regex.rst:1042 msgid "A negative lookahead cuts through all this confusion:" msgstr "" -#: ../../howto/regex.rst:1042 +#: ../../howto/regex.rst:1044 msgid "" "``.*[.](?!bat$)[^.]*$`` The negative lookahead means: if the expression " -"``bat`` doesn't match at this point, try the rest of the pattern; if ``bat" -"$`` does match, the whole pattern will fail. The trailing ``$`` is required " -"to ensure that something like ``sample.batch``, where the extension only " -"starts with ``bat``, will be allowed. The ``[^.]*`` makes sure that the " -"pattern works when there are multiple dots in the filename." +"``bat`` doesn't match at this point, try the rest of the pattern; if " +"``bat$`` does match, the whole pattern will fail. The trailing ``$`` is " +"required to ensure that something like ``sample.batch``, where the extension " +"only starts with ``bat``, will be allowed. The ``[^.]*`` makes sure that " +"the pattern works when there are multiple dots in the filename." msgstr "" -#: ../../howto/regex.rst:1049 +#: ../../howto/regex.rst:1051 msgid "" "Excluding another filename extension is now easy; simply add it as an " "alternative inside the assertion. The following pattern excludes filenames " "that end in either ``bat`` or ``exe``:" msgstr "" -#: ../../howto/regex.rst:1053 +#: ../../howto/regex.rst:1055 msgid "``.*[.](?!bat$|exe$)[^.]*$``" msgstr "``.*[.](?!bat$|exe$)[^.]*$``" -#: ../../howto/regex.rst:1057 +#: ../../howto/regex.rst:1059 msgid "Modifying Strings" msgstr "" -#: ../../howto/regex.rst:1059 +#: ../../howto/regex.rst:1061 msgid "" "Up to this point, we've simply performed searches against a static string. " "Regular expressions are also commonly used to modify strings in various " "ways, using the following pattern methods:" msgstr "" -#: ../../howto/regex.rst:1066 +#: ../../howto/regex.rst:1068 msgid "``split()``" msgstr "``split()``" -#: ../../howto/regex.rst:1066 +#: ../../howto/regex.rst:1068 msgid "Split the string into a list, splitting it wherever the RE matches" msgstr "" -#: ../../howto/regex.rst:1069 +#: ../../howto/regex.rst:1071 msgid "``sub()``" msgstr "``sub()``" -#: ../../howto/regex.rst:1069 +#: ../../howto/regex.rst:1071 msgid "" "Find all substrings where the RE matches, and replace them with a different " "string" msgstr "" -#: ../../howto/regex.rst:1072 +#: ../../howto/regex.rst:1074 msgid "``subn()``" msgstr "``subn()``" -#: ../../howto/regex.rst:1072 +#: ../../howto/regex.rst:1074 msgid "" "Does the same thing as :meth:`!sub`, but returns the new string and the " "number of replacements" msgstr "" -#: ../../howto/regex.rst:1079 +#: ../../howto/regex.rst:1081 msgid "Splitting Strings" msgstr "" -#: ../../howto/regex.rst:1081 +#: ../../howto/regex.rst:1083 msgid "" "The :meth:`~re.Pattern.split` method of a pattern splits a string apart " "wherever the RE matches, returning a list of the pieces. It's similar to " @@ -1559,7 +1559,7 @@ msgid "" "module-level :func:`re.split` function, too." msgstr "" -#: ../../howto/regex.rst:1092 +#: ../../howto/regex.rst:1094 msgid "" "Split *string* by the matches of the regular expression. If capturing " "parentheses are used in the RE, then their contents will also be returned as " @@ -1567,7 +1567,7 @@ msgid "" "splits are performed." msgstr "" -#: ../../howto/regex.rst:1097 +#: ../../howto/regex.rst:1099 msgid "" "You can limit the number of splits made, by passing a value for *maxsplit*. " "When *maxsplit* is nonzero, at most *maxsplit* splits will be made, and the " @@ -1576,7 +1576,7 @@ msgid "" "characters. ::" msgstr "" -#: ../../howto/regex.rst:1109 +#: ../../howto/regex.rst:1111 msgid "" "Sometimes you're not only interested in what the text between delimiters is, " "but also need to know what the delimiter was. If capturing parentheses are " @@ -1584,17 +1584,17 @@ msgid "" "Compare the following calls::" msgstr "" -#: ../../howto/regex.rst:1121 +#: ../../howto/regex.rst:1123 msgid "" "The module-level function :func:`re.split` adds the RE to be used as the " "first argument, but is otherwise the same. ::" msgstr "" -#: ../../howto/regex.rst:1133 +#: ../../howto/regex.rst:1135 msgid "Search and Replace" msgstr "" -#: ../../howto/regex.rst:1135 +#: ../../howto/regex.rst:1137 msgid "" "Another common task is to find all the matches for a pattern, and replace " "them with a different string. The :meth:`~re.Pattern.sub` method takes a " @@ -1602,57 +1602,57 @@ msgid "" "string to be processed." msgstr "" -#: ../../howto/regex.rst:1142 +#: ../../howto/regex.rst:1144 msgid "" "Returns the string obtained by replacing the leftmost non-overlapping " "occurrences of the RE in *string* by the replacement *replacement*. If the " "pattern isn't found, *string* is returned unchanged." msgstr "" -#: ../../howto/regex.rst:1146 +#: ../../howto/regex.rst:1148 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. The default value " "of 0 means to replace all occurrences." msgstr "" -#: ../../howto/regex.rst:1150 +#: ../../howto/regex.rst:1152 msgid "" "Here's a simple example of using the :meth:`~re.Pattern.sub` method. It " "replaces colour names with the word ``colour``::" msgstr "" -#: ../../howto/regex.rst:1159 +#: ../../howto/regex.rst:1161 msgid "" "The :meth:`~re.Pattern.subn` method does the same work, but returns a 2-" "tuple containing the new string value and the number of replacements that " "were performed::" msgstr "" -#: ../../howto/regex.rst:1168 +#: ../../howto/regex.rst:1170 msgid "" "Empty matches are replaced only when they're not adjacent to a previous " "empty match. ::" msgstr "" -#: ../../howto/regex.rst:1175 +#: ../../howto/regex.rst:1177 msgid "" "If *replacement* is a string, any backslash escapes in it are processed. " "That is, ``\\n`` is converted to a single newline character, ``\\r`` is " -"converted to a carriage return, and so forth. Unknown escapes such as ``" -"\\&`` are left alone. Backreferences, such as ``\\6``, are replaced with the " -"substring matched by the corresponding group in the RE. This lets you " +"converted to a carriage return, and so forth. Unknown escapes such as " +"``\\&`` are left alone. Backreferences, such as ``\\6``, are replaced with " +"the substring matched by the corresponding group in the RE. This lets you " "incorporate portions of the original text in the resulting replacement " "string." msgstr "" -#: ../../howto/regex.rst:1182 +#: ../../howto/regex.rst:1184 msgid "" "This example matches the word ``section`` followed by a string enclosed in " "``{``, ``}``, and changes ``section`` to ``subsection``::" msgstr "" -#: ../../howto/regex.rst:1189 +#: ../../howto/regex.rst:1191 msgid "" "There's also a syntax for referring to named groups as defined by the ``(?" "P...)`` syntax. ``\\g`` will use the substring matched by the " @@ -1664,7 +1664,7 @@ msgid "" "but use all three variations of the replacement string. ::" msgstr "" -#: ../../howto/regex.rst:1206 +#: ../../howto/regex.rst:1208 msgid "" "*replacement* can also be a function, which gives you even more control. If " "*replacement* is a function, the function is called for every non-" @@ -1673,13 +1673,13 @@ msgid "" "this information to compute the desired replacement string and return it." msgstr "" -#: ../../howto/regex.rst:1212 +#: ../../howto/regex.rst:1214 msgid "" "In the following example, the replacement function translates decimals into " "hexadecimal::" msgstr "" -#: ../../howto/regex.rst:1224 +#: ../../howto/regex.rst:1226 msgid "" "When using the module-level :func:`re.sub` function, the pattern is passed " "as the first argument. The pattern may be provided as an object or as a " @@ -1689,11 +1689,11 @@ msgid "" "x'``." msgstr "" -#: ../../howto/regex.rst:1232 +#: ../../howto/regex.rst:1234 msgid "Common Problems" msgstr "" -#: ../../howto/regex.rst:1234 +#: ../../howto/regex.rst:1236 msgid "" "Regular expressions are a powerful tool for some applications, but in some " "ways their behaviour isn't intuitive and at times they don't behave the way " @@ -1701,11 +1701,11 @@ msgid "" "pitfalls." msgstr "" -#: ../../howto/regex.rst:1240 +#: ../../howto/regex.rst:1242 msgid "Use String Methods" msgstr "" -#: ../../howto/regex.rst:1242 +#: ../../howto/regex.rst:1244 msgid "" "Sometimes using the :mod:`re` module is a mistake. If you're matching a " "fixed string, or a single character class, and you're not using any :mod:" @@ -1717,7 +1717,7 @@ msgid "" "engine." msgstr "" -#: ../../howto/regex.rst:1250 +#: ../../howto/regex.rst:1252 msgid "" "One example might be replacing a single fixed string with another one; for " "example, you might replace ``word`` with ``deed``. :func:`re.sub` seems " @@ -1730,7 +1730,7 @@ msgid "" "meth:`!replace`'s abilities.)" msgstr "" -#: ../../howto/regex.rst:1259 +#: ../../howto/regex.rst:1261 msgid "" "Another common task is deleting every occurrence of a single character from " "a string or replacing it with another single character. You might do this " @@ -1739,17 +1739,17 @@ msgid "" "operation can be." msgstr "" -#: ../../howto/regex.rst:1265 +#: ../../howto/regex.rst:1267 msgid "" "In short, before turning to the :mod:`re` module, consider whether your " "problem can be solved with a faster and simpler string method." msgstr "" -#: ../../howto/regex.rst:1270 +#: ../../howto/regex.rst:1272 msgid "match() versus search()" msgstr "" -#: ../../howto/regex.rst:1272 +#: ../../howto/regex.rst:1274 msgid "" "The :func:`~re.match` function only checks if the RE matches at the " "beginning of the string while :func:`~re.search` will scan forward through " @@ -1759,13 +1759,13 @@ msgid "" "report it. ::" msgstr "" -#: ../../howto/regex.rst:1283 +#: ../../howto/regex.rst:1285 msgid "" "On the other hand, :func:`~re.search` will scan forward through the string, " "reporting the first match it finds. ::" msgstr "" -#: ../../howto/regex.rst:1291 +#: ../../howto/regex.rst:1293 msgid "" "Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``." "*`` to the front of your RE. Resist this temptation and use :func:`re." @@ -1777,18 +1777,18 @@ msgid "" "starting character, only trying the full match if a ``'C'`` is found." msgstr "" -#: ../../howto/regex.rst:1300 +#: ../../howto/regex.rst:1302 msgid "" "Adding ``.*`` defeats this optimization, requiring scanning to the end of " "the string and then backtracking to find a match for the rest of the RE. " "Use :func:`re.search` instead." msgstr "" -#: ../../howto/regex.rst:1306 +#: ../../howto/regex.rst:1308 msgid "Greedy versus Non-Greedy" msgstr "" -#: ../../howto/regex.rst:1308 +#: ../../howto/regex.rst:1310 msgid "" "When repeating a regular expression, as in ``a*``, the resulting action is " "to consume as much of the pattern as possible. This fact often bites you " @@ -1797,7 +1797,7 @@ msgid "" "HTML tag doesn't work because of the greedy nature of ``.*``. ::" msgstr "" -#: ../../howto/regex.rst:1322 +#: ../../howto/regex.rst:1324 msgid "" "The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest " "of the string. There's still more left in the RE, though, and the ``>`` " @@ -1807,7 +1807,7 @@ msgid "" "``''``, which isn't what you want." msgstr "" -#: ../../howto/regex.rst:1329 +#: ../../howto/regex.rst:1331 msgid "" "In this case, the solution is to use the non-greedy quantifiers ``*?``, ``+?" "``, ``??``, or ``{m,n}?``, which match as *little* text as possible. In the " @@ -1816,7 +1816,7 @@ msgid "" "retrying the ``'>'`` at every step. This produces just the right result::" msgstr "" -#: ../../howto/regex.rst:1338 +#: ../../howto/regex.rst:1340 msgid "" "(Note that parsing HTML or XML with regular expressions is painful. Quick-" "and-dirty patterns will handle common cases, but HTML and XML have special " @@ -1826,11 +1826,11 @@ msgid "" "such tasks.)" msgstr "" -#: ../../howto/regex.rst:1346 +#: ../../howto/regex.rst:1348 msgid "Using re.VERBOSE" msgstr "" -#: ../../howto/regex.rst:1348 +#: ../../howto/regex.rst:1350 msgid "" "By now you've probably noticed that regular expressions are a very compact " "notation, but they're not terribly readable. REs of moderate complexity can " @@ -1838,14 +1838,14 @@ msgid "" "making them difficult to read and understand." msgstr "" -#: ../../howto/regex.rst:1353 +#: ../../howto/regex.rst:1355 msgid "" "For such REs, specifying the :const:`re.VERBOSE` flag when compiling the " "regular expression can be helpful, because it allows you to format the " "regular expression more clearly." msgstr "" -#: ../../howto/regex.rst:1357 +#: ../../howto/regex.rst:1359 msgid "" "The ``re.VERBOSE`` flag has several effects. Whitespace in the regular " "expression that *isn't* inside a character class is ignored. This means " @@ -1856,15 +1856,15 @@ msgid "" "quoted strings, this enables REs to be formatted more neatly::" msgstr "" -#: ../../howto/regex.rst:1374 +#: ../../howto/regex.rst:1376 msgid "This is far more readable than::" msgstr "" -#: ../../howto/regex.rst:1380 +#: ../../howto/regex.rst:1382 msgid "Feedback" msgstr "" -#: ../../howto/regex.rst:1382 +#: ../../howto/regex.rst:1384 msgid "" "Regular expressions are a complicated topic. Did this document help you " "understand them? Were there parts that were unclear, or Problems you " @@ -1872,7 +1872,7 @@ msgid "" "improvements to the author." msgstr "" -#: ../../howto/regex.rst:1387 +#: ../../howto/regex.rst:1389 msgid "" "The most complete book on regular expressions is almost certainly Jeffrey " "Friedl's Mastering Regular Expressions, published by O'Reilly. " diff --git a/howto/sorting.po b/howto/sorting.po index d72376d868..0361389017 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -307,13 +307,13 @@ msgstr "" msgid "" "The sort routines use ``<`` when making comparisons between two objects. So, " "it is easy to add a standard sort order to a class by defining an :meth:" -"`__lt__` method:" +"`~object.__lt__` method:" msgstr "" #: ../../howto/sorting.rst:284 msgid "" -"However, note that ``<`` can fall back to using :meth:`__gt__` if :meth:" -"`__lt__` is not implemented (see :func:`object.__lt__`)." +"However, note that ``<`` can fall back to using :meth:`~object.__gt__` if :" +"meth:`~object.__lt__` is not implemented (see :func:`object.__lt__`)." msgstr "" #: ../../howto/sorting.rst:287 diff --git a/howto/unicode.po b/howto/unicode.po index 16b44ab31f..fab512a2cb 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-26 00:21+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -501,9 +501,9 @@ msgid "" "A second tool is the :mod:`unicodedata` module's :func:`~unicodedata." "normalize` function that converts strings to one of several normal forms, " "where letters followed by a combining character are replaced with single " -"characters. :func:`normalize` can be used to perform string comparisons " -"that won't falsely report inequality if two strings use combining characters " -"differently:" +"characters. :func:`~unicodedata.normalize` can be used to perform string " +"comparisons that won't falsely report inequality if two strings use " +"combining characters differently:" msgstr "" #: ../../howto/unicode.rst:448 @@ -523,10 +523,10 @@ msgstr "" #: ../../howto/unicode.rst:477 msgid "" -"This will print ``True``. (Why is :func:`NFD` invoked twice? Because there " -"are a few characters that make :meth:`casefold` return a non-normalized " -"string, so the result needs to be normalized again. See section 3.13 of the " -"Unicode Standard for a discussion and an example.)" +"This will print ``True``. (Why is :func:`!NFD` invoked twice? Because " +"there are a few characters that make :meth:`~str.casefold` return a non-" +"normalized string, so the result needs to be normalized again. See section " +"3.13 of the Unicode Standard for a discussion and an example.)" msgstr "" #: ../../howto/unicode.rst:484 diff --git a/install/index.po b/install/index.po index 31244bacf6..1b885667aa 100644 --- a/install/index.po +++ b/install/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-17 00:33+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -432,9 +432,9 @@ msgstr "" #: ../../install/index.rst:312 msgid "" -"Files will be installed into subdirectories of :data:`site.USER_BASE` " +"Files will be installed into subdirectories of :const:`site.USER_BASE` " "(written as :file:`{userbase}` hereafter). This scheme installs pure Python " -"modules and extension modules in the same location (also known as :data:" +"modules and extension modules in the same location (also known as :const:" "`site.USER_SITE`). Here are the values for UNIX, including macOS:" msgstr "" diff --git a/library/__main__.po b/library/__main__.po index fb5bab00fe..6b6f6166e7 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-28 00:31+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -336,12 +336,12 @@ msgstr "" #: ../../library/__main__.rst:339 msgid "" -"Python inserts an empty ``__main__`` module in :attr:`sys.modules` at " +"Python inserts an empty ``__main__`` module in :data:`sys.modules` at " "interpreter startup, and populates it by running top-level code. In our " "example this is the ``start`` module which runs line by line and imports " "``namely``. In turn, ``namely`` imports ``__main__`` (which is really " "``start``). That's an import cycle! Fortunately, since the partially " -"populated ``__main__`` module is present in :attr:`sys.modules`, Python " +"populated ``__main__`` module is present in :data:`sys.modules`, Python " "passes that to ``namely``. See :ref:`Special considerations for __main__ " "` in the import system's reference for details on how " "this works." diff --git a/library/_thread.po b/library/_thread.po index 16e9e55da9..53212125cc 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -91,13 +91,13 @@ msgstr "" #: ../../library/_thread.rst:70 msgid "" "If given, *signum* is the number of the signal to simulate. If *signum* is " -"not given, :data:`signal.SIGINT` is simulated." +"not given, :const:`signal.SIGINT` is simulated." msgstr "" #: ../../library/_thread.rst:73 msgid "" -"If the given signal isn't handled by Python (it was set to :data:`signal." -"SIG_DFL` or :data:`signal.SIG_IGN`), this function does nothing." +"If the given signal isn't handled by Python (it was set to :const:`signal." +"SIG_DFL` or :const:`signal.SIG_IGN`), this function does nothing." msgstr "" #: ../../library/_thread.rst:77 @@ -175,9 +175,9 @@ msgstr "" #: ../../library/_thread.rst:150 msgid "" -"The maximum value allowed for the *timeout* parameter of :meth:`Lock." -"acquire`. Specifying a timeout greater than this value will raise an :exc:" -"`OverflowError`." +"The maximum value allowed for the *timeout* parameter of :meth:`Lock.acquire " +"`. Specifying a timeout greater than this value will " +"raise an :exc:`OverflowError`." msgstr "" #: ../../library/_thread.rst:157 @@ -259,19 +259,19 @@ msgstr "" #: ../../library/_thread.rst:218 msgid "" -"It is not possible to interrupt the :meth:`acquire` method on a lock --- " -"the :exc:`KeyboardInterrupt` exception will happen after the lock has been " -"acquired." +"It is not possible to interrupt the :meth:`~threading.Lock.acquire` method " +"on a lock --- the :exc:`KeyboardInterrupt` exception will happen after the " +"lock has been acquired." msgstr "" -#: ../../library/_thread.rst:221 +#: ../../library/_thread.rst:222 msgid "" "When the main thread exits, it is system defined whether the other threads " "survive. On most systems, they are killed without executing :keyword:" "`try` ... :keyword:`finally` clauses or executing object destructors." msgstr "" -#: ../../library/_thread.rst:226 +#: ../../library/_thread.rst:227 msgid "" "When the main thread exits, it does not do any of its usual cleanup (except " "that :keyword:`try` ... :keyword:`finally` clauses are honored), and the " diff --git a/library/array.po b/library/array.po index be40811ad3..d6ff727c85 100644 --- a/library/array.po +++ b/library/array.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2021-11-23 18:40+0800\n" "Last-Translator: Benson Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,10 +210,11 @@ msgid "It can be 16 bits or 32 bits depending on the platform." msgstr "根據平台的不同,它有可能是 16 位元或者 32 位元。" #: ../../library/array.rst:53 +#, fuzzy msgid "" -"``array('u')`` now uses ``wchar_t`` as C type instead of deprecated " +"``array('u')`` now uses :c:type:`wchar_t` as C type instead of deprecated " "``Py_UNICODE``. This change doesn't affect its behavior because " -"``Py_UNICODE`` is alias of ``wchar_t`` since Python 3.3." +"``Py_UNICODE`` is alias of :c:type:`wchar_t` since Python 3.3." msgstr "" "目前 ``array('u')`` 使用 ``wchar_t`` 取代已棄用的 ``Py_UNICODE`` 作為 C " "type。這個異動並沒有影響到它的作用,因爲自從 Python 3.3 開始 ``Py_UNICODE`` " diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index f5335f0b4b..ed63007b6f 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-06-11 15:29+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -74,9 +74,10 @@ msgid "In addition to enabling the debug mode, consider also:" msgstr "除了啟用除錯模式外,還要考慮:" #: ../../library/asyncio-dev.rst:36 +#, fuzzy msgid "" "setting the log level of the :ref:`asyncio logger ` to :py:" -"data:`logging.DEBUG`, for example the following snippet of code can be run " +"const:`logging.DEBUG`, for example the following snippet of code can be run " "at startup of the application::" msgstr "" "將 :ref:`asyncio logger(日誌記錄器) `\\ 的日誌級别設置為 :" @@ -146,10 +147,10 @@ msgid "" "``await`` expression, the running Task gets suspended, and the event loop " "executes the next Task." msgstr "" -"事件迴圈在執行緒中運行(通常是主執行緒),並在其執行緒中執行所有回呼和 " -"Tasks(任務)。當一個 Task 在事件迴圈中運行時,沒有其他 Task 可以在同一個執行" -"緒中運行。當一個 Task 執行一個 ``await`` 運算式時,正在執行的 Task 會被暫停," -"而事件迴圈會執行下一個 Task。" +"事件迴圈在執行緒中運行(通常是主執行緒),並在其執行緒中執行所有回呼和 Tasks" +"(任務)。當一個 Task 在事件迴圈中運行時,沒有其他 Task 可以在同一個執行緒中" +"運行。當一個 Task 執行一個 ``await`` 運算式時,正在執行的 Task 會被暫停,而事" +"件迴圈會執行下一個 Task。" #: ../../library/asyncio-dev.rst:76 msgid "" @@ -259,8 +260,9 @@ msgstr "" "logger 執行的。" #: ../../library/asyncio-dev.rst:145 +#, fuzzy msgid "" -"The default log level is :py:data:`logging.INFO`, which can be easily " +"The default log level is :py:const:`logging.INFO`, which can be easily " "adjusted::" msgstr "" "日誌級別被預設為 :py:data:`logging.INFO`,它可以很容易地被調整:\n" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index c518fadbbb..437eee8a47 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-29 00:39+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -263,7 +263,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:182 #: ../../library/asyncio-eventloop.rst:1219 -#: ../../library/asyncio-eventloop.rst:1607 +#: ../../library/asyncio-eventloop.rst:1610 msgid "Example::" msgstr "" "範例:\n" @@ -516,13 +516,13 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:400 msgid "" -"The socket family can be either :py:data:`~socket.AF_INET` or :py:data:" +"The socket family can be either :py:const:`~socket.AF_INET` or :py:const:" "`~socket.AF_INET6` depending on *host* (or the *family* argument, if " "provided)." msgstr "" #: ../../library/asyncio-eventloop.rst:404 -msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." +msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:406 @@ -677,7 +677,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:498 msgid "" -"The socket option :py:data:`~socket.TCP_NODELAY` is set by default for all " +"The socket option :py:const:`~socket.TCP_NODELAY` is set by default for all " "TCP connections." msgstr "" @@ -728,13 +728,13 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:538 msgid "" -"The socket family can be either :py:data:`~socket.AF_INET`, :py:data:" -"`~socket.AF_INET6`, or :py:data:`~socket.AF_UNIX`, depending on *host* (or " +"The socket family can be either :py:const:`~socket.AF_INET`, :py:const:" +"`~socket.AF_INET6`, or :py:const:`~socket.AF_UNIX`, depending on *host* (or " "the *family* argument, if provided)." msgstr "" #: ../../library/asyncio-eventloop.rst:542 -msgid "The socket type will be :py:data:`~socket.SOCK_DGRAM`." +msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:544 @@ -777,7 +777,7 @@ msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows and some " -"Unixes. If the :py:data:`~socket.SO_REUSEPORT` constant is not defined then " +"Unixes. If the :py:const:`~socket.SO_REUSEPORT` constant is not defined then " "this capability is unsupported." msgstr "" @@ -809,7 +809,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:591 msgid "" -"The *reuse_address* parameter is no longer supported, as using :py:data:" +"The *reuse_address* parameter is no longer supported, as using :py:const:" "`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " "Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" @@ -824,7 +824,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:600 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " -"similar functionality. With *reuse_port*, :py:data:`~sockets.SO_REUSEPORT` " +"similar functionality. With *reuse_port*, :py:const:`~sockets.SO_REUSEPORT` " "is used instead, which specifically prevents processes with differing UIDs " "from assigning sockets to the same socket address." msgstr "" @@ -845,8 +845,8 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:620 msgid "" -"The socket family will be :py:data:`~socket.AF_UNIX`; socket type will be :" -"py:data:`~socket.SOCK_STREAM`." +"The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :" +"py:const:`~socket.SOCK_STREAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:625 @@ -880,7 +880,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:657 msgid "" -"Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening on " +"Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" @@ -927,9 +927,9 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:685 msgid "" -"*family* can be set to either :data:`socket.AF_INET` or :data:`~socket." +"*family* can be set to either :const:`socket.AF_INET` or :const:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " -"will be determined from host name (defaults to :data:`~socket.AF_UNSPEC`)." +"will be determined from host name (defaults to :const:`~socket.AF_UNSPEC`)." msgstr "" #: ../../library/asyncio-eventloop.rst:690 @@ -994,11 +994,14 @@ msgid "The *host* parameter can be a sequence of strings." msgstr "" #: ../../library/asyncio-eventloop.rst:741 +#, fuzzy msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " -"option :py:data:`~socket.TCP_NODELAY` is set by default for all TCP " +"option :py:const:`~socket.TCP_NODELAY` is set by default for all TCP " "connections." msgstr "" +"新增 *ssl_handshake_timeout* 與 *start_serving* 參數。\\ *path* 參數現在可為" +"一個 :class:`~pathlib.Path` 物件。" #: ../../library/asyncio-eventloop.rst:751 msgid "" @@ -1009,7 +1012,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:762 msgid "" -"Similar to :meth:`loop.create_server` but works with the :py:data:`~socket." +"Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." "AF_UNIX` socket family." msgstr "" @@ -1935,39 +1938,45 @@ msgstr "" msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1566 +#: ../../library/asyncio-eventloop.rst:1564 +msgid "" +"This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " +"3.10.3 and 3.11." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1569 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1569 +#: ../../library/asyncio-eventloop.rst:1572 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1572 +#: ../../library/asyncio-eventloop.rst:1575 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1577 +#: ../../library/asyncio-eventloop.rst:1580 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1583 +#: ../../library/asyncio-eventloop.rst:1586 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1585 +#: ../../library/asyncio-eventloop.rst:1588 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1588 +#: ../../library/asyncio-eventloop.rst:1591 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -1976,98 +1985,98 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1599 +#: ../../library/asyncio-eventloop.rst:1602 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1603 +#: ../../library/asyncio-eventloop.rst:1606 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1625 +#: ../../library/asyncio-eventloop.rst:1628 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1631 +#: ../../library/asyncio-eventloop.rst:1634 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1635 +#: ../../library/asyncio-eventloop.rst:1638 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1638 +#: ../../library/asyncio-eventloop.rst:1641 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1648 +#: ../../library/asyncio-eventloop.rst:1651 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1650 +#: ../../library/asyncio-eventloop.rst:1653 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1653 +#: ../../library/asyncio-eventloop.rst:1656 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1659 +#: ../../library/asyncio-eventloop.rst:1662 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1661 +#: ../../library/asyncio-eventloop.rst:1664 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1676 +#: ../../library/asyncio-eventloop.rst:1679 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1681 +#: ../../library/asyncio-eventloop.rst:1684 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1683 +#: ../../library/asyncio-eventloop.rst:1686 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1687 +#: ../../library/asyncio-eventloop.rst:1690 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1693 +#: ../../library/asyncio-eventloop.rst:1696 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1695 +#: ../../library/asyncio-eventloop.rst:1698 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1701 +#: ../../library/asyncio-eventloop.rst:1704 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1703 +#: ../../library/asyncio-eventloop.rst:1706 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2075,70 +2084,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1713 +#: ../../library/asyncio-eventloop.rst:1716 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1715 +#: ../../library/asyncio-eventloop.rst:1718 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1739 +#: ../../library/asyncio-eventloop.rst:1742 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1746 +#: ../../library/asyncio-eventloop.rst:1749 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1748 +#: ../../library/asyncio-eventloop.rst:1751 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1776 +#: ../../library/asyncio-eventloop.rst:1779 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1783 +#: ../../library/asyncio-eventloop.rst:1786 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1785 +#: ../../library/asyncio-eventloop.rst:1788 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1823 +#: ../../library/asyncio-eventloop.rst:1826 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1827 +#: ../../library/asyncio-eventloop.rst:1830 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1835 +#: ../../library/asyncio-eventloop.rst:1838 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1837 +#: ../../library/asyncio-eventloop.rst:1840 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1839 +#: ../../library/asyncio-eventloop.rst:1842 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po index 91920d52cb..426f4cb803 100644 --- a/library/asyncio-platforms.po +++ b/library/asyncio-platforms.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-01-17 11:37+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,20 +66,22 @@ msgid "All event loops on Windows do not support the following methods:" msgstr "Windows 上的所有事件迴圈都不支援以下 method(方法):" #: ../../library/asyncio-platforms.rst:38 +#, fuzzy msgid "" ":meth:`loop.create_unix_connection` and :meth:`loop.create_unix_server` are " -"not supported. The :data:`socket.AF_UNIX` socket family is specific to Unix." +"not supported. The :const:`socket.AF_UNIX` socket family is specific to Unix." msgstr "" -"不支援 :meth:`loop.create_unix_connection` 和 :meth:`loop.create_unix_server`" -"\\ 。\\ :data:`socket.AF_UNIX` socket 系列常數僅限於 Unix 上使用。" +"不支援 :meth:`loop.create_unix_connection` 和 :meth:`loop." +"create_unix_server`\\ 。\\ :data:`socket.AF_UNIX` socket 系列常數僅限於 Unix " +"上使用。" #: ../../library/asyncio-platforms.rst:42 msgid "" ":meth:`loop.add_signal_handler` and :meth:`loop.remove_signal_handler` are " "not supported." msgstr "" -"不支援 :meth:`loop.add_signal_handler` 和 :meth:`loop.remove_signal_handler`" -"\\ 。" +"不支援 :meth:`loop.add_signal_handler` 和 :meth:`loop." +"remove_signal_handler`\\ 。" #: ../../library/asyncio-platforms.rst:45 msgid ":class:`SelectorEventLoop` has the following limitations:" diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index f3db72249a..9abe70948d 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-09 00:19+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -71,7 +71,7 @@ msgstr "" #: ../../library/asyncio-subprocess.rst:87 msgid "" "The *limit* argument sets the buffer limit for :class:`StreamReader` " -"wrappers for :attr:`Process.stdout` and :attr:`Process.stderr` (if :attr:" +"wrappers for :attr:`Process.stdout` and :attr:`Process.stderr` (if :const:" "`subprocess.PIPE` is passed to *stdout* and *stderr* arguments)." msgstr "" @@ -300,7 +300,7 @@ msgstr "" #: ../../library/asyncio-subprocess.rst:247 msgid "" -"On POSIX systems this method sends :py:data:`signal.SIGTERM` to the child " +"On POSIX systems this method sends :py:const:`signal.SIGTERM` to the child " "process." msgstr "" diff --git a/library/codeop.po b/library/codeop.po index 47d5bee87c..70813ff338 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-31 00:31+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2016-11-19 00:28+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -96,18 +96,18 @@ msgstr "" #: ../../library/codeop.rst:61 msgid "" -"Instances of this class have :meth:`__call__` methods identical in signature " -"to the built-in function :func:`compile`, but with the difference that if " -"the instance compiles program text containing a :mod:`__future__` statement, " -"the instance 'remembers' and compiles all subsequent program texts with the " -"statement in force." +"Instances of this class have :meth:`~object.__call__` methods identical in " +"signature to the built-in function :func:`compile`, but with the difference " +"that if the instance compiles program text containing a :mod:`__future__` " +"statement, the instance 'remembers' and compiles all subsequent program " +"texts with the statement in force." msgstr "" #: ../../library/codeop.rst:70 msgid "" -"Instances of this class have :meth:`__call__` methods identical in signature " -"to :func:`compile_command`; the difference is that if the instance compiles " -"program text containing a :mod:`__future__` statement, the instance " +"Instances of this class have :meth:`~object.__call__` methods identical in " +"signature to :func:`compile_command`; the difference is that if the instance " +"compiles program text containing a :mod:`__future__` statement, the instance " "'remembers' and compiles all subsequent program texts with the statement in " "force." msgstr "" diff --git a/library/compileall.po b/library/compileall.po index 9daefb3f3e..42bb48b772 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:35+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -190,9 +190,9 @@ msgstr "" #: ../../library/compileall.rst:144 msgid "" -"Similarly, the :func:`compile` function respects the :attr:`sys." +"Similarly, the :func:`compile` function respects the :data:`sys." "pycache_prefix` setting. The generated bytecode cache will only be useful " -"if :func:`compile` is run with the same :attr:`sys.pycache_prefix` (if any) " +"if :func:`compile` is run with the same :data:`sys.pycache_prefix` (if any) " "that will be used at runtime." msgstr "" diff --git a/library/constants.po b/library/constants.po index 7237db8f97..05db81dcc2 100644 --- a/library/constants.po +++ b/library/constants.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2021-11-19 23:36+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,25 +46,28 @@ msgstr "" "出 :exc:`SyntaxError`。" #: ../../library/constants.rst:22 +#, fuzzy msgid "" "An object frequently used to represent the absence of a value, as when " "default arguments are not passed to a function. Assignments to ``None`` are " "illegal and raise a :exc:`SyntaxError`. ``None`` is the sole instance of " -"the :data:`NoneType` type." +"the :data:`~types.NoneType` type." msgstr "" "型別 ``NoneType`` 的唯一值。``None`` 經常被使用來表達缺少值,例如未傳送預設的" "引數至函式時,相對應參數即會被賦予 ``None``。對於 ``None`` 的賦值是不合法的," "並且會拋出 :exc:`SyntaxError`。``None`` 是型別 :data:`NoneType` 的唯一實例。" #: ../../library/constants.rst:30 +#, fuzzy msgid "" "A special value which should be returned by the binary special methods (e." -"g. :meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, :meth:`__rsub__`, etc.) " -"to indicate that the operation is not implemented with respect to the other " -"type; may be returned by the in-place binary special methods (e.g. :meth:" -"`__imul__`, :meth:`__iand__`, etc.) for the same purpose. It should not be " -"evaluated in a boolean context. ``NotImplemented`` is the sole instance of " -"the :data:`types.NotImplementedType` type." +"g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :" +"meth:`~object.__rsub__`, etc.) to indicate that the operation is not " +"implemented with respect to the other type; may be returned by the in-place " +"binary special methods (e.g. :meth:`~object.__imul__`, :meth:`~object." +"__iand__`, etc.) for the same purpose. It should not be evaluated in a " +"boolean context. ``NotImplemented`` is the sole instance of the :data:`types." +"NotImplementedType` type." msgstr "" "會被二元特殊方法 (binary special methods)(如::meth:`__eq__`、:meth:" "`__lt__`、:meth:`__add__`,:meth:`__rsub__` 等)所回傳的特殊值,代表著該運算" diff --git a/library/ctypes.po b/library/ctypes.po index f3399f397f..24def9f22f 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-26 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -259,7 +259,8 @@ msgid ":class:`c_wchar`" msgstr ":class:`c_wchar`" #: ../../library/ctypes.rst:224 -msgid ":c:expr:`wchar_t`" +#, fuzzy +msgid ":c:type:`wchar_t`" msgstr ":c:expr:`wchar_t`" #: ../../library/ctypes.rst:224 @@ -356,7 +357,8 @@ msgid ":class:`c_size_t`" msgstr ":class:`c_size_t`" #: ../../library/ctypes.rst:247 -msgid ":c:expr:`size_t`" +#, fuzzy +msgid ":c:type:`size_t`" msgstr ":c:expr:`size_t`" #: ../../library/ctypes.rst:249 @@ -364,7 +366,8 @@ msgid ":class:`c_ssize_t`" msgstr ":class:`c_ssize_t`" #: ../../library/ctypes.rst:249 -msgid ":c:expr:`ssize_t` or :c:expr:`Py_ssize_t`" +#, fuzzy +msgid ":c:type:`ssize_t` or :c:expr:`Py_ssize_t`" msgstr ":c:expr:`ssize_t` 或 :c:expr:`Py_ssize_t`" #: ../../library/ctypes.rst:252 @@ -469,7 +472,7 @@ msgstr "" msgid "" "The :func:`create_string_buffer` function replaces the old :func:`c_buffer` " "function (which is still available as an alias). To create a mutable memory " -"block containing unicode characters of the C type :c:expr:`wchar_t`, use " +"block containing unicode characters of the C type :c:type:`wchar_t`, use " "the :func:`create_unicode_buffer` function." msgstr "" @@ -2460,7 +2463,7 @@ msgstr "" #: ../../library/ctypes.rst:2364 msgid "" -"Represents the C :c:expr:`wchar_t` datatype, and interprets the value as a " +"Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" diff --git a/library/curses.po b/library/curses.po index b0af2b3204..fc24b3e8a2 100644 --- a/library/curses.po +++ b/library/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-04 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -270,7 +270,7 @@ msgid "" "const:`BUTTON_ALT`." msgstr "" -#: ../../library/curses.rst:216 ../../library/curses.rst:1757 +#: ../../library/curses.rst:216 ../../library/curses.rst:1775 msgid "" "The ``BUTTON5_*`` constants are now exposed if they are provided by the " "underlying curses library." @@ -718,25 +718,25 @@ msgstr "" #: ../../library/curses.rst:647 msgid "" -"Update :envvar:`LINES` and :envvar:`COLS`. Useful for detecting manual " -"screen resize." +"Update the :const:`LINES` and :const:`COLS` module variables. Useful for " +"detecting manual screen resize." msgstr "" -#: ../../library/curses.rst:654 +#: ../../library/curses.rst:655 msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." msgstr "" -#: ../../library/curses.rst:658 +#: ../../library/curses.rst:659 msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." msgstr "" -#: ../../library/curses.rst:665 +#: ../../library/curses.rst:666 msgid "" "Push a :const:`KEY_MOUSE` event onto the input queue, associating the given " "state data with it." msgstr "" -#: ../../library/curses.rst:671 +#: ../../library/curses.rst:672 msgid "" "If used, this function should be called before :func:`initscr` or newterm " "are called. When *flag* is ``False``, the values of lines and columns " @@ -746,7 +746,7 @@ msgid "" "to use the window size if :envvar:`LINES` and :envvar:`COLUMNS` are not set)." msgstr "" -#: ../../library/curses.rst:681 +#: ../../library/curses.rst:682 msgid "" "Allow use of default values for colors on terminals supporting this feature. " "Use this to support transparency in your application. The default color is " @@ -755,7 +755,7 @@ msgid "" "*x* to a red foreground color on the default background." msgstr "" -#: ../../library/curses.rst:690 +#: ../../library/curses.rst:691 msgid "" "Initialize curses and call another callable object, *func*, which should be " "the rest of your curses-using application. If the application raises an " @@ -769,50 +769,50 @@ msgid "" "echo, and disables the terminal keypad." msgstr "" -#: ../../library/curses.rst:704 +#: ../../library/curses.rst:705 msgid "Window Objects" msgstr "" -#: ../../library/curses.rst:706 +#: ../../library/curses.rst:707 msgid "" "Window objects, as returned by :func:`initscr` and :func:`newwin` above, " "have the following methods and attributes:" msgstr "" -#: ../../library/curses.rst:713 +#: ../../library/curses.rst:714 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any " "character previously painted at that location. By default, the character " "position and attributes are the current settings for the window object." msgstr "" -#: ../../library/curses.rst:719 +#: ../../library/curses.rst:720 msgid "" "Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the character is printed." msgstr "" -#: ../../library/curses.rst:727 +#: ../../library/curses.rst:728 msgid "" "Paint at most *n* characters of the character string *str* at ``(y, x)`` " "with attributes *attr*, overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:735 +#: ../../library/curses.rst:736 msgid "" "Paint the character string *str* at ``(y, x)`` with attributes *attr*, " "overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:740 +#: ../../library/curses.rst:741 msgid "" "Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the string is printed." msgstr "" -#: ../../library/curses.rst:744 +#: ../../library/curses.rst:745 msgid "" "A `bug in ncurses `_, the backend for " "this Python module, can cause SegFaults when resizing windows. This is fixed " @@ -822,44 +822,44 @@ msgid "" "line." msgstr "" -#: ../../library/curses.rst:754 +#: ../../library/curses.rst:755 msgid "" "Remove attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:760 +#: ../../library/curses.rst:761 msgid "" "Add attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:766 +#: ../../library/curses.rst:767 msgid "" "Set the \"background\" set of attributes to *attr*. This set is initially " "``0`` (no attributes)." msgstr "" -#: ../../library/curses.rst:772 +#: ../../library/curses.rst:773 msgid "" "Set the background property of the window to the character *ch*, with " "attributes *attr*. The change is then applied to every character position " "in that window:" msgstr "" -#: ../../library/curses.rst:776 +#: ../../library/curses.rst:777 msgid "" "The attribute of every character in the window is changed to the new " "background attribute." msgstr "" -#: ../../library/curses.rst:779 +#: ../../library/curses.rst:780 msgid "" "Wherever the former background character appears, it is changed to the new " "background character." msgstr "" -#: ../../library/curses.rst:785 +#: ../../library/curses.rst:786 msgid "" "Set the window's background. A window's background consists of a character " "and any combination of attributes. The attribute part of the background is " @@ -870,128 +870,128 @@ msgid "" "delete line/character operations." msgstr "" -#: ../../library/curses.rst:795 +#: ../../library/curses.rst:796 msgid "" "Draw a border around the edges of the window. Each parameter specifies the " "character to use for a specific part of the border; see the table below for " "more details." msgstr "" -#: ../../library/curses.rst:801 +#: ../../library/curses.rst:802 msgid "" "A ``0`` value for any parameter will cause the default character to be used " "for that parameter. Keyword parameters can *not* be used. The defaults are " "listed in this table:" msgstr "" -#: ../../library/curses.rst:806 +#: ../../library/curses.rst:807 msgid "Parameter" msgstr "參數" -#: ../../library/curses.rst:806 +#: ../../library/curses.rst:807 msgid "Description" msgstr "描述" -#: ../../library/curses.rst:806 +#: ../../library/curses.rst:807 msgid "Default value" msgstr "" -#: ../../library/curses.rst:808 +#: ../../library/curses.rst:809 msgid "*ls*" msgstr "*ls*" -#: ../../library/curses.rst:808 +#: ../../library/curses.rst:809 msgid "Left side" msgstr "" -#: ../../library/curses.rst:808 ../../library/curses.rst:810 +#: ../../library/curses.rst:809 ../../library/curses.rst:811 msgid ":const:`ACS_VLINE`" msgstr ":const:`ACS_VLINE`" -#: ../../library/curses.rst:810 +#: ../../library/curses.rst:811 msgid "*rs*" msgstr "*rs*" -#: ../../library/curses.rst:810 +#: ../../library/curses.rst:811 msgid "Right side" msgstr "" -#: ../../library/curses.rst:812 +#: ../../library/curses.rst:813 msgid "*ts*" msgstr "*ts*" -#: ../../library/curses.rst:812 +#: ../../library/curses.rst:813 msgid "Top" msgstr "" -#: ../../library/curses.rst:812 ../../library/curses.rst:814 +#: ../../library/curses.rst:813 ../../library/curses.rst:815 msgid ":const:`ACS_HLINE`" msgstr ":const:`ACS_HLINE`" -#: ../../library/curses.rst:814 +#: ../../library/curses.rst:815 msgid "*bs*" msgstr "*bs*" -#: ../../library/curses.rst:814 +#: ../../library/curses.rst:815 msgid "Bottom" msgstr "" -#: ../../library/curses.rst:816 +#: ../../library/curses.rst:817 msgid "*tl*" msgstr "*tl*" -#: ../../library/curses.rst:816 +#: ../../library/curses.rst:817 msgid "Upper-left corner" msgstr "" -#: ../../library/curses.rst:816 +#: ../../library/curses.rst:817 msgid ":const:`ACS_ULCORNER`" msgstr ":const:`ACS_ULCORNER`" -#: ../../library/curses.rst:818 +#: ../../library/curses.rst:819 msgid "*tr*" msgstr "*tr*" -#: ../../library/curses.rst:818 +#: ../../library/curses.rst:819 msgid "Upper-right corner" msgstr "" -#: ../../library/curses.rst:818 +#: ../../library/curses.rst:819 msgid ":const:`ACS_URCORNER`" msgstr ":const:`ACS_URCORNER`" -#: ../../library/curses.rst:820 +#: ../../library/curses.rst:821 msgid "*bl*" msgstr "*bl*" -#: ../../library/curses.rst:820 +#: ../../library/curses.rst:821 msgid "Bottom-left corner" msgstr "" -#: ../../library/curses.rst:820 +#: ../../library/curses.rst:821 msgid ":const:`ACS_LLCORNER`" msgstr ":const:`ACS_LLCORNER`" -#: ../../library/curses.rst:822 +#: ../../library/curses.rst:823 msgid "*br*" msgstr "*br*" -#: ../../library/curses.rst:822 +#: ../../library/curses.rst:823 msgid "Bottom-right corner" msgstr "" -#: ../../library/curses.rst:822 +#: ../../library/curses.rst:823 msgid ":const:`ACS_LRCORNER`" msgstr ":const:`ACS_LRCORNER`" -#: ../../library/curses.rst:828 +#: ../../library/curses.rst:829 msgid "" "Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* " "and *bs* are *horch*. The default corner characters are always used by this " "function." msgstr "" -#: ../../library/curses.rst:837 +#: ../../library/curses.rst:838 msgid "" "Set the attributes of *num* characters at the current cursor position, or at " "position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " @@ -1001,45 +1001,45 @@ msgid "" "be redisplayed by the next window refresh." msgstr "" -#: ../../library/curses.rst:847 +#: ../../library/curses.rst:848 msgid "" "Like :meth:`erase`, but also cause the whole window to be repainted upon " "next call to :meth:`refresh`." msgstr "" -#: ../../library/curses.rst:853 +#: ../../library/curses.rst:854 msgid "" "If *flag* is ``True``, the next call to :meth:`refresh` will clear the " "window completely." msgstr "" -#: ../../library/curses.rst:859 +#: ../../library/curses.rst:860 msgid "" "Erase from cursor to the end of the window: all lines below the cursor are " "deleted, and then the equivalent of :meth:`clrtoeol` is performed." msgstr "" -#: ../../library/curses.rst:865 +#: ../../library/curses.rst:866 msgid "Erase from cursor to the end of the line." msgstr "" -#: ../../library/curses.rst:870 +#: ../../library/curses.rst:871 msgid "" "Update the current cursor position of all the ancestors of the window to " "reflect the current cursor position of the window." msgstr "" -#: ../../library/curses.rst:876 +#: ../../library/curses.rst:877 msgid "Delete any character at ``(y, x)``." msgstr "" -#: ../../library/curses.rst:881 +#: ../../library/curses.rst:882 msgid "" "Delete the line under the cursor. All following lines are moved up by one " "line." msgstr "" -#: ../../library/curses.rst:887 +#: ../../library/curses.rst:888 msgid "" "An abbreviation for \"derive window\", :meth:`derwin` is the same as " "calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to " @@ -1047,13 +1047,13 @@ msgid "" "a window object for the derived window." msgstr "" -#: ../../library/curses.rst:895 +#: ../../library/curses.rst:896 msgid "" "Add character *ch* with attribute *attr*, and immediately call :meth:" "`refresh` on the window." msgstr "" -#: ../../library/curses.rst:901 +#: ../../library/curses.rst:902 msgid "" "Test whether the given pair of screen-relative character-cell coordinates " "are enclosed by the given window, returning ``True`` or ``False``. It is " @@ -1061,11 +1061,11 @@ msgid "" "location of a mouse event." msgstr "" -#: ../../library/curses.rst:906 +#: ../../library/curses.rst:907 msgid "Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``." msgstr "" -#: ../../library/curses.rst:912 +#: ../../library/curses.rst:913 msgid "" "Encoding used to encode method arguments (Unicode strings and characters). " "The encoding attribute is inherited from the parent window when a subwindow " @@ -1073,19 +1073,19 @@ msgid "" "locale encoding is used (see :func:`locale.getencoding`)." msgstr "" -#: ../../library/curses.rst:922 +#: ../../library/curses.rst:923 msgid "Clear the window." msgstr "" -#: ../../library/curses.rst:927 +#: ../../library/curses.rst:928 msgid "Return a tuple ``(y, x)`` of co-ordinates of upper-left corner." msgstr "" -#: ../../library/curses.rst:932 +#: ../../library/curses.rst:933 msgid "Return the given window's current background character/attribute pair." msgstr "" -#: ../../library/curses.rst:937 +#: ../../library/curses.rst:938 msgid "" "Get a character. Note that the integer returned does *not* have to be in " "ASCII range: function keys, keypad keys and so on are represented by numbers " @@ -1093,14 +1093,14 @@ msgid "" "otherwise wait until a key is pressed." msgstr "" -#: ../../library/curses.rst:945 +#: ../../library/curses.rst:946 msgid "" "Get a wide character. Return a character for most keys, or an integer for " "function keys, keypad keys, and other special keys. In no-delay mode, raise " "an exception if there is no input." msgstr "" -#: ../../library/curses.rst:954 +#: ../../library/curses.rst:955 msgid "" "Get a character, returning a string instead of an integer, as :meth:`getch` " "does. Function keys, keypad keys and other special keys return a multibyte " @@ -1108,35 +1108,35 @@ msgid "" "there is no input." msgstr "" -#: ../../library/curses.rst:962 +#: ../../library/curses.rst:963 msgid "Return a tuple ``(y, x)`` of the height and width of the window." msgstr "" -#: ../../library/curses.rst:967 +#: ../../library/curses.rst:968 msgid "" "Return the beginning coordinates of this window relative to its parent " "window as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no " "parent." msgstr "" -#: ../../library/curses.rst:977 +#: ../../library/curses.rst:978 msgid "" "Read a bytes object from the user, with primitive line editing capacity." msgstr "" -#: ../../library/curses.rst:982 +#: ../../library/curses.rst:983 msgid "" "Return a tuple ``(y, x)`` of current cursor position relative to the " "window's upper-left corner." msgstr "" -#: ../../library/curses.rst:989 +#: ../../library/curses.rst:990 msgid "" "Display a horizontal line starting at ``(y, x)`` with length *n* consisting " "of the character *ch*." msgstr "" -#: ../../library/curses.rst:995 +#: ../../library/curses.rst:996 msgid "" "If *flag* is ``False``, curses no longer considers using the hardware insert/" "delete character feature of the terminal; if *flag* is ``True``, use of " @@ -1144,13 +1144,13 @@ msgid "" "initialized, use of character insert/delete is enabled by default." msgstr "" -#: ../../library/curses.rst:1003 +#: ../../library/curses.rst:1004 msgid "" "If *flag* is ``True``, :mod:`curses` will try and use hardware line editing " "facilities. Otherwise, line insertion/deletion are disabled." msgstr "" -#: ../../library/curses.rst:1009 +#: ../../library/curses.rst:1010 msgid "" "If *flag* is ``True``, any change in the window image automatically causes " "the window to be refreshed; you no longer have to call :meth:`refresh` " @@ -1158,19 +1158,19 @@ msgid "" "calls to wrefresh. This option is disabled by default." msgstr "" -#: ../../library/curses.rst:1017 +#: ../../library/curses.rst:1018 msgid "" "Return the character at the given position in the window. The bottom 8 bits " "are the character proper, and upper bits are the attributes." msgstr "" -#: ../../library/curses.rst:1024 +#: ../../library/curses.rst:1025 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line " "from position *x* right by one character." msgstr "" -#: ../../library/curses.rst:1030 +#: ../../library/curses.rst:1031 msgid "" "Insert *nlines* lines into the specified window above the current line. The " "*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* " @@ -1179,13 +1179,13 @@ msgid "" "remains the same." msgstr "" -#: ../../library/curses.rst:1039 +#: ../../library/curses.rst:1040 msgid "" "Insert a blank line under the cursor. All following lines are moved down by " "one line." msgstr "" -#: ../../library/curses.rst:1046 +#: ../../library/curses.rst:1047 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor, up to *n* characters. If *n* is " @@ -1195,7 +1195,7 @@ msgid "" "if specified)." msgstr "" -#: ../../library/curses.rst:1056 +#: ../../library/curses.rst:1057 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor. All characters to the right of the " @@ -1204,7 +1204,7 @@ msgid "" "specified)." msgstr "" -#: ../../library/curses.rst:1065 +#: ../../library/curses.rst:1066 msgid "" "Return a bytes object of characters, extracted from the window starting at " "the current cursor position, or at *y*, *x* if specified. Attributes are " @@ -1212,76 +1212,76 @@ msgid "" "string at most *n* characters long (exclusive of the trailing NUL)." msgstr "" -#: ../../library/curses.rst:1073 +#: ../../library/curses.rst:1074 msgid "" "Return ``True`` if the specified line was modified since the last call to :" "meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " "exception if *line* is not valid for the given window." msgstr "" -#: ../../library/curses.rst:1080 +#: ../../library/curses.rst:1081 msgid "" "Return ``True`` if the specified window was modified since the last call to :" "meth:`refresh`; otherwise return ``False``." msgstr "" -#: ../../library/curses.rst:1086 +#: ../../library/curses.rst:1087 msgid "" "If *flag* is ``True``, escape sequences generated by some keys (keypad, " "function keys) will be interpreted by :mod:`curses`. If *flag* is ``False``, " "escape sequences will be left as is in the input stream." msgstr "" -#: ../../library/curses.rst:1093 +#: ../../library/curses.rst:1094 msgid "" "If *flag* is ``True``, cursor is left where it is on update, instead of " "being at \"cursor position.\" This reduces cursor movement where possible. " "If possible the cursor will be made invisible." msgstr "" -#: ../../library/curses.rst:1097 +#: ../../library/curses.rst:1098 msgid "" "If *flag* is ``False``, cursor will always be at \"cursor position\" after " "an update." msgstr "" -#: ../../library/curses.rst:1102 +#: ../../library/curses.rst:1103 msgid "Move cursor to ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1107 +#: ../../library/curses.rst:1108 msgid "" "Move the window inside its parent window. The screen-relative parameters of " "the window are not changed. This routine is used to display different parts " "of the parent window at the same physical position on the screen." msgstr "" -#: ../../library/curses.rst:1114 +#: ../../library/curses.rst:1115 msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1119 +#: ../../library/curses.rst:1120 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." msgstr "" -#: ../../library/curses.rst:1124 +#: ../../library/curses.rst:1125 msgid "If *flag* is ``True``, escape sequences will not be timed out." msgstr "" -#: ../../library/curses.rst:1126 +#: ../../library/curses.rst:1127 msgid "" "If *flag* is ``False``, after a few milliseconds, an escape sequence will " "not be interpreted, and will be left in the input stream as is." msgstr "" -#: ../../library/curses.rst:1132 +#: ../../library/curses.rst:1133 msgid "" "Mark for refresh but wait. This function updates the data structure " "representing the desired state of the window, but does not force an update " "of the physical screen. To accomplish that, call :func:`doupdate`." msgstr "" -#: ../../library/curses.rst:1139 +#: ../../library/curses.rst:1140 msgid "" "Overlay the window on top of *destwin*. The windows need not be the same " "size, only the overlapping region is copied. This copy is non-destructive, " @@ -1289,7 +1289,7 @@ msgid "" "contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1144 +#: ../../library/curses.rst:1145 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overlay` can be used. *sminrow* and *smincol* are the upper-left " @@ -1297,7 +1297,7 @@ msgid "" "in the destination window." msgstr "" -#: ../../library/curses.rst:1152 +#: ../../library/curses.rst:1153 msgid "" "Overwrite the window on top of *destwin*. The windows need not be the same " "size, in which case only the overlapping region is copied. This copy is " @@ -1305,7 +1305,7 @@ msgid "" "the old contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1157 +#: ../../library/curses.rst:1158 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overwrite` can be used. *sminrow* and *smincol* are the upper-left " @@ -1313,31 +1313,31 @@ msgid "" "the destination window." msgstr "" -#: ../../library/curses.rst:1165 +#: ../../library/curses.rst:1166 msgid "" "Write all data associated with the window into the provided file object. " "This information can be later retrieved using the :func:`getwin` function." msgstr "" -#: ../../library/curses.rst:1171 +#: ../../library/curses.rst:1172 msgid "" "Indicate that the *num* screen lines, starting at line *beg*, are corrupted " "and should be completely redrawn on the next :meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1177 +#: ../../library/curses.rst:1178 msgid "" "Touch the entire window, causing it to be completely redrawn on the next :" "meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1183 +#: ../../library/curses.rst:1184 msgid "" "Update the display immediately (sync actual screen with previous drawing/" "deleting methods)." msgstr "" -#: ../../library/curses.rst:1186 +#: ../../library/curses.rst:1187 msgid "" "The 6 optional arguments can only be specified when the window is a pad " "created with :func:`newpad`. The additional parameters are needed to " @@ -1352,7 +1352,7 @@ msgid "" "*smincol* are treated as if they were zero." msgstr "" -#: ../../library/curses.rst:1200 +#: ../../library/curses.rst:1201 msgid "" "Reallocate storage for a curses window to adjust its dimensions to the " "specified values. If either dimension is larger than the current values, " @@ -1360,11 +1360,11 @@ msgid "" "rendition (as set by :meth:`bkgdset`) merged into them." msgstr "" -#: ../../library/curses.rst:1208 +#: ../../library/curses.rst:1209 msgid "Scroll the screen or scrolling region upward by *lines* lines." msgstr "" -#: ../../library/curses.rst:1213 +#: ../../library/curses.rst:1214 msgid "" "Control what happens when the cursor of a window is moved off the edge of " "the window or scrolling region, either as a result of a newline action on " @@ -1374,54 +1374,54 @@ msgid "" "scrolling effect on the terminal, it is also necessary to call :meth:`idlok`." msgstr "" -#: ../../library/curses.rst:1223 +#: ../../library/curses.rst:1224 msgid "" "Set the scrolling region from line *top* to line *bottom*. All scrolling " "actions will take place in this region." msgstr "" -#: ../../library/curses.rst:1229 +#: ../../library/curses.rst:1230 msgid "" "Turn off the standout attribute. On some terminals this has the side effect " "of turning off all attributes." msgstr "" -#: ../../library/curses.rst:1235 +#: ../../library/curses.rst:1236 msgid "Turn on attribute *A_STANDOUT*." msgstr "" -#: ../../library/curses.rst:1241 ../../library/curses.rst:1248 +#: ../../library/curses.rst:1242 ../../library/curses.rst:1249 msgid "" "Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, " "and whose width/height is *ncols*/*nlines*." msgstr "" -#: ../../library/curses.rst:1251 +#: ../../library/curses.rst:1252 msgid "" "By default, the sub-window will extend from the specified position to the " "lower right corner of the window." msgstr "" -#: ../../library/curses.rst:1257 +#: ../../library/curses.rst:1258 msgid "" "Touch each location in the window that has been touched in any of its " "ancestor windows. This routine is called by :meth:`refresh`, so it should " "almost never be necessary to call it manually." msgstr "" -#: ../../library/curses.rst:1264 +#: ../../library/curses.rst:1265 msgid "" "If *flag* is ``True``, then :meth:`syncup` is called automatically whenever " "there is a change in the window." msgstr "" -#: ../../library/curses.rst:1270 +#: ../../library/curses.rst:1271 msgid "" "Touch all locations in ancestors of the window that have been changed in " "the window." msgstr "" -#: ../../library/curses.rst:1276 +#: ../../library/curses.rst:1277 msgid "" "Set blocking or non-blocking read behavior for the window. If *delay* is " "negative, blocking read is used (which will wait indefinitely for input). " @@ -1431,7 +1431,7 @@ msgid "" "still no input at the end of that time." msgstr "" -#: ../../library/curses.rst:1286 +#: ../../library/curses.rst:1287 msgid "" "Pretend *count* lines have been changed, starting with line *start*. If " "*changed* is supplied, it specifies whether the affected lines are marked as " @@ -1439,49 +1439,49 @@ msgid "" "``=False``)." msgstr "" -#: ../../library/curses.rst:1293 +#: ../../library/curses.rst:1294 msgid "" "Pretend the whole window has been changed, for purposes of drawing " "optimizations." msgstr "" -#: ../../library/curses.rst:1299 +#: ../../library/curses.rst:1300 msgid "" "Mark all lines in the window as unchanged since the last call to :meth:" "`refresh`." msgstr "" -#: ../../library/curses.rst:1306 +#: ../../library/curses.rst:1307 msgid "" "Display a vertical line starting at ``(y, x)`` with length *n* consisting of " "the character *ch* with attributes *attr*." msgstr "" -#: ../../library/curses.rst:1311 +#: ../../library/curses.rst:1312 msgid "Constants" msgstr "" -#: ../../library/curses.rst:1313 +#: ../../library/curses.rst:1314 msgid "The :mod:`curses` module defines the following data members:" msgstr "" -#: ../../library/curses.rst:1318 +#: ../../library/curses.rst:1319 msgid "" "Some curses routines that return an integer, such as :meth:`~window." "getch`, return :const:`ERR` upon failure." msgstr "" -#: ../../library/curses.rst:1324 +#: ../../library/curses.rst:1325 msgid "" "Some curses routines that return an integer, such as :func:`napms`, " "return :const:`OK` upon success." msgstr "" -#: ../../library/curses.rst:1331 +#: ../../library/curses.rst:1332 msgid "A bytes object representing the current version of the module." msgstr "" -#: ../../library/curses.rst:1336 +#: ../../library/curses.rst:1337 msgid "" "A named tuple containing the three components of the ncurses library " "version: *major*, *minor*, and *patch*. All values are integers. The " @@ -1489,518 +1489,536 @@ msgid "" "is equivalent to ``curses.ncurses_version.major`` and so on." msgstr "" -#: ../../library/curses.rst:1341 +#: ../../library/curses.rst:1342 msgid "Availability: if the ncurses library is used." msgstr "" -#: ../../library/curses.rst:1347 -msgid "The maximum number of colors the terminal can support." +#: ../../library/curses.rst:1348 +msgid "" +"The maximum number of colors the terminal can support. It is defined only " +"after the call to :func:`start_color`." msgstr "" -#: ../../library/curses.rst:1351 -msgid "The maximum number of color pairs the terminal can support." +#: ../../library/curses.rst:1353 +msgid "" +"The maximum number of color pairs the terminal can support. It is defined " +"only after the call to :func:`start_color`." msgstr "" -#: ../../library/curses.rst:1353 +#: ../../library/curses.rst:1358 +msgid "" +"The width of the screen, i.e., the number of columns. It is defined only " +"after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" +"func:`resizeterm` and :func:`resize_term`." +msgstr "" + +#: ../../library/curses.rst:1365 +msgid "" +"The height of the screen, i.e., the number of lines. It is defined only " +"after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" +"func:`resizeterm` and :func:`resize_term`." +msgstr "" + +#: ../../library/curses.rst:1371 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" -#: ../../library/curses.rst:1357 +#: ../../library/curses.rst:1375 msgid "Attribute" msgstr "" -#: ../../library/curses.rst:1357 ../../library/curses.rst:1402 -#: ../../library/curses.rst:1646 ../../library/curses.rst:1738 +#: ../../library/curses.rst:1375 ../../library/curses.rst:1420 +#: ../../library/curses.rst:1664 ../../library/curses.rst:1756 msgid "Meaning" msgstr "" -#: ../../library/curses.rst:1359 +#: ../../library/curses.rst:1377 msgid "Alternate character set mode" msgstr "" -#: ../../library/curses.rst:1361 +#: ../../library/curses.rst:1379 msgid "Blink mode" msgstr "" -#: ../../library/curses.rst:1363 +#: ../../library/curses.rst:1381 msgid "Bold mode" msgstr "" -#: ../../library/curses.rst:1365 +#: ../../library/curses.rst:1383 msgid "Dim mode" msgstr "" -#: ../../library/curses.rst:1367 +#: ../../library/curses.rst:1385 msgid "Invisible or blank mode" msgstr "" -#: ../../library/curses.rst:1369 +#: ../../library/curses.rst:1387 msgid "Italic mode" msgstr "" -#: ../../library/curses.rst:1371 +#: ../../library/curses.rst:1389 msgid "Normal attribute" msgstr "" -#: ../../library/curses.rst:1373 +#: ../../library/curses.rst:1391 msgid "Protected mode" msgstr "" -#: ../../library/curses.rst:1375 +#: ../../library/curses.rst:1393 msgid "Reverse background and foreground colors" msgstr "" -#: ../../library/curses.rst:1378 +#: ../../library/curses.rst:1396 msgid "Standout mode" msgstr "" -#: ../../library/curses.rst:1380 +#: ../../library/curses.rst:1398 msgid "Underline mode" msgstr "" -#: ../../library/curses.rst:1382 +#: ../../library/curses.rst:1400 msgid "Horizontal highlight" msgstr "" -#: ../../library/curses.rst:1384 +#: ../../library/curses.rst:1402 msgid "Left highlight" msgstr "" -#: ../../library/curses.rst:1386 +#: ../../library/curses.rst:1404 msgid "Low highlight" msgstr "" -#: ../../library/curses.rst:1388 +#: ../../library/curses.rst:1406 msgid "Right highlight" msgstr "" -#: ../../library/curses.rst:1390 +#: ../../library/curses.rst:1408 msgid "Top highlight" msgstr "" -#: ../../library/curses.rst:1392 +#: ../../library/curses.rst:1410 msgid "Vertical highlight" msgstr "" -#: ../../library/curses.rst:1395 +#: ../../library/curses.rst:1413 msgid "``A_ITALIC`` was added." msgstr "" -#: ../../library/curses.rst:1398 +#: ../../library/curses.rst:1416 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" -#: ../../library/curses.rst:1402 +#: ../../library/curses.rst:1420 msgid "Bit-mask" msgstr "" -#: ../../library/curses.rst:1404 +#: ../../library/curses.rst:1422 msgid "Bit-mask to extract attributes" msgstr "" -#: ../../library/curses.rst:1407 +#: ../../library/curses.rst:1425 msgid "Bit-mask to extract a character" msgstr "" -#: ../../library/curses.rst:1410 +#: ../../library/curses.rst:1428 msgid "Bit-mask to extract color-pair field information" msgstr "" -#: ../../library/curses.rst:1414 +#: ../../library/curses.rst:1432 msgid "" "Keys are referred to by integer constants with names starting with " "``KEY_``. The exact keycaps available are system dependent." msgstr "" -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1438 msgid "Key constant" msgstr "" -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1438 msgid "Key" msgstr "" -#: ../../library/curses.rst:1422 +#: ../../library/curses.rst:1440 msgid "Minimum key value" msgstr "" -#: ../../library/curses.rst:1424 +#: ../../library/curses.rst:1442 msgid "Break key (unreliable)" msgstr "" -#: ../../library/curses.rst:1426 +#: ../../library/curses.rst:1444 msgid "Down-arrow" msgstr "" -#: ../../library/curses.rst:1428 +#: ../../library/curses.rst:1446 msgid "Up-arrow" msgstr "" -#: ../../library/curses.rst:1430 +#: ../../library/curses.rst:1448 msgid "Left-arrow" msgstr "" -#: ../../library/curses.rst:1432 +#: ../../library/curses.rst:1450 msgid "Right-arrow" msgstr "" -#: ../../library/curses.rst:1434 +#: ../../library/curses.rst:1452 msgid "Home key (upward+left arrow)" msgstr "" -#: ../../library/curses.rst:1436 +#: ../../library/curses.rst:1454 msgid "Backspace (unreliable)" msgstr "" -#: ../../library/curses.rst:1438 +#: ../../library/curses.rst:1456 msgid "Function keys. Up to 64 function keys are supported." msgstr "" -#: ../../library/curses.rst:1441 +#: ../../library/curses.rst:1459 msgid "Value of function key *n*" msgstr "" -#: ../../library/curses.rst:1443 +#: ../../library/curses.rst:1461 msgid "Delete line" msgstr "" -#: ../../library/curses.rst:1445 +#: ../../library/curses.rst:1463 msgid "Insert line" msgstr "" -#: ../../library/curses.rst:1447 +#: ../../library/curses.rst:1465 msgid "Delete character" msgstr "" -#: ../../library/curses.rst:1449 +#: ../../library/curses.rst:1467 msgid "Insert char or enter insert mode" msgstr "" -#: ../../library/curses.rst:1451 +#: ../../library/curses.rst:1469 msgid "Exit insert char mode" msgstr "" -#: ../../library/curses.rst:1453 +#: ../../library/curses.rst:1471 msgid "Clear screen" msgstr "" -#: ../../library/curses.rst:1455 +#: ../../library/curses.rst:1473 msgid "Clear to end of screen" msgstr "" -#: ../../library/curses.rst:1457 +#: ../../library/curses.rst:1475 msgid "Clear to end of line" msgstr "" -#: ../../library/curses.rst:1459 +#: ../../library/curses.rst:1477 msgid "Scroll 1 line forward" msgstr "" -#: ../../library/curses.rst:1461 +#: ../../library/curses.rst:1479 msgid "Scroll 1 line backward (reverse)" msgstr "" -#: ../../library/curses.rst:1463 +#: ../../library/curses.rst:1481 msgid "Next page" msgstr "" -#: ../../library/curses.rst:1465 +#: ../../library/curses.rst:1483 msgid "Previous page" msgstr "" -#: ../../library/curses.rst:1467 +#: ../../library/curses.rst:1485 msgid "Set tab" msgstr "" -#: ../../library/curses.rst:1469 +#: ../../library/curses.rst:1487 msgid "Clear tab" msgstr "" -#: ../../library/curses.rst:1471 +#: ../../library/curses.rst:1489 msgid "Clear all tabs" msgstr "" -#: ../../library/curses.rst:1473 +#: ../../library/curses.rst:1491 msgid "Enter or send (unreliable)" msgstr "" -#: ../../library/curses.rst:1475 +#: ../../library/curses.rst:1493 msgid "Soft (partial) reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1477 +#: ../../library/curses.rst:1495 msgid "Reset or hard reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1479 +#: ../../library/curses.rst:1497 msgid "Print" msgstr "" -#: ../../library/curses.rst:1481 +#: ../../library/curses.rst:1499 msgid "Home down or bottom (lower left)" msgstr "" -#: ../../library/curses.rst:1483 +#: ../../library/curses.rst:1501 msgid "Upper left of keypad" msgstr "" -#: ../../library/curses.rst:1485 +#: ../../library/curses.rst:1503 msgid "Upper right of keypad" msgstr "" -#: ../../library/curses.rst:1487 +#: ../../library/curses.rst:1505 msgid "Center of keypad" msgstr "" -#: ../../library/curses.rst:1489 +#: ../../library/curses.rst:1507 msgid "Lower left of keypad" msgstr "" -#: ../../library/curses.rst:1491 +#: ../../library/curses.rst:1509 msgid "Lower right of keypad" msgstr "" -#: ../../library/curses.rst:1493 +#: ../../library/curses.rst:1511 msgid "Back tab" msgstr "" -#: ../../library/curses.rst:1495 +#: ../../library/curses.rst:1513 msgid "Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1497 +#: ../../library/curses.rst:1515 msgid "Cancel" msgstr "" -#: ../../library/curses.rst:1499 +#: ../../library/curses.rst:1517 msgid "Close" msgstr "" -#: ../../library/curses.rst:1501 +#: ../../library/curses.rst:1519 msgid "Cmd (command)" msgstr "" -#: ../../library/curses.rst:1503 +#: ../../library/curses.rst:1521 msgid "Copy" msgstr "" -#: ../../library/curses.rst:1505 +#: ../../library/curses.rst:1523 msgid "Create" msgstr "" -#: ../../library/curses.rst:1507 +#: ../../library/curses.rst:1525 msgid "End" msgstr "" -#: ../../library/curses.rst:1509 +#: ../../library/curses.rst:1527 msgid "Exit" msgstr "" -#: ../../library/curses.rst:1511 +#: ../../library/curses.rst:1529 msgid "Find" msgstr "" -#: ../../library/curses.rst:1513 +#: ../../library/curses.rst:1531 msgid "Help" msgstr "" -#: ../../library/curses.rst:1515 +#: ../../library/curses.rst:1533 msgid "Mark" msgstr "" -#: ../../library/curses.rst:1517 +#: ../../library/curses.rst:1535 msgid "Message" msgstr "" -#: ../../library/curses.rst:1519 +#: ../../library/curses.rst:1537 msgid "Move" msgstr "" -#: ../../library/curses.rst:1521 +#: ../../library/curses.rst:1539 msgid "Next" msgstr "" -#: ../../library/curses.rst:1523 +#: ../../library/curses.rst:1541 msgid "Open" msgstr "" -#: ../../library/curses.rst:1525 +#: ../../library/curses.rst:1543 msgid "Options" msgstr "" -#: ../../library/curses.rst:1527 +#: ../../library/curses.rst:1545 msgid "Prev (previous)" msgstr "" -#: ../../library/curses.rst:1529 +#: ../../library/curses.rst:1547 msgid "Redo" msgstr "" -#: ../../library/curses.rst:1531 +#: ../../library/curses.rst:1549 msgid "Ref (reference)" msgstr "" -#: ../../library/curses.rst:1533 +#: ../../library/curses.rst:1551 msgid "Refresh" msgstr "" -#: ../../library/curses.rst:1535 +#: ../../library/curses.rst:1553 msgid "Replace" msgstr "" -#: ../../library/curses.rst:1537 +#: ../../library/curses.rst:1555 msgid "Restart" msgstr "" -#: ../../library/curses.rst:1539 +#: ../../library/curses.rst:1557 msgid "Resume" msgstr "" -#: ../../library/curses.rst:1541 +#: ../../library/curses.rst:1559 msgid "Save" msgstr "" -#: ../../library/curses.rst:1543 +#: ../../library/curses.rst:1561 msgid "Shifted Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1545 +#: ../../library/curses.rst:1563 msgid "Shifted Cancel" msgstr "" -#: ../../library/curses.rst:1547 +#: ../../library/curses.rst:1565 msgid "Shifted Command" msgstr "" -#: ../../library/curses.rst:1549 +#: ../../library/curses.rst:1567 msgid "Shifted Copy" msgstr "" -#: ../../library/curses.rst:1551 +#: ../../library/curses.rst:1569 msgid "Shifted Create" msgstr "" -#: ../../library/curses.rst:1553 +#: ../../library/curses.rst:1571 msgid "Shifted Delete char" msgstr "" -#: ../../library/curses.rst:1555 +#: ../../library/curses.rst:1573 msgid "Shifted Delete line" msgstr "" -#: ../../library/curses.rst:1557 +#: ../../library/curses.rst:1575 msgid "Select" msgstr "" -#: ../../library/curses.rst:1559 +#: ../../library/curses.rst:1577 msgid "Shifted End" msgstr "" -#: ../../library/curses.rst:1561 +#: ../../library/curses.rst:1579 msgid "Shifted Clear line" msgstr "" -#: ../../library/curses.rst:1563 +#: ../../library/curses.rst:1581 msgid "Shifted Exit" msgstr "" -#: ../../library/curses.rst:1565 +#: ../../library/curses.rst:1583 msgid "Shifted Find" msgstr "" -#: ../../library/curses.rst:1567 +#: ../../library/curses.rst:1585 msgid "Shifted Help" msgstr "" -#: ../../library/curses.rst:1569 +#: ../../library/curses.rst:1587 msgid "Shifted Home" msgstr "" -#: ../../library/curses.rst:1571 +#: ../../library/curses.rst:1589 msgid "Shifted Input" msgstr "" -#: ../../library/curses.rst:1573 +#: ../../library/curses.rst:1591 msgid "Shifted Left arrow" msgstr "" -#: ../../library/curses.rst:1575 +#: ../../library/curses.rst:1593 msgid "Shifted Message" msgstr "" -#: ../../library/curses.rst:1577 +#: ../../library/curses.rst:1595 msgid "Shifted Move" msgstr "" -#: ../../library/curses.rst:1579 +#: ../../library/curses.rst:1597 msgid "Shifted Next" msgstr "" -#: ../../library/curses.rst:1581 +#: ../../library/curses.rst:1599 msgid "Shifted Options" msgstr "" -#: ../../library/curses.rst:1583 +#: ../../library/curses.rst:1601 msgid "Shifted Prev" msgstr "" -#: ../../library/curses.rst:1585 +#: ../../library/curses.rst:1603 msgid "Shifted Print" msgstr "" -#: ../../library/curses.rst:1587 +#: ../../library/curses.rst:1605 msgid "Shifted Redo" msgstr "" -#: ../../library/curses.rst:1589 +#: ../../library/curses.rst:1607 msgid "Shifted Replace" msgstr "" -#: ../../library/curses.rst:1591 +#: ../../library/curses.rst:1609 msgid "Shifted Right arrow" msgstr "" -#: ../../library/curses.rst:1593 +#: ../../library/curses.rst:1611 msgid "Shifted Resume" msgstr "" -#: ../../library/curses.rst:1595 +#: ../../library/curses.rst:1613 msgid "Shifted Save" msgstr "" -#: ../../library/curses.rst:1597 +#: ../../library/curses.rst:1615 msgid "Shifted Suspend" msgstr "" -#: ../../library/curses.rst:1599 +#: ../../library/curses.rst:1617 msgid "Shifted Undo" msgstr "" -#: ../../library/curses.rst:1601 +#: ../../library/curses.rst:1619 msgid "Suspend" msgstr "" -#: ../../library/curses.rst:1603 +#: ../../library/curses.rst:1621 msgid "Undo" msgstr "" -#: ../../library/curses.rst:1605 +#: ../../library/curses.rst:1623 msgid "Mouse event has occurred" msgstr "" -#: ../../library/curses.rst:1607 +#: ../../library/curses.rst:1625 msgid "Terminal resize event" msgstr "" -#: ../../library/curses.rst:1609 +#: ../../library/curses.rst:1627 msgid "Maximum key value" msgstr "" -#: ../../library/curses.rst:1612 +#: ../../library/curses.rst:1630 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " "are normally at least four function keys (:const:`KEY_F1 `, :const:" @@ -2012,64 +2030,64 @@ msgid "" "keypad mappings are standard:" msgstr "" -#: ../../library/curses.rst:1621 +#: ../../library/curses.rst:1639 msgid "Keycap" msgstr "" -#: ../../library/curses.rst:1621 ../../library/curses.rst:1764 -#: ../../library/curses.rst:1888 +#: ../../library/curses.rst:1639 ../../library/curses.rst:1782 +#: ../../library/curses.rst:1906 msgid "Constant" msgstr "" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1641 msgid ":kbd:`Insert`" msgstr ":kbd:`Insert`" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1641 msgid "KEY_IC" msgstr "KEY_IC" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1643 msgid ":kbd:`Delete`" msgstr ":kbd:`Delete`" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1643 msgid "KEY_DC" msgstr "KEY_DC" -#: ../../library/curses.rst:1627 +#: ../../library/curses.rst:1645 msgid ":kbd:`Home`" msgstr ":kbd:`Home`" -#: ../../library/curses.rst:1627 +#: ../../library/curses.rst:1645 msgid "KEY_HOME" msgstr "KEY_HOME" -#: ../../library/curses.rst:1629 +#: ../../library/curses.rst:1647 msgid ":kbd:`End`" msgstr ":kbd:`End`" -#: ../../library/curses.rst:1629 +#: ../../library/curses.rst:1647 msgid "KEY_END" msgstr "KEY_END" -#: ../../library/curses.rst:1631 +#: ../../library/curses.rst:1649 msgid ":kbd:`Page Up`" msgstr ":kbd:`Page Up`" -#: ../../library/curses.rst:1631 +#: ../../library/curses.rst:1649 msgid "KEY_PPAGE" msgstr "KEY_PPAGE" -#: ../../library/curses.rst:1633 +#: ../../library/curses.rst:1651 msgid ":kbd:`Page Down`" msgstr ":kbd:`Page Down`" -#: ../../library/curses.rst:1633 +#: ../../library/curses.rst:1651 msgid "KEY_NPAGE" msgstr "KEY_NPAGE" -#: ../../library/curses.rst:1636 +#: ../../library/curses.rst:1654 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2077,268 +2095,268 @@ msgid "" "available, curses falls back on a crude printable ASCII approximation." msgstr "" -#: ../../library/curses.rst:1643 +#: ../../library/curses.rst:1661 msgid "These are available only after :func:`initscr` has been called." msgstr "" -#: ../../library/curses.rst:1646 +#: ../../library/curses.rst:1664 msgid "ACS code" msgstr "" -#: ../../library/curses.rst:1648 +#: ../../library/curses.rst:1666 msgid "alternate name for upper right corner" msgstr "" -#: ../../library/curses.rst:1650 +#: ../../library/curses.rst:1668 msgid "solid square block" msgstr "" -#: ../../library/curses.rst:1652 +#: ../../library/curses.rst:1670 msgid "board of squares" msgstr "" -#: ../../library/curses.rst:1654 +#: ../../library/curses.rst:1672 msgid "alternate name for horizontal line" msgstr "" -#: ../../library/curses.rst:1656 +#: ../../library/curses.rst:1674 msgid "alternate name for upper left corner" msgstr "" -#: ../../library/curses.rst:1658 +#: ../../library/curses.rst:1676 msgid "alternate name for top tee" msgstr "" -#: ../../library/curses.rst:1660 +#: ../../library/curses.rst:1678 msgid "bottom tee" msgstr "" -#: ../../library/curses.rst:1662 +#: ../../library/curses.rst:1680 msgid "bullet" msgstr "" -#: ../../library/curses.rst:1664 +#: ../../library/curses.rst:1682 msgid "checker board (stipple)" msgstr "" -#: ../../library/curses.rst:1666 +#: ../../library/curses.rst:1684 msgid "arrow pointing down" msgstr "" -#: ../../library/curses.rst:1668 +#: ../../library/curses.rst:1686 msgid "degree symbol" msgstr "" -#: ../../library/curses.rst:1670 +#: ../../library/curses.rst:1688 msgid "diamond" msgstr "" -#: ../../library/curses.rst:1672 +#: ../../library/curses.rst:1690 msgid "greater-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1674 +#: ../../library/curses.rst:1692 msgid "horizontal line" msgstr "" -#: ../../library/curses.rst:1676 +#: ../../library/curses.rst:1694 msgid "lantern symbol" msgstr "" -#: ../../library/curses.rst:1678 +#: ../../library/curses.rst:1696 msgid "left arrow" msgstr "" -#: ../../library/curses.rst:1680 +#: ../../library/curses.rst:1698 msgid "less-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1682 +#: ../../library/curses.rst:1700 msgid "lower left-hand corner" msgstr "" -#: ../../library/curses.rst:1684 +#: ../../library/curses.rst:1702 msgid "lower right-hand corner" msgstr "" -#: ../../library/curses.rst:1686 +#: ../../library/curses.rst:1704 msgid "left tee" msgstr "" -#: ../../library/curses.rst:1688 +#: ../../library/curses.rst:1706 msgid "not-equal sign" msgstr "" -#: ../../library/curses.rst:1690 +#: ../../library/curses.rst:1708 msgid "letter pi" msgstr "" -#: ../../library/curses.rst:1692 +#: ../../library/curses.rst:1710 msgid "plus-or-minus sign" msgstr "" -#: ../../library/curses.rst:1694 +#: ../../library/curses.rst:1712 msgid "big plus sign" msgstr "" -#: ../../library/curses.rst:1696 +#: ../../library/curses.rst:1714 msgid "right arrow" msgstr "" -#: ../../library/curses.rst:1698 +#: ../../library/curses.rst:1716 msgid "right tee" msgstr "" -#: ../../library/curses.rst:1700 +#: ../../library/curses.rst:1718 msgid "scan line 1" msgstr "" -#: ../../library/curses.rst:1702 +#: ../../library/curses.rst:1720 msgid "scan line 3" msgstr "" -#: ../../library/curses.rst:1704 +#: ../../library/curses.rst:1722 msgid "scan line 7" msgstr "" -#: ../../library/curses.rst:1706 +#: ../../library/curses.rst:1724 msgid "scan line 9" msgstr "" -#: ../../library/curses.rst:1708 +#: ../../library/curses.rst:1726 msgid "alternate name for lower right corner" msgstr "" -#: ../../library/curses.rst:1710 +#: ../../library/curses.rst:1728 msgid "alternate name for vertical line" msgstr "" -#: ../../library/curses.rst:1712 +#: ../../library/curses.rst:1730 msgid "alternate name for right tee" msgstr "" -#: ../../library/curses.rst:1714 +#: ../../library/curses.rst:1732 msgid "alternate name for lower left corner" msgstr "" -#: ../../library/curses.rst:1716 +#: ../../library/curses.rst:1734 msgid "alternate name for bottom tee" msgstr "" -#: ../../library/curses.rst:1718 +#: ../../library/curses.rst:1736 msgid "alternate name for left tee" msgstr "" -#: ../../library/curses.rst:1720 +#: ../../library/curses.rst:1738 msgid "alternate name for crossover or big plus" msgstr "" -#: ../../library/curses.rst:1722 +#: ../../library/curses.rst:1740 msgid "pound sterling" msgstr "" -#: ../../library/curses.rst:1724 +#: ../../library/curses.rst:1742 msgid "top tee" msgstr "" -#: ../../library/curses.rst:1726 +#: ../../library/curses.rst:1744 msgid "up arrow" msgstr "" -#: ../../library/curses.rst:1728 +#: ../../library/curses.rst:1746 msgid "upper left corner" msgstr "" -#: ../../library/curses.rst:1730 +#: ../../library/curses.rst:1748 msgid "upper right corner" msgstr "" -#: ../../library/curses.rst:1732 +#: ../../library/curses.rst:1750 msgid "vertical line" msgstr "" -#: ../../library/curses.rst:1735 +#: ../../library/curses.rst:1753 msgid "" "The following table lists mouse button constants used by :meth:`getmouse`:" msgstr "" -#: ../../library/curses.rst:1738 +#: ../../library/curses.rst:1756 msgid "Mouse button constant" msgstr "" -#: ../../library/curses.rst:1740 +#: ../../library/curses.rst:1758 msgid "Mouse button *n* pressed" msgstr "" -#: ../../library/curses.rst:1742 +#: ../../library/curses.rst:1760 msgid "Mouse button *n* released" msgstr "" -#: ../../library/curses.rst:1744 +#: ../../library/curses.rst:1762 msgid "Mouse button *n* clicked" msgstr "" -#: ../../library/curses.rst:1746 +#: ../../library/curses.rst:1764 msgid "Mouse button *n* double clicked" msgstr "" -#: ../../library/curses.rst:1748 +#: ../../library/curses.rst:1766 msgid "Mouse button *n* triple clicked" msgstr "" -#: ../../library/curses.rst:1750 +#: ../../library/curses.rst:1768 msgid "Shift was down during button state change" msgstr "" -#: ../../library/curses.rst:1752 ../../library/curses.rst:1754 +#: ../../library/curses.rst:1770 ../../library/curses.rst:1772 msgid "Control was down during button state change" msgstr "" -#: ../../library/curses.rst:1761 +#: ../../library/curses.rst:1779 msgid "The following table lists the predefined colors:" msgstr "" -#: ../../library/curses.rst:1764 +#: ../../library/curses.rst:1782 msgid "Color" msgstr "顏色" -#: ../../library/curses.rst:1766 +#: ../../library/curses.rst:1784 msgid "Black" msgstr "黑" -#: ../../library/curses.rst:1768 +#: ../../library/curses.rst:1786 msgid "Blue" msgstr "藍" -#: ../../library/curses.rst:1770 +#: ../../library/curses.rst:1788 msgid "Cyan (light greenish blue)" msgstr "" -#: ../../library/curses.rst:1772 +#: ../../library/curses.rst:1790 msgid "Green" msgstr "綠" -#: ../../library/curses.rst:1774 +#: ../../library/curses.rst:1792 msgid "Magenta (purplish red)" msgstr "" -#: ../../library/curses.rst:1776 +#: ../../library/curses.rst:1794 msgid "Red" msgstr "紅" -#: ../../library/curses.rst:1778 +#: ../../library/curses.rst:1796 msgid "White" msgstr "白" -#: ../../library/curses.rst:1780 +#: ../../library/curses.rst:1798 msgid "Yellow" msgstr "" -#: ../../library/curses.rst:1785 +#: ../../library/curses.rst:1803 msgid ":mod:`curses.textpad` --- Text input widget for curses programs" msgstr "" -#: ../../library/curses.rst:1793 +#: ../../library/curses.rst:1811 msgid "" "The :mod:`curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2348,11 +2366,11 @@ msgid "" "purposes." msgstr "" -#: ../../library/curses.rst:1799 +#: ../../library/curses.rst:1817 msgid "The module :mod:`curses.textpad` defines the following function:" msgstr "" -#: ../../library/curses.rst:1804 +#: ../../library/curses.rst:1822 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2364,15 +2382,15 @@ msgid "" "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" -#: ../../library/curses.rst:1817 +#: ../../library/curses.rst:1835 msgid "Textbox objects" msgstr "" -#: ../../library/curses.rst:1819 +#: ../../library/curses.rst:1837 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" -#: ../../library/curses.rst:1824 +#: ../../library/curses.rst:1842 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2381,11 +2399,11 @@ msgid "" "instance's :attr:`stripspaces` flag is initially on." msgstr "" -#: ../../library/curses.rst:1830 +#: ../../library/curses.rst:1848 msgid ":class:`Textbox` objects have the following methods:" msgstr "" -#: ../../library/curses.rst:1835 +#: ../../library/curses.rst:1853 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -2396,172 +2414,172 @@ msgid "" "`stripspaces` attribute." msgstr "" -#: ../../library/curses.rst:1846 +#: ../../library/curses.rst:1864 msgid "" "Process a single command keystroke. Here are the supported special " "keystrokes:" msgstr "" -#: ../../library/curses.rst:1850 ../../library/curses.rst:1888 +#: ../../library/curses.rst:1868 ../../library/curses.rst:1906 msgid "Keystroke" msgstr "" -#: ../../library/curses.rst:1850 +#: ../../library/curses.rst:1868 msgid "Action" msgstr "" -#: ../../library/curses.rst:1852 +#: ../../library/curses.rst:1870 msgid ":kbd:`Control-A`" msgstr ":kbd:`Control-A`" -#: ../../library/curses.rst:1852 +#: ../../library/curses.rst:1870 msgid "Go to left edge of window." msgstr "" -#: ../../library/curses.rst:1854 ../../library/curses.rst:1890 +#: ../../library/curses.rst:1872 ../../library/curses.rst:1908 msgid ":kbd:`Control-B`" msgstr ":kbd:`Control-B`" -#: ../../library/curses.rst:1854 +#: ../../library/curses.rst:1872 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "" -#: ../../library/curses.rst:1857 +#: ../../library/curses.rst:1875 msgid ":kbd:`Control-D`" msgstr ":kbd:`Control-D`" -#: ../../library/curses.rst:1857 +#: ../../library/curses.rst:1875 msgid "Delete character under cursor." msgstr "" -#: ../../library/curses.rst:1859 +#: ../../library/curses.rst:1877 msgid ":kbd:`Control-E`" msgstr ":kbd:`Control-E`" -#: ../../library/curses.rst:1859 +#: ../../library/curses.rst:1877 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" -#: ../../library/curses.rst:1862 ../../library/curses.rst:1892 +#: ../../library/curses.rst:1880 ../../library/curses.rst:1910 msgid ":kbd:`Control-F`" msgstr ":kbd:`Control-F`" -#: ../../library/curses.rst:1862 +#: ../../library/curses.rst:1880 msgid "Cursor right, wrapping to next line when appropriate." msgstr "" -#: ../../library/curses.rst:1865 +#: ../../library/curses.rst:1883 msgid ":kbd:`Control-G`" msgstr ":kbd:`Control-G`" -#: ../../library/curses.rst:1865 +#: ../../library/curses.rst:1883 msgid "Terminate, returning the window contents." msgstr "" -#: ../../library/curses.rst:1867 +#: ../../library/curses.rst:1885 msgid ":kbd:`Control-H`" msgstr ":kbd:`Control-H`" -#: ../../library/curses.rst:1867 +#: ../../library/curses.rst:1885 msgid "Delete character backward." msgstr "" -#: ../../library/curses.rst:1869 +#: ../../library/curses.rst:1887 msgid ":kbd:`Control-J`" msgstr ":kbd:`Control-J`" -#: ../../library/curses.rst:1869 +#: ../../library/curses.rst:1887 msgid "Terminate if the window is 1 line, otherwise insert newline." msgstr "" -#: ../../library/curses.rst:1872 +#: ../../library/curses.rst:1890 msgid ":kbd:`Control-K`" msgstr ":kbd:`Control-K`" -#: ../../library/curses.rst:1872 +#: ../../library/curses.rst:1890 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" -#: ../../library/curses.rst:1875 +#: ../../library/curses.rst:1893 msgid ":kbd:`Control-L`" msgstr ":kbd:`Control-L`" -#: ../../library/curses.rst:1875 +#: ../../library/curses.rst:1893 msgid "Refresh screen." msgstr "" -#: ../../library/curses.rst:1877 ../../library/curses.rst:1896 +#: ../../library/curses.rst:1895 ../../library/curses.rst:1914 msgid ":kbd:`Control-N`" msgstr ":kbd:`Control-N`" -#: ../../library/curses.rst:1877 +#: ../../library/curses.rst:1895 msgid "Cursor down; move down one line." msgstr "" -#: ../../library/curses.rst:1879 +#: ../../library/curses.rst:1897 msgid ":kbd:`Control-O`" msgstr ":kbd:`Control-O`" -#: ../../library/curses.rst:1879 +#: ../../library/curses.rst:1897 msgid "Insert a blank line at cursor location." msgstr "" -#: ../../library/curses.rst:1881 ../../library/curses.rst:1894 +#: ../../library/curses.rst:1899 ../../library/curses.rst:1912 msgid ":kbd:`Control-P`" msgstr ":kbd:`Control-P`" -#: ../../library/curses.rst:1881 +#: ../../library/curses.rst:1899 msgid "Cursor up; move up one line." msgstr "" -#: ../../library/curses.rst:1884 +#: ../../library/curses.rst:1902 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" msgstr "" -#: ../../library/curses.rst:1890 +#: ../../library/curses.rst:1908 #, fuzzy msgid ":const:`~curses.KEY_LEFT`" msgstr ":const:`KEY_LEFT`" -#: ../../library/curses.rst:1892 +#: ../../library/curses.rst:1910 #, fuzzy msgid ":const:`~curses.KEY_RIGHT`" msgstr ":const:`KEY_RIGHT`" -#: ../../library/curses.rst:1894 +#: ../../library/curses.rst:1912 #, fuzzy msgid ":const:`~curses.KEY_UP`" msgstr ":const:`KEY_UP`" -#: ../../library/curses.rst:1896 +#: ../../library/curses.rst:1914 #, fuzzy msgid ":const:`~curses.KEY_DOWN`" msgstr ":const:`KEY_DOWN`" -#: ../../library/curses.rst:1898 +#: ../../library/curses.rst:1916 #, fuzzy msgid ":const:`~curses.KEY_BACKSPACE`" msgstr ":const:`KEY_BACKSPACE`" -#: ../../library/curses.rst:1898 +#: ../../library/curses.rst:1916 msgid ":kbd:`Control-h`" msgstr ":kbd:`Control-h`" -#: ../../library/curses.rst:1901 +#: ../../library/curses.rst:1919 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." msgstr "" -#: ../../library/curses.rst:1907 +#: ../../library/curses.rst:1925 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." msgstr "" -#: ../../library/curses.rst:1913 +#: ../../library/curses.rst:1931 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " diff --git a/library/devmode.po b/library/devmode.po index 3112fb3a6b..e5ed18c0c7 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -177,7 +177,7 @@ msgstr "" #: ../../library/devmode.rst:84 msgid "" -"Set the :attr:`~sys.flags.dev_mode` attribute of :attr:`sys.flags` to " +"Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to " "``True``." msgstr "" diff --git a/library/dis.po b/library/dis.po index 7c305b94bf..f7dc9b60e4 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-17 00:33+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -770,7 +770,7 @@ msgstr "" #: ../../library/dis.rst:749 msgid "" "If TOS is an instance of :class:`collections.abc.Mapping` (or, more " -"technically: if it has the :const:`Py_TPFLAGS_MAPPING` flag set in its :c:" +"technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in its :c:" "member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. Otherwise, " "push ``False``." msgstr "" @@ -779,7 +779,7 @@ msgstr "" msgid "" "If TOS is an instance of :class:`collections.abc.Sequence` and is *not* an " "instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, more " -"technically: if it has the :const:`Py_TPFLAGS_SEQUENCE` flag set in its :c:" +"technically: if it has the :c:macro:`Py_TPFLAGS_SEQUENCE` flag set in its :c:" "member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. Otherwise, " "push ``False``." msgstr "" diff --git a/library/exceptions.po b/library/exceptions.po index d600f1a5d3..9ba0735b63 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-07 00:39+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -762,9 +762,9 @@ msgstr "" #: ../../library/exceptions.rst:660 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" -"blocking operation. Corresponds to :c:data:`errno` :py:data:`~errno." -"EAGAIN`, :py:data:`~errno.EALREADY`, :py:data:`~errno.EWOULDBLOCK` and :py:" -"data:`~errno.EINPROGRESS`." +"blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." +"EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` and :py:" +"const:`~errno.EINPROGRESS`." msgstr "" #: ../../library/exceptions.rst:665 @@ -783,7 +783,7 @@ msgstr "" #: ../../library/exceptions.rst:676 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" -"`errno` :py:data:`~errno.ECHILD`." +"`errno` :py:const:`~errno.ECHILD`." msgstr "" #: ../../library/exceptions.rst:681 @@ -800,46 +800,46 @@ msgstr "" 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 " -"has been shutdown for writing. Corresponds to :c:data:`errno` :py:data:" -"`~errno.EPIPE` and :py:data:`~errno.ESHUTDOWN`." +"has been shutdown for writing. Corresponds to :c:data:`errno` :py:const:" +"`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." msgstr "" #: ../../library/exceptions.rst:695 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " -"aborted by the peer. Corresponds to :c:data:`errno` :py:data:`~errno." +"aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNABORTED`." msgstr "" #: ../../library/exceptions.rst:701 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " -"refused by the peer. Corresponds to :c:data:`errno` :py:data:`~errno." +"refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNREFUSED`." msgstr "" #: ../../library/exceptions.rst:707 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " -"the peer. Corresponds to :c:data:`errno` :py:data:`~errno.ECONNRESET`." +"the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." msgstr "" #: ../../library/exceptions.rst:713 msgid "" "Raised when trying to create a file or directory which already exists. " -"Corresponds to :c:data:`errno` :py:data:`~errno.EEXIST`." +"Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." msgstr "" #: ../../library/exceptions.rst:718 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " -"to :c:data:`errno` :py:data:`~errno.ENOENT`." +"to :c:data:`errno` :py:const:`~errno.ENOENT`." msgstr "" #: ../../library/exceptions.rst:723 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " -"to :c:data:`errno` :py:data:`~errno.EINTR`." +"to :c:data:`errno` :py:const:`~errno.EINTR`." msgstr "" #: ../../library/exceptions.rst:726 @@ -852,7 +852,7 @@ msgstr "" #: ../../library/exceptions.rst:733 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " -"directory. Corresponds to :c:data:`errno` :py:data:`~errno.EISDIR`." +"directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." msgstr "" #: ../../library/exceptions.rst:739 @@ -860,32 +860,34 @@ 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 " "be raised if an operation attempts to open or traverse a non-directory file " -"as if it were a directory. Corresponds to :c:data:`errno` :py:data:`~errno." +"as if it were a directory. Corresponds to :c:data:`errno` :py:const:`~errno." "ENOTDIR`." msgstr "" #: ../../library/exceptions.rst:747 msgid "" "Raised when trying to run an operation without the adequate access rights - " -"for example filesystem permissions. Corresponds to :c:data:`errno` :py:data:" -"`~errno.EACCES`, :py:data:`~errno.EPERM`, and :py:data:`~errno.ENOTCAPABLE`." +"for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" +"`~errno.EACCES`, :py:const:`~errno.EPERM`, and :py:const:`~errno." +"ENOTCAPABLE`." msgstr "" #: ../../library/exceptions.rst:752 msgid "" -"WASI's :py:data:`~errno.ENOTCAPABLE` is now mapped to :exc:`PermissionError`." +"WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" +"`PermissionError`." msgstr "" #: ../../library/exceptions.rst:758 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" -"py:data:`~errno.ESRCH`." +"py:const:`~errno.ESRCH`." msgstr "" #: ../../library/exceptions.rst:763 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" -"c:data:`errno` :py:data:`~errno.ETIMEDOUT`." +"c:data:`errno` :py:const:`~errno.ETIMEDOUT`." msgstr "" #: ../../library/exceptions.rst:766 diff --git a/library/fcntl.po b/library/fcntl.po index 9009d35594..eb4df3bdf2 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -245,16 +245,16 @@ msgid "" msgstr "" #: ../../library/fcntl.rst:169 -msgid ":const:`0` -- relative to the start of the file (:data:`os.SEEK_SET`)" +msgid ":const:`0` -- relative to the start of the file (:const:`os.SEEK_SET`)" msgstr "" #: ../../library/fcntl.rst:170 msgid "" -":const:`1` -- relative to the current buffer position (:data:`os.SEEK_CUR`)" +":const:`1` -- relative to the current buffer position (:const:`os.SEEK_CUR`)" msgstr "" #: ../../library/fcntl.rst:171 -msgid ":const:`2` -- relative to the end of the file (:data:`os.SEEK_END`)" +msgid ":const:`2` -- relative to the end of the file (:const:`os.SEEK_END`)" msgstr "" #: ../../library/fcntl.rst:173 @@ -288,7 +288,7 @@ msgstr ":mod:`os` 模組" #: ../../library/fcntl.rst:198 msgid "" -"If the locking flags :data:`~os.O_SHLOCK` and :data:`~os.O_EXLOCK` are " +"If the locking flags :const:`~os.O_SHLOCK` and :const:`~os.O_EXLOCK` are " "present in the :mod:`os` module (on BSD only), the :func:`os.open` function " "provides an alternative to the :func:`lockf` and :func:`flock` functions." msgstr "" diff --git a/library/filecmp.po b/library/filecmp.po index 6383c53b44..49cc5a68ed 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -112,7 +112,7 @@ msgstr "" #: ../../library/filecmp.rst:75 msgid "" "Construct a new directory comparison object, to compare the directories *a* " -"and *b*. *ignore* is a list of names to ignore, and defaults to :attr:" +"and *b*. *ignore* is a list of names to ignore, and defaults to :const:" "`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and defaults " "to ``[os.curdir, os.pardir]``." msgstr "" diff --git a/library/ftplib.po b/library/ftplib.po index c13fbb3d40..7c7ee9a506 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -115,7 +115,7 @@ msgstr "" #: ../../library/ftplib.rst:108 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/ftplib.rst:115 @@ -441,7 +441,7 @@ msgid "" msgstr "" #: ../../library/ftplib.rst:441 -msgid "The SSL version to use (defaults to :attr:`ssl.PROTOCOL_SSLv23`)." +msgid "The SSL version to use (defaults to :data:`ssl.PROTOCOL_SSLv23`)." msgstr "" #: ../../library/ftplib.rst:445 @@ -453,7 +453,7 @@ msgstr "" #: ../../library/ftplib.rst:448 msgid "" "The method now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/ftplib.rst:455 diff --git a/library/functions.po b/library/functions.po index a60a0cef42..c34e7fda1c 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-09 00:42+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2023-01-04 14:53+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2094,8 +2094,8 @@ msgstr "" msgid "" "Binary files are buffered in fixed-size chunks; the size of the buffer is " "chosen using a heuristic trying to determine the underlying device's \"block " -"size\" and falling back on :attr:`io.DEFAULT_BUFFER_SIZE`. On many systems, " -"the buffer will typically be 4096 or 8192 bytes long." +"size\" and falling back on :const:`io.DEFAULT_BUFFER_SIZE`. On many " +"systems, the buffer will typically be 4096 or 8192 bytes long." msgstr "" #: ../../library/functions.rst:1236 diff --git a/library/gc.po b/library/gc.po index f74628d17b..31e4ba8371 100644 --- a/library/gc.po +++ b/library/gc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-21 00:33+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -286,7 +286,7 @@ msgstr "" #: ../../library/gc.rst:261 msgid "" "Following :pep:`442`, objects with a :meth:`__del__` method don't end up in :" -"attr:`gc.garbage` anymore." +"data:`gc.garbage` anymore." msgstr "" #: ../../library/gc.rst:267 diff --git a/library/gettext.po b/library/gettext.po index 5b990832ec..2956201c42 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -493,11 +493,11 @@ msgid "" "is not currently supported." msgstr "" -#: ../../library/gettext.rst:416 +#: ../../library/gettext.rst:417 msgid "Internationalizing your programs and modules" msgstr "" -#: ../../library/gettext.rst:418 +#: ../../library/gettext.rst:419 msgid "" "Internationalization (I18N) refers to the operation by which a program is " "made aware of multiple languages. Localization (L10N) refers to the " @@ -506,26 +506,26 @@ msgid "" "Python programs, you need to take the following steps:" msgstr "" -#: ../../library/gettext.rst:424 +#: ../../library/gettext.rst:425 msgid "" "prepare your program or module by specially marking translatable strings" msgstr "" -#: ../../library/gettext.rst:426 +#: ../../library/gettext.rst:427 msgid "" "run a suite of tools over your marked files to generate raw messages catalogs" msgstr "" -#: ../../library/gettext.rst:428 +#: ../../library/gettext.rst:429 msgid "create language-specific translations of the message catalogs" msgstr "" -#: ../../library/gettext.rst:430 +#: ../../library/gettext.rst:431 msgid "" "use the :mod:`gettext` module so that message strings are properly translated" msgstr "" -#: ../../library/gettext.rst:432 +#: ../../library/gettext.rst:433 msgid "" "In order to prepare your code for I18N, you need to look at all the strings " "in your files. Any string that needs to be translated should be marked by " @@ -533,14 +533,14 @@ msgid "" "For example::" msgstr "" -#: ../../library/gettext.rst:441 +#: ../../library/gettext.rst:442 msgid "" "In this example, the string ``'writing a log message'`` is marked as a " "candidate for translation, while the strings ``'mylog.txt'`` and ``'w'`` are " "not." msgstr "" -#: ../../library/gettext.rst:444 +#: ../../library/gettext.rst:445 msgid "" "There are a few tools to extract the strings meant for translation. The " "original GNU :program:`gettext` only supported C or C++ source code but its " @@ -553,7 +553,7 @@ msgid "" "utils>`__." msgstr "" -#: ../../library/gettext.rst:454 +#: ../../library/gettext.rst:455 msgid "" "(Python also includes pure-Python versions of these programs, called :" "program:`pygettext.py` and :program:`msgfmt.py`; some Python distributions " @@ -566,7 +566,7 @@ msgid "" "GNU :program:`gettext` package to internationalize your Python applications.)" msgstr "" -#: ../../library/gettext.rst:466 +#: ../../library/gettext.rst:467 msgid "" ":program:`xgettext`, :program:`pygettext`, and similar tools generate :file:" "`.po` files that are message catalogs. They are structured human-readable " @@ -574,7 +574,7 @@ msgid "" "placeholder for the translated versions of these strings." msgstr "" -#: ../../library/gettext.rst:472 +#: ../../library/gettext.rst:473 msgid "" "Copies of these :file:`.po` files are then handed over to the individual " "human translators who write translations for every supported natural " @@ -585,25 +585,25 @@ msgid "" "processing at run-time." msgstr "" -#: ../../library/gettext.rst:481 +#: ../../library/gettext.rst:482 msgid "" "How you use the :mod:`gettext` module in your code depends on whether you " "are internationalizing a single module or your entire application. The next " "two sections will discuss each case." msgstr "" -#: ../../library/gettext.rst:487 +#: ../../library/gettext.rst:488 msgid "Localizing your module" msgstr "" -#: ../../library/gettext.rst:489 +#: ../../library/gettext.rst:490 msgid "" "If you are localizing your module, you must take care not to make global " "changes, e.g. to the built-in namespace. You should not use the GNU :program:" "`gettext` API but instead the class-based API." msgstr "" -#: ../../library/gettext.rst:493 +#: ../../library/gettext.rst:494 msgid "" "Let's say your module is called \"spam\" and the module's various natural " "language translation :file:`.mo` files reside in :file:`/usr/share/locale` " @@ -611,11 +611,11 @@ msgid "" "your module::" msgstr "" -#: ../../library/gettext.rst:504 +#: ../../library/gettext.rst:505 msgid "Localizing your application" msgstr "" -#: ../../library/gettext.rst:506 +#: ../../library/gettext.rst:507 msgid "" "If you are localizing your application, you can install the :func:`_` " "function globally into the built-in namespace, usually in the main driver " @@ -623,52 +623,52 @@ msgid "" "just use ``_('...')`` without having to explicitly install it in each file." msgstr "" -#: ../../library/gettext.rst:511 +#: ../../library/gettext.rst:512 msgid "" "In the simple case then, you need only add the following bit of code to the " "main driver file of your application::" msgstr "" -#: ../../library/gettext.rst:517 +#: ../../library/gettext.rst:518 msgid "" "If you need to set the locale directory, you can pass it into the :func:" "`install` function::" msgstr "" -#: ../../library/gettext.rst:525 +#: ../../library/gettext.rst:526 msgid "Changing languages on the fly" msgstr "" -#: ../../library/gettext.rst:527 +#: ../../library/gettext.rst:528 msgid "" "If your program needs to support many languages at the same time, you may " "want to create multiple translation instances and then switch between them " "explicitly, like so::" msgstr "" -#: ../../library/gettext.rst:548 +#: ../../library/gettext.rst:549 msgid "Deferred translations" msgstr "" -#: ../../library/gettext.rst:550 +#: ../../library/gettext.rst:551 msgid "" "In most coding situations, strings are translated where they are coded. " "Occasionally however, you need to mark strings for translation, but defer " "actual translation until later. A classic example is::" msgstr "" -#: ../../library/gettext.rst:563 +#: ../../library/gettext.rst:564 msgid "" "Here, you want to mark the strings in the ``animals`` list as being " "translatable, but you don't actually want to translate them until they are " "printed." msgstr "" -#: ../../library/gettext.rst:567 +#: ../../library/gettext.rst:568 msgid "Here is one way you can handle this situation::" msgstr "" -#: ../../library/gettext.rst:583 +#: ../../library/gettext.rst:584 msgid "" "This works because the dummy definition of :func:`_` simply returns the " "string unchanged. And this dummy definition will temporarily override any " @@ -677,18 +677,18 @@ msgid "" "in the local namespace." msgstr "" -#: ../../library/gettext.rst:589 +#: ../../library/gettext.rst:590 msgid "" "Note that the second use of :func:`_` will not identify \"a\" as being " "translatable to the :program:`gettext` program, because the parameter is not " "a string literal." msgstr "" -#: ../../library/gettext.rst:593 +#: ../../library/gettext.rst:594 msgid "Another way to handle this is with the following example::" msgstr "" -#: ../../library/gettext.rst:607 +#: ../../library/gettext.rst:608 msgid "" "In this case, you are marking translatable strings with the function :func:" "`N_`, which won't conflict with any definition of :func:`_`. However, you " @@ -700,54 +700,54 @@ msgid "" "`MarkThisStringForTranslation`." msgstr "" -#: ../../library/gettext.rst:618 +#: ../../library/gettext.rst:619 msgid "Acknowledgements" msgstr "致謝" -#: ../../library/gettext.rst:620 +#: ../../library/gettext.rst:621 msgid "" "The following people contributed code, feedback, design suggestions, " "previous implementations, and valuable experience to the creation of this " "module:" msgstr "" -#: ../../library/gettext.rst:623 +#: ../../library/gettext.rst:624 msgid "Peter Funk" msgstr "Peter Funk" -#: ../../library/gettext.rst:625 +#: ../../library/gettext.rst:626 msgid "James Henstridge" msgstr "James Henstridge" -#: ../../library/gettext.rst:627 +#: ../../library/gettext.rst:628 msgid "Juan David Ibáñez Palomar" msgstr "Juan David Ibáñez Palomar" -#: ../../library/gettext.rst:629 +#: ../../library/gettext.rst:630 msgid "Marc-André Lemburg" msgstr "Marc-André Lemburg" -#: ../../library/gettext.rst:631 +#: ../../library/gettext.rst:632 msgid "Martin von Löwis" msgstr "Martin von Löwis" -#: ../../library/gettext.rst:633 +#: ../../library/gettext.rst:634 msgid "François Pinard" msgstr "François Pinard" -#: ../../library/gettext.rst:635 +#: ../../library/gettext.rst:636 msgid "Barry Warsaw" msgstr "Barry Warsaw" -#: ../../library/gettext.rst:637 +#: ../../library/gettext.rst:638 msgid "Gustavo Niemeyer" msgstr "Gustavo Niemeyer" -#: ../../library/gettext.rst:640 +#: ../../library/gettext.rst:641 msgid "Footnotes" msgstr "註解" -#: ../../library/gettext.rst:641 +#: ../../library/gettext.rst:642 msgid "" "The default locale directory is system dependent; for example, on RedHat " "Linux it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/" @@ -758,7 +758,7 @@ msgid "" "your application." msgstr "" -#: ../../library/gettext.rst:649 +#: ../../library/gettext.rst:650 msgid "See the footnote for :func:`bindtextdomain` above." msgstr "請見上方 :func:`bindtextdomain` 之註解。" diff --git a/library/gzip.po b/library/gzip.po index 3c16c7a106..ec3a545473 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-26 00:33+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -352,7 +352,7 @@ msgid "Command line options" msgstr "" #: ../../library/gzip.rst:267 -msgid "If *file* is not specified, read from :attr:`sys.stdin`." +msgid "If *file* is not specified, read from :data:`sys.stdin`." msgstr "" #: ../../library/gzip.rst:271 diff --git a/library/http.client.po b/library/http.client.po index b802f4ec2f..3abd5415f4 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-10 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -112,7 +112,7 @@ msgstr "新增 *source_address*\\ 、\\ *context* 與 *check_hostname*\\ 。" #: ../../library/http.client.rst:85 msgid "" -"This class now supports HTTPS virtual hosts if possible (that is, if :data:" +"This class now supports HTTPS virtual hosts if possible (that is, if :const:" "`ssl.HAS_SNI` is true)." msgstr "" diff --git a/library/imaplib.po b/library/imaplib.po index 685d9dfd03..8b2b40a869 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -142,7 +142,7 @@ msgstr "新增 *ssl_context* 參數。" #: ../../library/imaplib.rst:112 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/imaplib.rst:119 @@ -571,7 +571,7 @@ msgstr "" #: ../../library/imaplib.rst:513 msgid "" "The method now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/imaplib.rst:521 diff --git a/library/importlib.po b/library/importlib.po index 3948e88467..f640d899f4 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -642,7 +642,7 @@ msgstr ":attr:`__path__`" msgid "" "The list of locations where the package's submodules will be found. Most of " "the time this is a single directory. The import system passes this attribute " -"to ``__import__()`` and to finders in the same way as :attr:`sys.path` but " +"to ``__import__()`` and to finders in the same way as :data:`sys.path` but " "just for the package. It is not set on non-package modules so it can be used " "as an indicator that the module is a package." msgstr "" @@ -943,7 +943,7 @@ msgstr "" #: ../../library/importlib.rst:719 msgid "" -"When writing to the path fails because the path is read-only (:attr:`errno." +"When writing to the path fails because the path is read-only (:const:`errno." "EACCES`/:exc:`PermissionError`), do not propagate the exception." msgstr "" @@ -1184,7 +1184,7 @@ msgstr "" #: ../../library/importlib.rst:968 msgid "" -"A class method which returns a closure for use on :attr:`sys.path_hooks`. An " +"A class method which returns a closure for use on :data:`sys.path_hooks`. An " "instance of :class:`FileFinder` is returned by the closure using the path " "argument given to the closure directly and *loader_details* indirectly." msgstr "" @@ -1525,10 +1525,10 @@ msgstr "" #: ../../library/importlib.rst:1308 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " -"specified **package** name. If the module is in :attr:`sys.modules`, then " +"specified **package** name. If the module is in :data:`sys.modules`, then " "``sys.modules[name].__spec__`` is returned (unless the spec would be " "``None`` or is not set, in which case :exc:`ValueError` is raised). " -"Otherwise a search using :attr:`sys.meta_path` is done. ``None`` is returned " +"Otherwise a search using :data:`sys.meta_path` is done. ``None`` is returned " "if no spec is found." msgstr "" @@ -1678,7 +1678,7 @@ msgid "" "is required. For those same reasons, the loader's :meth:`~importlib.abc." "Loader.create_module` method must return ``None`` or a type for which its " "``__class__`` attribute can be mutated along with not using :term:`slots " -"<__slots__>`. Finally, modules which substitute the object placed into :attr:" +"<__slots__>`. Finally, modules which substitute the object placed into :data:" "`sys.modules` will not work as there is no way to properly replace the " "module references throughout the interpreter safely; :exc:`ValueError` is " "raised if such a substitution is detected." @@ -1762,9 +1762,9 @@ msgid "" "`importer`. This means managing both the :term:`finder` and :term:`loader` " "side of things. For finders there are two flavours to choose from depending " "on your needs: a :term:`meta path finder` or a :term:`path entry finder`. " -"The former is what you would put on :attr:`sys.meta_path` while the latter " -"is what you create using a :term:`path entry hook` on :attr:`sys.path_hooks` " -"which works with :attr:`sys.path` entries to potentially create a finder. " +"The former is what you would put on :data:`sys.meta_path` while the latter " +"is what you create using a :term:`path entry hook` on :data:`sys.path_hooks` " +"which works with :data:`sys.path` entries to potentially create a finder. " "This example will show you how to register your own importers so that import " "will use them (for creating an importer for yourself, read the documentation " "for the appropriate classes defined within this package)::" diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index f6f5c13943..9c00e34ca8 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-26 00:38+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -154,7 +154,7 @@ msgstr "" #: ../../library/importlib.resources.abc.rst:126 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" -"attr:`io.TextIOWrapper`." +"class:`io.TextIOWrapper`." msgstr "" #: ../../library/importlib.resources.abc.rst:131 diff --git a/library/io.po b/library/io.po index b1a2298b7a..0d484e6590 100644 --- a/library/io.po +++ b/library/io.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -619,9 +619,9 @@ msgstr "" #: ../../library/io.rst:424 msgid "" -"Some operating systems could support additional values, like :data:`os." -"SEEK_HOLE` or :data:`os.SEEK_DATA`. The valid values for a file could depend " -"on it being open in text or binary mode." +"Some operating systems could support additional values, like :const:`os." +"SEEK_HOLE` or :const:`os.SEEK_DATA`. The valid values for a file could " +"depend on it being open in text or binary mode." msgstr "" #: ../../library/io.rst:431 diff --git a/library/json.po b/library/json.po index d25aeb93d4..d89ecb45c2 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -773,7 +773,7 @@ msgstr "" #: ../../library/json.rst:685 msgid "" "If the optional ``infile`` and ``outfile`` arguments are not specified, :" -"attr:`sys.stdin` and :attr:`sys.stdout` will be used respectively:" +"data:`sys.stdin` and :data:`sys.stdout` will be used respectively:" msgstr "" #: ../../library/json.rst:697 @@ -791,13 +791,13 @@ msgid "The JSON file to be validated or pretty-printed:" msgstr "" #: ../../library/json.rst:724 -msgid "If *infile* is not specified, read from :attr:`sys.stdin`." +msgid "If *infile* is not specified, read from :data:`sys.stdin`." msgstr "" #: ../../library/json.rst:728 msgid "" "Write the output of the *infile* to the given *outfile*. Otherwise, write it " -"to :attr:`sys.stdout`." +"to :data:`sys.stdout`." msgstr "" #: ../../library/json.rst:733 diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 5855f98090..1f1d3d0781 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -537,8 +537,9 @@ msgstr "" #: ../../library/logging.handlers.rst:398 msgid "" "The system will save old log files by appending extensions to the filename. " -"The extensions are date-and-time based, using the strftime format ``%Y-%m-%d_" -"%H-%M-%S`` or a leading portion thereof, depending on the rollover interval." +"The extensions are date-and-time based, using the strftime format ``%Y-%m-" +"%d_%H-%M-%S`` or a leading portion thereof, depending on the rollover " +"interval." msgstr "" #: ../../library/logging.handlers.rst:403 @@ -1307,17 +1308,18 @@ msgstr "" #: ../../library/logging.handlers.rst:920 msgid "" -"You can override this to implement custom flushing behavior. This version " -"just zaps the buffer to empty." +"For a :class:`BufferingHandler` instance, flushing means that it sets the " +"buffer to an empty list. This method can be overwritten to implement more " +"useful flushing behavior." msgstr "" -#: ../../library/logging.handlers.rst:926 +#: ../../library/logging.handlers.rst:927 msgid "" "Return ``True`` if the buffer is up to capacity. This method can be " "overridden to implement custom flushing strategies." msgstr "" -#: ../../library/logging.handlers.rst:932 +#: ../../library/logging.handlers.rst:933 msgid "" "Returns a new instance of the :class:`MemoryHandler` class. The instance is " "initialized with a buffer size of *capacity* (number of records buffered). " @@ -1329,41 +1331,42 @@ msgid "" "the buffer will occur when the handler is closed." msgstr "" -#: ../../library/logging.handlers.rst:941 +#: ../../library/logging.handlers.rst:942 msgid "The *flushOnClose* parameter was added." msgstr "新增 *flushOnClose* 參數。" -#: ../../library/logging.handlers.rst:947 +#: ../../library/logging.handlers.rst:948 msgid "Calls :meth:`flush`, sets the target to ``None`` and clears the buffer." msgstr "" -#: ../../library/logging.handlers.rst:953 +#: ../../library/logging.handlers.rst:954 msgid "" -"For a :class:`MemoryHandler`, flushing means just sending the buffered " -"records to the target, if there is one. The buffer is also cleared when this " -"happens. Override if you want different behavior." +"For a :class:`MemoryHandler` instance, flushing means just sending the " +"buffered records to the target, if there is one. The buffer is also cleared " +"when buffered records are sent to the target. Override if you want different " +"behavior." msgstr "" -#: ../../library/logging.handlers.rst:960 +#: ../../library/logging.handlers.rst:961 msgid "Sets the target handler for this handler." msgstr "" -#: ../../library/logging.handlers.rst:965 +#: ../../library/logging.handlers.rst:966 msgid "Checks for buffer full or a record at the *flushLevel* or higher." msgstr "" -#: ../../library/logging.handlers.rst:971 +#: ../../library/logging.handlers.rst:972 msgid "HTTPHandler" msgstr "HTTPHandler" -#: ../../library/logging.handlers.rst:973 +#: ../../library/logging.handlers.rst:974 msgid "" "The :class:`HTTPHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a web server, using either " "``GET`` or ``POST`` semantics." msgstr "" -#: ../../library/logging.handlers.rst:980 +#: ../../library/logging.handlers.rst:981 msgid "" "Returns a new instance of the :class:`HTTPHandler` class. The *host* can be " "of the form ``host:port``, should you need to use a specific port number. " @@ -1377,11 +1380,11 @@ msgid "" "cleartext across the wire." msgstr "" -#: ../../library/logging.handlers.rst:991 +#: ../../library/logging.handlers.rst:992 msgid "The *context* parameter was added." msgstr "新增 *context* 參數。" -#: ../../library/logging.handlers.rst:996 +#: ../../library/logging.handlers.rst:997 msgid "" "Provides a dictionary, based on ``record``, which is to be URL-encoded and " "sent to the web server. The default implementation just returns ``record." @@ -1390,14 +1393,14 @@ msgid "" "customization of what's sent to the server is required." msgstr "" -#: ../../library/logging.handlers.rst:1004 +#: ../../library/logging.handlers.rst:1005 msgid "" "Sends the record to the web server as a URL-encoded dictionary. The :meth:" "`mapLogRecord` method is used to convert the record to the dictionary to be " "sent." msgstr "" -#: ../../library/logging.handlers.rst:1008 +#: ../../library/logging.handlers.rst:1009 msgid "" "Since preparing a record for sending it to a web server is not the same as a " "generic formatting operation, using :meth:`~logging.Handler.setFormatter` to " @@ -1407,18 +1410,18 @@ msgid "" "the dictionary in a form suitable for sending to a web server." msgstr "" -#: ../../library/logging.handlers.rst:1021 +#: ../../library/logging.handlers.rst:1022 msgid "QueueHandler" msgstr "QueueHandler" -#: ../../library/logging.handlers.rst:1025 +#: ../../library/logging.handlers.rst:1026 msgid "" "The :class:`QueueHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a queue, such as those " "implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" -#: ../../library/logging.handlers.rst:1029 +#: ../../library/logging.handlers.rst:1030 msgid "" "Along with the :class:`QueueListener` class, :class:`QueueHandler` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1428,7 +1431,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1038 +#: ../../library/logging.handlers.rst:1039 msgid "" "Returns a new instance of the :class:`QueueHandler` class. The instance is " "initialized with the queue to send messages to. The *queue* can be any queue-" @@ -1438,30 +1441,30 @@ msgid "" "instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1045 -#: ../../library/logging.handlers.rst:1128 +#: ../../library/logging.handlers.rst:1046 +#: ../../library/logging.handlers.rst:1129 msgid "" "If you are using :mod:`multiprocessing`, you should avoid using :class:" "`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`." msgstr "" -#: ../../library/logging.handlers.rst:1050 +#: ../../library/logging.handlers.rst:1051 msgid "" "Enqueues the result of preparing the LogRecord. Should an exception occur (e." "g. because a bounded queue has filled up), the :meth:`~logging.Handler." "handleError` method is called to handle the error. This can result in the " -"record silently being dropped (if :attr:`logging.raiseExceptions` is " -"``False``) or a message printed to ``sys.stderr`` (if :attr:`logging." +"record silently being dropped (if :data:`logging.raiseExceptions` is " +"``False``) or a message printed to ``sys.stderr`` (if :data:`logging." "raiseExceptions` is ``True``)." msgstr "" -#: ../../library/logging.handlers.rst:1059 +#: ../../library/logging.handlers.rst:1060 msgid "" "Prepares a record for queuing. The object returned by this method is " "enqueued." msgstr "" -#: ../../library/logging.handlers.rst:1062 +#: ../../library/logging.handlers.rst:1063 msgid "" "The base implementation formats the record to merge the message, arguments, " "exception and stack information, if present. It also removes unpickleable " @@ -1471,14 +1474,14 @@ msgid "" "attr:`exc_info` and :attr:`exc_text` attributes to ``None``." msgstr "" -#: ../../library/logging.handlers.rst:1070 +#: ../../library/logging.handlers.rst:1071 msgid "" "You might want to override this method if you want to convert the record to " "a dict or JSON string, or send a modified copy of the record while leaving " "the original intact." msgstr "" -#: ../../library/logging.handlers.rst:1074 +#: ../../library/logging.handlers.rst:1075 msgid "" "The base implementation formats the message with arguments, sets the " "``message`` and ``msg`` attributes to the formatted message and sets the " @@ -1494,18 +1497,18 @@ msgid "" "libraries that you use.)" msgstr "" -#: ../../library/logging.handlers.rst:1090 +#: ../../library/logging.handlers.rst:1091 msgid "" "Enqueues the record on the queue using ``put_nowait()``; you may want to " "override this if you want to use blocking behaviour, or a timeout, or a " "customized queue implementation." msgstr "" -#: ../../library/logging.handlers.rst:1099 +#: ../../library/logging.handlers.rst:1100 msgid "QueueListener" msgstr "QueueListener" -#: ../../library/logging.handlers.rst:1103 +#: ../../library/logging.handlers.rst:1104 msgid "" "The :class:`QueueListener` class, located in the :mod:`logging.handlers` " "module, supports receiving logging messages from a queue, such as those " @@ -1516,7 +1519,7 @@ msgid "" "works hand-in-hand with :class:`QueueHandler`." msgstr "" -#: ../../library/logging.handlers.rst:1111 +#: ../../library/logging.handlers.rst:1112 msgid "" "Along with the :class:`QueueHandler` class, :class:`QueueListener` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1526,7 +1529,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1120 +#: ../../library/logging.handlers.rst:1121 msgid "" "Returns a new instance of the :class:`QueueListener` class. The instance is " "initialized with the queue to send messages to and a list of handlers which " @@ -1537,7 +1540,7 @@ msgid "" "class:`~queue.SimpleQueue` instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1131 +#: ../../library/logging.handlers.rst:1132 msgid "" "If ``respect_handler_level`` is ``True``, a handler's level is respected " "(compared with the level for the message) when deciding whether to pass " @@ -1545,82 +1548,82 @@ msgid "" "versions - to always pass each message to each handler." msgstr "" -#: ../../library/logging.handlers.rst:1136 +#: ../../library/logging.handlers.rst:1137 msgid "The ``respect_handler_level`` argument was added." msgstr "新增 ``respect_handler_level`` 引數。" -#: ../../library/logging.handlers.rst:1141 +#: ../../library/logging.handlers.rst:1142 msgid "Dequeues a record and return it, optionally blocking." msgstr "" -#: ../../library/logging.handlers.rst:1143 +#: ../../library/logging.handlers.rst:1144 msgid "" "The base implementation uses ``get()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1149 +#: ../../library/logging.handlers.rst:1150 msgid "Prepare a record for handling." msgstr "" -#: ../../library/logging.handlers.rst:1151 +#: ../../library/logging.handlers.rst:1152 msgid "" "This implementation just returns the passed-in record. You may want to " "override this method if you need to do any custom marshalling or " "manipulation of the record before passing it to the handlers." msgstr "" -#: ../../library/logging.handlers.rst:1157 +#: ../../library/logging.handlers.rst:1158 msgid "Handle a record." msgstr "" -#: ../../library/logging.handlers.rst:1159 +#: ../../library/logging.handlers.rst:1160 msgid "" "This just loops through the handlers offering them the record to handle. The " "actual object passed to the handlers is that which is returned from :meth:" "`prepare`." msgstr "" -#: ../../library/logging.handlers.rst:1165 +#: ../../library/logging.handlers.rst:1166 msgid "Starts the listener." msgstr "" -#: ../../library/logging.handlers.rst:1167 +#: ../../library/logging.handlers.rst:1168 msgid "" "This starts up a background thread to monitor the queue for LogRecords to " "process." msgstr "" -#: ../../library/logging.handlers.rst:1172 +#: ../../library/logging.handlers.rst:1173 msgid "Stops the listener." msgstr "" -#: ../../library/logging.handlers.rst:1174 +#: ../../library/logging.handlers.rst:1175 msgid "" "This asks the thread to terminate, and then waits for it to do so. Note that " "if you don't call this before your application exits, there may be some " "records still left on the queue, which won't be processed." msgstr "" -#: ../../library/logging.handlers.rst:1180 +#: ../../library/logging.handlers.rst:1181 msgid "" "Writes a sentinel to the queue to tell the listener to quit. This " "implementation uses ``put_nowait()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1191 +#: ../../library/logging.handlers.rst:1192 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.handlers.rst:1191 +#: ../../library/logging.handlers.rst:1192 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.handlers.rst:1193 +#: ../../library/logging.handlers.rst:1194 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../library/logging.handlers.rst:1194 +#: ../../library/logging.handlers.rst:1195 msgid "Configuration API for the logging module." msgstr "" diff --git a/library/mailbox.po b/library/mailbox.po index 2efc914822..f90da3011e 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -540,7 +540,7 @@ msgstr "" #: ../../library/mailbox.rst:739 msgid "" "Three locking mechanisms are used---dot locking and, if available, the :c:" -"func:`flock` and :c:func:`lockf` system calls." +"func:`!flock` and :c:func:`!lockf` system calls." msgstr "" #: ../../library/mailbox.rst:486 @@ -665,8 +665,8 @@ msgstr "" #: ../../library/mailbox.rst:590 msgid "" "Three locking mechanisms are used---dot locking and, if available, the :c:" -"func:`flock` and :c:func:`lockf` system calls. For MH mailboxes, locking the " -"mailbox means locking the :file:`.mh_sequences` file and, only for the " +"func:`!flock` and :c:func:`!lockf` system calls. For MH mailboxes, locking " +"the mailbox means locking the :file:`.mh_sequences` file and, only for the " "duration of any operations that affect them, locking individual message " "files." msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index a3cc2f02e4..8ef38f47c6 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-23 00:33+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2909,7 +2909,7 @@ msgstr "" #: ../../library/multiprocessing.rst:2685 msgid "" -"When first created the logger has level :data:`logging.NOTSET` and no " +"When first created the logger has level :const:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" diff --git a/library/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index 06768793bf..589d69d1dd 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -212,22 +212,22 @@ msgstr "" msgid "" "Provides a mutable list-like object where all values stored within are " "stored in a shared memory block. This constrains storable values to only " -"the ``int``, ``float``, ``bool``, ``str`` (less than 10M bytes each), " -"``bytes`` (less than 10M bytes each), and ``None`` built-in data types. It " -"also notably differs from the built-in ``list`` type in that these lists can " -"not change their overall length (i.e. no append, insert, etc.) and do not " -"support the dynamic creation of new :class:`ShareableList` instances via " -"slicing." +"the ``int`` (signed 64-bit), ``float``, ``bool``, ``str`` (less than 10M " +"bytes each when encoded as utf-8), ``bytes`` (less than 10M bytes each), and " +"``None`` built-in data types. It also notably differs from the built-in " +"``list`` type in that these lists can not change their overall length (i.e. " +"no append, insert, etc.) and do not support the dynamic creation of new :" +"class:`ShareableList` instances via slicing." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:269 +#: ../../library/multiprocessing.shared_memory.rst:270 msgid "" "*sequence* is used in populating a new ``ShareableList`` full of values. Set " "to ``None`` to instead attach to an already existing ``ShareableList`` by " "its unique shared memory name." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:273 +#: ../../library/multiprocessing.shared_memory.rst:274 msgid "" "*name* is the unique name for the requested shared memory, as described in " "the definition for :class:`SharedMemory`. When attaching to an existing " @@ -235,40 +235,56 @@ msgid "" "leaving ``sequence`` set to ``None``." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:280 +#: ../../library/multiprocessing.shared_memory.rst:281 +msgid "" +"A known issue exists for :class:`bytes` and :class:`str` values. If they end " +"with ``\\x00`` nul bytes or characters, those may be *silently stripped* " +"when fetching them by index from the :class:`ShareableList`. This ``." +"rstrip(b'\\x00')`` behavior is considered a bug and may go away in the " +"future. See :gh:`106939`." +msgstr "" + +#: ../../library/multiprocessing.shared_memory.rst:287 +msgid "" +"For applications where rstripping of trailing nulls is a problem, work " +"around it by always unconditionally appending an extra non-0 byte to the end " +"of such values when storing and unconditionally removing it when fetching:" +msgstr "" + +#: ../../library/multiprocessing.shared_memory.rst:310 msgid "Returns the number of occurrences of ``value``." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:284 +#: ../../library/multiprocessing.shared_memory.rst:314 msgid "" "Returns first index position of ``value``. Raises :exc:`ValueError` if " "``value`` is not present." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:289 +#: ../../library/multiprocessing.shared_memory.rst:319 msgid "" "Read-only attribute containing the :mod:`struct` packing format used by all " "currently stored values." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:294 +#: ../../library/multiprocessing.shared_memory.rst:324 msgid "The :class:`SharedMemory` instance where the values are stored." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:297 +#: ../../library/multiprocessing.shared_memory.rst:327 msgid "" "The following example demonstrates basic use of a :class:`ShareableList` " "instance:" msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:330 +#: ../../library/multiprocessing.shared_memory.rst:360 msgid "" "The following example depicts how one, two, or many processes may access the " "same :class:`ShareableList` by supplying the name of the shared memory block " "behind it:" msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:345 +#: ../../library/multiprocessing.shared_memory.rst:375 msgid "" "The following examples demonstrates that ``ShareableList`` (and underlying " "``SharedMemory``) objects can be pickled and unpickled if needed. Note, that " diff --git a/library/optparse.po b/library/optparse.po index 688782bc86..453720d910 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-29 00:39+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -923,7 +923,7 @@ msgid "" "help option. When :mod:`optparse` prints the usage string, it expands " "``%prog`` to ``os.path.basename(sys.argv[0])`` (or to ``prog`` if you passed " "that keyword argument). To suppress a usage message, pass the special " -"value :data:`optparse.SUPPRESS_USAGE`." +"value :const:`optparse.SUPPRESS_USAGE`." msgstr "" #: ../../library/optparse.rst:822 @@ -1300,7 +1300,7 @@ msgid "" "Help text to print for this option when listing all available options after " "the user supplies a :attr:`~Option.help` option (such as ``--help``). If no " "help text is supplied, the option will be listed without help text. To hide " -"this option, use the special value :data:`optparse.SUPPRESS_HELP`." +"this option, use the special value :const:`optparse.SUPPRESS_HELP`." msgstr "" #: ../../library/optparse.rst:1087 @@ -1509,7 +1509,7 @@ msgstr "" msgid "" "If no :attr:`~Option.help` string is supplied for an option, it will still " "be listed in the help message. To omit an option entirely, use the special " -"value :data:`optparse.SUPPRESS_HELP`." +"value :const:`optparse.SUPPRESS_HELP`." msgstr "" #: ../../library/optparse.rst:1255 @@ -1846,7 +1846,7 @@ msgstr "" msgid "" "Set the usage string according to the rules described above for the " "``usage`` constructor keyword argument. Passing ``None`` sets the default " -"usage string; use :data:`optparse.SUPPRESS_USAGE` to suppress a usage " +"usage string; use :const:`optparse.SUPPRESS_USAGE` to suppress a usage " "message." msgstr "" diff --git a/library/os.path.po b/library/os.path.po index 7895528685..7c70a3bd6c 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -395,7 +395,7 @@ msgid "" msgstr "" #: ../../library/os.path.rst:386 -msgid "*start* defaults to :attr:`os.curdir`." +msgid "*start* defaults to :data:`os.curdir`." msgstr "" #: ../../library/os.path.rst:396 diff --git a/library/os.po b/library/os.po index 68d47da3e9..926d61bec4 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,7 +99,7 @@ msgstr "" #: ../../library/os.rst:63 msgid "" -":attr:`sys.platform` has a finer granularity. :func:`os.uname` gives system-" +":data:`sys.platform` has a finer granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" @@ -398,7 +398,7 @@ msgstr "" #: ../../library/os.rst:236 msgid "" -":data:`environb` is only available if :data:`supports_bytes_environ` is " +":data:`environb` is only available if :const:`supports_bytes_environ` is " "``True``." msgstr "" @@ -497,7 +497,7 @@ msgstr "" #: ../../library/os.rst:334 msgid "" -":func:`getenvb` is only available if :data:`supports_bytes_environ` is " +":func:`getenvb` is only available if :const:`supports_bytes_environ` is " "``True``." msgstr "" @@ -768,13 +768,13 @@ msgstr "" #: ../../library/os.rst:668 msgid "" -"Call the system call :c:func:`getsid`. See the Unix manual for the " +"Call the system call :c:func:`!getsid`. See the Unix manual for the " "semantics." msgstr "" #: ../../library/os.rst:675 msgid "" -"Call the system call :c:func:`setsid`. See the Unix manual for the " +"Call the system call :c:func:`!setsid`. See the Unix manual for the " "semantics." msgstr "" @@ -785,7 +785,7 @@ msgstr "" #: ../../library/os.rst:692 msgid "" "Return the error message corresponding to the error code in *code*. On " -"platforms where :c:func:`strerror` returns ``NULL`` when given an unknown " +"platforms where :c:func:`!strerror` returns ``NULL`` when given an unknown " "error number, :exc:`ValueError` is raised." msgstr "" @@ -940,7 +940,7 @@ msgid "" "If *offset_src* is None, then *src* is read from the current position; " "respectively for *offset_dst*. The files pointed by *src* and *dst* must " "reside in the same filesystem, otherwise an :exc:`OSError` is raised with :" -"attr:`~OSError.errno` set to :data:`errno.EXDEV`." +"attr:`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" #: ../../library/os.rst:834 ../../library/os.rst:1518 @@ -1192,8 +1192,8 @@ msgstr "" #: ../../library/os.rst:1072 msgid "" -"Some operating systems could support additional values, like :data:`os." -"SEEK_HOLE` or :data:`os.SEEK_DATA`." +"Some operating systems could support additional values, like :const:`os." +"SEEK_HOLE` or :const:`os.SEEK_DATA`." msgstr "" #: ../../library/os.rst:1079 @@ -1440,7 +1440,7 @@ msgstr "" #: ../../library/os.rst:1313 msgid "" "If some data was successfully read, it will return the number of bytes read. " -"If no bytes were read, it will return ``-1`` and set errno to :data:`errno." +"If no bytes were read, it will return ``-1`` and set errno to :const:`errno." "EAGAIN`." msgstr "" @@ -1634,7 +1634,7 @@ msgid "" "*offset_dst*. The offset associated to the file descriptor that refers to a " "pipe must be ``None``. The files pointed by *src* and *dst* must reside in " "the same filesystem, otherwise an :exc:`OSError` is raised with :attr:" -"`~OSError.errno` set to :data:`errno.EXDEV`." +"`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" #: ../../library/os.rst:1523 @@ -1967,51 +1967,63 @@ msgid "" msgstr "" #: ../../library/os.rst:1849 -msgid ":data:`stat.UF_NODUMP`" +#, fuzzy +msgid ":const:`stat.UF_NODUMP`" msgstr ":data:`stat.UF_NODUMP`" #: ../../library/os.rst:1850 -msgid ":data:`stat.UF_IMMUTABLE`" +#, fuzzy +msgid ":const:`stat.UF_IMMUTABLE`" msgstr ":data:`stat.UF_IMMUTABLE`" #: ../../library/os.rst:1851 -msgid ":data:`stat.UF_APPEND`" +#, fuzzy +msgid ":const:`stat.UF_APPEND`" msgstr ":data:`stat.UF_APPEND`" #: ../../library/os.rst:1852 -msgid ":data:`stat.UF_OPAQUE`" +#, fuzzy +msgid ":const:`stat.UF_OPAQUE`" msgstr ":data:`stat.UF_OPAQUE`" #: ../../library/os.rst:1853 -msgid ":data:`stat.UF_NOUNLINK`" +#, fuzzy +msgid ":const:`stat.UF_NOUNLINK`" msgstr ":data:`stat.UF_NOUNLINK`" #: ../../library/os.rst:1854 -msgid ":data:`stat.UF_COMPRESSED`" +#, fuzzy +msgid ":const:`stat.UF_COMPRESSED`" msgstr ":data:`stat.UF_COMPRESSED`" #: ../../library/os.rst:1855 -msgid ":data:`stat.UF_HIDDEN`" +#, fuzzy +msgid ":const:`stat.UF_HIDDEN`" msgstr ":data:`stat.UF_HIDDEN`" #: ../../library/os.rst:1856 -msgid ":data:`stat.SF_ARCHIVED`" +#, fuzzy +msgid ":const:`stat.SF_ARCHIVED`" msgstr ":data:`stat.SF_ARCHIVED`" #: ../../library/os.rst:1857 -msgid ":data:`stat.SF_IMMUTABLE`" +#, fuzzy +msgid ":const:`stat.SF_IMMUTABLE`" msgstr ":data:`stat.SF_IMMUTABLE`" #: ../../library/os.rst:1858 -msgid ":data:`stat.SF_APPEND`" +#, fuzzy +msgid ":const:`stat.SF_APPEND`" msgstr ":data:`stat.SF_APPEND`" #: ../../library/os.rst:1859 -msgid ":data:`stat.SF_NOUNLINK`" +#, fuzzy +msgid ":const:`stat.SF_NOUNLINK`" msgstr ":data:`stat.SF_NOUNLINK`" #: ../../library/os.rst:1860 -msgid ":data:`stat.SF_SNAPSHOT`" +#, fuzzy +msgid ":const:`stat.SF_SNAPSHOT`" msgstr ":data:`stat.SF_SNAPSHOT`" #: ../../library/os.rst:1862 @@ -2037,79 +2049,98 @@ msgid "" msgstr "" #: ../../library/os.rst:1881 -msgid ":data:`stat.S_ISUID`" +#, fuzzy +msgid ":const:`stat.S_ISUID`" msgstr ":data:`stat.S_ISUID`" #: ../../library/os.rst:1882 -msgid ":data:`stat.S_ISGID`" +#, fuzzy +msgid ":const:`stat.S_ISGID`" msgstr ":data:`stat.S_ISGID`" #: ../../library/os.rst:1883 -msgid ":data:`stat.S_ENFMT`" +#, fuzzy +msgid ":const:`stat.S_ENFMT`" msgstr ":data:`stat.S_ENFMT`" #: ../../library/os.rst:1884 -msgid ":data:`stat.S_ISVTX`" +#, fuzzy +msgid ":const:`stat.S_ISVTX`" msgstr ":data:`stat.S_ISVTX`" #: ../../library/os.rst:1885 -msgid ":data:`stat.S_IREAD`" +#, fuzzy +msgid ":const:`stat.S_IREAD`" msgstr ":data:`stat.S_IREAD`" #: ../../library/os.rst:1886 -msgid ":data:`stat.S_IWRITE`" +#, fuzzy +msgid ":const:`stat.S_IWRITE`" msgstr ":data:`stat.S_IWRITE`" #: ../../library/os.rst:1887 -msgid ":data:`stat.S_IEXEC`" +#, fuzzy +msgid ":const:`stat.S_IEXEC`" msgstr ":data:`stat.S_IEXEC`" #: ../../library/os.rst:1888 -msgid ":data:`stat.S_IRWXU`" +#, fuzzy +msgid ":const:`stat.S_IRWXU`" msgstr ":data:`stat.S_IRWXU`" #: ../../library/os.rst:1889 -msgid ":data:`stat.S_IRUSR`" +#, fuzzy +msgid ":const:`stat.S_IRUSR`" msgstr ":data:`stat.S_IRUSR`" #: ../../library/os.rst:1890 -msgid ":data:`stat.S_IWUSR`" +#, fuzzy +msgid ":const:`stat.S_IWUSR`" msgstr ":data:`stat.S_IWUSR`" #: ../../library/os.rst:1891 -msgid ":data:`stat.S_IXUSR`" +#, fuzzy +msgid ":const:`stat.S_IXUSR`" msgstr ":data:`stat.S_IXUSR`" #: ../../library/os.rst:1892 -msgid ":data:`stat.S_IRWXG`" +#, fuzzy +msgid ":const:`stat.S_IRWXG`" msgstr ":data:`stat.S_IRWXG`" #: ../../library/os.rst:1893 -msgid ":data:`stat.S_IRGRP`" +#, fuzzy +msgid ":const:`stat.S_IRGRP`" msgstr ":data:`stat.S_IRGRP`" #: ../../library/os.rst:1894 -msgid ":data:`stat.S_IWGRP`" +#, fuzzy +msgid ":const:`stat.S_IWGRP`" msgstr ":data:`stat.S_IWGRP`" #: ../../library/os.rst:1895 -msgid ":data:`stat.S_IXGRP`" +#, fuzzy +msgid ":const:`stat.S_IXGRP`" msgstr ":data:`stat.S_IXGRP`" #: ../../library/os.rst:1896 -msgid ":data:`stat.S_IRWXO`" +#, fuzzy +msgid ":const:`stat.S_IRWXO`" msgstr ":data:`stat.S_IRWXO`" #: ../../library/os.rst:1897 -msgid ":data:`stat.S_IROTH`" +#, fuzzy +msgid ":const:`stat.S_IROTH`" msgstr ":data:`stat.S_IROTH`" #: ../../library/os.rst:1898 -msgid ":data:`stat.S_IWOTH`" +#, fuzzy +msgid ":const:`stat.S_IWOTH`" msgstr ":data:`stat.S_IWOTH`" #: ../../library/os.rst:1899 -msgid ":data:`stat.S_IXOTH`" +#, fuzzy +msgid ":const:`stat.S_IXOTH`" msgstr ":data:`stat.S_IXOTH`" #: ../../library/os.rst:1901 ../../library/os.rst:1929 @@ -4178,12 +4209,13 @@ msgstr "" #: ../../library/os.rst:3923 msgid "" -"Windows: The :data:`signal.CTRL_C_EVENT` and :data:`signal.CTRL_BREAK_EVENT` " -"signals are special signals which can only be sent to console processes " -"which share a common console window, e.g., some subprocesses. Any other " -"value for *sig* will cause the process to be unconditionally killed by the " -"TerminateProcess API, and the exit code will be set to *sig*. The Windows " -"version of :func:`kill` additionally takes process handles to be killed." +"Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." +"CTRL_BREAK_EVENT` signals are special signals which can only be sent to " +"console processes which share a common console window, e.g., some " +"subprocesses. Any other value for *sig* will cause the process to be " +"unconditionally killed by the TerminateProcess API, and the exit code will " +"be set to *sig*. The Windows version of :func:`kill` additionally takes " +"process handles to be killed." msgstr "" #: ../../library/os.rst:3931 @@ -4360,7 +4392,7 @@ msgid "" "value specified. If the value specified is 0, the child's process group ID " "will be made the same as its process ID. If the value of *setpgroup* is not " "set, the child will inherit the parent's process group ID. This argument " -"corresponds to the C library :c:data:`POSIX_SPAWN_SETPGROUP` flag." +"corresponds to the C library :c:macro:`POSIX_SPAWN_SETPGROUP` flag." msgstr "" #: ../../library/os.rst:4073 @@ -4371,13 +4403,13 @@ msgid "" "the parent. In either case, if the set-user-ID and set-group-ID permission " "bits are enabled on the executable file, their effect will override the " "setting of the effective UID and GID. This argument corresponds to the C " -"library :c:data:`POSIX_SPAWN_RESETIDS` flag." +"library :c:macro:`POSIX_SPAWN_RESETIDS` flag." msgstr "" #: ../../library/os.rst:4081 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " -"``posix_spawn``. *setsid* requires :c:data:`POSIX_SPAWN_SETSID` or :c:data:" +"``posix_spawn``. *setsid* requires :c:macro:`POSIX_SPAWN_SETSID` or :c:macro:" "`POSIX_SPAWN_SETSID_NP` flag. Otherwise, :exc:`NotImplementedError` is " "raised." msgstr "" @@ -4386,14 +4418,14 @@ msgstr "" msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " -"parent's signal mask. This argument corresponds to the C library :c:data:" +"parent's signal mask. This argument corresponds to the C library :c:macro:" "`POSIX_SPAWN_SETSIGMASK` flag." msgstr "" #: ../../library/os.rst:4091 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " -"specified. This argument corresponds to the C library :c:data:" +"specified. This argument corresponds to the C library :c:macro:" "`POSIX_SPAWN_SETSIGDEF` flag." msgstr "" @@ -4403,7 +4435,7 @@ msgid "" "policy and an instance of :class:`sched_param` with the scheduler " "parameters. A value of ``None`` in the place of the scheduler policy " "indicates that is not being provided. This argument is a combination of the " -"C library :c:data:`POSIX_SPAWN_SETSCHEDPARAM` and :c:data:" +"C library :c:macro:`POSIX_SPAWN_SETSCHEDPARAM` and :c:macro:" "`POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" @@ -4807,7 +4839,7 @@ msgstr "" #: ../../library/os.rst:4412 msgid "" "The return value is an object representing the data contained in the :c:type:" -"`!siginfo_t` structure with the following attributes:" +"`siginfo_t` structure with the following attributes:" msgstr "" #: ../../library/os.rst:4415 @@ -4819,7 +4851,7 @@ msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" #: ../../library/os.rst:4417 -msgid ":attr:`!si_signo` (always :data:`~signal.SIGCHLD`)" +msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" #: ../../library/os.rst:4418 @@ -5067,7 +5099,7 @@ msgstr "" #: ../../library/os.rst:4654 msgid "" -"Return ``True`` if a stopped child has been resumed by delivery of :data:" +"Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" @@ -5435,7 +5467,7 @@ msgstr "" #: ../../library/os.rst:5026 msgid "" "The flags argument is a bit mask that can contain zero or more of the " -"following values ORed together: :py:data:`os.GRND_RANDOM` and :py:data:" +"following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" diff --git a/library/platform.po b/library/platform.po index 0d043e0ab4..e23b247ab5 100644 --- a/library/platform.po +++ b/library/platform.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-10 00:16+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-06-11 14:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -62,8 +62,8 @@ msgid "" "supported pointer size." msgstr "" "無法確定的值將回傳參數所給定之預先設置值。如果給定的位元為 ``''``\\ ,則會使" -"用 ``sizeof(pointer)``\\ (或者當 Python 版本 < 1.5.2 時為 ``sizeof(long)``" -"\\ )作為所支援指標大小的指示器 (indicator)。" +"用 ``sizeof(pointer)``\\ (或者當 Python 版本 < 1.5.2 時為 " +"``sizeof(long)``\\ )作為所支援指標大小的指示器 (indicator)。" #: ../../library/platform.rst:38 msgid "" @@ -84,9 +84,10 @@ msgstr "" "在 macOS(也許還有其他平臺)上,可執行檔案可能是包含多種架構的通用檔案。" #: ../../library/platform.rst:48 +#, fuzzy msgid "" "To get at the \"64-bitness\" of the current interpreter, it is more reliable " -"to query the :attr:`sys.maxsize` attribute::" +"to query the :data:`sys.maxsize` attribute::" msgstr "" "要獲取當前直譯器的 \"64 位元性 (64-bitness)\",更可靠的做法是查詢 :attr:`sys." "maxsize` 屬性:\n" @@ -226,8 +227,8 @@ msgid "" "Returns the system/OS name, such as ``'Linux'``, ``'Darwin'``, ``'Java'``, " "``'Windows'``. An empty string is returned if the value cannot be determined." msgstr "" -"回傳系統/OS 的名稱,例如 ``'Linux'``\\ 、\\ ``'Darwin'``\\ 、\\ ``'Java'``" -"\\ 、\\ ``'Windows'``\\ 。如果該值無法確定則回傳一個空字串。" +"回傳系統/OS 的名稱,例如 ``'Linux'``\\ 、\\ ``'Darwin'``\\ 、\\ " +"``'Java'``\\ 、\\ ``'Windows'``\\ 。如果該值無法確定則回傳一個空字串。" #: ../../library/platform.rst:154 msgid "" @@ -235,8 +236,8 @@ msgid "" "used for some systems. It also does some reordering of the information in " "some cases where it would otherwise cause confusion." msgstr "" -"回傳做為某些系統所使用的常見行銷名稱之別名的 ``(system, release, version)``" -"\\ 。它還會在可能導致混淆的情況下對資訊進行一些重新排序。" +"回傳做為某些系統所使用的常見行銷名稱之別名的 ``(system, release, " +"version)``\\ 。它還會在可能導致混淆的情況下對資訊進行一些重新排序。" #: ../../library/platform.rst:161 msgid "" @@ -332,16 +333,17 @@ msgid "" "to ``'Enterprise'``, ``'IoTUAP'``, ``'ServerStandard'``, and " "``'nanoserver'``." msgstr "" -"回傳一個代表當前 Windows 版本的字串。可能的值包括但不限於 ``'Enterprise'``" -"\\ 、\\ ``'IoTUAP'``\\ 、\\ ``'ServerStandard'`` 和 ``'nanoserver'``\\ 。" +"回傳一個代表當前 Windows 版本的字串。可能的值包括但不限於 " +"``'Enterprise'``\\ 、\\ ``'IoTUAP'``\\ 、\\ ``'ServerStandard'`` 和 " +"``'nanoserver'``\\ 。" #: ../../library/platform.rst:224 msgid "" "Return ``True`` if the Windows edition returned by :func:`win32_edition` is " "recognized as an IoT edition." msgstr "" -"如果 :func:`win32_edition` 回傳的 Windows 版本被識別為 IoT 版則回傳 ``True``" -"\\ 。" +"如果 :func:`win32_edition` 回傳的 Windows 版本被識別為 IoT 版則回傳 " +"``True``\\ 。" #: ../../library/platform.rst:231 msgid "macOS Platform" @@ -353,8 +355,8 @@ msgid "" "versioninfo, machine)`` with *versioninfo* being a tuple ``(version, " "dev_stage, non_release_version)``." msgstr "" -"獲取 Mac OS 版本資訊並將其回傳為 tuple ``(release, versioninfo, machine)``" -"\\ ,其中 *versioninfo* 是一個 tuple ``(version, dev_stage, " +"獲取 Mac OS 版本資訊並將其回傳為 tuple ``(release, versioninfo, " +"machine)``\\ ,其中 *versioninfo* 是一個 tuple ``(version, dev_stage, " "non_release_version)``\\ 。" #: ../../library/platform.rst:240 @@ -423,8 +425,8 @@ msgid "" "defined according to the standard. All other fields are optional. Vendors " "may include additional fields." msgstr "" -"成功時,該函式將回傳一個字典,其中鍵和值均為字串。值當中的特殊字元例如 ``" -"\"`` 和 ``$`` 會被移除引號 (unquoted)。欄位 ``NAME``\\ 、\\ ``ID`` 和 " +"成功時,該函式將回傳一個字典,其中鍵和值均為字串。值當中的特殊字元例如 " +"``\"`` 和 ``$`` 會被移除引號 (unquoted)。欄位 ``NAME``\\ 、\\ ``ID`` 和 " "``PRETTY_NAME`` 總會按照標準來定義。所有其他欄位都是可選的。根據不同廠商可能" "會包括額外的欄位。" diff --git a/library/poplib.po b/library/poplib.po index 911c723bd1..7349d4c65c 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,7 +125,7 @@ msgstr "" #: ../../library/poplib.rst:81 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/poplib.rst:88 @@ -305,7 +305,7 @@ msgstr "" #: ../../library/poplib.rst:249 msgid "" "This method supports hostname checking via :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/poplib.rst:256 diff --git a/library/random.po b/library/random.po index eda5bbb325..5035151cab 100644 --- a/library/random.po +++ b/library/random.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-15 00:31+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2023-01-23 22:47+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -262,8 +262,9 @@ msgstr "" "為 ``randrange(10)``。將來,這將會引發 :exc:`TypeError`。" #: ../../library/random.rst:143 +#, fuzzy msgid "" -"The exception raised for non-integral values such as ``randrange(10.5)`` or " +"The exception raised for non-integer values such as ``randrange(10.5)`` or " "``randrange('10')`` will be changed from :exc:`ValueError` to :exc:" "`TypeError`." msgstr "" diff --git a/library/re.po b/library/re.po index 30cb0d393f..24a3821fd9 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -146,7 +146,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1530 +#: ../../library/re.rst:104 ../../library/re.rst:1543 msgid "``.``" msgstr "``.``" @@ -694,14 +694,14 @@ msgid "" "``''``." msgstr "" -#: ../../library/re.rst:497 ../../library/re.rst:1020 +#: ../../library/re.rst:497 ../../library/re.rst:1033 msgid "" "Group *id* containing anything except ASCII digits. Group *name* containing " "characters outside the ASCII range (``b'\\x00'``-``b'\\x7f'``) in :class:" "`bytes` replacement strings." msgstr "" -#: ../../library/re.rst:503 +#: ../../library/re.rst:505 msgid "" "The special sequences consist of ``'\\'`` and a character from the list " "below. If the ordinary character is not an ASCII digit or an ASCII letter, " @@ -709,11 +709,11 @@ msgid "" "matches the character ``'$'``." msgstr "" -#: ../../library/re.rst:518 +#: ../../library/re.rst:520 msgid "``\\number``" msgstr "``\\number``" -#: ../../library/re.rst:511 +#: ../../library/re.rst:513 msgid "" "Matches the contents of the group of the same number. Groups are numbered " "starting from 1. For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 " @@ -725,19 +725,19 @@ msgid "" "escapes are treated as characters." msgstr "" -#: ../../library/re.rst:523 +#: ../../library/re.rst:525 msgid "``\\A``" msgstr "``\\A``" -#: ../../library/re.rst:523 +#: ../../library/re.rst:525 msgid "Matches only at the start of the string." msgstr "" -#: ../../library/re.rst:539 +#: ../../library/re.rst:541 msgid "``\\b``" msgstr "``\\b``" -#: ../../library/re.rst:528 +#: ../../library/re.rst:530 msgid "" "Matches the empty string, but only at the beginning or end of a word. A word " "is defined as a sequence of word characters. Note that formally, ``\\b`` is " @@ -747,7 +747,7 @@ msgid "" "baz'`` but not ``'foobar'`` or ``'foo3'``." msgstr "" -#: ../../library/re.rst:535 +#: ../../library/re.rst:537 msgid "" "By default Unicode alphanumerics are the ones used in Unicode patterns, but " "this can be changed by using the :const:`ASCII` flag. Word boundaries are " @@ -756,11 +756,11 @@ msgid "" "compatibility with Python's string literals." msgstr "" -#: ../../library/re.rst:550 +#: ../../library/re.rst:552 msgid "``\\B``" msgstr "``\\B``" -#: ../../library/re.rst:544 +#: ../../library/re.rst:546 msgid "" "Matches the empty string, but only when it is *not* at the beginning or end " "of a word. This means that ``r'py\\B'`` matches ``'python'``, ``'py3'``, " @@ -771,15 +771,15 @@ msgid "" "the :const:`LOCALE` flag is used." msgstr "" -#: ../../library/re.rst:562 +#: ../../library/re.rst:564 msgid "``\\d``" msgstr "``\\d``" -#: ../../library/re.rst:559 ../../library/re.rst:579 ../../library/re.rst:598 +#: ../../library/re.rst:561 ../../library/re.rst:581 ../../library/re.rst:600 msgid "For Unicode (str) patterns:" msgstr "" -#: ../../library/re.rst:556 +#: ../../library/re.rst:558 msgid "" "Matches any Unicode decimal digit (that is, any character in Unicode " "character category [Nd]). This includes ``[0-9]``, and also many other " @@ -787,30 +787,30 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:562 ../../library/re.rst:583 ../../library/re.rst:604 +#: ../../library/re.rst:564 ../../library/re.rst:585 ../../library/re.rst:606 msgid "For 8-bit (bytes) patterns:" msgstr "" -#: ../../library/re.rst:562 +#: ../../library/re.rst:564 msgid "Matches any decimal digit; this is equivalent to ``[0-9]``." msgstr "" -#: ../../library/re.rst:569 +#: ../../library/re.rst:571 msgid "``\\D``" msgstr "``\\D``" -#: ../../library/re.rst:567 +#: ../../library/re.rst:569 msgid "" "Matches any character which is not a decimal digit. This is the opposite of " "``\\d``. If the :const:`ASCII` flag is used this becomes the equivalent of " "``[^0-9]``." msgstr "" -#: ../../library/re.rst:583 +#: ../../library/re.rst:585 msgid "``\\s``" msgstr "``\\s``" -#: ../../library/re.rst:575 +#: ../../library/re.rst:577 msgid "" "Matches Unicode whitespace characters (which includes " "``[ \\t\\n\\r\\f\\v]``, and also many other characters, for example the non-" @@ -818,35 +818,35 @@ msgid "" "const:`ASCII` flag is used, only ``[ \\t\\n\\r\\f\\v]`` is matched." msgstr "" -#: ../../library/re.rst:582 +#: ../../library/re.rst:584 msgid "" "Matches characters considered whitespace in the ASCII character set; this is " "equivalent to ``[ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:590 +#: ../../library/re.rst:592 msgid "``\\S``" msgstr "``\\S``" -#: ../../library/re.rst:588 +#: ../../library/re.rst:590 msgid "" "Matches any character which is not a whitespace character. This is the " "opposite of ``\\s``. If the :const:`ASCII` flag is used this becomes the " "equivalent of ``[^ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:604 +#: ../../library/re.rst:606 msgid "``\\w``" msgstr "``\\w``" -#: ../../library/re.rst:596 +#: ../../library/re.rst:598 msgid "" "Matches Unicode word characters; this includes alphanumeric characters (as " "defined by :meth:`str.isalnum`) as well as the underscore (``_``). If the :" "const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched." msgstr "" -#: ../../library/re.rst:601 +#: ../../library/re.rst:603 msgid "" "Matches characters considered alphanumeric in the ASCII character set; this " "is equivalent to ``[a-zA-Z0-9_]``. If the :const:`LOCALE` flag is used, " @@ -854,11 +854,11 @@ msgid "" "underscore." msgstr "" -#: ../../library/re.rst:613 +#: ../../library/re.rst:615 msgid "``\\W``" msgstr "``\\W``" -#: ../../library/re.rst:609 +#: ../../library/re.rst:611 msgid "" "Matches any character which is not a word character. This is the opposite of " "``\\w``. If the :const:`ASCII` flag is used this becomes the equivalent of " @@ -866,34 +866,34 @@ msgid "" "which are neither alphanumeric in the current locale nor the underscore." msgstr "" -#: ../../library/re.rst:618 +#: ../../library/re.rst:620 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../library/re.rst:618 +#: ../../library/re.rst:620 msgid "Matches only at the end of the string." msgstr "" -#: ../../library/re.rst:634 +#: ../../library/re.rst:636 msgid "" "Most of the standard escapes supported by Python string literals are also " "accepted by the regular expression parser::" msgstr "" -#: ../../library/re.rst:641 +#: ../../library/re.rst:643 msgid "" "(Note that ``\\b`` is used to represent word boundaries, and means " "\"backspace\" only inside character classes.)" msgstr "" -#: ../../library/re.rst:644 +#: ../../library/re.rst:646 msgid "" "``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in " "Unicode patterns. In bytes patterns they are errors. Unknown escapes of " "ASCII letters are reserved for future use and treated as errors." msgstr "" -#: ../../library/re.rst:648 +#: ../../library/re.rst:650 msgid "" "Octal escapes are included in a limited form. If the first digit is a 0, or " "if there are three octal digits, it is considered an octal escape. " @@ -901,26 +901,26 @@ msgid "" "are always at most three digits in length." msgstr "" -#: ../../library/re.rst:653 +#: ../../library/re.rst:655 msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added." msgstr "" -#: ../../library/re.rst:656 +#: ../../library/re.rst:658 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors." msgstr "" -#: ../../library/re.rst:659 +#: ../../library/re.rst:661 msgid "" "The ``'\\N{name}'`` escape sequence has been added. As in string literals, " "it expands to the named Unicode character (e.g. ``'\\N{EM DASH}'``)." msgstr "" -#: ../../library/re.rst:667 +#: ../../library/re.rst:669 msgid "Module Contents" msgstr "模組內容" -#: ../../library/re.rst:669 +#: ../../library/re.rst:671 msgid "" "The module defines several functions, constants, and an exception. Some of " "the functions are simplified versions of the full featured methods for " @@ -928,26 +928,26 @@ msgid "" "compiled form." msgstr "" -#: ../../library/re.rst:676 +#: ../../library/re.rst:678 msgid "Flags" msgstr "" -#: ../../library/re.rst:678 +#: ../../library/re.rst:680 msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" -#: ../../library/re.rst:685 +#: ../../library/re.rst:687 msgid "" "An :class:`enum.IntFlag` class containing the regex options listed below." msgstr "" -#: ../../library/re.rst:687 +#: ../../library/re.rst:689 msgid "- added to ``__all__``" msgstr "" -#: ../../library/re.rst:692 +#: ../../library/re.rst:694 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " "``\\S`` perform ASCII-only matching instead of full Unicode matching. This " @@ -955,7 +955,7 @@ msgid "" "Corresponds to the inline flag ``(?a)``." msgstr "" -#: ../../library/re.rst:697 +#: ../../library/re.rst:699 msgid "" "Note that for backward compatibility, the :const:`re.U` flag still exists " "(as well as its synonym :const:`re.UNICODE` and its embedded counterpart ``(?" @@ -963,13 +963,13 @@ msgid "" "default for strings (and Unicode matching isn't allowed for bytes)." msgstr "" -#: ../../library/re.rst:706 +#: ../../library/re.rst:708 msgid "" "Display debug information about compiled expression. No corresponding inline " "flag." msgstr "" -#: ../../library/re.rst:713 +#: ../../library/re.rst:715 msgid "" "Perform case-insensitive matching; expressions like ``[A-Z]`` will also " "match lowercase letters. Full Unicode matching (such as ``Ü`` matching " @@ -979,7 +979,7 @@ msgid "" "flag ``(?i)``." msgstr "" -#: ../../library/re.rst:720 +#: ../../library/re.rst:722 msgid "" "Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in " "combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " @@ -990,7 +990,7 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:731 +#: ../../library/re.rst:733 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale. This flag can be used only with bytes " @@ -1001,20 +1001,20 @@ msgid "" "locales/languages. Corresponds to the inline flag ``(?L)``." msgstr "" -#: ../../library/re.rst:740 +#: ../../library/re.rst:742 msgid "" ":const:`re.LOCALE` can be used only with bytes patterns and is not " "compatible with :const:`re.ASCII`." msgstr "" -#: ../../library/re.rst:744 +#: ../../library/re.rst:746 msgid "" "Compiled regular expression objects with the :const:`re.LOCALE` flag no " "longer depend on the locale at compile time. Only the locale at matching " "time affects the result of matching." msgstr "" -#: ../../library/re.rst:753 +#: ../../library/re.rst:755 msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -1025,7 +1025,7 @@ msgid "" "the end of the string. Corresponds to the inline flag ``(?m)``." msgstr "" -#: ../../library/re.rst:763 +#: ../../library/re.rst:765 msgid "" "Indicates no flag being applied, the value is ``0``. This flag may be used " "as a default value for a function keyword argument or as a base value that " @@ -1033,7 +1033,7 @@ msgid "" "value::" msgstr "" -#: ../../library/re.rst:776 +#: ../../library/re.rst:778 msgid "" "Make the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline. " @@ -1042,6 +1042,21 @@ msgstr "" #: ../../library/re.rst:786 msgid "" +"In Python 2, this flag made :ref:`special sequences ` " +"include Unicode characters in matches. Since Python 3, Unicode characters " +"are matched by default." +msgstr "" + +#: ../../library/re.rst:790 +msgid "See :const:`A` for restricting matching on ASCII characters instead." +msgstr "" + +#: ../../library/re.rst:792 +msgid "This flag is only kept for backward compatibility." +msgstr "" + +#: ../../library/re.rst:799 +msgid "" "This flag allows you to write regular expressions that look nicer and are " "more readable by allowing you to visually separate logical sections of the " "pattern and add comments. Whitespace within the pattern is ignored, except " @@ -1053,53 +1068,53 @@ msgid "" "ignored." msgstr "" -#: ../../library/re.rst:796 +#: ../../library/re.rst:809 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: ../../library/re.rst:804 +#: ../../library/re.rst:817 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: ../../library/re.rst:808 +#: ../../library/re.rst:821 msgid "Functions" msgstr "" -#: ../../library/re.rst:812 +#: ../../library/re.rst:825 msgid "" "Compile a regular expression pattern into a :ref:`regular expression object " "`, which can be used for matching using its :func:`~Pattern." "match`, :func:`~Pattern.search` and other methods, described below." msgstr "" -#: ../../library/re.rst:817 +#: ../../library/re.rst:830 msgid "" "The expression's behaviour can be modified by specifying a *flags* value. " "Values can be any of the following variables, combined using bitwise OR (the " "``|`` operator)." msgstr "" -#: ../../library/re.rst:821 +#: ../../library/re.rst:834 msgid "The sequence ::" msgstr "" -#: ../../library/re.rst:826 +#: ../../library/re.rst:839 msgid "is equivalent to ::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/re.rst:830 +#: ../../library/re.rst:843 msgid "" "but using :func:`re.compile` and saving the resulting regular expression " "object for reuse is more efficient when the expression will be used several " "times in a single program." msgstr "" -#: ../../library/re.rst:836 +#: ../../library/re.rst:849 msgid "" "The compiled versions of the most recent patterns passed to :func:`re." "compile` and the module-level matching functions are cached, so programs " @@ -1107,7 +1122,7 @@ msgid "" "compiling regular expressions." msgstr "" -#: ../../library/re.rst:844 +#: ../../library/re.rst:857 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :ref:" @@ -1116,7 +1131,7 @@ msgid "" "length match at some point in the string." msgstr "" -#: ../../library/re.rst:853 +#: ../../library/re.rst:866 msgid "" "If zero or more characters at the beginning of *string* match the regular " "expression *pattern*, return a corresponding :ref:`match object `. Return ``None`` if the " @@ -1144,7 +1159,7 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:877 +#: ../../library/re.rst:890 msgid "" "Split *string* by the occurrences of *pattern*. If capturing parentheses " "are used in *pattern*, then the text of all groups in the pattern are also " @@ -1153,42 +1168,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:892 +#: ../../library/re.rst:905 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" -#: ../../library/re.rst:899 +#: ../../library/re.rst:912 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:902 +#: ../../library/re.rst:915 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:912 ../../library/re.rst:1002 ../../library/re.rst:1031 +#: ../../library/re.rst:925 ../../library/re.rst:1015 ../../library/re.rst:1044 msgid "Added the optional flags argument." msgstr "" -#: ../../library/re.rst:915 +#: ../../library/re.rst:928 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:921 +#: ../../library/re.rst:934 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " "strings or tuples. The *string* is scanned left-to-right, and matches are " "returned in the order found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:925 +#: ../../library/re.rst:938 msgid "" "The result depends on the number of capturing groups in the pattern. If " "there are no groups, return a list of strings matching the whole pattern. " @@ -1198,11 +1213,11 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:937 ../../library/re.rst:948 +#: ../../library/re.rst:950 ../../library/re.rst:961 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:943 +#: ../../library/re.rst:956 msgid "" "Return an :term:`iterator` yielding :ref:`match objects ` " "over all non-overlapping matches for the RE *pattern* in *string*. The " @@ -1210,7 +1225,7 @@ msgid "" "found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:954 +#: ../../library/re.rst:967 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1224,18 +1239,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:970 +#: ../../library/re.rst:983 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :ref:`match object ` argument, and returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:982 +#: ../../library/re.rst:995 msgid "The pattern may be a string or a :ref:`pattern object `." msgstr "" -#: ../../library/re.rst:984 +#: ../../library/re.rst:997 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1244,7 +1259,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:992 +#: ../../library/re.rst:1005 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1257,53 +1272,53 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:1005 ../../library/re.rst:1034 -#: ../../library/re.rst:1268 +#: ../../library/re.rst:1018 ../../library/re.rst:1047 +#: ../../library/re.rst:1281 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:1008 +#: ../../library/re.rst:1021 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:1012 +#: ../../library/re.rst:1025 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:1016 +#: ../../library/re.rst:1029 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:1028 +#: ../../library/re.rst:1041 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:1040 +#: ../../library/re.rst:1053 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: ../../library/re.rst:1055 +#: ../../library/re.rst:1068 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: ../../library/re.rst:1063 +#: ../../library/re.rst:1076 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:1066 +#: ../../library/re.rst:1079 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1311,15 +1326,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:1075 +#: ../../library/re.rst:1088 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:1079 +#: ../../library/re.rst:1092 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:1083 +#: ../../library/re.rst:1096 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " @@ -1328,41 +1343,41 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:1091 +#: ../../library/re.rst:1104 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1095 +#: ../../library/re.rst:1108 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1099 +#: ../../library/re.rst:1112 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1103 +#: ../../library/re.rst:1116 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1107 +#: ../../library/re.rst:1120 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1109 +#: ../../library/re.rst:1122 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1115 +#: ../../library/re.rst:1128 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1117 +#: ../../library/re.rst:1130 msgid "" "Compiled regular expression objects support the following methods and " "attributes:" msgstr "" -#: ../../library/re.rst:1122 +#: ../../library/re.rst:1135 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :ref:`match object " @@ -1371,7 +1386,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:1128 +#: ../../library/re.rst:1141 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1380,7 +1395,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1134 +#: ../../library/re.rst:1147 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1390,7 +1405,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1149 +#: ../../library/re.rst:1162 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :ref:`match object `. " @@ -1398,19 +1413,19 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:1154 ../../library/re.rst:1172 +#: ../../library/re.rst:1167 ../../library/re.rst:1185 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1162 +#: ../../library/re.rst:1175 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:1168 +#: ../../library/re.rst:1181 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :ref:`match object `. Return ``None`` if the " @@ -1418,76 +1433,76 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:1186 +#: ../../library/re.rst:1199 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1191 +#: ../../library/re.rst:1204 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1198 +#: ../../library/re.rst:1211 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1205 +#: ../../library/re.rst:1218 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1210 +#: ../../library/re.rst:1223 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1215 +#: ../../library/re.rst:1228 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :data:`UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1222 +#: ../../library/re.rst:1235 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1227 +#: ../../library/re.rst:1240 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: ../../library/re.rst:1234 +#: ../../library/re.rst:1247 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1237 +#: ../../library/re.rst:1250 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1245 +#: ../../library/re.rst:1258 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1247 +#: ../../library/re.rst:1260 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: ../../library/re.rst:1256 +#: ../../library/re.rst:1269 msgid "Match objects support the following methods and attributes:" msgstr "" -#: ../../library/re.rst:1261 +#: ../../library/re.rst:1274 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1496,7 +1511,7 @@ msgid "" "``\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1273 +#: ../../library/re.rst:1286 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1511,7 +1526,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1295 +#: ../../library/re.rst:1308 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1519,57 +1534,57 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1300 +#: ../../library/re.rst:1313 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1308 +#: ../../library/re.rst:1321 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1315 +#: ../../library/re.rst:1328 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1324 +#: ../../library/re.rst:1337 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1335 +#: ../../library/re.rst:1348 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1348 +#: ../../library/re.rst:1361 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1352 ../../library/re.rst:1577 +#: ../../library/re.rst:1365 ../../library/re.rst:1590 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1358 +#: ../../library/re.rst:1371 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1371 +#: ../../library/re.rst:1384 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1383 +#: ../../library/re.rst:1396 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1578,7 +1593,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1391 +#: ../../library/re.rst:1404 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1586,32 +1601,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1396 +#: ../../library/re.rst:1409 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1406 +#: ../../library/re.rst:1419 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1413 +#: ../../library/re.rst:1426 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1420 +#: ../../library/re.rst:1433 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1427 +#: ../../library/re.rst:1440 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1620,43 +1635,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1436 +#: ../../library/re.rst:1449 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1442 +#: ../../library/re.rst:1455 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1448 +#: ../../library/re.rst:1461 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1451 +#: ../../library/re.rst:1464 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1459 +#: ../../library/re.rst:1472 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1463 +#: ../../library/re.rst:1476 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1465 +#: ../../library/re.rst:1478 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1473 +#: ../../library/re.rst:1486 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1664,154 +1679,154 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1478 +#: ../../library/re.rst:1491 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1488 +#: ../../library/re.rst:1501 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1498 +#: ../../library/re.rst:1511 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1517 +#: ../../library/re.rst:1530 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1521 +#: ../../library/re.rst:1534 msgid "" -"Python does not currently have an equivalent to :c:func:`scanf`. Regular " +"Python does not currently have an equivalent to :c:func:`!scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" -"func:`scanf` format strings. The table below offers some more-or-less " -"equivalent mappings between :c:func:`scanf` format tokens and regular " +"func:`!scanf` format strings. The table below offers some more-or-less " +"equivalent mappings between :c:func:`!scanf` format tokens and regular " "expressions." msgstr "" -#: ../../library/re.rst:1528 -msgid ":c:func:`scanf` Token" +#: ../../library/re.rst:1541 +msgid ":c:func:`!scanf` Token" msgstr "" -#: ../../library/re.rst:1528 +#: ../../library/re.rst:1541 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1530 +#: ../../library/re.rst:1543 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1545 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1545 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1547 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1547 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1549 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1549 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1538 +#: ../../library/re.rst:1551 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1538 +#: ../../library/re.rst:1551 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1540 +#: ../../library/re.rst:1553 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1540 +#: ../../library/re.rst:1553 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1542 +#: ../../library/re.rst:1555 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1542 +#: ../../library/re.rst:1555 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1544 +#: ../../library/re.rst:1557 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1544 +#: ../../library/re.rst:1557 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1546 +#: ../../library/re.rst:1559 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1546 +#: ../../library/re.rst:1559 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1549 +#: ../../library/re.rst:1562 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1553 -msgid "you would use a :c:func:`scanf` format like ::" +#: ../../library/re.rst:1566 +msgid "you would use a :c:func:`!scanf` format like ::" msgstr "" -#: ../../library/re.rst:1557 +#: ../../library/re.rst:1570 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1565 +#: ../../library/re.rst:1578 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1569 +#: ../../library/re.rst:1582 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1571 +#: ../../library/re.rst:1584 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1572 +#: ../../library/re.rst:1585 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1574 +#: ../../library/re.rst:1587 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1586 +#: ../../library/re.rst:1599 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1594 +#: ../../library/re.rst:1607 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1819,11 +1834,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1604 +#: ../../library/re.rst:1617 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1606 +#: ../../library/re.rst:1619 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1831,37 +1846,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1611 +#: ../../library/re.rst:1624 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1624 +#: ../../library/re.rst:1637 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1637 +#: ../../library/re.rst:1650 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1650 +#: ../../library/re.rst:1663 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1665 +#: ../../library/re.rst:1678 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1667 +#: ../../library/re.rst:1680 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1869,11 +1884,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1684 +#: ../../library/re.rst:1697 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1686 +#: ../../library/re.rst:1699 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1881,11 +1896,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1697 +#: ../../library/re.rst:1710 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1699 +#: ../../library/re.rst:1712 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :ref:`match objects " @@ -1894,11 +1909,11 @@ msgid "" "text, they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1713 +#: ../../library/re.rst:1726 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1715 +#: ../../library/re.rst:1728 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1906,7 +1921,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1725 +#: ../../library/re.rst:1738 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1914,29 +1929,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1737 +#: ../../library/re.rst:1750 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1739 +#: ../../library/re.rst:1752 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1743 +#: ../../library/re.rst:1756 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1799 +#: ../../library/re.rst:1812 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1822 +#: ../../library/re.rst:1835 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " @@ -1956,12 +1971,12 @@ msgstr "" #: ../../library/re.rst:309 ../../library/re.rst:319 ../../library/re.rst:345 #: ../../library/re.rst:394 ../../library/re.rst:425 ../../library/re.rst:431 #: ../../library/re.rst:436 ../../library/re.rst:443 ../../library/re.rst:450 -#: ../../library/re.rst:477 ../../library/re.rst:487 ../../library/re.rst:508 -#: ../../library/re.rst:520 ../../library/re.rst:525 ../../library/re.rst:541 -#: ../../library/re.rst:552 ../../library/re.rst:564 ../../library/re.rst:571 -#: ../../library/re.rst:585 ../../library/re.rst:592 ../../library/re.rst:606 -#: ../../library/re.rst:615 ../../library/re.rst:620 ../../library/re.rst:784 -#: ../../library/re.rst:990 +#: ../../library/re.rst:477 ../../library/re.rst:487 ../../library/re.rst:510 +#: ../../library/re.rst:522 ../../library/re.rst:527 ../../library/re.rst:543 +#: ../../library/re.rst:554 ../../library/re.rst:566 ../../library/re.rst:573 +#: ../../library/re.rst:587 ../../library/re.rst:594 ../../library/re.rst:608 +#: ../../library/re.rst:617 ../../library/re.rst:622 ../../library/re.rst:797 +#: ../../library/re.rst:1003 msgid "in regular expressions" msgstr "" @@ -2013,7 +2028,7 @@ msgstr "" msgid "{} (curly brackets)" msgstr "" -#: ../../library/re.rst:220 ../../library/re.rst:257 ../../library/re.rst:508 +#: ../../library/re.rst:220 ../../library/re.rst:257 ../../library/re.rst:510 msgid "\\ (backslash)" msgstr "" @@ -2073,98 +2088,98 @@ msgstr "" msgid "(?(" msgstr "" -#: ../../library/re.rst:520 +#: ../../library/re.rst:522 msgid "\\A" msgstr "" -#: ../../library/re.rst:525 ../../library/re.rst:620 +#: ../../library/re.rst:527 ../../library/re.rst:622 msgid "\\b" msgstr "" -#: ../../library/re.rst:541 +#: ../../library/re.rst:543 msgid "\\B" msgstr "" -#: ../../library/re.rst:552 +#: ../../library/re.rst:554 msgid "\\d" msgstr "" -#: ../../library/re.rst:564 +#: ../../library/re.rst:566 msgid "\\D" msgstr "" -#: ../../library/re.rst:571 +#: ../../library/re.rst:573 msgid "\\s" msgstr "" -#: ../../library/re.rst:585 +#: ../../library/re.rst:587 msgid "\\S" msgstr "" -#: ../../library/re.rst:592 +#: ../../library/re.rst:594 msgid "\\w" msgstr "" -#: ../../library/re.rst:606 +#: ../../library/re.rst:608 msgid "\\W" msgstr "" -#: ../../library/re.rst:615 +#: ../../library/re.rst:617 msgid "\\Z" msgstr "" -#: ../../library/re.rst:620 +#: ../../library/re.rst:622 msgid "\\a" msgstr "" -#: ../../library/re.rst:620 +#: ../../library/re.rst:622 msgid "\\f" msgstr "" -#: ../../library/re.rst:620 +#: ../../library/re.rst:622 msgid "\\n" msgstr "" -#: ../../library/re.rst:620 +#: ../../library/re.rst:622 msgid "\\N" msgstr "" -#: ../../library/re.rst:620 +#: ../../library/re.rst:622 msgid "\\r" msgstr "" -#: ../../library/re.rst:620 +#: ../../library/re.rst:622 msgid "\\t" msgstr "" -#: ../../library/re.rst:620 +#: ../../library/re.rst:622 msgid "\\u" msgstr "" -#: ../../library/re.rst:620 +#: ../../library/re.rst:622 msgid "\\U" msgstr "" -#: ../../library/re.rst:620 +#: ../../library/re.rst:622 msgid "\\v" msgstr "" -#: ../../library/re.rst:620 +#: ../../library/re.rst:622 msgid "\\x" msgstr "" -#: ../../library/re.rst:620 +#: ../../library/re.rst:622 msgid "\\\\" msgstr "" -#: ../../library/re.rst:784 +#: ../../library/re.rst:797 msgid "# (hash)" msgstr "" -#: ../../library/re.rst:990 +#: ../../library/re.rst:1003 msgid "\\g" msgstr "" -#: ../../library/re.rst:1519 +#: ../../library/re.rst:1532 msgid "scanf()" msgstr "" diff --git a/library/select.po b/library/select.po index f7ec95723f..e06afb5061 100644 --- a/library/select.po +++ b/library/select.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -24,13 +24,13 @@ msgstr "" #: ../../library/select.rst:9 msgid "" -"This module provides access to the :c:func:`select` and :c:func:`poll` " -"functions available in most operating systems, :c:func:`devpoll` available " -"on Solaris and derivatives, :c:func:`epoll` available on Linux 2.5+ and :c:" -"func:`kqueue` available on most BSD. Note that on Windows, it only works for " -"sockets; on other operating systems, it also works for other file types (in " -"particular, on Unix, it works on pipes). It cannot be used on regular files " -"to determine whether a file has grown since it was last read." +"This module provides access to the :c:func:`!select` and :c:func:`!poll` " +"functions available in most operating systems, :c:func:`!devpoll` available " +"on Solaris and derivatives, :c:func:`!epoll` available on Linux 2.5+ and :c:" +"func:`!kqueue` available on most BSD. Note that on Windows, it only works " +"for sockets; on other operating systems, it also works for other file types " +"(in particular, on Unix, it works on pipes). It cannot be used on regular " +"files to determine whether a file has grown since it was last read." msgstr "" #: ../../library/select.rst:20 @@ -73,10 +73,10 @@ msgstr "" #: ../../library/select.rst:44 msgid "" -":c:func:`devpoll` objects are linked to the number of file descriptors " +":c:func:`!devpoll` objects are linked to the number of file descriptors " "allowed at the time of instantiation. If your program reduces this value, :c:" -"func:`devpoll` will fail. If your program increases this value, :c:func:" -"`devpoll` may return an incomplete list of active file descriptors." +"func:`!devpoll` will fail. If your program increases this value, :c:func:`!" +"devpoll` may return an incomplete list of active file descriptors." msgstr "" #: ../../library/select.rst:50 ../../library/select.rst:79 @@ -98,7 +98,7 @@ msgstr "" msgid "" "*sizehint* informs epoll about the expected number of events to be " "registered. It must be positive, or ``-1`` to use the default. It is only " -"used on older systems where :c:func:`epoll_create1` is not available; " +"used on older systems where :c:func:`!epoll_create1` is not available; " "otherwise it has no effect (though its value is still checked)." msgstr "" @@ -160,7 +160,7 @@ msgstr "" #: ../../library/select.rst:120 msgid "" -"This is a straightforward interface to the Unix :c:func:`select` system " +"This is a straightforward interface to the Unix :c:func:`!select` system " "call. The first three arguments are iterables of 'waitable objects': either " "integers representing file descriptors or objects with a parameterless " "method named :meth:`~io.IOBase.fileno` returning such an integer:" @@ -210,8 +210,9 @@ msgstr "" #: ../../library/select.rst:156 msgid "" "File objects on Windows are not acceptable, but sockets are. On Windows, " -"the underlying :c:func:`select` function is provided by the WinSock library, " -"and does not handle file descriptors that don't originate from WinSock." +"the underlying :c:func:`!select` function is provided by the WinSock " +"library, and does not handle file descriptors that don't originate from " +"WinSock." msgstr "" #: ../../library/select.rst:161 ../../library/select.rst:267 @@ -227,7 +228,7 @@ msgstr "" msgid "" "The minimum number of bytes which can be written without blocking to a pipe " "when the pipe has been reported as ready for writing by :func:`~select." -"select`, :func:`poll` or another interface in this module. This doesn't " +"select`, :func:`!poll` or another interface in this module. This doesn't " "apply to other kind of file-like objects such as sockets." msgstr "" @@ -245,14 +246,14 @@ msgstr "" #: ../../library/select.rst:187 msgid "" -"Solaris and derivatives have ``/dev/poll``. While :c:func:`select` is " -"O(highest file descriptor) and :c:func:`poll` is O(number of file " +"Solaris and derivatives have ``/dev/poll``. While :c:func:`!select` is " +"O(highest file descriptor) and :c:func:`!poll` is O(number of file " "descriptors), ``/dev/poll`` is O(active file descriptors)." msgstr "" #: ../../library/select.rst:191 msgid "" -"``/dev/poll`` behaviour is very close to the standard :c:func:`poll` object." +"``/dev/poll`` behaviour is very close to the standard :c:func:`!poll` object." msgstr "" #: ../../library/select.rst:197 @@ -279,7 +280,7 @@ msgstr "" #: ../../library/select.rst:224 msgid "" "*eventmask* is an optional bitmask describing the type of events you want to " -"check for. The constants are the same that with :c:func:`poll` object. The " +"check for. The constants are the same that with :c:func:`!poll` object. The " "default value is a combination of the constants :const:`POLLIN`, :const:" "`POLLPRI`, and :const:`POLLOUT`." msgstr "" @@ -288,7 +289,7 @@ msgstr "" msgid "" "Registering a file descriptor that's already registered is not an error, but " "the result is undefined. The appropriate action is to unregister or modify " -"it first. This is an important difference compared with :c:func:`poll`." +"it first. This is an important difference compared with :c:func:`!poll`." msgstr "" #: ../../library/select.rst:239 @@ -515,13 +516,13 @@ msgstr "" #: ../../library/select.rst:379 msgid "" -"The :c:func:`poll` system call, supported on most Unix systems, provides " +"The :c:func:`!poll` system call, supported on most Unix systems, provides " "better scalability for network servers that service many, many clients at " -"the same time. :c:func:`poll` scales better because the system call only " -"requires listing the file descriptors of interest, while :c:func:`select` " +"the same time. :c:func:`!poll` scales better because the system call only " +"requires listing the file descriptors of interest, while :c:func:`!select` " "builds a bitmap, turns on bits for the fds of interest, and then afterward " -"the whole bitmap has to be linearly scanned again. :c:func:`select` is " -"O(highest file descriptor), while :c:func:`poll` is O(number of file " +"the whole bitmap has to be linearly scanned again. :c:func:`!select` is " +"O(highest file descriptor), while :c:func:`!poll` is O(number of file " "descriptors)." msgstr "" diff --git a/library/shelve.po b/library/shelve.po index c7aea2cb91..24dd30afb4 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,9 +48,9 @@ msgstr "" #: ../../library/shelve.rst:28 msgid "" -"By default, pickles created with :data:`pickle.DEFAULT_PROTOCOL` are used to " -"serialize values. The version of the pickle protocol can be specified with " -"the *protocol* parameter." +"By default, pickles created with :const:`pickle.DEFAULT_PROTOCOL` are used " +"to serialize values. The version of the pickle protocol can be specified " +"with the *protocol* parameter." msgstr "" #: ../../library/shelve.rst:32 @@ -70,7 +70,7 @@ msgstr "" #: ../../library/shelve.rst:44 ../../library/shelve.rst:145 msgid "" -":data:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle protocol." +":const:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle protocol." msgstr "" #: ../../library/shelve.rst:48 @@ -157,9 +157,9 @@ msgstr "" #: ../../library/shelve.rst:122 msgid "" -"By default, pickles created with :data:`pickle.DEFAULT_PROTOCOL` are used to " -"serialize values. The version of the pickle protocol can be specified with " -"the *protocol* parameter. See the :mod:`pickle` documentation for a " +"By default, pickles created with :const:`pickle.DEFAULT_PROTOCOL` are used " +"to serialize values. The version of the pickle protocol can be specified " +"with the *protocol* parameter. See the :mod:`pickle` documentation for a " "discussion of the pickle protocols." msgstr "" diff --git a/library/shutil.po b/library/shutil.po index a0f16658e8..e178a1b8ee 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -495,56 +495,63 @@ msgid "" msgstr "" #: ../../library/shutil.rst:398 +msgid "" +"On Unix filesystems, *path* must point to a path within a **mounted** " +"filesystem partition. On those platforms, CPython doesn't attempt to " +"retrieve disk usage information from non-mounted filesystems." +msgstr "" + +#: ../../library/shutil.rst:404 msgid "On Windows, *path* can now be a file or directory." msgstr "" -#: ../../library/shutil.rst:401 +#: ../../library/shutil.rst:407 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/shutil.rst:405 +#: ../../library/shutil.rst:411 msgid "Change owner *user* and/or *group* of the given *path*." msgstr "" -#: ../../library/shutil.rst:407 +#: ../../library/shutil.rst:413 msgid "" "*user* can be a system user name or a uid; the same applies to *group*. At " "least one argument is required." msgstr "" -#: ../../library/shutil.rst:410 +#: ../../library/shutil.rst:416 msgid "See also :func:`os.chown`, the underlying function." msgstr "" -#: ../../library/shutil.rst:412 +#: ../../library/shutil.rst:418 msgid "" "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " "``path``, ``user``, ``group``." msgstr "" -#: ../../library/shutil.rst:414 +#: ../../library/shutil.rst:420 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/shutil.rst:421 +#: ../../library/shutil.rst:427 msgid "" "Return the path to an executable which would be run if the given *cmd* was " "called. If no *cmd* would be called, return ``None``." msgstr "" -#: ../../library/shutil.rst:424 +#: ../../library/shutil.rst:430 msgid "" "*mode* is a permission mask passed to :func:`os.access`, by default " "determining if the file exists and executable." msgstr "" -#: ../../library/shutil.rst:427 +#: ../../library/shutil.rst:433 msgid "" "When no *path* is specified, the results of :func:`os.environ` are used, " -"returning either the \"PATH\" value or a fallback of :attr:`os.defpath`." +"returning either the \"PATH\" value or a fallback of :data:`os.defpath`." msgstr "" -#: ../../library/shutil.rst:430 +#: ../../library/shutil.rst:436 msgid "" "On Windows, the current directory is always prepended to the *path* whether " "or not you use the default or provide your own, which is the behavior the " @@ -555,24 +562,24 @@ msgid "" "directories. For example, on Windows::" msgstr "" -#: ../../library/shutil.rst:443 +#: ../../library/shutil.rst:449 msgid "" "The :class:`bytes` type is now accepted. If *cmd* type is :class:`bytes`, " "the result type is also :class:`bytes`." msgstr "" -#: ../../library/shutil.rst:449 +#: ../../library/shutil.rst:455 msgid "" "This exception collects exceptions that are raised during a multi-file " "operation. For :func:`copytree`, the exception argument is a list of 3-" "tuples (*srcname*, *dstname*, *exception*)." msgstr "" -#: ../../library/shutil.rst:456 +#: ../../library/shutil.rst:462 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:458 +#: ../../library/shutil.rst:464 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -582,51 +589,51 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:466 +#: ../../library/shutil.rst:472 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:468 +#: ../../library/shutil.rst:474 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:470 +#: ../../library/shutil.rst:476 msgid "" "On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB " "instead of 64 KiB) and a :func:`memoryview`-based variant of :func:`shutil." "copyfileobj` is used." msgstr "" -#: ../../library/shutil.rst:474 +#: ../../library/shutil.rst:480 msgid "" "If the fast-copy operation fails and no data was written in the destination " "file then shutil will silently fallback on using less efficient :func:" "`copyfileobj` function internally." msgstr "" -#: ../../library/shutil.rst:483 +#: ../../library/shutil.rst:489 msgid "copytree example" msgstr "" -#: ../../library/shutil.rst:485 +#: ../../library/shutil.rst:491 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:491 +#: ../../library/shutil.rst:497 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:494 +#: ../../library/shutil.rst:500 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:509 +#: ../../library/shutil.rst:515 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:511 +#: ../../library/shutil.rst:517 msgid "" "This example shows how to remove a directory tree on Windows where some of " "the files have their read-only bit set. It uses the onerror callback to " @@ -634,25 +641,25 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:529 +#: ../../library/shutil.rst:535 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:533 +#: ../../library/shutil.rst:539 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:537 +#: ../../library/shutil.rst:543 msgid "" "High-level utilities to create and read compressed and archived files are " "also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules." msgstr "" -#: ../../library/shutil.rst:542 +#: ../../library/shutil.rst:548 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:544 +#: ../../library/shutil.rst:550 msgid "" "*base_name* is the name of the file to create, including the path, minus any " "format-specific extension. *format* is the archive format: one of " @@ -661,14 +668,14 @@ msgid "" "available), or \"xztar\" (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:550 +#: ../../library/shutil.rst:556 msgid "" "*root_dir* is a directory that will be the root directory of the archive, " "all paths in the archive will be relative to it; for example, we typically " "chdir into *root_dir* before creating the archive." msgstr "" -#: ../../library/shutil.rst:554 +#: ../../library/shutil.rst:560 msgid "" "*base_dir* is the directory where we start archiving from; i.e. *base_dir* " "will be the common prefix of all files and directories in the archive. " @@ -676,99 +683,99 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:560 +#: ../../library/shutil.rst:566 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:562 +#: ../../library/shutil.rst:568 msgid "" "If *dry_run* is true, no archive is created, but the operations that would " "be executed are logged to *logger*." msgstr "" -#: ../../library/shutil.rst:565 +#: ../../library/shutil.rst:571 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:568 +#: ../../library/shutil.rst:574 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:571 +#: ../../library/shutil.rst:577 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:573 +#: ../../library/shutil.rst:579 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." msgstr "" -#: ../../library/shutil.rst:577 +#: ../../library/shutil.rst:583 msgid "" "This function is not thread-safe when custom archivers registered with :func:" "`register_archive_format` are used. In this case it temporarily changes the " "current working directory of the process to perform archiving." msgstr "" -#: ../../library/shutil.rst:582 +#: ../../library/shutil.rst:588 msgid "" "The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU " "format for archives created with ``format=\"tar\"``." msgstr "" -#: ../../library/shutil.rst:586 +#: ../../library/shutil.rst:592 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: ../../library/shutil.rst:592 +#: ../../library/shutil.rst:598 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:595 ../../library/shutil.rst:698 +#: ../../library/shutil.rst:601 ../../library/shutil.rst:704 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:597 +#: ../../library/shutil.rst:603 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:598 +#: ../../library/shutil.rst:604 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:599 ../../library/shutil.rst:703 +#: ../../library/shutil.rst:605 ../../library/shutil.rst:709 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:600 ../../library/shutil.rst:704 +#: ../../library/shutil.rst:606 ../../library/shutil.rst:710 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:601 ../../library/shutil.rst:705 +#: ../../library/shutil.rst:607 ../../library/shutil.rst:711 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:603 +#: ../../library/shutil.rst:609 msgid "" "You can register new formats or provide your own archiver for any existing " "formats, by using :func:`register_archive_format`." msgstr "" -#: ../../library/shutil.rst:609 +#: ../../library/shutil.rst:615 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:611 +#: ../../library/shutil.rst:617 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive the *base_name* of the file to create, followed by the " @@ -777,33 +784,33 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:617 +#: ../../library/shutil.rst:623 msgid "" "If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be " "used as extra keywords arguments when the archiver callable is used." msgstr "" -#: ../../library/shutil.rst:620 +#: ../../library/shutil.rst:626 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:626 +#: ../../library/shutil.rst:632 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:631 +#: ../../library/shutil.rst:637 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:633 +#: ../../library/shutil.rst:639 msgid "" "*extract_dir* is the name of the target directory where the archive is " "unpacked. If not provided, the current working directory is used." msgstr "" -#: ../../library/shutil.rst:636 +#: ../../library/shutil.rst:642 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " "\"bztar\", or \"xztar\". Or any other format registered with :func:" @@ -812,7 +819,7 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:643 +#: ../../library/shutil.rst:649 msgid "" "The keyword-only *filter* argument, which was added in Python 3.11.4, is " "passed to the underlying unpacking function. For zip files, *filter* is not " @@ -822,13 +829,13 @@ msgid "" "default for tar files in Python 3.14." msgstr "" -#: ../../library/shutil.rst:652 +#: ../../library/shutil.rst:658 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." msgstr "" -#: ../../library/shutil.rst:656 +#: ../../library/shutil.rst:662 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -836,139 +843,139 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: ../../library/shutil.rst:661 +#: ../../library/shutil.rst:667 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:664 +#: ../../library/shutil.rst:670 #, fuzzy msgid "Added the *filter* argument." msgstr "新增 *copy_function* 關鍵字引數。" -#: ../../library/shutil.rst:669 +#: ../../library/shutil.rst:675 msgid "" "Registers an unpack format. *name* is the name of the format and " "*extensions* is a list of extensions corresponding to the format, like ``." "zip`` for Zip files." msgstr "" -#: ../../library/shutil.rst:673 +#: ../../library/shutil.rst:679 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: ../../library/shutil.rst:676 +#: ../../library/shutil.rst:682 msgid "the path of the archive, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:677 +#: ../../library/shutil.rst:683 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:678 +#: ../../library/shutil.rst:684 msgid "" "possibly a *filter* keyword argument, if it was given to :func:" "`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:680 +#: ../../library/shutil.rst:686 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:683 +#: ../../library/shutil.rst:689 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:689 +#: ../../library/shutil.rst:695 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:694 +#: ../../library/shutil.rst:700 msgid "" "Return a list of all registered formats for unpacking. Each element of the " "returned sequence is a tuple ``(name, extensions, description)``." msgstr "" -#: ../../library/shutil.rst:700 +#: ../../library/shutil.rst:706 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:702 +#: ../../library/shutil.rst:708 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:707 +#: ../../library/shutil.rst:713 msgid "" "You can register new formats or provide your own unpacker for any existing " "formats, by using :func:`register_unpack_format`." msgstr "" -#: ../../library/shutil.rst:714 +#: ../../library/shutil.rst:720 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:716 +#: ../../library/shutil.rst:722 msgid "" "In this example, we create a gzip'ed tar-file archive containing all files " "found in the :file:`.ssh` directory of the user::" msgstr "" -#: ../../library/shutil.rst:726 +#: ../../library/shutil.rst:732 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:744 +#: ../../library/shutil.rst:750 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:746 +#: ../../library/shutil.rst:752 msgid "" "In this example, similar to the `one above `_, we " "show how to use :func:`make_archive`, but this time with the usage of " "*base_dir*. We now have the following directory structure:" msgstr "" -#: ../../library/shutil.rst:760 +#: ../../library/shutil.rst:766 msgid "" "In the final archive, :file:`please_add.txt` should be included, but :file:" "`do_not_add.txt` should not. Therefore we use the following::" msgstr "" -#: ../../library/shutil.rst:774 +#: ../../library/shutil.rst:780 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:784 +#: ../../library/shutil.rst:790 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:788 +#: ../../library/shutil.rst:794 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:790 +#: ../../library/shutil.rst:796 msgid "" "For each of the two dimensions, the environment variable, ``COLUMNS`` and " "``LINES`` respectively, is checked. If the variable is defined and the value " "is a positive integer, it is used." msgstr "" -#: ../../library/shutil.rst:794 +#: ../../library/shutil.rst:800 msgid "" "When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the " "terminal connected to :data:`sys.__stdout__` is queried by invoking :func:" "`os.get_terminal_size`." msgstr "" -#: ../../library/shutil.rst:798 +#: ../../library/shutil.rst:804 msgid "" "If the terminal size cannot be successfully queried, either because the " "system doesn't support querying, or because we are not connected to a " @@ -977,17 +984,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:804 +#: ../../library/shutil.rst:810 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:806 +#: ../../library/shutil.rst:812 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:811 +#: ../../library/shutil.rst:817 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/library/signal.po b/library/signal.po index 13e2737ecd..1811305cdf 100644 --- a/library/signal.po +++ b/library/signal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -665,8 +665,8 @@ msgstr "更多資訊請見 :manpage:`siginterrupt(3)` 手冊頁。" #: ../../library/signal.rst:563 msgid "" "Note that installing a signal handler with :func:`signal` will reset the " -"restart behaviour to interruptible by implicitly calling :c:func:" -"`siginterrupt` with a true *flag* value for the given signal." +"restart behaviour to interruptible by implicitly calling :c:func:`!" +"siginterrupt` with a true *flag* value for the given signal." msgstr "" #: ../../library/signal.rst:570 diff --git a/library/smtplib.po b/library/smtplib.po index 24449115b8..0db1368fad 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -137,7 +137,7 @@ msgstr "新增 *context*\\ 。" #: ../../library/smtplib.rst:103 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/smtplib.rst:110 ../../library/smtplib.rst:414 @@ -542,7 +542,7 @@ msgstr "" #: ../../library/smtplib.rst:431 msgid "" "The method now supports hostname check with :attr:`SSLContext." -"check_hostname` and *Server Name Indicator* (see :data:`~ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indicator* (see :const:`~ssl.HAS_SNI`)." msgstr "" #: ../../library/smtplib.rst:436 diff --git a/library/socket.po b/library/socket.po index 770d27a26a..51bba2cba8 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-05 00:35+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -2227,7 +2227,7 @@ msgstr "" #: ../../library/socket.rst:2155 msgid "" -"There is a :mod:`socket` flag to set, in order to prevent this, :data:" +"There is a :mod:`socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index e961a9e3ae..8fe0721663 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-12 00:40+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -1536,9 +1536,9 @@ msgstr "" #: ../../library/sqlite3.rst:1645 msgid "" "Set the current access position of the blob to *offset*. The *origin* " -"argument defaults to :data:`os.SEEK_SET` (absolute blob positioning). Other " -"values for *origin* are :data:`os.SEEK_CUR` (seek relative to the current " -"position) and :data:`os.SEEK_END` (seek relative to the blob’s end)." +"argument defaults to :const:`os.SEEK_SET` (absolute blob positioning). Other " +"values for *origin* are :const:`os.SEEK_CUR` (seek relative to the current " +"position) and :const:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" #: ../../library/sqlite3.rst:1653 diff --git a/library/ssl.po b/library/ssl.po index f7c4a0bb3b..5937cdb36d 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -168,7 +168,7 @@ msgid "" "The settings are: :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER`, :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` with " "high encryption cipher suites without RC4 and without unauthenticated cipher " -"suites. Passing :data:`~Purpose.SERVER_AUTH` as *purpose* sets :data:" +"suites. Passing :const:`~Purpose.SERVER_AUTH` as *purpose* sets :data:" "`~SSLContext.verify_mode` to :data:`CERT_REQUIRED` and either loads CA " "certificates (when at least one of *cafile*, *capath* or *cadata* is given) " "or uses :meth:`SSLContext.load_default_certs` to load default CA " @@ -1786,9 +1786,9 @@ msgstr "" #: ../../library/ssl.rst:1581 msgid "" "The *purpose* flag specifies what kind of CA certificates are loaded. The " -"default settings :data:`Purpose.SERVER_AUTH` loads certificates, that are " +"default settings :const:`Purpose.SERVER_AUTH` loads certificates, that are " "flagged and trusted for TLS web server authentication (client side " -"sockets). :data:`Purpose.CLIENT_AUTH` loads CA certificates for client " +"sockets). :const:`Purpose.CLIENT_AUTH` loads CA certificates for client " "certificate verification on the server side." msgstr "" @@ -2051,7 +2051,7 @@ msgid "" "Wrap an existing Python socket *sock* and return an instance of :attr:" "`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The returned SSL " "socket is tied to the context, its settings and certificates. *sock* must be " -"a :data:`~socket.SOCK_STREAM` socket; other socket types are unsupported." +"a :const:`~socket.SOCK_STREAM` socket; other socket types are unsupported." msgstr "" #: ../../library/ssl.rst:1830 @@ -2959,7 +2959,7 @@ msgstr "" #: ../../library/ssl.rst:2691 msgid "" -"The SSL context created above will only allow TLSv1.2 and later (if " +"The SSL context created above will only allow TLSv1.3 and later (if " "supported by your system) connections to a server. :const:" "`PROTOCOL_TLS_CLIENT` implies certificate validation and hostname checks by " "default. You have to load certificates into the context." diff --git a/library/stdtypes.po b/library/stdtypes.po index a26f6fe68a..4ef2bb9ef1 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-15 00:38+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -6025,7 +6025,7 @@ msgstr "" #: ../../library/stdtypes.rst:5594 msgid "" -"Information about the default and minimum can be found in :attr:`sys." +"Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" diff --git a/library/struct.po b/library/struct.po index aa5758c829..0514952356 100644 --- a/library/struct.po +++ b/library/struct.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-30 20:18+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -492,7 +492,8 @@ msgid "``n``" msgstr "``n``" #: ../../library/struct.rst:234 -msgid ":c:expr:`ssize_t`" +#, fuzzy +msgid ":c:type:`ssize_t`" msgstr ":c:expr:`ssize_t`" #: ../../library/struct.rst:234 ../../library/struct.rst:236 @@ -504,7 +505,8 @@ msgid "``N``" msgstr "``N``" #: ../../library/struct.rst:236 -msgid ":c:expr:`size_t`" +#, fuzzy +msgid ":c:type:`size_t`" msgstr ":c:expr:`size_t`" #: ../../library/struct.rst:238 diff --git a/library/subprocess.po b/library/subprocess.po index 0223fbdbc0..e6c0138ed3 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1788,7 +1788,7 @@ msgstr "" #: ../../library/subprocess.rst:1610 msgid "" "If you ever encounter a presumed highly unusual situation where you need to " -"prevent ``vfork()`` from being used by Python, you can set the :attr:" +"prevent ``vfork()`` from being used by Python, you can set the :const:" "`subprocess._USE_VFORK` attribute to a false value." msgstr "" @@ -1796,7 +1796,7 @@ msgstr "" msgid "" "Setting this has no impact on use of ``posix_spawn()`` which could use " "``vfork()`` internally within its libc implementation. There is a similar :" -"attr:`subprocess._USE_POSIX_SPAWN` attribute if you need to prevent use of " +"const:`subprocess._USE_POSIX_SPAWN` attribute if you need to prevent use of " "that." msgstr "" diff --git a/library/sys.po b/library/sys.po index e14bb31020..2a7ca610ec 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -211,7 +211,8 @@ msgid "" msgstr "" #: ../../library/sys.rst:169 -msgid "See also the :attr:`sys.stdlib_module_names` list." +#, fuzzy +msgid "See also the :data:`sys.stdlib_module_names` list." msgstr "另請參閱 :attr:`sys.stdlib_module_names` 清單。" #: ../../library/sys.rst:174 @@ -346,8 +347,8 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:278 ../../library/sys.rst:879 -#: ../../library/sys.rst:1585 ../../library/sys.rst:1818 +#: ../../library/sys.rst:278 ../../library/sys.rst:883 +#: ../../library/sys.rst:1589 ../../library/sys.rst:1822 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -392,13 +393,13 @@ msgid "" "in the future." msgstr "" -#: ../../library/sys.rst:335 ../../library/sys.rst:1026 -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:335 ../../library/sys.rst:1030 +#: ../../library/sys.rst:1705 msgid "Attribute" msgstr "屬性" -#: ../../library/sys.rst:335 ../../library/sys.rst:1026 -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:335 ../../library/sys.rst:1030 +#: ../../library/sys.rst:1705 msgid "Explanation" msgstr "解釋" @@ -631,8 +632,8 @@ msgid "" "The attributes are read only." msgstr "" -#: ../../library/sys.rst:515 ../../library/sys.rst:572 -#: ../../library/sys.rst:925 +#: ../../library/sys.rst:515 ../../library/sys.rst:576 +#: ../../library/sys.rst:929 msgid "attribute" msgstr "" @@ -774,38 +775,54 @@ msgid "" "limitation `)" msgstr "" -#: ../../library/sys.rst:536 +#: ../../library/sys.rst:534 +#, fuzzy +msgid ":const:`warn_default_encoding`" +msgstr ":const:`default_max_str_digits`" + +#: ../../library/sys.rst:534 +#, fuzzy +msgid ":option:`-X warn_default_encoding <-X>`" +msgstr ":option:`-X utf8 <-X>`" + +#: ../../library/sys.rst:537 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "" -#: ../../library/sys.rst:539 +#: ../../library/sys.rst:540 msgid "The ``hash_randomization`` attribute." msgstr "" -#: ../../library/sys.rst:542 +#: ../../library/sys.rst:543 msgid "Removed obsolete ``division_warning`` attribute." msgstr "" -#: ../../library/sys.rst:545 +#: ../../library/sys.rst:546 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "" -#: ../../library/sys.rst:548 +#: ../../library/sys.rst:549 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: ../../library/sys.rst:553 +#: ../../library/sys.rst:554 +msgid "" +"Added ``warn_default_encoding`` attribute for :option:`-X` " +"``warn_default_encoding`` flag." +msgstr "" + +#: ../../library/sys.rst:557 msgid "Added the ``safe_path`` attribute for :option:`-P` option." msgstr "" -#: ../../library/sys.rst:556 +#: ../../library/sys.rst:560 msgid "Added the ``int_max_str_digits`` attribute." msgstr "" -#: ../../library/sys.rst:562 +#: ../../library/sys.rst:566 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -815,182 +832,182 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:572 +#: ../../library/sys.rst:576 msgid "float.h macro" msgstr "" -#: ../../library/sys.rst:572 ../../library/sys.rst:925 +#: ../../library/sys.rst:576 ../../library/sys.rst:929 msgid "explanation" msgstr "" -#: ../../library/sys.rst:574 +#: ../../library/sys.rst:578 #, fuzzy msgid "``epsilon``" msgstr ":const:`epsilon`" -#: ../../library/sys.rst:574 +#: ../../library/sys.rst:578 #, fuzzy msgid "``DBL_EPSILON``" msgstr "DBL_EPSILON" -#: ../../library/sys.rst:574 +#: ../../library/sys.rst:578 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float" msgstr "" -#: ../../library/sys.rst:577 +#: ../../library/sys.rst:581 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`\\ 。" -#: ../../library/sys.rst:579 +#: ../../library/sys.rst:583 msgid "``dig``" msgstr "" -#: ../../library/sys.rst:579 +#: ../../library/sys.rst:583 #, fuzzy msgid "``DBL_DIG``" msgstr "DBL_DIG" -#: ../../library/sys.rst:579 +#: ../../library/sys.rst:583 msgid "" "maximum number of decimal digits that can be faithfully represented in a " "float; see below" msgstr "" -#: ../../library/sys.rst:582 +#: ../../library/sys.rst:586 #, fuzzy msgid "``mant_dig``" msgstr ":const:`mant_dig`" -#: ../../library/sys.rst:582 +#: ../../library/sys.rst:586 #, fuzzy msgid "``DBL_MANT_DIG``" msgstr "DBL_MANT_DIG" -#: ../../library/sys.rst:582 +#: ../../library/sys.rst:586 msgid "" "float precision: the number of base-``radix`` digits in the significand of a " "float" msgstr "" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:589 msgid "``max``" msgstr "" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:589 #, fuzzy msgid "``DBL_MAX``" msgstr "DBL_MAX" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:589 msgid "maximum representable positive finite float" msgstr "" -#: ../../library/sys.rst:587 +#: ../../library/sys.rst:591 #, fuzzy msgid "``max_exp``" msgstr ":const:`max_exp`" -#: ../../library/sys.rst:587 +#: ../../library/sys.rst:591 #, fuzzy msgid "``DBL_MAX_EXP``" msgstr "DBL_MAX_EXP" -#: ../../library/sys.rst:587 +#: ../../library/sys.rst:591 msgid "" "maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float" msgstr "" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:594 #, fuzzy msgid "``max_10_exp``" msgstr ":const:`max_10_exp`" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:594 #, fuzzy msgid "``DBL_MAX_10_EXP``" msgstr "DBL_MAX_10_EXP" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:594 msgid "" "maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats" msgstr "" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:597 msgid "``min``" msgstr "" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:597 #, fuzzy msgid "``DBL_MIN``" msgstr "DBL_MIN" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:597 msgid "minimum representable positive *normalized* float" msgstr "" -#: ../../library/sys.rst:595 +#: ../../library/sys.rst:599 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:599 +#: ../../library/sys.rst:603 #, fuzzy msgid "``min_exp``" msgstr ":const:`min_exp`" -#: ../../library/sys.rst:599 +#: ../../library/sys.rst:603 #, fuzzy msgid "``DBL_MIN_EXP``" msgstr "DBL_MIN_EXP" -#: ../../library/sys.rst:599 +#: ../../library/sys.rst:603 msgid "minimum integer *e* such that ``radix**(e-1)`` is a normalized float" msgstr "" -#: ../../library/sys.rst:602 +#: ../../library/sys.rst:606 #, fuzzy msgid "``min_10_exp``" msgstr ":const:`min_10_exp`" -#: ../../library/sys.rst:602 +#: ../../library/sys.rst:606 #, fuzzy msgid "``DBL_MIN_10_EXP``" msgstr "DBL_MIN_10_EXP" -#: ../../library/sys.rst:602 +#: ../../library/sys.rst:606 msgid "minimum integer *e* such that ``10**e`` is a normalized float" msgstr "" -#: ../../library/sys.rst:605 +#: ../../library/sys.rst:609 #, fuzzy msgid "``radix``" msgstr ":const:`radix`" -#: ../../library/sys.rst:605 +#: ../../library/sys.rst:609 #, fuzzy msgid "``FLT_RADIX``" msgstr "FLT_RADIX" -#: ../../library/sys.rst:605 +#: ../../library/sys.rst:609 msgid "radix of exponent representation" msgstr "" -#: ../../library/sys.rst:607 +#: ../../library/sys.rst:611 #, fuzzy msgid "``rounds``" msgstr ":const:`rounds`" -#: ../../library/sys.rst:607 +#: ../../library/sys.rst:611 #, fuzzy msgid "``FLT_ROUNDS``" msgstr "FLT_ROUNDS" -#: ../../library/sys.rst:607 +#: ../../library/sys.rst:611 msgid "" "integer representing the rounding mode for floating-point arithmetic. This " "reflects the value of the system ``FLT_ROUNDS`` macro at interpreter startup " @@ -998,13 +1015,13 @@ msgid "" "toward positive infinity, ``3`` toward negative infinity" msgstr "" -#: ../../library/sys.rst:617 +#: ../../library/sys.rst:621 msgid "" "All other values for ``FLT_ROUNDS`` characterize implementation-defined " "rounding behavior." msgstr "" -#: ../../library/sys.rst:621 +#: ../../library/sys.rst:625 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`sys." @@ -1012,13 +1029,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:634 +#: ../../library/sys.rst:638 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:643 +#: ../../library/sys.rst:647 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -1028,7 +1045,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:656 +#: ../../library/sys.rst:660 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -1038,38 +1055,38 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:663 +#: ../../library/sys.rst:667 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:671 +#: ../../library/sys.rst:675 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:673 +#: ../../library/sys.rst:677 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:680 +#: ../../library/sys.rst:684 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:686 +#: ../../library/sys.rst:690 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " -"module (``RTLD_xxx`` constants, e.g. :data:`os.RTLD_LAZY`)." +"module (``RTLD_xxx`` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:691 ../../library/sys.rst:1347 +#: ../../library/sys.rst:695 ../../library/sys.rst:1351 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:696 +#: ../../library/sys.rst:700 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:729 +#: ../../library/sys.rst:733 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1124,20 +1141,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:747 +#: ../../library/sys.rst:751 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:754 +#: ../../library/sys.rst:758 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:761 +#: ../../library/sys.rst:765 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1145,46 +1162,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:769 +#: ../../library/sys.rst:773 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:774 +#: ../../library/sys.rst:778 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:777 +#: ../../library/sys.rst:781 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:780 +#: ../../library/sys.rst:784 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:784 +#: ../../library/sys.rst:788 msgid "" "See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size " "of containers and all their contents." msgstr "" -#: ../../library/sys.rst:790 +#: ../../library/sys.rst:794 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:798 +#: ../../library/sys.rst:802 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1193,27 +1210,27 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:803 +#: ../../library/sys.rst:807 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." msgstr "" -#: ../../library/sys.rst:807 +#: ../../library/sys.rst:811 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:817 +#: ../../library/sys.rst:821 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:826 +#: ../../library/sys.rst:830 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:830 +#: ../../library/sys.rst:834 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1221,7 +1238,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:838 +#: ../../library/sys.rst:842 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1233,54 +1250,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:849 +#: ../../library/sys.rst:853 msgid "*platform* will be :const:`2 (VER_PLATFORM_WIN32_NT)`." msgstr "" -#: ../../library/sys.rst:851 +#: ../../library/sys.rst:855 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:854 +#: ../../library/sys.rst:858 msgid "Constant" msgstr "" -#: ../../library/sys.rst:854 +#: ../../library/sys.rst:858 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:856 +#: ../../library/sys.rst:860 msgid ":const:`1 (VER_NT_WORKSTATION)`" msgstr ":const:`1 (VER_NT_WORKSTATION)`" -#: ../../library/sys.rst:856 +#: ../../library/sys.rst:860 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:858 +#: ../../library/sys.rst:862 msgid ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" msgstr ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" -#: ../../library/sys.rst:858 +#: ../../library/sys.rst:862 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:861 +#: ../../library/sys.rst:865 msgid ":const:`3 (VER_NT_SERVER)`" msgstr ":const:`3 (VER_NT_SERVER)`" -#: ../../library/sys.rst:861 +#: ../../library/sys.rst:865 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:865 +#: ../../library/sys.rst:869 msgid "" "This function wraps the Win32 :c:func:`GetVersionEx` function; see the " "Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:869 +#: ../../library/sys.rst:873 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1288,24 +1305,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:875 +#: ../../library/sys.rst:879 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:881 +#: ../../library/sys.rst:885 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:885 +#: ../../library/sys.rst:889 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:891 +#: ../../library/sys.rst:895 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1315,103 +1332,103 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:898 +#: ../../library/sys.rst:902 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:902 ../../library/sys.rst:1549 +#: ../../library/sys.rst:906 ../../library/sys.rst:1553 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:908 +#: ../../library/sys.rst:912 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:914 ../../library/sys.rst:1570 +#: ../../library/sys.rst:918 ../../library/sys.rst:1574 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:920 +#: ../../library/sys.rst:924 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:927 +#: ../../library/sys.rst:931 msgid ":const:`width`" msgstr ":const:`width`" -#: ../../library/sys.rst:927 +#: ../../library/sys.rst:931 msgid "width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:929 +#: ../../library/sys.rst:933 msgid ":const:`modulus`" msgstr ":const:`modulus`" -#: ../../library/sys.rst:929 +#: ../../library/sys.rst:933 msgid "prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:931 +#: ../../library/sys.rst:935 msgid ":const:`inf`" msgstr ":const:`inf`" -#: ../../library/sys.rst:931 +#: ../../library/sys.rst:935 msgid "hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:933 +#: ../../library/sys.rst:937 msgid ":const:`nan`" msgstr ":const:`nan`" -#: ../../library/sys.rst:933 +#: ../../library/sys.rst:937 msgid "(this attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:935 +#: ../../library/sys.rst:939 msgid ":const:`imag`" msgstr ":const:`imag`" -#: ../../library/sys.rst:935 +#: ../../library/sys.rst:939 msgid "multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:938 +#: ../../library/sys.rst:942 msgid ":const:`algorithm`" msgstr ":const:`algorithm`" -#: ../../library/sys.rst:938 +#: ../../library/sys.rst:942 msgid "name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:941 +#: ../../library/sys.rst:945 msgid ":const:`hash_bits`" msgstr ":const:`hash_bits`" -#: ../../library/sys.rst:941 +#: ../../library/sys.rst:945 msgid "internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:943 +#: ../../library/sys.rst:947 msgid ":const:`seed_bits`" msgstr ":const:`seed_bits`" -#: ../../library/sys.rst:943 +#: ../../library/sys.rst:947 msgid "size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:949 +#: ../../library/sys.rst:953 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:955 +#: ../../library/sys.rst:959 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1419,7 +1436,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:966 +#: ../../library/sys.rst:970 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1427,25 +1444,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:971 +#: ../../library/sys.rst:975 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:976 +#: ../../library/sys.rst:980 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:980 +#: ../../library/sys.rst:984 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:984 +#: ../../library/sys.rst:988 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1457,13 +1474,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:994 +#: ../../library/sys.rst:998 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:997 +#: ../../library/sys.rst:1001 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1472,7 +1489,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1004 +#: ../../library/sys.rst:1008 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1482,61 +1499,61 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1015 +#: ../../library/sys.rst:1019 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1020 +#: ../../library/sys.rst:1024 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1028 +#: ../../library/sys.rst:1032 msgid ":const:`bits_per_digit`" msgstr ":const:`bits_per_digit`" -#: ../../library/sys.rst:1028 +#: ../../library/sys.rst:1032 msgid "" "number of bits held in each digit. Python integers are stored internally in " "base ``2**int_info.bits_per_digit``" msgstr "" -#: ../../library/sys.rst:1032 +#: ../../library/sys.rst:1036 msgid ":const:`sizeof_digit`" msgstr ":const:`sizeof_digit`" -#: ../../library/sys.rst:1032 +#: ../../library/sys.rst:1036 msgid "size in bytes of the C type used to represent a digit" msgstr "" -#: ../../library/sys.rst:1035 +#: ../../library/sys.rst:1039 msgid ":const:`default_max_str_digits`" msgstr ":const:`default_max_str_digits`" -#: ../../library/sys.rst:1035 +#: ../../library/sys.rst:1039 msgid "" "default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1039 +#: ../../library/sys.rst:1043 msgid ":const:`str_digits_check_threshold`" msgstr ":const:`str_digits_check_threshold`" -#: ../../library/sys.rst:1039 +#: ../../library/sys.rst:1043 msgid "" "minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1047 +#: ../../library/sys.rst:1051 msgid "Added ``default_max_str_digits`` and ``str_digits_check_threshold``." msgstr "新增 ``default_max_str_digits`` 和 ``str_digits_check_threshold``。" -#: ../../library/sys.rst:1053 +#: ../../library/sys.rst:1057 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1059 +#: ../../library/sys.rst:1063 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." msgstr "" -#: ../../library/sys.rst:1061 +#: ../../library/sys.rst:1065 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1070 +#: ../../library/sys.rst:1074 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1569,19 +1586,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1078 +#: ../../library/sys.rst:1082 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1084 +#: ../../library/sys.rst:1088 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1094 +#: ../../library/sys.rst:1098 msgid "" "These three variables are not always defined; they are set when an exception " "is not handled and the interpreter prints an error message and a stack " @@ -1592,33 +1609,33 @@ msgid "" "information.)" msgstr "" -#: ../../library/sys.rst:1102 +#: ../../library/sys.rst:1106 msgid "" "The meaning of the variables is the same as that of the return values from :" "func:`exc_info` above." msgstr "" -#: ../../library/sys.rst:1108 +#: ../../library/sys.rst:1112 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1115 +#: ../../library/sys.rst:1119 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1118 +#: ../../library/sys.rst:1122 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1126 +#: ../../library/sys.rst:1130 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1631,27 +1648,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1139 +#: ../../library/sys.rst:1143 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1139 +#: ../../library/sys.rst:1143 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1143 +#: ../../library/sys.rst:1147 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1142 +#: ../../library/sys.rst:1146 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1148 +#: ../../library/sys.rst:1152 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:" @@ -1660,7 +1677,7 @@ msgid "" "MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1156 +#: ../../library/sys.rst:1160 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1672,78 +1689,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1168 +#: ../../library/sys.rst:1172 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1171 +#: ../../library/sys.rst:1175 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1180 +#: ../../library/sys.rst:1184 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1184 +#: ../../library/sys.rst:1188 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1188 +#: ../../library/sys.rst:1192 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1190 +#: ../../library/sys.rst:1194 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1192 +#: ../../library/sys.rst:1196 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1195 +#: ../../library/sys.rst:1199 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1198 +#: ../../library/sys.rst:1202 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1204 +#: ../../library/sys.rst:1208 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1209 +#: ../../library/sys.rst:1213 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1213 ../../library/sys.rst:1224 +#: ../../library/sys.rst:1217 ../../library/sys.rst:1228 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1218 +#: ../../library/sys.rst:1222 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1751,19 +1768,19 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1226 +#: ../../library/sys.rst:1230 msgid "" "``None`` is stored instead of :class:`imp.NullImporter` when no finder is " "found." msgstr "" -#: ../../library/sys.rst:1233 +#: ../../library/sys.rst:1237 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1236 +#: ../../library/sys.rst:1240 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1772,141 +1789,141 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1249 +#: ../../library/sys.rst:1253 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1256 msgid "System" msgstr "" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1256 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1254 +#: ../../library/sys.rst:1258 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1254 +#: ../../library/sys.rst:1258 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1255 +#: ../../library/sys.rst:1259 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1255 +#: ../../library/sys.rst:1259 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1256 +#: ../../library/sys.rst:1260 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1256 +#: ../../library/sys.rst:1260 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1257 +#: ../../library/sys.rst:1261 msgid "WASI" msgstr "" -#: ../../library/sys.rst:1257 +#: ../../library/sys.rst:1261 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1258 +#: ../../library/sys.rst:1262 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1258 +#: ../../library/sys.rst:1262 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1259 +#: ../../library/sys.rst:1263 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1259 +#: ../../library/sys.rst:1263 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1260 +#: ../../library/sys.rst:1264 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1260 +#: ../../library/sys.rst:1264 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1263 +#: ../../library/sys.rst:1267 msgid "" -"On Linux, :attr:`sys.platform` doesn't contain the major version anymore. It " +"On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " "Python versions include the version number, it is recommended to always use " "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1269 +#: ../../library/sys.rst:1273 msgid "" -"On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " +"On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " "Python versions include the version number, it is recommended to always use " "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1277 +#: ../../library/sys.rst:1281 msgid "" -":attr:`os.name` has a coarser granularity. :func:`os.uname` gives system-" +":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1280 +#: ../../library/sys.rst:1284 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1290 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1289 +#: ../../library/sys.rst:1293 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1293 +#: ../../library/sys.rst:1297 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1295 +#: ../../library/sys.rst:1299 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1298 +#: ../../library/sys.rst:1302 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1300 +#: ../../library/sys.rst:1304 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1308 +#: ../../library/sys.rst:1312 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1915,14 +1932,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1314 +#: ../../library/sys.rst:1318 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1329 +#: ../../library/sys.rst:1333 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1932,7 +1949,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1339 +#: ../../library/sys.rst:1343 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1940,17 +1957,17 @@ msgid "" "``sys.setdlopenflags(0)``. To share symbols across extension modules, call " "as ``sys.setdlopenflags(os.RTLD_GLOBAL)``. Symbolic names for the flag " "values can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g. :" -"data:`os.RTLD_LAZY`)." +"const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1351 +#: ../../library/sys.rst:1355 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1363 +#: ../../library/sys.rst:1367 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1965,7 +1982,7 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1374 +#: ../../library/sys.rst:1378 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1973,71 +1990,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1379 +#: ../../library/sys.rst:1383 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1381 ../../library/sys.rst:1462 +#: ../../library/sys.rst:1385 ../../library/sys.rst:1466 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1385 ../../library/sys.rst:1467 +#: ../../library/sys.rst:1389 ../../library/sys.rst:1471 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1384 +#: ../../library/sys.rst:1388 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1390 ../../library/sys.rst:1482 +#: ../../library/sys.rst:1394 ../../library/sys.rst:1486 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1392 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1394 +#: ../../library/sys.rst:1398 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1397 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1397 +#: ../../library/sys.rst:1401 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1397 +#: ../../library/sys.rst:1401 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1399 +#: ../../library/sys.rst:1403 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1400 +#: ../../library/sys.rst:1404 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1404 +#: ../../library/sys.rst:1408 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1408 +#: ../../library/sys.rst:1412 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -2045,19 +2062,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1413 +#: ../../library/sys.rst:1417 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1416 +#: ../../library/sys.rst:1420 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2068,7 +2085,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1440 +#: ../../library/sys.rst:1444 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -2077,7 +2094,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1445 +#: ../../library/sys.rst:1449 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2085,7 +2102,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1450 +#: ../../library/sys.rst:1454 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2093,31 +2110,31 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1455 +#: ../../library/sys.rst:1459 msgid "" "The local trace function should return a reference to itself (or to another " "function for further tracing in that scope), or ``None`` to turn off tracing " "in that scope." msgstr "" -#: ../../library/sys.rst:1459 +#: ../../library/sys.rst:1463 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1469 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1476 +#: ../../library/sys.rst:1480 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1470 +#: ../../library/sys.rst:1474 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2127,7 +2144,7 @@ msgid "" "const:`False` on that frame." msgstr "" -#: ../../library/sys.rst:1479 +#: ../../library/sys.rst:1483 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2135,22 +2152,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1487 +#: ../../library/sys.rst:1491 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1485 +#: ../../library/sys.rst:1489 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1495 +#: ../../library/sys.rst:1499 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1490 +#: ../../library/sys.rst:1494 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2159,13 +2176,13 @@ msgid "" "`f_trace_opcodes` to :const:`True` on the frame." msgstr "" -#: ../../library/sys.rst:1497 +#: ../../library/sys.rst:1501 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1504 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2179,17 +2196,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1511 +#: ../../library/sys.rst:1515 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1513 +#: ../../library/sys.rst:1517 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1517 +#: ../../library/sys.rst:1521 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2197,13 +2214,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1524 +#: ../../library/sys.rst:1528 msgid "" "``'opcode'`` event type added; :attr:`f_trace_lines` and :attr:" "`f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1529 +#: ../../library/sys.rst:1533 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2212,32 +2229,32 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1535 +#: ../../library/sys.rst:1539 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." msgstr "" -#: ../../library/sys.rst:1537 +#: ../../library/sys.rst:1541 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" -#: ../../library/sys.rst:1539 +#: ../../library/sys.rst:1543 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1542 +#: ../../library/sys.rst:1546 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1554 +#: ../../library/sys.rst:1558 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2246,74 +2263,74 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1561 +#: ../../library/sys.rst:1565 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1565 +#: ../../library/sys.rst:1569 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1575 +#: ../../library/sys.rst:1579 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1579 +#: ../../library/sys.rst:1583 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1582 +#: ../../library/sys.rst:1586 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1587 +#: ../../library/sys.rst:1591 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1594 +#: ../../library/sys.rst:1598 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1597 +#: ../../library/sys.rst:1601 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1599 +#: ../../library/sys.rst:1603 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1601 +#: ../../library/sys.rst:1605 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1603 +#: ../../library/sys.rst:1607 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1607 +#: ../../library/sys.rst:1611 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1610 +#: ../../library/sys.rst:1614 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2324,14 +2341,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1619 +#: ../../library/sys.rst:1623 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1624 +#: ../../library/sys.rst:1628 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2340,7 +2357,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1631 +#: ../../library/sys.rst:1635 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2349,19 +2366,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1641 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1643 +#: ../../library/sys.rst:1647 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1647 +#: ../../library/sys.rst:1651 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2369,7 +2386,7 @@ msgid "" "support the :attr:`~io.BufferedIOBase.buffer` attribute." msgstr "" -#: ../../library/sys.rst:1657 +#: ../../library/sys.rst:1661 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2377,7 +2394,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1662 +#: ../../library/sys.rst:1666 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2385,7 +2402,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1668 +#: ../../library/sys.rst:1672 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2393,12 +2410,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1676 +#: ../../library/sys.rst:1680 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1678 +#: ../../library/sys.rst:1682 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2406,7 +2423,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1683 +#: ../../library/sys.rst:1687 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2414,72 +2431,73 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1688 -msgid "See also the :attr:`sys.builtin_module_names` list." +#: ../../library/sys.rst:1692 +#, fuzzy +msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1695 +#: ../../library/sys.rst:1699 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1703 +#: ../../library/sys.rst:1707 msgid ":const:`name`" msgstr ":const:`name`" -#: ../../library/sys.rst:1703 +#: ../../library/sys.rst:1707 msgid "Name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1705 +#: ../../library/sys.rst:1709 msgid "``'nt'``: Windows threads" msgstr "" -#: ../../library/sys.rst:1706 +#: ../../library/sys.rst:1710 msgid "``'pthread'``: POSIX threads" msgstr "" -#: ../../library/sys.rst:1707 +#: ../../library/sys.rst:1711 msgid "" "``'pthread-stubs'``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1709 +#: ../../library/sys.rst:1713 msgid "``'solaris'``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1711 +#: ../../library/sys.rst:1715 msgid ":const:`lock`" msgstr ":const:`lock`" -#: ../../library/sys.rst:1711 +#: ../../library/sys.rst:1715 msgid "Name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1713 +#: ../../library/sys.rst:1717 msgid "``'semaphore'``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1714 +#: ../../library/sys.rst:1718 msgid "``'mutex+cond'``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1716 +#: ../../library/sys.rst:1720 msgid "``None`` if this information is unknown" msgstr "" -#: ../../library/sys.rst:1718 +#: ../../library/sys.rst:1722 msgid ":const:`version`" msgstr ":const:`version`" -#: ../../library/sys.rst:1718 +#: ../../library/sys.rst:1722 msgid "" "Name and version of the thread library. It is a string, or ``None`` if this " "information is unknown." msgstr "" -#: ../../library/sys.rst:1727 +#: ../../library/sys.rst:1731 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2488,78 +2506,78 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1735 +#: ../../library/sys.rst:1739 msgid "Handle an unraisable exception." msgstr "" -#: ../../library/sys.rst:1737 +#: ../../library/sys.rst:1741 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1741 +#: ../../library/sys.rst:1745 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1743 +#: ../../library/sys.rst:1747 msgid "*exc_type*: Exception type." msgstr "" -#: ../../library/sys.rst:1744 +#: ../../library/sys.rst:1748 msgid "*exc_value*: Exception value, can be ``None``." msgstr "" -#: ../../library/sys.rst:1745 +#: ../../library/sys.rst:1749 msgid "*exc_traceback*: Exception traceback, can be ``None``." msgstr "" -#: ../../library/sys.rst:1746 +#: ../../library/sys.rst:1750 msgid "*err_msg*: Error message, can be ``None``." msgstr "" -#: ../../library/sys.rst:1747 +#: ../../library/sys.rst:1751 msgid "*object*: Object causing the exception, can be ``None``." msgstr "" -#: ../../library/sys.rst:1749 +#: ../../library/sys.rst:1753 msgid "" "The default hook formats *err_msg* and *object* as: ``f'{err_msg}: {object!" "r}'``; use \"Exception ignored in\" error message if *err_msg* is ``None``." msgstr "" -#: ../../library/sys.rst:1753 +#: ../../library/sys.rst:1757 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1756 +#: ../../library/sys.rst:1760 msgid "" "Storing *exc_value* using a custom hook can create a reference cycle. It " "should be cleared explicitly to break the reference cycle when the exception " "is no longer needed." msgstr "" -#: ../../library/sys.rst:1760 +#: ../../library/sys.rst:1764 msgid "" "Storing *object* using a custom hook can resurrect it if it is set to an " "object which is being finalized. Avoid storing *object* after the custom " "hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1764 +#: ../../library/sys.rst:1768 msgid "See also :func:`excepthook` which handles uncaught exceptions." msgstr "" -#: ../../library/sys.rst:1766 +#: ../../library/sys.rst:1770 msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " "arguments ``hook``, ``unraisable``." msgstr "" -#: ../../library/sys.rst:1768 +#: ../../library/sys.rst:1772 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments ``hook``, " "``unraisable`` when an exception that cannot be handled occurs. The " @@ -2567,7 +2585,7 @@ msgid "" "hook has been set, ``hook`` may be ``None``." msgstr "" -#: ../../library/sys.rst:1777 +#: ../../library/sys.rst:1781 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2576,13 +2594,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1786 +#: ../../library/sys.rst:1790 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1792 +#: ../../library/sys.rst:1796 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2593,18 +2611,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1800 +#: ../../library/sys.rst:1804 msgid "Added named component attributes." msgstr "" -#: ../../library/sys.rst:1805 +#: ../../library/sys.rst:1809 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1812 +#: ../../library/sys.rst:1816 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2613,25 +2631,25 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1823 +#: ../../library/sys.rst:1827 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1839 +#: ../../library/sys.rst:1843 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1847 +#: ../../library/sys.rst:1851 msgid "Citations" msgstr "" -#: ../../library/sys.rst:1848 +#: ../../library/sys.rst:1852 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2650,51 +2668,51 @@ msgstr "" msgid "traceback" msgstr "" -#: ../../library/sys.rst:813 ../../library/sys.rst:1359 +#: ../../library/sys.rst:817 ../../library/sys.rst:1363 msgid "profile function" msgstr "" -#: ../../library/sys.rst:813 ../../library/sys.rst:1359 +#: ../../library/sys.rst:817 ../../library/sys.rst:1363 msgid "profiler" msgstr "" -#: ../../library/sys.rst:822 ../../library/sys.rst:1436 +#: ../../library/sys.rst:826 ../../library/sys.rst:1440 msgid "trace function" msgstr "" -#: ../../library/sys.rst:822 ../../library/sys.rst:1436 +#: ../../library/sys.rst:826 ../../library/sys.rst:1440 msgid "debugger" msgstr "" -#: ../../library/sys.rst:1178 +#: ../../library/sys.rst:1182 msgid "module" msgstr "" -#: ../../library/sys.rst:1178 +#: ../../library/sys.rst:1182 msgid "search" msgstr "" -#: ../../library/sys.rst:1178 +#: ../../library/sys.rst:1182 msgid "path" msgstr "" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1327 msgid "interpreter prompts" msgstr "" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1327 msgid "prompts, interpreter" msgstr "" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1327 msgid ">>>" msgstr "" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1327 msgid "interpreter prompt" msgstr "" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1327 msgid "..." msgstr "" diff --git a/library/tarfile.po b/library/tarfile.po index 636ce90cde..80672e4fde 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-29 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1218,7 +1218,7 @@ msgid "Implements the ``'tar'`` filter." msgstr "" #: ../../library/tarfile.rst:934 -msgid "Strip leading slashes (``/`` and :attr:`os.sep`) from filenames." +msgid "Strip leading slashes (``/`` and :data:`os.sep`) from filenames." msgstr "" #: ../../library/tarfile.rst:935 @@ -1238,7 +1238,7 @@ msgstr "" #: ../../library/tarfile.rst:942 msgid "" "Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:" -"attr:`~stat.S_IWGRP`|:attr:`~stat.S_IWOTH`)." +"const:`~stat.S_IWGRP`|:const:`~stat.S_IWOTH`)." msgstr "" #: ../../library/tarfile.rst:945 ../../library/tarfile.rst:978 @@ -1280,14 +1280,14 @@ msgstr "" #: ../../library/tarfile.rst:967 msgid "" -"Set the owner read and write permissions (:attr:`~stat.S_IRUSR`|:attr:`~stat." -"S_IWUSR`)." +"Set the owner read and write permissions (:const:`~stat.S_IRUSR`|:const:" +"`~stat.S_IWUSR`)." msgstr "" #: ../../library/tarfile.rst:969 msgid "" -"Remove the group & other executable permission (:attr:`~stat.S_IXGRP`|:attr:" -"`~stat.S_IXOTH`) if the owner doesn’t have it (:attr:`~stat.S_IXUSR`)." +"Remove the group & other executable permission (:const:`~stat.S_IXGRP`|:" +"const:`~stat.S_IXOTH`) if the owner doesn’t have it (:const:`~stat.S_IXUSR`)." msgstr "" #: ../../library/tarfile.rst:973 diff --git a/library/tempfile.po b/library/tempfile.po index c38fab5057..8bfa725b92 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -120,9 +120,10 @@ msgstr "" "object,它的 :attr:`!file` 屬性為底層的真實檔案物件。" #: ../../library/tempfile.rst:62 +#, fuzzy msgid "" -"The :py:data:`os.O_TMPFILE` flag is used if it is available and works (Linux-" -"specific, requires Linux kernel 3.11 or later)." +"The :py:const:`os.O_TMPFILE` flag is used if it is available and works " +"(Linux-specific, requires Linux kernel 3.11 or later)." msgstr "" "如果可用且可運作,則使用 :py:data:`os.O_TMPFILE` 旗標(僅限於 Linux,需要 " "3.11 版本以上的核心)。" @@ -144,7 +145,8 @@ msgstr "" "`。" #: ../../library/tempfile.rst:72 -msgid "The :py:data:`os.O_TMPFILE` flag is now used if available." +#, fuzzy +msgid "The :py:const:`os.O_TMPFILE` flag is now used if available." msgstr "如果可用,自此開始使用 :py:data:`os.O_TMPFILE` 旗標。" #: ../../library/tempfile.rst:74 ../../library/tempfile.rst:98 diff --git a/library/test.po b/library/test.po index 3f2a29d31b..15e8ba8140 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-03 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -479,7 +479,7 @@ msgid "Return ``True`` if Python was not built with ``-O0`` or ``-Og``." msgstr "" #: ../../library/test.rst:421 -msgid "Return :data:`_testcapi.WITH_PYMALLOC`." +msgid "Return :const:`_testcapi.WITH_PYMALLOC`." msgstr "" #: ../../library/test.rst:426 @@ -1004,7 +1004,7 @@ msgstr "" #: ../../library/test.rst:975 msgid "" -"On UNIX, :func:`resource.setrlimit` is used to set :attr:`resource." +"On UNIX, :func:`resource.setrlimit` is used to set :const:`resource." "RLIMIT_CORE`'s soft limit to 0 to prevent coredump file creation." msgstr "" diff --git a/library/tkinter.po b/library/tkinter.po index eba5f7aff2..f18ee728d0 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -329,7 +329,7 @@ msgid "" "tcl` and :file:`.{baseName}.tcl`, into the Tcl interpreter and calls :func:" "`exec` on the contents of :file:`.{className}.py` and :file:`.{baseName}." "py`. The path for the profile files is the :envvar:`HOME` environment " -"variable or, if that isn't defined, then :attr:`os.curdir`." +"variable or, if that isn't defined, then :data:`os.curdir`." msgstr "" #: ../../library/tkinter.rst:170 diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 7c19b82a8e..fa732fc3d6 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -144,7 +144,7 @@ msgid "Standard Options" msgstr "" #: ../../library/tkinter.ttk.rst:105 -msgid "All the :mod:`ttk` Widgets accepts the following options:" +msgid "All the :mod:`ttk` Widgets accept the following options:" msgstr "" #: ../../library/tkinter.ttk.rst:110 ../../library/tkinter.ttk.rst:145 diff --git a/library/turtle.po b/library/turtle.po index 6e5245d7fc..87078b191e 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-14 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,44 +34,317 @@ msgstr "介紹" #: ../../library/turtle.rst:22 #, fuzzy msgid "" -"Turtle graphics is a popular way for introducing programming to kids. It " -"was part of the original Logo programming language developed by Wally " -"Feurzeig, Seymour Papert and Cynthia Solomon in 1967." +"Turtle graphics is an implementation of `the popular geometric drawing tools " +"introduced in Logo `_, " +"developed by Wally Feurzeig, Seymour Papert and Cynthia Solomon in 1967." msgstr "" "龜圖學是介紹程式設計給孩子們的常用方法,這是由 Wally Feurzeig 和 Seymour " "Papert 於 1966 年開發的原始 Logo 程式語言的一部分。" -#: ../../library/turtle.rst:26 +#: ../../library/turtle.rst:29 msgid "" -"Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an " -"``import turtle``, give it the command ``turtle.forward(15)``, and it moves " -"(on-screen!) 15 pixels in the direction it is facing, drawing a line as it " -"moves. Give it the command ``turtle.right(25)``, and it rotates in-place 25 " -"degrees clockwise." +"Turtle can draw intricate shapes using programs that repeat simple moves." +msgstr "龜可以使用重複簡單動作之程式來畫出複雜的形狀。" + +#: ../../library/turtle.rst:35 +msgid "" +"In Python, turtle graphics provides a representation of a physical " +"\"turtle\" (a little robot with a pen) that draws on a sheet of paper on the " +"floor." msgstr "" -"想像一下,一隻機器龜在 x-y 平面上從 (0, 0) 出發。在 ``import turtle`` 之後," -"給它命令 ``turtle.forward(15)`` ,然後它就會移動 (在螢幕上!) 15 個單位像素," -"方向是朝著其正面對的方向。給它命令 ``turtle.right(25)`` ,它就會在原地順時針" -"旋轉 25 度。" -#: ../../library/turtle.rst:33 +#: ../../library/turtle.rst:38 msgid "" -"Turtle can draw intricate shapes using programs that repeat simple moves." -msgstr "龜可以使用重複簡單動作之程式來畫出複雜的形狀。" +"It's an effective and well-proven way for learners to encounter programming " +"concepts and interaction with software, as it provides instant, visible " +"feedback. It also provides convenient access to graphical output in general." +msgstr "" + +#: ../../library/turtle.rst:43 +msgid "" +"Turtle drawing was originally created as an educational tool, to be used by " +"teachers in the classroom. For the programmer who needs to produce some " +"graphical output it can be a way to do that without the overhead of " +"introducing more complex or external libraries into their work." +msgstr "" + +#: ../../library/turtle.rst:52 +msgid "Tutorial" +msgstr "" + +#: ../../library/turtle.rst:54 +msgid "" +"New users should start here. In this tutorial we'll explore some of the " +"basics of turtle drawing." +msgstr "" + +#: ../../library/turtle.rst:59 +msgid "Starting a turtle environment" +msgstr "" + +#: ../../library/turtle.rst:61 +msgid "In a Python shell, import all the objects of the ``turtle`` module::" +msgstr "" + +#: ../../library/turtle.rst:65 +msgid "" +"If you run into a ``No module named '_tkinter'`` error, you'll have to " +"install the :mod:`Tk interface package ` on your system." +msgstr "" + +#: ../../library/turtle.rst:70 +msgid "Basic drawing" +msgstr "" + +#: ../../library/turtle.rst:72 +msgid "Send the turtle forward 100 steps::" +msgstr "" + +#: ../../library/turtle.rst:76 +msgid "" +"You should see (most likely, in a new window on your display) a line drawn " +"by the turtle, heading East. Change the direction of the turtle, so that it " +"turns 120 degrees left (anti-clockwise)::" +msgstr "" + +#: ../../library/turtle.rst:82 +msgid "Let's continue by drawing a triangle::" +msgstr "" + +#: ../../library/turtle.rst:88 +msgid "" +"Notice how the turtle, represented by an arrow, points in different " +"directions as you steer it." +msgstr "" + +#: ../../library/turtle.rst:91 +msgid "" +"Experiment with those commands, and also with ``backward()`` and ``right()``." +msgstr "" + +#: ../../library/turtle.rst:96 ../../library/turtle.rst:396 +#: ../../library/turtle.rst:1036 +msgid "Pen control" +msgstr "" -#: ../../library/turtle.rst:41 +#: ../../library/turtle.rst:98 +msgid "" +"Try changing the color - for example, ``color('blue')`` - and width of the " +"line - for example, ``width(3)`` - and then drawing again." +msgstr "" + +#: ../../library/turtle.rst:101 +msgid "" +"You can also move the turtle around without drawing, by lifting up the pen: " +"``up()`` before moving. To start drawing again, use ``down()``." +msgstr "" + +#: ../../library/turtle.rst:106 +msgid "The turtle's position" +msgstr "" + +#: ../../library/turtle.rst:108 msgid "" -"By combining together these and similar commands, intricate shapes and " -"pictures can easily be drawn." -msgstr "藉由結合這些類似的命令,複雜的形狀和圖形可以輕易被畫出來。" +"Send your turtle back to its starting-point (useful if it has disappeared " +"off-screen)::" +msgstr "" -#: ../../library/turtle.rst:44 +#: ../../library/turtle.rst:113 +msgid "" +"The home position is at the center of the turtle's screen. If you ever need " +"to know them, get the turtle's x-y co-ordinates with::" +msgstr "" + +#: ../../library/turtle.rst:118 +msgid "Home is at ``(0, 0)``." +msgstr "" + +#: ../../library/turtle.rst:120 +msgid "" +"And after a while, it will probably help to clear the window so we can start " +"anew::" +msgstr "" + +#: ../../library/turtle.rst:127 +msgid "Making algorithmic patterns" +msgstr "" + +#: ../../library/turtle.rst:129 +msgid "Using loops, it's possible to build up geometric patterns::" +msgstr "" + +#: ../../library/turtle.rst:138 +msgid "\\ - which of course, are limited only by the imagination!" +msgstr "" + +#: ../../library/turtle.rst:140 +msgid "" +"Let's draw the star shape at the top of this page. We want red lines, filled " +"in with yellow::" +msgstr "" + +#: ../../library/turtle.rst:146 +msgid "" +"Just as ``up()`` and ``down()`` determine whether lines will be drawn, " +"filling can be turned on and off::" +msgstr "" + +#: ../../library/turtle.rst:151 +msgid "Next we'll create a loop::" +msgstr "" + +#: ../../library/turtle.rst:159 +msgid "" +"``abs(pos()) < 1`` is a good way to know when the turtle is back at its home " +"position." +msgstr "" + +#: ../../library/turtle.rst:162 +msgid "Finally, complete the filling::" +msgstr "" + +#: ../../library/turtle.rst:166 +msgid "" +"(Note that filling only actually takes place when you give the " +"``end_fill()`` command.)" +msgstr "" + +#: ../../library/turtle.rst:173 +msgid "How to..." +msgstr "" + +#: ../../library/turtle.rst:175 +msgid "This section covers some typical turtle use-cases and approaches." +msgstr "" + +#: ../../library/turtle.rst:179 +msgid "Get started as quickly as possible" +msgstr "" + +#: ../../library/turtle.rst:181 +msgid "" +"One of the joys of turtle graphics is the immediate, visual feedback that's " +"available from simple commands - it's an excellent way to introduce children " +"to programming ideas, with a minimum of overhead (not just children, of " +"course)." +msgstr "" + +#: ../../library/turtle.rst:186 +msgid "" +"The turtle module makes this possible by exposing all its basic " +"functionality as functions, available with ``from turtle import *``. The :" +"ref:`turtle graphics tutorial ` covers this approach." +msgstr "" + +#: ../../library/turtle.rst:190 +msgid "" +"It's worth noting that many of the turtle commands also have even more terse " +"equivalents, such as ``fd()`` for :func:`forward`. These are especially " +"useful when working with learners for whom typing is not a skill." +msgstr "" + +#: ../../library/turtle.rst:196 +msgid "" +"You'll need to have the :mod:`Tk interface package ` installed on " +"your system for turtle graphics to work. Be warned that this is not always " +"straightforward, so check this in advance if you're planning to use turtle " +"graphics with a learner." +msgstr "" + +#: ../../library/turtle.rst:203 +msgid "Use the ``turtle`` module namespace" +msgstr "" + +#: ../../library/turtle.rst:205 +msgid "" +"Using ``from turtle import *`` is convenient - but be warned that it imports " +"a rather large collection of objects, and if you're doing anything but " +"turtle graphics you run the risk of a name conflict (this becomes even more " +"an issue if you're using turtle graphics in a script where other modules " +"might be imported)." +msgstr "" + +#: ../../library/turtle.rst:211 +msgid "" +"The solution is to use ``import turtle`` - ``fd()`` becomes ``turtle.fd()``, " +"``width()`` becomes ``turtle.width()`` and so on. (If typing \"turtle\" over " +"and over again becomes tedious, use for example ``import turtle as t`` " +"instead.)" +msgstr "" + +#: ../../library/turtle.rst:218 +msgid "Use turtle graphics in a script" +msgstr "" + +#: ../../library/turtle.rst:220 +msgid "" +"It's recommended to use the ``turtle`` module namespace as described " +"immediately above, for example::" +msgstr "" + +#: ../../library/turtle.rst:232 +msgid "" +"Another step is also required though - as soon as the script ends, Python " +"will also close the turtle's window. Add::" +msgstr "" + +#: ../../library/turtle.rst:237 +msgid "" +"to the end of the script. The script will now wait to be dismissed and will " +"not exit until it is terminated, for example by closing the turtle graphics " +"window." +msgstr "" + +#: ../../library/turtle.rst:243 +msgid "Use object-oriented turtle graphics" +msgstr "" + +#: ../../library/turtle.rst:245 +msgid "" +":ref:`Explanation of the object-oriented interface `" +msgstr "" + +#: ../../library/turtle.rst:247 +msgid "" +"Other than for very basic introductory purposes, or for trying things out as " +"quickly as possible, it's more usual and much more powerful to use the " +"object-oriented approach to turtle graphics. For example, this allows " +"multiple turtles on screen at once." +msgstr "" + +#: ../../library/turtle.rst:252 +msgid "" +"In this approach, the various turtle commands are methods of objects (mostly " +"of ``Turtle`` objects). You *can* use the object-oriented approach in the " +"shell, but it would be more typical in a Python script." +msgstr "" + +#: ../../library/turtle.rst:256 +msgid "The example above then becomes::" +msgstr "" + +#: ../../library/turtle.rst:270 +msgid "" +"Note the last line. ``t.screen`` is an instance of the :class:`Screen` that " +"a Turtle instance exists on; it's created automatically along with the " +"turtle." +msgstr "" + +#: ../../library/turtle.rst:274 +msgid "The turtle's screen can be customised, for example::" +msgstr "" + +#: ../../library/turtle.rst:283 +msgid "Explanation" +msgstr "" + +#: ../../library/turtle.rst:285 msgid "" "The :mod:`turtle` module is an extended reimplementation of the same-named " "module from the Python standard distribution up to version Python 2.5." msgstr "" -#: ../../library/turtle.rst:47 +#: ../../library/turtle.rst:288 msgid "" "It tries to keep the merits of the old turtle module and to be (nearly) 100% " "compatible with it. This means in the first place to enable the learning " @@ -79,7 +352,7 @@ msgid "" "using the module from within IDLE run with the ``-n`` switch." msgstr "" -#: ../../library/turtle.rst:52 +#: ../../library/turtle.rst:293 msgid "" "The turtle module provides turtle graphics primitives, in both object-" "oriented and procedure-oriented ways. Because it uses :mod:`tkinter` for " @@ -87,11 +360,11 @@ msgid "" "support." msgstr "" -#: ../../library/turtle.rst:56 +#: ../../library/turtle.rst:297 msgid "The object-oriented interface uses essentially two+two classes:" msgstr "" -#: ../../library/turtle.rst:58 +#: ../../library/turtle.rst:299 msgid "" "The :class:`TurtleScreen` class defines graphics windows as a playground for " "the drawing turtles. Its constructor needs a :class:`tkinter.Canvas` or a :" @@ -99,7 +372,7 @@ msgid "" "used as part of some application." msgstr "" -#: ../../library/turtle.rst:63 +#: ../../library/turtle.rst:304 msgid "" "The function :func:`Screen` returns a singleton object of a :class:" "`TurtleScreen` subclass. This function should be used when :mod:`turtle` is " @@ -107,13 +380,13 @@ msgid "" "inheriting from its class is not possible." msgstr "" -#: ../../library/turtle.rst:68 +#: ../../library/turtle.rst:309 msgid "" "All methods of TurtleScreen/Screen also exist as functions, i.e. as part of " "the procedure-oriented interface." msgstr "" -#: ../../library/turtle.rst:71 +#: ../../library/turtle.rst:312 msgid "" ":class:`RawTurtle` (alias: :class:`RawPen`) defines Turtle objects which " "draw on a :class:`TurtleScreen`. Its constructor needs a Canvas, " @@ -121,20 +394,20 @@ msgid "" "where to draw." msgstr "" -#: ../../library/turtle.rst:75 +#: ../../library/turtle.rst:316 msgid "" "Derived from RawTurtle is the subclass :class:`Turtle` (alias: :class:" "`Pen`), which draws on \"the\" :class:`Screen` instance which is " "automatically created, if not already present." msgstr "" -#: ../../library/turtle.rst:79 +#: ../../library/turtle.rst:320 msgid "" "All methods of RawTurtle/Turtle also exist as functions, i.e. part of the " "procedure-oriented interface." msgstr "" -#: ../../library/turtle.rst:82 +#: ../../library/turtle.rst:323 msgid "" "The procedural interface provides functions which are derived from the " "methods of the classes :class:`Screen` and :class:`Turtle`. They have the " @@ -144,32 +417,32 @@ msgid "" "functions derived from a Turtle method is called." msgstr "" -#: ../../library/turtle.rst:89 +#: ../../library/turtle.rst:330 msgid "" "To use multiple turtles on a screen one has to use the object-oriented " "interface." msgstr "" -#: ../../library/turtle.rst:92 +#: ../../library/turtle.rst:333 msgid "" "In the following documentation the argument list for functions is given. " "Methods, of course, have the additional first argument *self* which is " "omitted here." msgstr "" -#: ../../library/turtle.rst:98 -msgid "Overview of available Turtle and Screen methods" +#: ../../library/turtle.rst:339 +msgid "Turtle graphics reference" msgstr "" -#: ../../library/turtle.rst:101 +#: ../../library/turtle.rst:342 msgid "Turtle methods" msgstr "" -#: ../../library/turtle.rst:132 ../../library/turtle.rst:242 +#: ../../library/turtle.rst:373 ../../library/turtle.rst:483 msgid "Turtle motion" msgstr "" -#: ../../library/turtle.rst:120 +#: ../../library/turtle.rst:361 msgid "Move and draw" msgstr "" @@ -209,7 +482,7 @@ msgstr ":func:`setheading` | :func:`seth`" msgid ":func:`home`" msgstr ":func:`home`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2467 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2708 msgid ":func:`circle`" msgstr ":func:`circle`" @@ -217,7 +490,7 @@ msgstr ":func:`circle`" msgid ":func:`dot`" msgstr ":func:`dot`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2445 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2686 msgid ":func:`stamp`" msgstr ":func:`stamp`" @@ -237,7 +510,7 @@ msgstr ":func:`undo`" msgid ":func:`speed`" msgstr ":func:`speed`" -#: ../../library/turtle.rst:128 ../../library/turtle.rst:644 +#: ../../library/turtle.rst:369 ../../library/turtle.rst:885 msgid "Tell Turtle's state" msgstr "" @@ -265,7 +538,7 @@ msgstr ":func:`heading`" msgid ":func:`distance`" msgstr ":func:`distance`" -#: ../../library/turtle.rst:132 +#: ../../library/turtle.rst:373 msgid "Setting and measurement" msgstr "" @@ -277,11 +550,7 @@ msgstr ":func:`degrees`" msgid ":func:`radians`" msgstr ":func:`radians`" -#: ../../library/turtle.rst:155 ../../library/turtle.rst:795 -msgid "Pen control" -msgstr "" - -#: ../../library/turtle.rst:140 ../../library/turtle.rst:798 +#: ../../library/turtle.rst:381 ../../library/turtle.rst:1039 msgid "Drawing state" msgstr "" @@ -305,7 +574,7 @@ msgstr ":func:`pen`" msgid ":func:`isdown`" msgstr ":func:`isdown`" -#: ../../library/turtle.rst:145 ../../library/turtle.rst:890 +#: ../../library/turtle.rst:386 ../../library/turtle.rst:1131 msgid "Color control" msgstr "" @@ -321,7 +590,7 @@ msgstr ":func:`pencolor`" msgid ":func:`fillcolor`" msgstr ":func:`fillcolor`" -#: ../../library/turtle.rst:150 ../../library/turtle.rst:1022 +#: ../../library/turtle.rst:391 ../../library/turtle.rst:1263 msgid "Filling" msgstr "" @@ -337,7 +606,7 @@ msgstr ":func:`begin_fill`" msgid ":func:`end_fill`" msgstr ":func:`end_fill`" -#: ../../library/turtle.rst:155 ../../library/turtle.rst:1069 +#: ../../library/turtle.rst:396 ../../library/turtle.rst:1310 msgid "More drawing control" msgstr "" @@ -353,11 +622,11 @@ msgstr ":func:`clear`" msgid ":func:`write`" msgstr ":func:`write`" -#: ../../library/turtle.rst:172 ../../library/turtle.rst:1115 +#: ../../library/turtle.rst:413 ../../library/turtle.rst:1356 msgid "Turtle state" msgstr "" -#: ../../library/turtle.rst:161 ../../library/turtle.rst:1118 +#: ../../library/turtle.rst:402 ../../library/turtle.rst:1359 msgid "Visibility" msgstr "" @@ -373,7 +642,7 @@ msgstr ":func:`hideturtle` | :func:`ht`" msgid ":func:`isvisible`" msgstr ":func:`isvisible`" -#: ../../library/turtle.rst:172 ../../library/turtle.rst:1157 +#: ../../library/turtle.rst:413 ../../library/turtle.rst:1398 msgid "Appearance" msgstr "" @@ -413,11 +682,11 @@ msgstr ":func:`shapetransform`" msgid ":func:`get_shapepoly`" msgstr ":func:`get_shapepoly`" -#: ../../library/turtle.rst:177 ../../library/turtle.rst:1362 +#: ../../library/turtle.rst:418 ../../library/turtle.rst:1603 msgid "Using events" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2680 msgid ":func:`onclick`" msgstr ":func:`onclick`" @@ -425,11 +694,11 @@ msgstr ":func:`onclick`" msgid ":func:`onrelease`" msgstr ":func:`onrelease`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2663 msgid ":func:`ondrag`" msgstr ":func:`ondrag`" -#: ../../library/turtle.rst:188 ../../library/turtle.rst:1436 +#: ../../library/turtle.rst:429 ../../library/turtle.rst:1677 msgid "Special Turtle methods" msgstr "" @@ -445,7 +714,7 @@ msgstr ":func:`end_poly`" msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2461 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2702 msgid ":func:`clone`" msgstr ":func:`clone`" @@ -465,11 +734,11 @@ msgstr ":func:`setundobuffer`" msgid ":func:`undobufferentries`" msgstr ":func:`undobufferentries`" -#: ../../library/turtle.rst:191 +#: ../../library/turtle.rst:432 msgid "Methods of TurtleScreen/Screen" msgstr "" -#: ../../library/turtle.rst:199 ../../library/turtle.rst:1590 +#: ../../library/turtle.rst:440 ../../library/turtle.rst:1831 msgid "Window control" msgstr "" @@ -497,7 +766,7 @@ msgstr ":func:`screensize`" msgid ":func:`setworldcoordinates`" msgstr ":func:`setworldcoordinates`" -#: ../../library/turtle.rst:204 ../../library/turtle.rst:1713 +#: ../../library/turtle.rst:445 ../../library/turtle.rst:1954 msgid "Animation control" msgstr "" @@ -513,7 +782,7 @@ msgstr ":func:`tracer`" msgid ":func:`update`" msgstr ":func:`update`" -#: ../../library/turtle.rst:212 ../../library/turtle.rst:1766 +#: ../../library/turtle.rst:453 ../../library/turtle.rst:2007 msgid "Using screen events" msgstr "" @@ -541,7 +810,7 @@ msgstr ":func:`ontimer`" msgid ":func:`mainloop` | :func:`done`" msgstr ":func:`mainloop` | :func:`done`" -#: ../../library/turtle.rst:222 ../../library/turtle.rst:1911 +#: ../../library/turtle.rst:463 ../../library/turtle.rst:2152 msgid "Settings and special methods" msgstr "" @@ -577,7 +846,7 @@ msgstr ":func:`window_height`" msgid ":func:`window_width`" msgstr ":func:`window_width`" -#: ../../library/turtle.rst:226 ../../library/turtle.rst:1875 +#: ../../library/turtle.rst:467 ../../library/turtle.rst:2116 msgid "Input methods" msgstr "" @@ -589,7 +858,7 @@ msgstr ":func:`textinput`" msgid ":func:`numinput`" msgstr ":func:`numinput`" -#: ../../library/turtle.rst:233 +#: ../../library/turtle.rst:474 msgid "Methods specific to Screen" msgstr "" @@ -609,11 +878,11 @@ msgstr ":func:`setup`" msgid ":func:`title`" msgstr ":func:`title`" -#: ../../library/turtle.rst:236 +#: ../../library/turtle.rst:477 msgid "Methods of RawTurtle/Turtle and corresponding functions" msgstr "" -#: ../../library/turtle.rst:238 +#: ../../library/turtle.rst:479 msgid "" "Most of the examples in this section refer to a Turtle instance called " "``turtle``." @@ -623,135 +892,135 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/turtle.rst:247 ../../library/turtle.rst:292 -#: ../../library/turtle.rst:317 ../../library/turtle.rst:377 -#: ../../library/turtle.rst:400 ../../library/turtle.rst:423 +#: ../../library/turtle.rst:488 ../../library/turtle.rst:533 +#: ../../library/turtle.rst:558 ../../library/turtle.rst:618 +#: ../../library/turtle.rst:641 ../../library/turtle.rst:664 msgid "a number (integer or float)" msgstr "" -#: ../../library/turtle.rst:249 +#: ../../library/turtle.rst:490 msgid "" "Move the turtle forward by the specified *distance*, in the direction the " "turtle is headed." msgstr "" -#: ../../library/turtle.rst:269 ../../library/turtle.rst:473 -#: ../../library/turtle.rst:748 ../../library/turtle.rst:1256 -#: ../../library/turtle.rst:1275 +#: ../../library/turtle.rst:510 ../../library/turtle.rst:714 +#: ../../library/turtle.rst:989 ../../library/turtle.rst:1497 +#: ../../library/turtle.rst:1516 msgid "a number" msgstr "" -#: ../../library/turtle.rst:271 +#: ../../library/turtle.rst:512 msgid "" "Move the turtle backward by *distance*, opposite to the direction the turtle " "is headed. Do not change the turtle's heading." msgstr "" -#: ../../library/turtle.rst:294 +#: ../../library/turtle.rst:535 msgid "" "Turn turtle right by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:319 +#: ../../library/turtle.rst:560 msgid "" "Turn turtle left by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:343 +#: ../../library/turtle.rst:584 msgid "a number or a pair/vector of numbers" msgstr "" -#: ../../library/turtle.rst:344 +#: ../../library/turtle.rst:585 msgid "a number or ``None``" msgstr "" -#: ../../library/turtle.rst:346 +#: ../../library/turtle.rst:587 msgid "" "If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` (e." "g. as returned by :func:`pos`)." msgstr "" -#: ../../library/turtle.rst:349 +#: ../../library/turtle.rst:590 msgid "" "Move turtle to an absolute position. If the pen is down, draw line. Do not " "change the turtle's orientation." msgstr "" -#: ../../library/turtle.rst:379 +#: ../../library/turtle.rst:620 msgid "" "Set the turtle's first coordinate to *x*, leave second coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:402 +#: ../../library/turtle.rst:643 msgid "" "Set the turtle's second coordinate to *y*, leave first coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:425 +#: ../../library/turtle.rst:666 msgid "" "Set the orientation of the turtle to *to_angle*. Here are some common " "directions in degrees:" msgstr "" -#: ../../library/turtle.rst:429 +#: ../../library/turtle.rst:670 msgid "standard mode" msgstr "" -#: ../../library/turtle.rst:429 +#: ../../library/turtle.rst:670 msgid "logo mode" msgstr "" -#: ../../library/turtle.rst:431 +#: ../../library/turtle.rst:672 msgid "0 - east" msgstr "" -#: ../../library/turtle.rst:431 +#: ../../library/turtle.rst:672 msgid "0 - north" msgstr "" -#: ../../library/turtle.rst:432 +#: ../../library/turtle.rst:673 msgid "90 - north" msgstr "" -#: ../../library/turtle.rst:432 +#: ../../library/turtle.rst:673 msgid "90 - east" msgstr "" -#: ../../library/turtle.rst:433 +#: ../../library/turtle.rst:674 msgid "180 - west" msgstr "" -#: ../../library/turtle.rst:433 +#: ../../library/turtle.rst:674 msgid "180 - south" msgstr "" -#: ../../library/turtle.rst:434 +#: ../../library/turtle.rst:675 msgid "270 - south" msgstr "" -#: ../../library/turtle.rst:434 +#: ../../library/turtle.rst:675 msgid "270 - west" msgstr "" -#: ../../library/turtle.rst:447 +#: ../../library/turtle.rst:688 msgid "" "Move turtle to the origin -- coordinates (0,0) -- and set its heading to its " "start-orientation (which depends on the mode, see :func:`mode`)." msgstr "" -#: ../../library/turtle.rst:474 +#: ../../library/turtle.rst:715 msgid "a number (or ``None``)" msgstr "" -#: ../../library/turtle.rst:475 ../../library/turtle.rst:569 +#: ../../library/turtle.rst:716 ../../library/turtle.rst:810 msgid "an integer (or ``None``)" msgstr "" -#: ../../library/turtle.rst:477 +#: ../../library/turtle.rst:718 msgid "" "Draw a circle with given *radius*. The center is *radius* units left of the " "turtle; *extent* -- an angle -- determines which part of the circle is " @@ -762,117 +1031,117 @@ msgid "" "changed by the amount of *extent*." msgstr "" -#: ../../library/turtle.rst:485 +#: ../../library/turtle.rst:726 msgid "" "As the circle is approximated by an inscribed regular polygon, *steps* " "determines the number of steps to use. If not given, it will be calculated " "automatically. May be used to draw regular polygons." msgstr "" -#: ../../library/turtle.rst:511 +#: ../../library/turtle.rst:752 msgid "an integer >= 1 (if given)" msgstr "" -#: ../../library/turtle.rst:512 +#: ../../library/turtle.rst:753 msgid "a colorstring or a numeric color tuple" msgstr "" -#: ../../library/turtle.rst:514 +#: ../../library/turtle.rst:755 msgid "" "Draw a circular dot with diameter *size*, using *color*. If *size* is not " "given, the maximum of pensize+4 and 2*pensize is used." msgstr "" -#: ../../library/turtle.rst:532 +#: ../../library/turtle.rst:773 msgid "" "Stamp a copy of the turtle shape onto the canvas at the current turtle " "position. Return a stamp_id for that stamp, which can be used to delete it " "by calling ``clearstamp(stamp_id)``." msgstr "" -#: ../../library/turtle.rst:547 +#: ../../library/turtle.rst:788 msgid "an integer, must be return value of previous :func:`stamp` call" msgstr "" -#: ../../library/turtle.rst:550 +#: ../../library/turtle.rst:791 msgid "Delete stamp with given *stampid*." msgstr "" -#: ../../library/turtle.rst:571 +#: ../../library/turtle.rst:812 msgid "" "Delete all or first/last *n* of turtle's stamps. If *n* is ``None``, delete " "all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete last " "*n* stamps." msgstr "" -#: ../../library/turtle.rst:594 +#: ../../library/turtle.rst:835 msgid "" "Undo (repeatedly) the last turtle action(s). Number of available undo " "actions is determined by the size of the undobuffer." msgstr "" -#: ../../library/turtle.rst:609 +#: ../../library/turtle.rst:850 msgid "an integer in the range 0..10 or a speedstring (see below)" msgstr "" -#: ../../library/turtle.rst:611 +#: ../../library/turtle.rst:852 msgid "" "Set the turtle's speed to an integer value in the range 0..10. If no " "argument is given, return current speed." msgstr "" -#: ../../library/turtle.rst:614 +#: ../../library/turtle.rst:855 msgid "" "If input is a number greater than 10 or smaller than 0.5, speed is set to " "0. Speedstrings are mapped to speedvalues as follows:" msgstr "" -#: ../../library/turtle.rst:617 +#: ../../library/turtle.rst:858 msgid "\"fastest\": 0" msgstr "" -#: ../../library/turtle.rst:618 +#: ../../library/turtle.rst:859 msgid "\"fast\": 10" msgstr "" -#: ../../library/turtle.rst:619 +#: ../../library/turtle.rst:860 msgid "\"normal\": 6" msgstr "" -#: ../../library/turtle.rst:620 +#: ../../library/turtle.rst:861 msgid "\"slow\": 3" msgstr "" -#: ../../library/turtle.rst:621 +#: ../../library/turtle.rst:862 msgid "\"slowest\": 1" msgstr "" -#: ../../library/turtle.rst:623 +#: ../../library/turtle.rst:864 msgid "" "Speeds from 1 to 10 enforce increasingly faster animation of line drawing " "and turtle turning." msgstr "" -#: ../../library/turtle.rst:626 +#: ../../library/turtle.rst:867 msgid "" "Attention: *speed* = 0 means that *no* animation takes place. forward/back " "makes turtle jump and likewise left/right make the turtle turn instantly." msgstr "" -#: ../../library/turtle.rst:649 +#: ../../library/turtle.rst:890 msgid "" "Return the turtle's current location (x,y) (as a :class:`Vec2D` vector)." msgstr "" -#: ../../library/turtle.rst:660 ../../library/turtle.rst:723 +#: ../../library/turtle.rst:901 ../../library/turtle.rst:964 msgid "a number or a pair/vector of numbers or a turtle instance" msgstr "" -#: ../../library/turtle.rst:661 ../../library/turtle.rst:724 +#: ../../library/turtle.rst:902 ../../library/turtle.rst:965 msgid "a number if *x* is a number, else ``None``" msgstr "" -#: ../../library/turtle.rst:663 +#: ../../library/turtle.rst:904 msgid "" "Return the angle between the line from turtle position to position specified " "by (x,y), the vector or the other turtle. This depends on the turtle's " @@ -880,116 +1149,116 @@ msgid "" "\"logo\"." msgstr "" -#: ../../library/turtle.rst:677 +#: ../../library/turtle.rst:918 msgid "Return the turtle's x coordinate." msgstr "" -#: ../../library/turtle.rst:693 +#: ../../library/turtle.rst:934 msgid "Return the turtle's y coordinate." msgstr "" -#: ../../library/turtle.rst:709 +#: ../../library/turtle.rst:950 msgid "" "Return the turtle's current heading (value depends on the turtle mode, see :" "func:`mode`)." msgstr "" -#: ../../library/turtle.rst:726 +#: ../../library/turtle.rst:967 msgid "" "Return the distance from the turtle to (x,y), the given vector, or the given " "other turtle, in turtle step units." msgstr "" -#: ../../library/turtle.rst:744 +#: ../../library/turtle.rst:985 msgid "Settings for measurement" msgstr "" -#: ../../library/turtle.rst:750 +#: ../../library/turtle.rst:991 msgid "" "Set angle measurement units, i.e. set number of \"degrees\" for a full " "circle. Default value is 360 degrees." msgstr "" -#: ../../library/turtle.rst:773 +#: ../../library/turtle.rst:1014 msgid "" "Set the angle measurement units to radians. Equivalent to ``degrees(2*math." "pi)``." msgstr "" -#: ../../library/turtle.rst:804 +#: ../../library/turtle.rst:1045 msgid "Pull the pen down -- drawing when moving." msgstr "" -#: ../../library/turtle.rst:811 +#: ../../library/turtle.rst:1052 msgid "Pull the pen up -- no drawing when moving." msgstr "" -#: ../../library/turtle.rst:817 +#: ../../library/turtle.rst:1058 msgid "a positive number" msgstr "" -#: ../../library/turtle.rst:819 +#: ../../library/turtle.rst:1060 msgid "" "Set the line thickness to *width* or return it. If resizemode is set to " "\"auto\" and turtleshape is a polygon, that polygon is drawn with the same " "line thickness. If no argument is given, the current pensize is returned." msgstr "" -#: ../../library/turtle.rst:833 +#: ../../library/turtle.rst:1074 msgid "a dictionary with some or all of the below listed keys" msgstr "" -#: ../../library/turtle.rst:834 +#: ../../library/turtle.rst:1075 msgid "one or more keyword-arguments with the below listed keys as keywords" msgstr "" -#: ../../library/turtle.rst:836 +#: ../../library/turtle.rst:1077 msgid "" "Return or set the pen's attributes in a \"pen-dictionary\" with the " "following key/value pairs:" msgstr "" -#: ../../library/turtle.rst:839 +#: ../../library/turtle.rst:1080 msgid "\"shown\": True/False" msgstr "" -#: ../../library/turtle.rst:840 +#: ../../library/turtle.rst:1081 msgid "\"pendown\": True/False" msgstr "" -#: ../../library/turtle.rst:841 +#: ../../library/turtle.rst:1082 msgid "\"pencolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:842 +#: ../../library/turtle.rst:1083 msgid "\"fillcolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:843 +#: ../../library/turtle.rst:1084 msgid "\"pensize\": positive number" msgstr "" -#: ../../library/turtle.rst:844 +#: ../../library/turtle.rst:1085 msgid "\"speed\": number in range 0..10" msgstr "" -#: ../../library/turtle.rst:845 +#: ../../library/turtle.rst:1086 msgid "\"resizemode\": \"auto\" or \"user\" or \"noresize\"" msgstr "" -#: ../../library/turtle.rst:846 +#: ../../library/turtle.rst:1087 msgid "\"stretchfactor\": (positive number, positive number)" msgstr "" -#: ../../library/turtle.rst:847 +#: ../../library/turtle.rst:1088 msgid "\"outline\": positive number" msgstr "" -#: ../../library/turtle.rst:848 +#: ../../library/turtle.rst:1089 msgid "\"tilt\": number" msgstr "" -#: ../../library/turtle.rst:850 +#: ../../library/turtle.rst:1091 msgid "" "This dictionary can be used as argument for a subsequent call to :func:`pen` " "to restore the former pen-state. Moreover one or more of these attributes " @@ -997,182 +1266,182 @@ msgid "" "attributes in one statement." msgstr "" -#: ../../library/turtle.rst:876 +#: ../../library/turtle.rst:1117 msgid "Return ``True`` if pen is down, ``False`` if it's up." msgstr "" -#: ../../library/turtle.rst:894 +#: ../../library/turtle.rst:1135 msgid "Return or set the pencolor." msgstr "" -#: ../../library/turtle.rst:896 ../../library/turtle.rst:945 +#: ../../library/turtle.rst:1137 ../../library/turtle.rst:1186 msgid "Four input formats are allowed:" msgstr "" -#: ../../library/turtle.rst:901 +#: ../../library/turtle.rst:1142 msgid "``pencolor()``" msgstr "``pencolor()``" -#: ../../library/turtle.rst:899 +#: ../../library/turtle.rst:1140 msgid "" "Return the current pencolor as color specification string or as a tuple (see " "example). May be used as input to another color/pencolor/fillcolor call." msgstr "" -#: ../../library/turtle.rst:905 +#: ../../library/turtle.rst:1146 msgid "``pencolor(colorstring)``" msgstr "``pencolor(colorstring)``" -#: ../../library/turtle.rst:904 +#: ../../library/turtle.rst:1145 msgid "" "Set pencolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:910 +#: ../../library/turtle.rst:1151 msgid "``pencolor((r, g, b))``" msgstr "``pencolor((r, g, b))``" -#: ../../library/turtle.rst:908 +#: ../../library/turtle.rst:1149 msgid "" "Set pencolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:914 +#: ../../library/turtle.rst:1155 msgid "``pencolor(r, g, b)``" msgstr "``pencolor(r, g, b)``" -#: ../../library/turtle.rst:913 +#: ../../library/turtle.rst:1154 msgid "" "Set pencolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:916 +#: ../../library/turtle.rst:1157 msgid "" "If turtleshape is a polygon, the outline of that polygon is drawn with the " "newly set pencolor." msgstr "" -#: ../../library/turtle.rst:943 +#: ../../library/turtle.rst:1184 msgid "Return or set the fillcolor." msgstr "" -#: ../../library/turtle.rst:950 +#: ../../library/turtle.rst:1191 msgid "``fillcolor()``" msgstr "``fillcolor()``" -#: ../../library/turtle.rst:948 +#: ../../library/turtle.rst:1189 msgid "" "Return the current fillcolor as color specification string, possibly in " "tuple format (see example). May be used as input to another color/pencolor/" "fillcolor call." msgstr "" -#: ../../library/turtle.rst:954 +#: ../../library/turtle.rst:1195 msgid "``fillcolor(colorstring)``" msgstr "``fillcolor(colorstring)``" -#: ../../library/turtle.rst:953 +#: ../../library/turtle.rst:1194 msgid "" "Set fillcolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:959 +#: ../../library/turtle.rst:1200 msgid "``fillcolor((r, g, b))``" msgstr "``fillcolor((r, g, b))``" -#: ../../library/turtle.rst:957 +#: ../../library/turtle.rst:1198 msgid "" "Set fillcolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:963 +#: ../../library/turtle.rst:1204 msgid "``fillcolor(r, g, b)``" msgstr "``fillcolor(r, g, b)``" -#: ../../library/turtle.rst:962 +#: ../../library/turtle.rst:1203 msgid "" "Set fillcolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:965 +#: ../../library/turtle.rst:1206 msgid "" "If turtleshape is a polygon, the interior of that polygon is drawn with the " "newly set fillcolor." msgstr "" -#: ../../library/turtle.rst:986 +#: ../../library/turtle.rst:1227 msgid "Return or set pencolor and fillcolor." msgstr "" -#: ../../library/turtle.rst:988 +#: ../../library/turtle.rst:1229 msgid "" "Several input formats are allowed. They use 0 to 3 arguments as follows:" msgstr "" -#: ../../library/turtle.rst:994 +#: ../../library/turtle.rst:1235 msgid "``color()``" msgstr "``color()``" -#: ../../library/turtle.rst:992 +#: ../../library/turtle.rst:1233 msgid "" "Return the current pencolor and the current fillcolor as a pair of color " "specification strings or tuples as returned by :func:`pencolor` and :func:" "`fillcolor`." msgstr "" -#: ../../library/turtle.rst:998 +#: ../../library/turtle.rst:1239 msgid "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" msgstr "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" -#: ../../library/turtle.rst:997 +#: ../../library/turtle.rst:1238 msgid "" "Inputs as in :func:`pencolor`, set both, fillcolor and pencolor, to the " "given value." msgstr "" -#: ../../library/turtle.rst:1002 +#: ../../library/turtle.rst:1243 msgid "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" msgstr "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" -#: ../../library/turtle.rst:1001 +#: ../../library/turtle.rst:1242 msgid "" "Equivalent to ``pencolor(colorstring1)`` and ``fillcolor(colorstring2)`` and " "analogously if the other input format is used." msgstr "" -#: ../../library/turtle.rst:1004 +#: ../../library/turtle.rst:1245 msgid "" "If turtleshape is a polygon, outline and interior of that polygon is drawn " "with the newly set colors." msgstr "" -#: ../../library/turtle.rst:1018 +#: ../../library/turtle.rst:1259 msgid "See also: Screen method :func:`colormode`." msgstr "" -#: ../../library/turtle.rst:1032 +#: ../../library/turtle.rst:1273 msgid "Return fillstate (``True`` if filling, ``False`` else)." msgstr "" -#: ../../library/turtle.rst:1047 +#: ../../library/turtle.rst:1288 msgid "To be called just before drawing a shape to be filled." msgstr "" -#: ../../library/turtle.rst:1052 +#: ../../library/turtle.rst:1293 msgid "Fill the shape drawn after the last call to :func:`begin_fill`." msgstr "" -#: ../../library/turtle.rst:1054 +#: ../../library/turtle.rst:1295 msgid "" "Whether or not overlap regions for self-intersecting polygons or multiple " "shapes are filled depends on the operating system graphics, type of overlap, " @@ -1180,36 +1449,36 @@ msgid "" "all yellow or have some white regions." msgstr "" -#: ../../library/turtle.rst:1073 +#: ../../library/turtle.rst:1314 msgid "" "Delete the turtle's drawings from the screen, re-center the turtle and set " "variables to the default values." msgstr "" -#: ../../library/turtle.rst:1094 +#: ../../library/turtle.rst:1335 msgid "" "Delete the turtle's drawings from the screen. Do not move turtle. State " "and position of the turtle as well as drawings of other turtles are not " "affected." msgstr "" -#: ../../library/turtle.rst:1100 +#: ../../library/turtle.rst:1341 msgid "object to be written to the TurtleScreen" msgstr "" -#: ../../library/turtle.rst:1101 +#: ../../library/turtle.rst:1342 msgid "True/False" msgstr "" -#: ../../library/turtle.rst:1102 +#: ../../library/turtle.rst:1343 msgid "one of the strings \"left\", \"center\" or right\"" msgstr "" -#: ../../library/turtle.rst:1103 +#: ../../library/turtle.rst:1344 msgid "a triple (fontname, fontsize, fonttype)" msgstr "" -#: ../../library/turtle.rst:1105 +#: ../../library/turtle.rst:1346 msgid "" "Write text - the string representation of *arg* - at the current turtle " "position according to *align* (\"left\", \"center\" or \"right\") and with " @@ -1217,26 +1486,26 @@ msgid "" "corner of the text. By default, *move* is ``False``." msgstr "" -#: ../../library/turtle.rst:1123 +#: ../../library/turtle.rst:1364 msgid "" "Make the turtle invisible. It's a good idea to do this while you're in the " "middle of doing some complex drawing, because hiding the turtle speeds up " "the drawing observably." msgstr "" -#: ../../library/turtle.rst:1136 +#: ../../library/turtle.rst:1377 msgid "Make the turtle visible." msgstr "" -#: ../../library/turtle.rst:1146 +#: ../../library/turtle.rst:1387 msgid "Return ``True`` if the Turtle is shown, ``False`` if it's hidden." msgstr "" -#: ../../library/turtle.rst:1161 +#: ../../library/turtle.rst:1402 msgid "a string which is a valid shapename" msgstr "" -#: ../../library/turtle.rst:1163 +#: ../../library/turtle.rst:1404 msgid "" "Set turtle shape to shape with given *name* or, if name is not given, return " "name of current shape. Shape with *name* must exist in the TurtleScreen's " @@ -1246,45 +1515,45 @@ msgid "" "`register_shape`." msgstr "" -#: ../../library/turtle.rst:1181 +#: ../../library/turtle.rst:1422 msgid "one of the strings \"auto\", \"user\", \"noresize\"" msgstr "" -#: ../../library/turtle.rst:1183 +#: ../../library/turtle.rst:1424 msgid "" "Set resizemode to one of the values: \"auto\", \"user\", \"noresize\". If " "*rmode* is not given, return current resizemode. Different resizemodes have " "the following effects:" msgstr "" -#: ../../library/turtle.rst:1187 +#: ../../library/turtle.rst:1428 msgid "" "\"auto\": adapts the appearance of the turtle corresponding to the value of " "pensize." msgstr "" -#: ../../library/turtle.rst:1188 +#: ../../library/turtle.rst:1429 msgid "" "\"user\": adapts the appearance of the turtle according to the values of " "stretchfactor and outlinewidth (outline), which are set by :func:`shapesize`." msgstr "" -#: ../../library/turtle.rst:1191 +#: ../../library/turtle.rst:1432 msgid "\"noresize\": no adaption of the turtle's appearance takes place." msgstr "" -#: ../../library/turtle.rst:1193 +#: ../../library/turtle.rst:1434 msgid "" "``resizemode(\"user\")`` is called by :func:`shapesize` when used with " "arguments." msgstr "" -#: ../../library/turtle.rst:1208 ../../library/turtle.rst:1209 -#: ../../library/turtle.rst:1210 +#: ../../library/turtle.rst:1449 ../../library/turtle.rst:1450 +#: ../../library/turtle.rst:1451 msgid "positive number" msgstr "" -#: ../../library/turtle.rst:1212 +#: ../../library/turtle.rst:1453 msgid "" "Return or set the pen's attributes x/y-stretchfactors and/or outline. Set " "resizemode to \"user\". If and only if resizemode is set to \"user\", the " @@ -1294,12 +1563,12 @@ msgid "" "determines the width of the shape's outline." msgstr "" -#: ../../library/turtle.rst:1235 ../../library/turtle.rst:1894 -#: ../../library/turtle.rst:1895 ../../library/turtle.rst:1896 +#: ../../library/turtle.rst:1476 ../../library/turtle.rst:2135 +#: ../../library/turtle.rst:2136 ../../library/turtle.rst:2137 msgid "number (optional)" msgstr "" -#: ../../library/turtle.rst:1237 +#: ../../library/turtle.rst:1478 msgid "" "Set or return the current shearfactor. Shear the turtleshape according to " "the given shearfactor shear, which is the tangent of the shear angle. Do " @@ -1308,26 +1577,26 @@ msgid "" "by which lines parallel to the heading of the turtle are sheared." msgstr "" -#: ../../library/turtle.rst:1258 +#: ../../library/turtle.rst:1499 msgid "" "Rotate the turtleshape by *angle* from its current tilt-angle, but do *not* " "change the turtle's heading (direction of movement)." msgstr "" -#: ../../library/turtle.rst:1277 +#: ../../library/turtle.rst:1518 msgid "" "Rotate the turtleshape to point in the direction specified by *angle*, " "regardless of its current tilt-angle. *Do not* change the turtle's heading " "(direction of movement)." msgstr "" -#: ../../library/turtle.rst:1297 ../../library/turtle.rst:1320 -#: ../../library/turtle.rst:1321 ../../library/turtle.rst:1322 -#: ../../library/turtle.rst:1323 +#: ../../library/turtle.rst:1538 ../../library/turtle.rst:1561 +#: ../../library/turtle.rst:1562 ../../library/turtle.rst:1563 +#: ../../library/turtle.rst:1564 msgid "a number (optional)" msgstr "" -#: ../../library/turtle.rst:1299 +#: ../../library/turtle.rst:1540 msgid "" "Set or return the current tilt-angle. If angle is given, rotate the " "turtleshape to point in the direction specified by angle, regardless of its " @@ -1337,11 +1606,11 @@ msgid "" "turtle (its direction of movement)." msgstr "" -#: ../../library/turtle.rst:1325 +#: ../../library/turtle.rst:1566 msgid "Set or return the current transformation matrix of the turtle shape." msgstr "" -#: ../../library/turtle.rst:1327 +#: ../../library/turtle.rst:1568 msgid "" "If none of the matrix elements are given, return the transformation matrix " "as a tuple of 4 elements. Otherwise set the given elements and transform the " @@ -1351,101 +1620,101 @@ msgid "" "tiltangle according to the given matrix." msgstr "" -#: ../../library/turtle.rst:1349 +#: ../../library/turtle.rst:1590 msgid "" "Return the current shape polygon as tuple of coordinate pairs. This can be " "used to define a new shape or components of a compound shape." msgstr "" -#: ../../library/turtle.rst:1367 ../../library/turtle.rst:1389 -#: ../../library/turtle.rst:1414 ../../library/turtle.rst:1818 +#: ../../library/turtle.rst:1608 ../../library/turtle.rst:1630 +#: ../../library/turtle.rst:1655 ../../library/turtle.rst:2059 msgid "" "a function with two arguments which will be called with the coordinates of " "the clicked point on the canvas" msgstr "" -#: ../../library/turtle.rst:1369 ../../library/turtle.rst:1391 -#: ../../library/turtle.rst:1416 ../../library/turtle.rst:1820 +#: ../../library/turtle.rst:1610 ../../library/turtle.rst:1632 +#: ../../library/turtle.rst:1657 ../../library/turtle.rst:2061 msgid "number of the mouse-button, defaults to 1 (left mouse button)" msgstr "" -#: ../../library/turtle.rst:1370 ../../library/turtle.rst:1392 -#: ../../library/turtle.rst:1417 ../../library/turtle.rst:1821 +#: ../../library/turtle.rst:1611 ../../library/turtle.rst:1633 +#: ../../library/turtle.rst:1658 ../../library/turtle.rst:2062 msgid "" "``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise " "it will replace a former binding" msgstr "" -#: ../../library/turtle.rst:1373 +#: ../../library/turtle.rst:1614 msgid "" "Bind *fun* to mouse-click events on this turtle. If *fun* is ``None``, " "existing bindings are removed. Example for the anonymous turtle, i.e. the " "procedural way:" msgstr "" -#: ../../library/turtle.rst:1395 +#: ../../library/turtle.rst:1636 msgid "" "Bind *fun* to mouse-button-release events on this turtle. If *fun* is " "``None``, existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1420 +#: ../../library/turtle.rst:1661 msgid "" "Bind *fun* to mouse-move events on this turtle. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1423 +#: ../../library/turtle.rst:1664 msgid "" "Remark: Every sequence of mouse-move-events on a turtle is preceded by a " "mouse-click event on that turtle." msgstr "" -#: ../../library/turtle.rst:1431 +#: ../../library/turtle.rst:1672 msgid "" "Subsequently, clicking and dragging the Turtle will move it across the " "screen thereby producing handdrawings (if pen is down)." msgstr "" -#: ../../library/turtle.rst:1440 +#: ../../library/turtle.rst:1681 msgid "" "Start recording the vertices of a polygon. Current turtle position is first " "vertex of polygon." msgstr "" -#: ../../library/turtle.rst:1446 +#: ../../library/turtle.rst:1687 msgid "" "Stop recording the vertices of a polygon. Current turtle position is last " "vertex of polygon. This will be connected with the first vertex." msgstr "" -#: ../../library/turtle.rst:1452 +#: ../../library/turtle.rst:1693 msgid "Return the last recorded polygon." msgstr "" -#: ../../library/turtle.rst:1471 +#: ../../library/turtle.rst:1712 msgid "" "Create and return a clone of the turtle with same position, heading and " "turtle properties." msgstr "" -#: ../../library/turtle.rst:1484 +#: ../../library/turtle.rst:1725 msgid "" "Return the Turtle object itself. Only reasonable use: as a function to " "return the \"anonymous turtle\":" msgstr "" -#: ../../library/turtle.rst:1498 +#: ../../library/turtle.rst:1739 msgid "" "Return the :class:`TurtleScreen` object the turtle is drawing on. " "TurtleScreen methods can then be called for that object." msgstr "" -#: ../../library/turtle.rst:1512 +#: ../../library/turtle.rst:1753 msgid "an integer or ``None``" msgstr "" -#: ../../library/turtle.rst:1514 +#: ../../library/turtle.rst:1755 msgid "" "Set or disable undobuffer. If *size* is an integer, an empty undobuffer of " "given size is installed. *size* gives the maximum number of turtle actions " @@ -1453,71 +1722,71 @@ msgid "" "``None``, the undobuffer is disabled." msgstr "" -#: ../../library/turtle.rst:1527 +#: ../../library/turtle.rst:1768 msgid "Return number of entries in the undobuffer." msgstr "" -#: ../../library/turtle.rst:1540 +#: ../../library/turtle.rst:1781 msgid "Compound shapes" msgstr "" -#: ../../library/turtle.rst:1542 +#: ../../library/turtle.rst:1783 msgid "" "To use compound turtle shapes, which consist of several polygons of " "different color, you must use the helper class :class:`Shape` explicitly as " "described below:" msgstr "" -#: ../../library/turtle.rst:1546 +#: ../../library/turtle.rst:1787 msgid "Create an empty Shape object of type \"compound\"." msgstr "" -#: ../../library/turtle.rst:1547 +#: ../../library/turtle.rst:1788 msgid "" "Add as many components to this object as desired, using the :meth:`~Shape." "addcomponent` method." msgstr "" -#: ../../library/turtle.rst:1550 +#: ../../library/turtle.rst:1791 msgid "For example:" msgstr "舉例來說:" -#: ../../library/turtle.rst:1561 +#: ../../library/turtle.rst:1802 msgid "Now add the Shape to the Screen's shapelist and use it:" msgstr "" -#: ../../library/turtle.rst:1572 +#: ../../library/turtle.rst:1813 msgid "" "The :class:`Shape` class is used internally by the :func:`register_shape` " "method in different ways. The application programmer has to deal with the " "Shape class *only* when using compound shapes like shown above!" msgstr "" -#: ../../library/turtle.rst:1578 +#: ../../library/turtle.rst:1819 msgid "Methods of TurtleScreen/Screen and corresponding functions" msgstr "" -#: ../../library/turtle.rst:1580 +#: ../../library/turtle.rst:1821 msgid "" "Most of the examples in this section refer to a TurtleScreen instance called " "``screen``." msgstr "" -#: ../../library/turtle.rst:1594 +#: ../../library/turtle.rst:1835 msgid "" "a color string or three numbers in the range 0..colormode or a 3-tuple of " "such numbers" msgstr "" -#: ../../library/turtle.rst:1598 +#: ../../library/turtle.rst:1839 msgid "Set or return background color of the TurtleScreen." msgstr "" -#: ../../library/turtle.rst:1613 +#: ../../library/turtle.rst:1854 msgid "a string, name of a gif-file or ``\"nopic\"``, or ``None``" msgstr "" -#: ../../library/turtle.rst:1615 +#: ../../library/turtle.rst:1856 msgid "" "Set background image or return name of current backgroundimage. If " "*picname* is a filename, set the corresponding image as background. If " @@ -1525,44 +1794,44 @@ msgid "" "*picname* is ``None``, return the filename of the current backgroundimage. ::" msgstr "" -#: ../../library/turtle.rst:1631 +#: ../../library/turtle.rst:1872 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``clearscreen``. The global function ``clear`` is a different one " "derived from the Turtle method ``clear``." msgstr "" -#: ../../library/turtle.rst:1638 +#: ../../library/turtle.rst:1879 msgid "" "Delete all drawings and all turtles from the TurtleScreen. Reset the now " "empty TurtleScreen to its initial state: white background, no background " "image, no event bindings and tracing on." msgstr "" -#: ../../library/turtle.rst:1647 +#: ../../library/turtle.rst:1888 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``resetscreen``. The global function ``reset`` is another one derived " "from the Turtle method ``reset``." msgstr "" -#: ../../library/turtle.rst:1654 +#: ../../library/turtle.rst:1895 msgid "Reset all Turtles on the Screen to their initial state." msgstr "" -#: ../../library/turtle.rst:1659 +#: ../../library/turtle.rst:1900 msgid "positive integer, new width of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1660 +#: ../../library/turtle.rst:1901 msgid "positive integer, new height of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1661 +#: ../../library/turtle.rst:1902 msgid "colorstring or color-tuple, new background color" msgstr "" -#: ../../library/turtle.rst:1663 +#: ../../library/turtle.rst:1904 msgid "" "If no arguments are given, return current (canvaswidth, canvasheight). Else " "resize the canvas the turtles are drawing on. Do not alter the drawing " @@ -1571,59 +1840,59 @@ msgid "" "outside the canvas before." msgstr "" -#: ../../library/turtle.rst:1675 +#: ../../library/turtle.rst:1916 msgid "e.g. to search for an erroneously escaped turtle ;-)" msgstr "" -#: ../../library/turtle.rst:1680 +#: ../../library/turtle.rst:1921 msgid "a number, x-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1681 +#: ../../library/turtle.rst:1922 msgid "a number, y-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1682 +#: ../../library/turtle.rst:1923 msgid "a number, x-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1683 +#: ../../library/turtle.rst:1924 msgid "a number, y-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1685 +#: ../../library/turtle.rst:1926 msgid "" "Set up user-defined coordinate system and switch to mode \"world\" if " "necessary. This performs a ``screen.reset()``. If mode \"world\" is " "already active, all drawings are redrawn according to the new coordinates." msgstr "" -#: ../../library/turtle.rst:1689 +#: ../../library/turtle.rst:1930 msgid "" "**ATTENTION**: in user-defined coordinate systems angles may appear " "distorted." msgstr "" -#: ../../library/turtle.rst:1717 +#: ../../library/turtle.rst:1958 msgid "positive integer" msgstr "" -#: ../../library/turtle.rst:1719 +#: ../../library/turtle.rst:1960 msgid "" "Set or return the drawing *delay* in milliseconds. (This is approximately " "the time interval between two consecutive canvas updates.) The longer the " "drawing delay, the slower the animation." msgstr "" -#: ../../library/turtle.rst:1723 +#: ../../library/turtle.rst:1964 msgid "Optional argument:" msgstr "" -#: ../../library/turtle.rst:1737 ../../library/turtle.rst:1738 +#: ../../library/turtle.rst:1978 ../../library/turtle.rst:1979 msgid "nonnegative integer" msgstr "" -#: ../../library/turtle.rst:1740 +#: ../../library/turtle.rst:1981 msgid "" "Turn turtle animation on/off and set delay for update drawings. If *n* is " "given, only each n-th regular screen update is really performed. (Can be " @@ -1632,75 +1901,75 @@ msgid "" "delay value (see :func:`delay`)." msgstr "" -#: ../../library/turtle.rst:1760 +#: ../../library/turtle.rst:2001 msgid "Perform a TurtleScreen update. To be used when tracer is turned off." msgstr "" -#: ../../library/turtle.rst:1762 +#: ../../library/turtle.rst:2003 msgid "See also the RawTurtle/Turtle method :func:`speed`." msgstr "" -#: ../../library/turtle.rst:1770 +#: ../../library/turtle.rst:2011 msgid "" "Set focus on TurtleScreen (in order to collect key-events). Dummy arguments " "are provided in order to be able to pass :func:`listen` to the onclick " "method." msgstr "" -#: ../../library/turtle.rst:1777 ../../library/turtle.rst:1797 +#: ../../library/turtle.rst:2018 ../../library/turtle.rst:2038 msgid "a function with no arguments or ``None``" msgstr "" -#: ../../library/turtle.rst:1778 ../../library/turtle.rst:1798 +#: ../../library/turtle.rst:2019 ../../library/turtle.rst:2039 msgid "a string: key (e.g. \"a\") or key-symbol (e.g. \"space\")" msgstr "" -#: ../../library/turtle.rst:1780 +#: ../../library/turtle.rst:2021 msgid "" "Bind *fun* to key-release event of key. If *fun* is ``None``, event " "bindings are removed. Remark: in order to be able to register key-events, " "TurtleScreen must have the focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1800 +#: ../../library/turtle.rst:2041 msgid "" "Bind *fun* to key-press event of key if key is given, or to any key-press-" "event if no key is given. Remark: in order to be able to register key-" "events, TurtleScreen must have focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1824 +#: ../../library/turtle.rst:2065 msgid "" "Bind *fun* to mouse-click events on this screen. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1827 +#: ../../library/turtle.rst:2068 msgid "" "Example for a TurtleScreen instance named ``screen`` and a Turtle instance " "named ``turtle``:" msgstr "" -#: ../../library/turtle.rst:1838 +#: ../../library/turtle.rst:2079 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``onscreenclick``. The global function ``onclick`` is another one " "derived from the Turtle method ``onclick``." msgstr "" -#: ../../library/turtle.rst:1845 +#: ../../library/turtle.rst:2086 msgid "a function with no arguments" msgstr "" -#: ../../library/turtle.rst:1846 +#: ../../library/turtle.rst:2087 msgid "a number >= 0" msgstr "" -#: ../../library/turtle.rst:1848 +#: ../../library/turtle.rst:2089 msgid "Install a timer that calls *fun* after *t* milliseconds." msgstr "" -#: ../../library/turtle.rst:1866 +#: ../../library/turtle.rst:2107 msgid "" "Starts event loop - calling Tkinter's mainloop function. Must be the last " "statement in a turtle graphics program. Must *not* be used if a script is " @@ -1708,12 +1977,12 @@ msgid "" "turtle graphics. ::" msgstr "" -#: ../../library/turtle.rst:1879 ../../library/turtle.rst:1880 -#: ../../library/turtle.rst:1892 ../../library/turtle.rst:1893 +#: ../../library/turtle.rst:2120 ../../library/turtle.rst:2121 +#: ../../library/turtle.rst:2133 ../../library/turtle.rst:2134 msgid "string" msgstr "" -#: ../../library/turtle.rst:1882 +#: ../../library/turtle.rst:2123 msgid "" "Pop up a dialog window for input of a string. Parameter title is the title " "of the dialog window, prompt is a text mostly describing what information to " @@ -1721,7 +1990,7 @@ msgid "" "``None``. ::" msgstr "" -#: ../../library/turtle.rst:1898 +#: ../../library/turtle.rst:2139 msgid "" "Pop up a dialog window for input of a number. title is the title of the " "dialog window, prompt is a text mostly describing what numerical information " @@ -1732,17 +2001,17 @@ msgid "" "return ``None``. ::" msgstr "" -#: ../../library/turtle.rst:1915 +#: ../../library/turtle.rst:2156 msgid "one of the strings \"standard\", \"logo\" or \"world\"" msgstr "" -#: ../../library/turtle.rst:1917 +#: ../../library/turtle.rst:2158 msgid "" "Set turtle mode (\"standard\", \"logo\" or \"world\") and perform reset. If " "mode is not given, current mode is returned." msgstr "" -#: ../../library/turtle.rst:1920 +#: ../../library/turtle.rst:2161 msgid "" "Mode \"standard\" is compatible with old :mod:`turtle`. Mode \"logo\" is " "compatible with most Logo turtle graphics. Mode \"world\" uses user-defined " @@ -1750,121 +2019,121 @@ msgid "" "if ``x/y`` unit-ratio doesn't equal 1." msgstr "" -#: ../../library/turtle.rst:1926 +#: ../../library/turtle.rst:2167 msgid "Mode" msgstr "" -#: ../../library/turtle.rst:1926 +#: ../../library/turtle.rst:2167 msgid "Initial turtle heading" msgstr "" -#: ../../library/turtle.rst:1926 +#: ../../library/turtle.rst:2167 msgid "positive angles" msgstr "" -#: ../../library/turtle.rst:1928 +#: ../../library/turtle.rst:2169 msgid "\"standard\"" msgstr "" -#: ../../library/turtle.rst:1928 +#: ../../library/turtle.rst:2169 msgid "to the right (east)" msgstr "" -#: ../../library/turtle.rst:1928 +#: ../../library/turtle.rst:2169 msgid "counterclockwise" msgstr "" -#: ../../library/turtle.rst:1929 +#: ../../library/turtle.rst:2170 msgid "\"logo\"" msgstr "" -#: ../../library/turtle.rst:1929 +#: ../../library/turtle.rst:2170 msgid "upward (north)" msgstr "" -#: ../../library/turtle.rst:1929 +#: ../../library/turtle.rst:2170 msgid "clockwise" msgstr "" -#: ../../library/turtle.rst:1942 +#: ../../library/turtle.rst:2183 msgid "one of the values 1.0 or 255" msgstr "" -#: ../../library/turtle.rst:1944 +#: ../../library/turtle.rst:2185 msgid "" "Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* " "values of color triples have to be in the range 0..*cmode*." msgstr "" -#: ../../library/turtle.rst:1965 +#: ../../library/turtle.rst:2206 msgid "" "Return the Canvas of this TurtleScreen. Useful for insiders who know what " "to do with a Tkinter Canvas." msgstr "" -#: ../../library/turtle.rst:1978 +#: ../../library/turtle.rst:2219 msgid "Return a list of names of all currently available turtle shapes." msgstr "" -#: ../../library/turtle.rst:1990 +#: ../../library/turtle.rst:2231 msgid "There are three different ways to call this function:" msgstr "" -#: ../../library/turtle.rst:1992 +#: ../../library/turtle.rst:2233 msgid "" "*name* is the name of a gif-file and *shape* is ``None``: Install the " "corresponding image shape. ::" msgstr "" -#: ../../library/turtle.rst:1998 +#: ../../library/turtle.rst:2239 msgid "" "Image shapes *do not* rotate when turning the turtle, so they do not display " "the heading of the turtle!" msgstr "" -#: ../../library/turtle.rst:2001 +#: ../../library/turtle.rst:2242 msgid "" "*name* is an arbitrary string and *shape* is a tuple of pairs of " "coordinates: Install the corresponding polygon shape." msgstr "" -#: ../../library/turtle.rst:2009 +#: ../../library/turtle.rst:2250 msgid "" "*name* is an arbitrary string and *shape* is a (compound) :class:`Shape` " "object: Install the corresponding compound shape." msgstr "" -#: ../../library/turtle.rst:2012 +#: ../../library/turtle.rst:2253 msgid "" "Add a turtle shape to TurtleScreen's shapelist. Only thusly registered " "shapes can be used by issuing the command ``shape(shapename)``." msgstr "" -#: ../../library/turtle.rst:2018 +#: ../../library/turtle.rst:2259 msgid "Return the list of turtles on the screen." msgstr "" -#: ../../library/turtle.rst:2029 +#: ../../library/turtle.rst:2270 msgid "Return the height of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2037 +#: ../../library/turtle.rst:2278 msgid "Return the width of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2046 +#: ../../library/turtle.rst:2287 msgid "Methods specific to Screen, not inherited from TurtleScreen" msgstr "" -#: ../../library/turtle.rst:2050 +#: ../../library/turtle.rst:2291 msgid "Shut the turtlegraphics window." msgstr "" -#: ../../library/turtle.rst:2055 +#: ../../library/turtle.rst:2296 msgid "Bind ``bye()`` method to mouse clicks on the Screen." msgstr "" -#: ../../library/turtle.rst:2058 +#: ../../library/turtle.rst:2299 msgid "" "If the value \"using_IDLE\" in the configuration dictionary is ``False`` " "(default value), also enter mainloop. Remark: If IDLE with the ``-n`` " @@ -1873,246 +2142,246 @@ msgid "" "client script." msgstr "" -#: ../../library/turtle.rst:2067 +#: ../../library/turtle.rst:2308 msgid "" "Set the size and position of the main window. Default values of arguments " "are stored in the configuration dictionary and can be changed via a :file:" "`turtle.cfg` file." msgstr "" -#: ../../library/turtle.rst:2071 +#: ../../library/turtle.rst:2312 msgid "" "if an integer, a size in pixels, if a float, a fraction of the screen; " "default is 50% of screen" msgstr "" -#: ../../library/turtle.rst:2073 +#: ../../library/turtle.rst:2314 msgid "" "if an integer, the height in pixels, if a float, a fraction of the screen; " "default is 75% of screen" msgstr "" -#: ../../library/turtle.rst:2075 +#: ../../library/turtle.rst:2316 msgid "" "if positive, starting position in pixels from the left edge of the screen, " "if negative from the right edge, if ``None``, center window horizontally" msgstr "" -#: ../../library/turtle.rst:2078 +#: ../../library/turtle.rst:2319 msgid "" "if positive, starting position in pixels from the top edge of the screen, if " "negative from the bottom edge, if ``None``, center window vertically" msgstr "" -#: ../../library/turtle.rst:2093 +#: ../../library/turtle.rst:2334 msgid "a string that is shown in the titlebar of the turtle graphics window" msgstr "" -#: ../../library/turtle.rst:2096 +#: ../../library/turtle.rst:2337 msgid "Set title of turtle window to *titlestring*." msgstr "" -#: ../../library/turtle.rst:2105 +#: ../../library/turtle.rst:2346 msgid "Public classes" msgstr "" -#: ../../library/turtle.rst:2111 +#: ../../library/turtle.rst:2352 msgid "" "a :class:`tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" -#: ../../library/turtle.rst:2114 +#: ../../library/turtle.rst:2355 msgid "" "Create a turtle. The turtle has all methods described above as \"methods of " "Turtle/RawTurtle\"." msgstr "" -#: ../../library/turtle.rst:2120 +#: ../../library/turtle.rst:2361 msgid "" "Subclass of RawTurtle, has the same interface but draws on a default :class:" "`Screen` object created automatically when needed for the first time." msgstr "" -#: ../../library/turtle.rst:2126 +#: ../../library/turtle.rst:2367 msgid "a :class:`tkinter.Canvas`" msgstr "" -#: ../../library/turtle.rst:2128 +#: ../../library/turtle.rst:2369 msgid "" "Provides screen oriented methods like :func:`bgcolor` etc. that are " "described above." msgstr "" -#: ../../library/turtle.rst:2133 +#: ../../library/turtle.rst:2374 msgid "" "Subclass of TurtleScreen, with :ref:`four methods added `." msgstr "" -#: ../../library/turtle.rst:2138 +#: ../../library/turtle.rst:2379 msgid "" "some Tkinter widget to contain the ScrolledCanvas, i.e. a Tkinter-canvas " "with scrollbars added" msgstr "" -#: ../../library/turtle.rst:2141 +#: ../../library/turtle.rst:2382 msgid "" "Used by class Screen, which thus automatically provides a ScrolledCanvas as " "playground for the turtles." msgstr "" -#: ../../library/turtle.rst:2146 +#: ../../library/turtle.rst:2387 msgid "one of the strings \"polygon\", \"image\", \"compound\"" msgstr "" -#: ../../library/turtle.rst:2148 +#: ../../library/turtle.rst:2389 msgid "" "Data structure modeling shapes. The pair ``(type_, data)`` must follow this " "specification:" msgstr "" -#: ../../library/turtle.rst:2153 +#: ../../library/turtle.rst:2394 msgid "*type_*" msgstr "*type_*" -#: ../../library/turtle.rst:2153 +#: ../../library/turtle.rst:2394 msgid "*data*" msgstr "" -#: ../../library/turtle.rst:2155 +#: ../../library/turtle.rst:2396 msgid "\"polygon\"" msgstr "" -#: ../../library/turtle.rst:2155 +#: ../../library/turtle.rst:2396 msgid "a polygon-tuple, i.e. a tuple of pairs of coordinates" msgstr "" -#: ../../library/turtle.rst:2156 +#: ../../library/turtle.rst:2397 msgid "\"image\"" msgstr "" -#: ../../library/turtle.rst:2156 +#: ../../library/turtle.rst:2397 msgid "an image (in this form only used internally!)" msgstr "" -#: ../../library/turtle.rst:2157 +#: ../../library/turtle.rst:2398 msgid "\"compound\"" msgstr "" -#: ../../library/turtle.rst:2157 +#: ../../library/turtle.rst:2398 msgid "" "``None`` (a compound shape has to be constructed using the :meth:" "`addcomponent` method)" msgstr "" -#: ../../library/turtle.rst:2163 +#: ../../library/turtle.rst:2404 msgid "a polygon, i.e. a tuple of pairs of numbers" msgstr "" -#: ../../library/turtle.rst:2164 +#: ../../library/turtle.rst:2405 msgid "a color the *poly* will be filled with" msgstr "" -#: ../../library/turtle.rst:2165 +#: ../../library/turtle.rst:2406 msgid "a color for the poly's outline (if given)" msgstr "" -#: ../../library/turtle.rst:2167 +#: ../../library/turtle.rst:2408 msgid "Example:" msgstr "例如:" -#: ../../library/turtle.rst:2177 +#: ../../library/turtle.rst:2418 msgid "See :ref:`compoundshapes`." msgstr "請見\\ :ref:`compoundshapes`\\ 。" -#: ../../library/turtle.rst:2182 +#: ../../library/turtle.rst:2423 msgid "" "A two-dimensional vector class, used as a helper class for implementing " "turtle graphics. May be useful for turtle graphics programs too. Derived " "from tuple, so a vector is a tuple!" msgstr "" -#: ../../library/turtle.rst:2186 +#: ../../library/turtle.rst:2427 msgid "Provides (for *a*, *b* vectors, *k* number):" msgstr "" -#: ../../library/turtle.rst:2188 +#: ../../library/turtle.rst:2429 msgid "``a + b`` vector addition" msgstr "" -#: ../../library/turtle.rst:2189 +#: ../../library/turtle.rst:2430 msgid "``a - b`` vector subtraction" msgstr "" -#: ../../library/turtle.rst:2190 +#: ../../library/turtle.rst:2431 msgid "``a * b`` inner product" msgstr "" -#: ../../library/turtle.rst:2191 +#: ../../library/turtle.rst:2432 msgid "``k * a`` and ``a * k`` multiplication with scalar" msgstr "" -#: ../../library/turtle.rst:2192 +#: ../../library/turtle.rst:2433 msgid "``abs(a)`` absolute value of a" msgstr "" -#: ../../library/turtle.rst:2193 +#: ../../library/turtle.rst:2434 msgid "``a.rotate(angle)`` rotation" msgstr "" -#: ../../library/turtle.rst:2197 +#: ../../library/turtle.rst:2438 msgid "Help and configuration" msgstr "" -#: ../../library/turtle.rst:2200 +#: ../../library/turtle.rst:2441 msgid "How to use help" msgstr "" -#: ../../library/turtle.rst:2202 +#: ../../library/turtle.rst:2443 msgid "" "The public methods of the Screen and Turtle classes are documented " "extensively via docstrings. So these can be used as online-help via the " "Python help facilities:" msgstr "" -#: ../../library/turtle.rst:2206 +#: ../../library/turtle.rst:2447 msgid "" "When using IDLE, tooltips show the signatures and first lines of the " "docstrings of typed in function-/method calls." msgstr "" -#: ../../library/turtle.rst:2209 +#: ../../library/turtle.rst:2450 msgid "Calling :func:`help` on methods or functions displays the docstrings::" msgstr "" -#: ../../library/turtle.rst:2240 +#: ../../library/turtle.rst:2481 msgid "" "The docstrings of the functions which are derived from methods have a " "modified form::" msgstr "" -#: ../../library/turtle.rst:2274 +#: ../../library/turtle.rst:2515 msgid "" "These modified docstrings are created automatically together with the " "function definitions that are derived from the methods at import time." msgstr "" -#: ../../library/turtle.rst:2279 +#: ../../library/turtle.rst:2520 msgid "Translation of docstrings into different languages" msgstr "" -#: ../../library/turtle.rst:2281 +#: ../../library/turtle.rst:2522 msgid "" "There is a utility to create a dictionary the keys of which are the method " "names and the values of which are the docstrings of the public methods of " "the classes Screen and Turtle." msgstr "" -#: ../../library/turtle.rst:2287 +#: ../../library/turtle.rst:2528 msgid "a string, used as filename" msgstr "" -#: ../../library/turtle.rst:2289 +#: ../../library/turtle.rst:2530 msgid "" "Create and write docstring-dictionary to a Python script with the given " "filename. This function has to be called explicitly (it is not used by the " @@ -2121,37 +2390,37 @@ msgid "" "for translation of the docstrings into different languages." msgstr "" -#: ../../library/turtle.rst:2295 +#: ../../library/turtle.rst:2536 msgid "" "If you (or your students) want to use :mod:`turtle` with online help in your " "native language, you have to translate the docstrings and save the resulting " "file as e.g. :file:`turtle_docstringdict_german.py`." msgstr "" -#: ../../library/turtle.rst:2299 +#: ../../library/turtle.rst:2540 msgid "" "If you have an appropriate entry in your :file:`turtle.cfg` file this " "dictionary will be read in at import time and will replace the original " "English docstrings." msgstr "" -#: ../../library/turtle.rst:2302 +#: ../../library/turtle.rst:2543 msgid "" "At the time of this writing there are docstring dictionaries in German and " "in Italian. (Requests please to glingl@aon.at.)" msgstr "" -#: ../../library/turtle.rst:2308 +#: ../../library/turtle.rst:2549 msgid "How to configure Screen and Turtles" msgstr "" -#: ../../library/turtle.rst:2310 +#: ../../library/turtle.rst:2551 msgid "" "The built-in default configuration mimics the appearance and behaviour of " "the old turtle module in order to retain best possible compatibility with it." msgstr "" -#: ../../library/turtle.rst:2313 +#: ../../library/turtle.rst:2554 msgid "" "If you want to use a different configuration which better reflects the " "features of this module or which better fits to your needs, e.g. for use in " @@ -2160,54 +2429,54 @@ msgid "" "settings." msgstr "" -#: ../../library/turtle.rst:2318 +#: ../../library/turtle.rst:2559 msgid "" "The built in configuration would correspond to the following ``turtle.cfg``:" msgstr "" -#: ../../library/turtle.rst:2343 +#: ../../library/turtle.rst:2584 msgid "Short explanation of selected entries:" msgstr "" -#: ../../library/turtle.rst:2345 +#: ../../library/turtle.rst:2586 msgid "" "The first four lines correspond to the arguments of the :func:`Screen.setup " "` method." msgstr "" -#: ../../library/turtle.rst:2347 +#: ../../library/turtle.rst:2588 msgid "" "Line 5 and 6 correspond to the arguments of the method :func:`Screen." "screensize `." msgstr "" -#: ../../library/turtle.rst:2349 +#: ../../library/turtle.rst:2590 msgid "" "*shape* can be any of the built-in shapes, e.g: arrow, turtle, etc. For " "more info try ``help(shape)``." msgstr "" -#: ../../library/turtle.rst:2351 +#: ../../library/turtle.rst:2592 msgid "" "If you want to use no fill color (i.e. make the turtle transparent), you " "have to write ``fillcolor = \"\"`` (but all nonempty strings must not have " "quotes in the cfg file)." msgstr "" -#: ../../library/turtle.rst:2354 +#: ../../library/turtle.rst:2595 msgid "" "If you want to reflect the turtle its state, you have to use ``resizemode = " "auto``." msgstr "" -#: ../../library/turtle.rst:2356 +#: ../../library/turtle.rst:2597 msgid "" "If you set e.g. ``language = italian`` the docstringdict :file:" "`turtle_docstringdict_italian.py` will be loaded at import time (if present " "on the import path, e.g. in the same directory as :mod:`turtle`)." msgstr "" -#: ../../library/turtle.rst:2359 +#: ../../library/turtle.rst:2600 msgid "" "The entries *exampleturtle* and *examplescreen* define the names of these " "objects as they occur in the docstrings. The transformation of method-" @@ -2215,301 +2484,301 @@ msgid "" "docstrings." msgstr "" -#: ../../library/turtle.rst:2363 +#: ../../library/turtle.rst:2604 msgid "" "*using_IDLE*: Set this to ``True`` if you regularly work with IDLE and its " "``-n`` switch (\"no subprocess\"). This will prevent :func:`exitonclick` to " "enter the mainloop." msgstr "" -#: ../../library/turtle.rst:2367 +#: ../../library/turtle.rst:2608 msgid "" "There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` " "is stored and an additional one in the current working directory. The " "latter will override the settings of the first one." msgstr "" -#: ../../library/turtle.rst:2371 +#: ../../library/turtle.rst:2612 msgid "" "The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. " "You can study it as an example and see its effects when running the demos " "(preferably not from within the demo-viewer)." msgstr "" -#: ../../library/turtle.rst:2377 +#: ../../library/turtle.rst:2618 msgid ":mod:`turtledemo` --- Demo scripts" msgstr "" -#: ../../library/turtle.rst:2382 +#: ../../library/turtle.rst:2623 msgid "" "The :mod:`turtledemo` package includes a set of demo scripts. These scripts " "can be run and viewed using the supplied demo viewer as follows::" msgstr "" -#: ../../library/turtle.rst:2387 +#: ../../library/turtle.rst:2628 msgid "" "Alternatively, you can run the demo scripts individually. For example, ::" msgstr "" -#: ../../library/turtle.rst:2391 +#: ../../library/turtle.rst:2632 msgid "The :mod:`turtledemo` package directory contains:" msgstr "" -#: ../../library/turtle.rst:2393 +#: ../../library/turtle.rst:2634 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" -#: ../../library/turtle.rst:2395 +#: ../../library/turtle.rst:2636 msgid "" "Multiple scripts demonstrating different features of the :mod:`turtle` " "module. Examples can be accessed via the Examples menu. They can also be " "run standalone." msgstr "" -#: ../../library/turtle.rst:2398 +#: ../../library/turtle.rst:2639 msgid "" "A :file:`turtle.cfg` file which serves as an example of how to write and use " "such files." msgstr "" -#: ../../library/turtle.rst:2401 +#: ../../library/turtle.rst:2642 msgid "The demo scripts are:" msgstr "" -#: ../../library/turtle.rst:2408 +#: ../../library/turtle.rst:2649 msgid "Name" msgstr "" -#: ../../library/turtle.rst:2408 +#: ../../library/turtle.rst:2649 msgid "Description" msgstr "描述" -#: ../../library/turtle.rst:2408 +#: ../../library/turtle.rst:2649 msgid "Features" msgstr "" -#: ../../library/turtle.rst:2410 +#: ../../library/turtle.rst:2651 msgid "bytedesign" msgstr "" -#: ../../library/turtle.rst:2410 +#: ../../library/turtle.rst:2651 msgid "complex classical turtle graphics pattern" msgstr "" -#: ../../library/turtle.rst:2410 +#: ../../library/turtle.rst:2651 msgid ":func:`tracer`, delay, :func:`update`" msgstr "" -#: ../../library/turtle.rst:2413 +#: ../../library/turtle.rst:2654 msgid "chaos" msgstr "" -#: ../../library/turtle.rst:2413 +#: ../../library/turtle.rst:2654 msgid "" "graphs Verhulst dynamics, shows that computer's computations can generate " "results sometimes against the common sense expectations" msgstr "" -#: ../../library/turtle.rst:2413 +#: ../../library/turtle.rst:2654 msgid "world coordinates" msgstr "" -#: ../../library/turtle.rst:2419 +#: ../../library/turtle.rst:2660 msgid "clock" msgstr "" -#: ../../library/turtle.rst:2419 +#: ../../library/turtle.rst:2660 msgid "analog clock showing time of your computer" msgstr "" -#: ../../library/turtle.rst:2419 +#: ../../library/turtle.rst:2660 msgid "turtles as clock's hands, ontimer" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2663 msgid "colormixer" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2663 msgid "experiment with r, g, b" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2665 msgid "forest" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2665 msgid "3 breadth-first trees" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2665 msgid "randomization" msgstr "" -#: ../../library/turtle.rst:2426 +#: ../../library/turtle.rst:2667 msgid "fractalcurves" msgstr "" -#: ../../library/turtle.rst:2426 +#: ../../library/turtle.rst:2667 msgid "Hilbert & Koch curves" msgstr "" -#: ../../library/turtle.rst:2426 +#: ../../library/turtle.rst:2667 msgid "recursion" msgstr "" -#: ../../library/turtle.rst:2428 +#: ../../library/turtle.rst:2669 msgid "lindenmayer" msgstr "" -#: ../../library/turtle.rst:2428 +#: ../../library/turtle.rst:2669 msgid "ethnomathematics (indian kolams)" msgstr "" -#: ../../library/turtle.rst:2428 +#: ../../library/turtle.rst:2669 msgid "L-System" msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2672 msgid "minimal_hanoi" msgstr "minimal_hanoi" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2672 msgid "Towers of Hanoi" msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2672 msgid "Rectangular Turtles as Hanoi discs (shape, shapesize)" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2676 msgid "nim" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2676 msgid "" "play the classical nim game with three heaps of sticks against the computer." msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2676 msgid "turtles as nimsticks, event driven (mouse, keyboard)" msgstr "" -#: ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:2680 msgid "paint" msgstr "" -#: ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:2680 msgid "super minimalistic drawing program" msgstr "" -#: ../../library/turtle.rst:2442 +#: ../../library/turtle.rst:2683 msgid "peace" msgstr "" -#: ../../library/turtle.rst:2442 +#: ../../library/turtle.rst:2683 msgid "elementary" msgstr "" -#: ../../library/turtle.rst:2442 +#: ../../library/turtle.rst:2683 msgid "turtle: appearance and animation" msgstr "" -#: ../../library/turtle.rst:2445 +#: ../../library/turtle.rst:2686 msgid "penrose" msgstr "" -#: ../../library/turtle.rst:2445 +#: ../../library/turtle.rst:2686 msgid "aperiodic tiling with kites and darts" msgstr "" -#: ../../library/turtle.rst:2448 +#: ../../library/turtle.rst:2689 msgid "planet_and_moon" msgstr "planet_and_moon" -#: ../../library/turtle.rst:2448 +#: ../../library/turtle.rst:2689 msgid "simulation of gravitational system" msgstr "" -#: ../../library/turtle.rst:2448 +#: ../../library/turtle.rst:2689 msgid "compound shapes, :class:`Vec2D`" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2692 msgid "rosette" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2692 msgid "a pattern from the wikipedia article on turtle graphics" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2692 msgid ":func:`clone`, :func:`undo`" msgstr ":func:`clone`, :func:`undo`" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2695 msgid "round_dance" msgstr "round_dance" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2695 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2695 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2458 +#: ../../library/turtle.rst:2699 msgid "sorting_animate" msgstr "sorting_animate" -#: ../../library/turtle.rst:2458 +#: ../../library/turtle.rst:2699 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2458 +#: ../../library/turtle.rst:2699 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2461 +#: ../../library/turtle.rst:2702 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2461 +#: ../../library/turtle.rst:2702 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2464 +#: ../../library/turtle.rst:2705 msgid "two_canvases" msgstr "two_canvases" -#: ../../library/turtle.rst:2464 +#: ../../library/turtle.rst:2705 msgid "simple design" msgstr "" -#: ../../library/turtle.rst:2464 +#: ../../library/turtle.rst:2705 msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2467 +#: ../../library/turtle.rst:2708 msgid "yinyang" msgstr "" -#: ../../library/turtle.rst:2467 +#: ../../library/turtle.rst:2708 msgid "another elementary example" msgstr "" -#: ../../library/turtle.rst:2470 +#: ../../library/turtle.rst:2711 msgid "Have fun!" msgstr "" -#: ../../library/turtle.rst:2474 +#: ../../library/turtle.rst:2715 msgid "Changes since Python 2.6" msgstr "" -#: ../../library/turtle.rst:2476 +#: ../../library/turtle.rst:2717 msgid "" "The methods :func:`Turtle.tracer `, :func:`Turtle.window_width " "` and :func:`Turtle.window_height ` have been " @@ -2520,14 +2789,14 @@ msgid "" "methods.)" msgstr "" -#: ../../library/turtle.rst:2484 +#: ../../library/turtle.rst:2725 msgid "" "The method :func:`!Turtle.fill` has been eliminated. The behaviour of :func:" "`begin_fill` and :func:`end_fill` have changed slightly: now every filling " "process must be completed with an ``end_fill()`` call." msgstr "" -#: ../../library/turtle.rst:2489 +#: ../../library/turtle.rst:2730 msgid "" "A method :func:`Turtle.filling ` has been added. It returns a " "boolean value: ``True`` if a filling process is under way, ``False`` " @@ -2535,11 +2804,11 @@ msgid "" "in Python 2.6." msgstr "" -#: ../../library/turtle.rst:2495 +#: ../../library/turtle.rst:2736 msgid "Changes since Python 3.0" msgstr "" -#: ../../library/turtle.rst:2497 +#: ../../library/turtle.rst:2738 msgid "" "The :class:`Turtle` methods :func:`shearfactor`, :func:`shapetransform` and :" "func:`get_shapepoly` have been added. Thus the full range of regular linear " @@ -2548,29 +2817,46 @@ msgid "" "set the tilt angle. :func:`settiltangle` has been deprecated." msgstr "" -#: ../../library/turtle.rst:2504 +#: ../../library/turtle.rst:2745 msgid "" "The :class:`Screen` method :func:`onkeypress` has been added as a complement " "to :func:`onkey`. As the latter binds actions to the key release event, an " "alias: :func:`onkeyrelease` was also added for it." msgstr "" -#: ../../library/turtle.rst:2508 +#: ../../library/turtle.rst:2749 msgid "" "The method :func:`Screen.mainloop ` has been added, so there is no " "longer a need to use the standalone :func:`mainloop` function when working " "with :class:`Screen` and :class:`Turtle` objects." msgstr "" -#: ../../library/turtle.rst:2512 +#: ../../library/turtle.rst:2753 msgid "" "Two input methods have been added: :func:`Screen.textinput ` and :" "func:`Screen.numinput `. These pop up input dialogs and return " "strings and numbers respectively." msgstr "" -#: ../../library/turtle.rst:2516 +#: ../../library/turtle.rst:2757 msgid "" "Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` " "have been added to the :file:`Lib/turtledemo` directory." msgstr "" + +#~ msgid "" +#~ "Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an " +#~ "``import turtle``, give it the command ``turtle.forward(15)``, and it " +#~ "moves (on-screen!) 15 pixels in the direction it is facing, drawing a " +#~ "line as it moves. Give it the command ``turtle.right(25)``, and it " +#~ "rotates in-place 25 degrees clockwise." +#~ msgstr "" +#~ "想像一下,一隻機器龜在 x-y 平面上從 (0, 0) 出發。在 ``import turtle`` 之" +#~ "後,給它命令 ``turtle.forward(15)`` ,然後它就會移動 (在螢幕上!) 15 個單" +#~ "位像素,方向是朝著其正面對的方向。給它命令 ``turtle.right(25)`` ,它就會在" +#~ "原地順時針旋轉 25 度。" + +#~ msgid "" +#~ "By combining together these and similar commands, intricate shapes and " +#~ "pictures can easily be drawn." +#~ msgstr "藉由結合這些類似的命令,複雜的形狀和圖形可以輕易被畫出來。" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index fc27d366c3..55279fe480 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-14 00:33+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2085,7 +2085,7 @@ msgstr "" msgid "" "Alternatively you can just use ``vars(my_mock)`` (instance members) and " "``dir(type(my_mock))`` (type members) to bypass the filtering irrespective " -"of :data:`mock.FILTER_DIR`." +"of :const:`mock.FILTER_DIR`." msgstr "" #: ../../library/unittest.mock.rst:2443 diff --git a/library/unittest.po b/library/unittest.po index 7348e67514..8f7040d573 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1407,8 +1407,8 @@ msgstr "" #: ../../library/unittest.rst:1129 ../../library/unittest.rst:1170 msgid "" "If given, *level* should be either a numeric logging level or its string " -"equivalent (for example either ``\"ERROR\"`` or :attr:`logging.ERROR`). The " -"default is :attr:`logging.INFO`." +"equivalent (for example either ``\"ERROR\"`` or :const:`logging.ERROR`). " +"The default is :const:`logging.INFO`." msgstr "" #: ../../library/unittest.rst:1133 diff --git a/library/urllib.request.po b/library/urllib.request.po index 7eb5bfff0a..a907c5cfa8 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-10 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -217,8 +217,9 @@ msgid "*cafile* and *capath* were added." msgstr "新增 *cafile* 與 *capath*。" #: ../../library/urllib.request.rst:100 +#, fuzzy msgid "" -"HTTPS virtual hosts are now supported if possible (that is, if :data:`ssl." +"HTTPS virtual hosts are now supported if possible (that is, if :const:`ssl." "HAS_SNI` is true)." msgstr "" "HTTPS 虛擬主機 (virtual hosts) 現已支援,只要 :data:`ssl.HAS_SNI` 的值為 " diff --git a/library/venv.po b/library/venv.po index b2af51cee4..356a2658a0 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -196,7 +196,7 @@ msgstr "" msgid "" "A virtual environment may be \"activated\" using a script in its binary " "directory (``bin`` on POSIX; ``Scripts`` on Windows). This will prepend that " -"directory to your :envvar:`!PATH`, so that running :program:`python` will " +"directory to your :envvar:`PATH`, so that running :program:`python` will " "invoke the environment's Python interpreter and you can run installed " "scripts without having to use their full path. The invocation of the " "activation script is platform-specific (:samp:`{}` must be replaced by " @@ -290,11 +290,11 @@ msgid "" "In order to achieve this, scripts installed into virtual environments have a " "\"shebang\" line which points to the environment's Python interpreter, i.e. :" "samp:`#!/{}/bin/python`. This means that the script will run " -"with that interpreter regardless of the value of :envvar:`!PATH`. On " -"Windows, \"shebang\" line processing is supported if you have the :ref:" -"`launcher` installed. Thus, double-clicking an installed script in a Windows " -"Explorer window should run it with the correct interpreter without the " -"environment needing to be activated or on the :envvar:`!PATH`." +"with that interpreter regardless of the value of :envvar:`PATH`. On Windows, " +"\"shebang\" line processing is supported if you have the :ref:`launcher` " +"installed. Thus, double-clicking an installed script in a Windows Explorer " +"window should run it with the correct interpreter without the environment " +"needing to be activated or on the :envvar:`PATH`." msgstr "" #: ../../library/venv.rst:108 diff --git a/library/xml.po b/library/xml.po index aacf25c687..9642fc32f9 100644 --- a/library/xml.po +++ b/library/xml.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -177,7 +177,7 @@ msgstr "" msgid "" "Expat 2.4.1 and newer is not vulnerable to the \"billion laughs\" and " "\"quadratic blowup\" vulnerabilities. Items still listed as vulnerable due " -"to potential reliance on system-provided libraries. Check :data:`pyexpat." +"to potential reliance on system-provided libraries. Check :const:`pyexpat." "EXPAT_VERSION`." msgstr "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 61bb4d9b1b..f3cd6478e7 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1756,7 +1756,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:1605 msgid "" -"a builtin class that has its (CPython) :data:`Py_TPFLAGS_SEQUENCE` bit set" +"a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" #: ../../reference/compound_stmts.rst:1606 @@ -1805,7 +1805,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:1624 msgid "" -"a builtin class that has its (CPython) :data:`Py_TPFLAGS_MAPPING` bit set" +"a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" #: ../../reference/compound_stmts.rst:1627 diff --git a/reference/datamodel.po b/reference/datamodel.po index e18a0a5256..00b8def801 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2934,8 +2934,8 @@ msgstr "" #: ../../reference/datamodel.rst:2485 msgid "" -"In CPython, the length is required to be at most :attr:`sys.maxsize`. If the " -"length is larger than :attr:`!sys.maxsize` some features (such as :func:" +"In CPython, the length is required to be at most :data:`sys.maxsize`. If the " +"length is larger than :data:`!sys.maxsize` some features (such as :func:" "`len`) may raise :exc:`OverflowError`. To prevent raising :exc:`!" "OverflowError` by truth value testing, an object must define a :meth:" "`__bool__` method." diff --git a/sphinx.po b/sphinx.po index 2546ddc36b..22f2221506 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-06-27 11:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -293,23 +293,25 @@ msgid "Python Developer’s Guide" msgstr "Python 開發者指南" #: ../../tools/templates/layout.html:6 +#, fuzzy msgid "" "This document is for an old version of Python that is no longer supported.\n" -" You should upgrade, and read the " +" You should upgrade, and read the" msgstr "這份說明文件是寫給一個不再被支援的舊版 Python。你應該升級,並閱讀 " #: ../../tools/templates/layout.html:8 -msgid " Python documentation for the current stable release" +#, fuzzy +msgid "Python documentation for the current stable release" msgstr " 當前穩定發行的 Python 版本說明文件" #: ../../tools/templates/layout.html:14 msgid "" "This is a deploy preview created from a pull request.\n" -" For authoritative documentation, see the " +" For authoritative documentation, see" msgstr "" #: ../../tools/templates/layout.html:16 #, fuzzy -msgid " the current stable release" +msgid "the current stable release" msgstr " 當前穩定發行的 Python 版本說明文件" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index b36215aa66..38a67a4159 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-18 00:58+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,9 +28,10 @@ msgid "More Control Flow Tools" msgstr "深入了解流程控制" #: ../../tutorial/controlflow.rst:7 +#, fuzzy msgid "" -"Besides the :keyword:`while` statement just introduced, Python uses the " -"usual flow control statements known from other languages, with some twists." +"As well as the :keyword:`while` statement just introduced, Python uses a few " +"more that we will encounter in this chapter." msgstr "" "除了剛才介紹的 :keyword:`while`,Python 擁有在其他程式語言中常用的流程控制語" "法,並有一些不一樣的改變。" @@ -196,29 +197,48 @@ msgstr "" "子句" #: ../../tutorial/controlflow.rst:166 +#, fuzzy msgid "" -"The :keyword:`break` statement, like in C, breaks out of the innermost " -"enclosing :keyword:`for` or :keyword:`while` loop." +"The :keyword:`break` statement breaks out of the innermost enclosing :" +"keyword:`for` or :keyword:`while` loop." msgstr "" ":keyword:`break` 陳述式,如同 C 語言,終止包含它的最內部 :keyword:`for` 或 :" "keyword:`while` 迴圈。" #: ../../tutorial/controlflow.rst:169 +#, fuzzy msgid "" -"Loop statements may have an :keyword:`!else` clause; it is executed when the " -"loop terminates through exhaustion of the iterable (with :keyword:`for`) or " -"when the condition becomes false (with :keyword:`while`), but not when the " -"loop is terminated by a :keyword:`break` statement. This is exemplified by " -"the following loop, which searches for prime numbers::" +"A :keyword:`!for` or :keyword:`!while` loop can include an :keyword:`!else` " +"clause." +msgstr "" +"迴圈內的 :keyword:`!break` 和 :keyword:`!continue` 陳述式及 :keyword:`!else` " +"子句" + +#: ../../tutorial/controlflow.rst:171 +msgid "" +"In a :keyword:`for` loop, the :keyword:`!else` clause is executed after the " +"loop reaches its final iteration." +msgstr "" + +#: ../../tutorial/controlflow.rst:174 +msgid "" +"In a :keyword:`while` loop, it's executed after the loop's condition becomes " +"false." +msgstr "" + +#: ../../tutorial/controlflow.rst:176 +msgid "" +"In either kind of loop, the :keyword:`!else` clause is **not** executed if " +"the loop was terminated by a :keyword:`break`." +msgstr "" + +#: ../../tutorial/controlflow.rst:179 +msgid "" +"This is exemplified in the following :keyword:`!for` loop, which searches " +"for prime numbers::" msgstr "" -"迴圈陳述式可以帶有一個 :keyword:`!else` 子句。當迴圈用盡所有的 iterable " -"(在 :keyword:`for` 中)或條件為假(在 :keyword:`while` 中)時,這個子句會被" -"執行;但迴圈被 :keyword:`break` 陳述式終止時則不會執行。底下尋找質數的迴圈即" -"示範了這個行為:\n" -"\n" -"::" -#: ../../tutorial/controlflow.rst:193 +#: ../../tutorial/controlflow.rst:200 msgid "" "(Yes, this is the correct code. Look closely: the ``else`` clause belongs " "to the :keyword:`for` loop, **not** the :keyword:`if` statement.)" @@ -226,7 +246,7 @@ msgstr "" "(沒錯,這是正確的程式碼。請看仔細:``else`` 子句屬於 :keyword:`for` 迴圈,**" "並非** :keyword:`if` 陳述式。)" -#: ../../tutorial/controlflow.rst:196 +#: ../../tutorial/controlflow.rst:203 msgid "" "When used with a loop, the ``else`` clause has more in common with the " "``else`` clause of a :keyword:`try` statement than it does with that of :" @@ -241,7 +261,7 @@ msgstr "" "任何 ``break`` 發生時執行。更多有關 :keyword:`!try` 陳述式和例外的介紹,見" "\\ :ref:`tut-handling`\\ 。" -#: ../../tutorial/controlflow.rst:203 +#: ../../tutorial/controlflow.rst:210 msgid "" "The :keyword:`continue` statement, also borrowed from C, continues with the " "next iteration of the loop::" @@ -250,11 +270,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:224 +#: ../../tutorial/controlflow.rst:231 msgid ":keyword:`!pass` Statements" msgstr ":keyword:`!pass` 陳述式" -#: ../../tutorial/controlflow.rst:226 +#: ../../tutorial/controlflow.rst:233 msgid "" "The :keyword:`pass` statement does nothing. It can be used when a statement " "is required syntactically but the program requires no action. For example::" @@ -264,14 +284,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:233 +#: ../../tutorial/controlflow.rst:240 msgid "This is commonly used for creating minimal classes::" msgstr "" "這經常用於建立簡單的 class(類別):\n" "\n" "::" -#: ../../tutorial/controlflow.rst:239 +#: ../../tutorial/controlflow.rst:246 msgid "" "Another place :keyword:`pass` can be used is as a place-holder for a " "function or conditional body when you are working on new code, allowing you " @@ -283,11 +303,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:251 +#: ../../tutorial/controlflow.rst:258 msgid ":keyword:`!match` Statements" msgstr ":keyword:`!match` 陳述式" -#: ../../tutorial/controlflow.rst:253 +#: ../../tutorial/controlflow.rst:260 msgid "" "A :keyword:`match` statement takes an expression and compares its value to " "successive patterns given as one or more case blocks. This is superficially " @@ -303,7 +323,7 @@ msgstr "" "言中的模式匹配 (pattern matching) 更為相近。只有第一個匹配成功的模式會被執" "行,而它也可以將成分(序列元素或物件屬性)從值中提取到變數中。" -#: ../../tutorial/controlflow.rst:261 +#: ../../tutorial/controlflow.rst:268 msgid "" "The simplest form compares a subject value against one or more literals::" msgstr "" @@ -312,7 +332,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:274 +#: ../../tutorial/controlflow.rst:281 msgid "" "Note the last block: the \"variable name\" ``_`` acts as a *wildcard* and " "never fails to match. If no case matches, none of the branches is executed." @@ -320,7 +340,7 @@ msgstr "" "請注意最後一段:「變數名稱」\\ ``_`` 是作為\\ *通用字元 (wildcard)*\\ 的角" "色,且永遠不會匹配失敗。如果沒有 case 匹配成功,則不會執行任何的分支。" -#: ../../tutorial/controlflow.rst:277 +#: ../../tutorial/controlflow.rst:284 msgid "" "You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "" @@ -328,7 +348,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:282 +#: ../../tutorial/controlflow.rst:289 msgid "" "Patterns can look like unpacking assignments, and can be used to bind " "variables::" @@ -337,7 +357,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:298 +#: ../../tutorial/controlflow.rst:305 msgid "" "Study that one carefully! The first pattern has two literals, and can be " "thought of as an extension of the literal pattern shown above. But the next " @@ -351,7 +371,7 @@ msgstr "" "(bind)*\\ 了來自主題 (``point``) 的一個值。第四個模式會擷取兩個值,這使得它在" "概念上類似於拆解賦值 ``(x, y) = point``。" -#: ../../tutorial/controlflow.rst:305 +#: ../../tutorial/controlflow.rst:312 msgid "" "If you are using classes to structure your data you can use the class name " "followed by an argument list resembling a constructor, but with the ability " @@ -362,7 +382,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:327 +#: ../../tutorial/controlflow.rst:334 msgid "" "You can use positional parameters with some builtin classes that provide an " "ordering for their attributes (e.g. dataclasses). You can also define a " @@ -378,7 +398,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:338 +#: ../../tutorial/controlflow.rst:345 msgid "" "A recommended way to read patterns is to look at them as an extended form of " "what you would put on the left of an assignment, to understand which " @@ -394,7 +414,7 @@ msgstr "" "的 ``x=`` 及 ``y=``)或 class 名稱(由它們後面的 \"(...)\" 被辨識,如上面的 " "``Point``)則永遠無法被賦值。" -#: ../../tutorial/controlflow.rst:345 +#: ../../tutorial/controlflow.rst:352 #, fuzzy msgid "" "Patterns can be arbitrarily nested. For example, if we have a short list of " @@ -405,7 +425,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:366 +#: ../../tutorial/controlflow.rst:373 msgid "" "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " "guard is false, ``match`` goes on to try the next case block. Note that " @@ -417,11 +437,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:376 +#: ../../tutorial/controlflow.rst:383 msgid "Several other key features of this statement:" msgstr "此種陳述式的其他幾個重要特色:" -#: ../../tutorial/controlflow.rst:378 +#: ../../tutorial/controlflow.rst:385 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. An important exception is " @@ -430,7 +450,7 @@ msgstr "" "與拆解賦值的情況類似,tuple(元組)和 list 模式具有完全相同的意義,而且實際上" "可以匹配任意的序列。一個重要的例外,是它們不能匹配疊代器 (iterator) 或字串。" -#: ../../tutorial/controlflow.rst:382 +#: ../../tutorial/controlflow.rst:389 msgid "" "Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, " "*rest)`` work similar to unpacking assignments. The name after ``*`` may " @@ -442,7 +462,7 @@ msgstr "" "是 ``_``,所以 ``(x, y, *_)`` 會匹配一個至少兩項的序列,且不會連結那兩項以外" "的其餘項。" -#: ../../tutorial/controlflow.rst:387 +#: ../../tutorial/controlflow.rst:394 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " @@ -454,14 +474,14 @@ msgstr "" "模式不同,額外的鍵 (key) 會被忽略。一種像是 ``**rest`` 的拆解方式,也是可被支" "援的。(但 ``**_`` 則是多餘的做法,所以它並不被允許。)" -#: ../../tutorial/controlflow.rst:392 +#: ../../tutorial/controlflow.rst:399 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "" "使用關鍵字 ``as`` 可以擷取子模式 (subpattern):\n" "\n" "::" -#: ../../tutorial/controlflow.rst:396 +#: ../../tutorial/controlflow.rst:403 msgid "" "will capture the second element of the input as ``p2`` (as long as the input " "is a sequence of two points)" @@ -469,7 +489,7 @@ msgstr "" "將會擷取輸入的第二個元素作為 ``p2``\\ (只要該輸入是一個由兩個點所組成的序" "列)。" -#: ../../tutorial/controlflow.rst:399 +#: ../../tutorial/controlflow.rst:406 msgid "" "Most literals are compared by equality, however the singletons ``True``, " "``False`` and ``None`` are compared by identity." @@ -477,7 +497,7 @@ msgstr "" "大部分的字面值是藉由相等性 (equality) 來比較,但是單例物件 (singleton) " "``True``\\ 、\\ ``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。" -#: ../../tutorial/controlflow.rst:402 +#: ../../tutorial/controlflow.rst:409 msgid "" "Patterns may use named constants. These must be dotted names to prevent " "them from being interpreted as capture variable::" @@ -487,18 +507,18 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:421 +#: ../../tutorial/controlflow.rst:428 msgid "" "For a more detailed explanation and additional examples, you can look into :" "pep:`636` which is written in a tutorial format." msgstr "" "關於更詳細的解釋和其他範例,你可以閱讀 :pep:`636`,它是以教學的格式編寫而成。" -#: ../../tutorial/controlflow.rst:427 +#: ../../tutorial/controlflow.rst:434 msgid "Defining Functions" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:429 +#: ../../tutorial/controlflow.rst:436 msgid "" "We can create a function that writes the Fibonacci series to an arbitrary " "boundary::" @@ -507,7 +527,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:449 +#: ../../tutorial/controlflow.rst:456 msgid "" "The keyword :keyword:`def` introduces a function *definition*. It must be " "followed by the function name and the parenthesized list of formal " @@ -517,7 +537,7 @@ msgstr "" "關鍵字 :keyword:`def` 介紹一個函式的\\ *定義*\\ 。它之後必須連著該函式的名稱" "和置於括號之中的一串參數。自下一行起,所有縮排的陳述式成為該函式的主體。" -#: ../../tutorial/controlflow.rst:454 +#: ../../tutorial/controlflow.rst:461 msgid "" "The first statement of the function body can optionally be a string literal; " "this string literal is the function's documentation string, or :dfn:" @@ -533,7 +553,7 @@ msgstr "" "件,或讓使用者能以互動的方式在原始碼中瀏覽文件。在原始碼中加入 docstring 是個" "好慣例,應該養成這樣的習慣。" -#: ../../tutorial/controlflow.rst:461 +#: ../../tutorial/controlflow.rst:468 msgid "" "The *execution* of a function introduces a new symbol table used for the " "local variables of the function. More precisely, all variable assignments " @@ -554,7 +574,7 @@ msgstr "" "域變數是在 :keyword:`global` 陳述式中被定義,或外層函式變數在 :keyword:" "`nonlocal` 陳述式中被定義)。" -#: ../../tutorial/controlflow.rst:472 +#: ../../tutorial/controlflow.rst:479 msgid "" "The actual parameters (arguments) to a function call are introduced in the " "local symbol table of the called function when it is called; thus, arguments " @@ -569,7 +589,7 @@ msgstr "" "函式呼叫別的函式或遞迴呼叫它自己時,在被呼叫的函式中會建立一個新的區域符號" "表。" -#: ../../tutorial/controlflow.rst:479 +#: ../../tutorial/controlflow.rst:486 msgid "" "A function definition associates the function name with the function object " "in the current symbol table. The interpreter recognizes the object pointed " @@ -582,7 +602,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:490 +#: ../../tutorial/controlflow.rst:497 msgid "" "Coming from other languages, you might object that ``fib`` is not a function " "but a procedure since it doesn't return a value. In fact, even functions " @@ -599,7 +619,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:501 +#: ../../tutorial/controlflow.rst:508 msgid "" "It is simple to write a function that returns a list of the numbers of the " "Fibonacci series, instead of printing it::" @@ -608,11 +628,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:517 +#: ../../tutorial/controlflow.rst:524 msgid "This example, as usual, demonstrates some new Python features:" msgstr "這個例子一樣示範了一些新的 Python 特性:" -#: ../../tutorial/controlflow.rst:519 +#: ../../tutorial/controlflow.rst:526 msgid "" "The :keyword:`return` statement returns with a value from a function. :" "keyword:`!return` without an expression argument returns ``None``. Falling " @@ -622,7 +642,7 @@ msgstr "" "不外加一個運算式作為引數時會回傳 ``None``\\ 。一個函式執行到結束也會回傳 " "``None``\\ 。" -#: ../../tutorial/controlflow.rst:523 +#: ../../tutorial/controlflow.rst:530 msgid "" "The statement ``result.append(a)`` calls a *method* of the list object " "``result``. A method is a function that 'belongs' to an object and is named " @@ -644,22 +664,22 @@ msgstr "" "method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" "於 ``result = result + [a]``\\ ,但更有效率。" -#: ../../tutorial/controlflow.rst:538 +#: ../../tutorial/controlflow.rst:545 msgid "More on Defining Functions" msgstr "深入了解函式定義" -#: ../../tutorial/controlflow.rst:540 +#: ../../tutorial/controlflow.rst:547 msgid "" "It is also possible to define functions with a variable number of arguments. " "There are three forms, which can be combined." msgstr "" "定義函式時使用的引數 (argument) 數量是可變的。總共有三種可以組合使用的形式。" -#: ../../tutorial/controlflow.rst:547 +#: ../../tutorial/controlflow.rst:554 msgid "Default Argument Values" msgstr "預設引數值" -#: ../../tutorial/controlflow.rst:549 +#: ../../tutorial/controlflow.rst:556 msgid "" "The most useful form is to specify a default value for one or more " "arguments. This creates a function that can be called with fewer arguments " @@ -670,22 +690,22 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:565 +#: ../../tutorial/controlflow.rst:572 msgid "This function can be called in several ways:" msgstr "該函式可以用以下幾種方式被呼叫:" -#: ../../tutorial/controlflow.rst:567 +#: ../../tutorial/controlflow.rst:574 msgid "" "giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``" msgstr "只給必要引數:\\ ``ask_ok('Do you really want to quit?')``" -#: ../../tutorial/controlflow.rst:569 +#: ../../tutorial/controlflow.rst:576 msgid "" "giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', " "2)``" msgstr "給予一個選擇性引數:\\ ``ask_ok('OK to overwrite the file?', 2)``" -#: ../../tutorial/controlflow.rst:571 +#: ../../tutorial/controlflow.rst:578 msgid "" "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " "on, only yes or no!')``" @@ -693,14 +713,14 @@ msgstr "" "給予所有引數:\\ ``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes " "or no!')``" -#: ../../tutorial/controlflow.rst:574 +#: ../../tutorial/controlflow.rst:581 msgid "" "This example also introduces the :keyword:`in` keyword. This tests whether " "or not a sequence contains a certain value." msgstr "" "此例也使用了關鍵字 :keyword:`in`\\ ,用於測試序列中是否包含某個特定值。" -#: ../../tutorial/controlflow.rst:577 +#: ../../tutorial/controlflow.rst:584 msgid "" "The default values are evaluated at the point of function definition in the " "*defining* scope, so that ::" @@ -709,11 +729,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:588 +#: ../../tutorial/controlflow.rst:595 msgid "will print ``5``." msgstr "將會輸出 ``5``\\ 。" -#: ../../tutorial/controlflow.rst:590 +#: ../../tutorial/controlflow.rst:597 msgid "" "**Important warning:** The default value is evaluated only once. This makes " "a difference when the default is a mutable object such as a list, " @@ -726,24 +746,24 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:603 +#: ../../tutorial/controlflow.rst:610 msgid "This will print ::" msgstr "" "將會輸出:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:609 +#: ../../tutorial/controlflow.rst:616 msgid "" "If you don't want the default to be shared between subsequent calls, you can " "write the function like this instead::" msgstr "如果不想在後續呼叫之間共用預設值,應以如下方式編寫函式:" -#: ../../tutorial/controlflow.rst:622 +#: ../../tutorial/controlflow.rst:629 msgid "Keyword Arguments" msgstr "關鍵字引數" -#: ../../tutorial/controlflow.rst:624 +#: ../../tutorial/controlflow.rst:631 msgid "" "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following " @@ -754,7 +774,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:633 +#: ../../tutorial/controlflow.rst:640 msgid "" "accepts one required argument (``voltage``) and three optional arguments " "(``state``, ``action``, and ``type``). This function can be called in any " @@ -765,14 +785,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:644 +#: ../../tutorial/controlflow.rst:651 msgid "but all the following calls would be invalid::" msgstr "" "但以下呼叫方式都無效:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:651 +#: ../../tutorial/controlflow.rst:658 msgid "" "In a function call, keyword arguments must follow positional arguments. All " "the keyword arguments passed must match one of the arguments accepted by the " @@ -790,7 +810,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:667 +#: ../../tutorial/controlflow.rst:674 msgid "" "When a final formal parameter of the form ``**name`` is present, it receives " "a dictionary (see :ref:`typesmapping`) containing all keyword arguments " @@ -808,31 +828,31 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:684 +#: ../../tutorial/controlflow.rst:691 msgid "It could be called like this::" msgstr "" "它可以被如此呼叫:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:692 +#: ../../tutorial/controlflow.rst:699 msgid "and of course it would print:" msgstr "" "輸出結果如下:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:705 +#: ../../tutorial/controlflow.rst:712 msgid "" "Note that the order in which the keyword arguments are printed is guaranteed " "to match the order in which they were provided in the function call." msgstr "注意,關鍵字引數的輸出順序與呼叫函式時被提供的順序必定一致。" -#: ../../tutorial/controlflow.rst:709 +#: ../../tutorial/controlflow.rst:716 msgid "Special parameters" msgstr "特殊參數" -#: ../../tutorial/controlflow.rst:711 +#: ../../tutorial/controlflow.rst:718 msgid "" "By default, arguments may be passed to a Python function either by position " "or explicitly by keyword. For readability and performance, it makes sense to " @@ -844,11 +864,11 @@ msgstr "" "及效能,限制引數的傳遞方式是合理的,如此,開發者只需查看函式定義,即可確定各" "項目是按位置,按位置或關鍵字,還是按關鍵字傳遞。" -#: ../../tutorial/controlflow.rst:717 +#: ../../tutorial/controlflow.rst:724 msgid "A function definition may look like:" msgstr "函式定義可能如以下樣式:" -#: ../../tutorial/controlflow.rst:728 +#: ../../tutorial/controlflow.rst:735 msgid "" "where ``/`` and ``*`` are optional. If used, these symbols indicate the kind " "of parameter by how the arguments may be passed to the function: positional-" @@ -859,22 +879,22 @@ msgstr "" "類:僅限位置、位置或關鍵字、僅限關鍵字。關鍵字參數也稱為附名參數 (named " "parameters)。" -#: ../../tutorial/controlflow.rst:735 +#: ../../tutorial/controlflow.rst:742 msgid "Positional-or-Keyword Arguments" msgstr "位置或關鍵字引數 (Positional-or-Keyword Arguments)" -#: ../../tutorial/controlflow.rst:737 +#: ../../tutorial/controlflow.rst:744 msgid "" "If ``/`` and ``*`` are not present in the function definition, arguments may " "be passed to a function by position or by keyword." msgstr "" "若函式定義中未使用 ``/`` 和 ``*`` 時,引數可以按位置或關鍵字傳遞給函式。" -#: ../../tutorial/controlflow.rst:742 +#: ../../tutorial/controlflow.rst:749 msgid "Positional-Only Parameters" msgstr "僅限位置參數 (Positional-Only Parameters)" -#: ../../tutorial/controlflow.rst:744 +#: ../../tutorial/controlflow.rst:751 msgid "" "Looking at this in a bit more detail, it is possible to mark certain " "parameters as *positional-only*. If *positional-only*, the parameters' order " @@ -889,17 +909,17 @@ msgstr "" "``/``\\ (斜線)之前。\\ ``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函" "式定義中沒有 ``/``\\ ,則表示沒有任何僅限位置參數。" -#: ../../tutorial/controlflow.rst:752 +#: ../../tutorial/controlflow.rst:759 msgid "" "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" "only*." msgstr "``/`` 後面的參數可以是\\ *位置或關鍵字*\\ 或\\ *僅限關鍵字*\\ 參數。" -#: ../../tutorial/controlflow.rst:756 +#: ../../tutorial/controlflow.rst:763 msgid "Keyword-Only Arguments" msgstr "僅限關鍵字引數 (Keyword-Only Arguments)" -#: ../../tutorial/controlflow.rst:758 +#: ../../tutorial/controlflow.rst:765 msgid "" "To mark parameters as *keyword-only*, indicating the parameters must be " "passed by keyword argument, place an ``*`` in the arguments list just before " @@ -908,11 +928,11 @@ msgstr "" "要把參數標記為\\ *僅限關鍵字*\\ ,表明參數必須以關鍵字引數傳遞,必須在引數列" "表中第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``\\ 。" -#: ../../tutorial/controlflow.rst:764 +#: ../../tutorial/controlflow.rst:771 msgid "Function Examples" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:766 +#: ../../tutorial/controlflow.rst:773 msgid "" "Consider the following example function definitions paying close attention " "to the markers ``/`` and ``*``::" @@ -921,7 +941,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:782 +#: ../../tutorial/controlflow.rst:789 msgid "" "The first function definition, ``standard_arg``, the most familiar form, " "places no restrictions on the calling convention and arguments may be passed " @@ -932,7 +952,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:792 +#: ../../tutorial/controlflow.rst:799 msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" @@ -941,7 +961,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:803 +#: ../../tutorial/controlflow.rst:810 msgid "" "The third function ``kwd_only_args`` only allows keyword arguments as " "indicated by a ``*`` in the function definition::" @@ -950,7 +970,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:814 +#: ../../tutorial/controlflow.rst:821 msgid "" "And the last uses all three calling conventions in the same function " "definition::" @@ -959,7 +979,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:834 +#: ../../tutorial/controlflow.rst:841 msgid "" "Finally, consider this function definition which has a potential collision " "between the positional argument ``name`` and ``**kwds`` which has ``name`` " @@ -970,7 +990,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:839 +#: ../../tutorial/controlflow.rst:846 msgid "" "There is no possible call that will make it return ``True`` as the keyword " "``'name'`` will always bind to the first parameter. For example::" @@ -980,7 +1000,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:848 +#: ../../tutorial/controlflow.rst:855 msgid "" "But using ``/`` (positional only arguments), it is possible since it allows " "``name`` as a positional argument and ``'name'`` as a key in the keyword " @@ -991,17 +1011,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:856 +#: ../../tutorial/controlflow.rst:863 msgid "" "In other words, the names of positional-only parameters can be used in " "``**kwds`` without ambiguity." msgstr "換句話說,僅限位置參數的名稱可以在 ``**kwds`` 中使用,而不產生歧義。" -#: ../../tutorial/controlflow.rst:861 +#: ../../tutorial/controlflow.rst:868 msgid "Recap" msgstr "回顧" -#: ../../tutorial/controlflow.rst:863 +#: ../../tutorial/controlflow.rst:870 msgid "" "The use case will determine which parameters to use in the function " "definition::" @@ -1010,11 +1030,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:867 +#: ../../tutorial/controlflow.rst:874 msgid "As guidance:" msgstr "說明:" -#: ../../tutorial/controlflow.rst:869 +#: ../../tutorial/controlflow.rst:876 msgid "" "Use positional-only if you want the name of the parameters to not be " "available to the user. This is useful when parameter names have no real " @@ -1026,7 +1046,7 @@ msgstr "" "想控制引數在函式呼叫的排列順序,或同時使用位置參數和任意關鍵字時,這種方式很" "有用。" -#: ../../tutorial/controlflow.rst:874 +#: ../../tutorial/controlflow.rst:881 msgid "" "Use keyword-only when names have meaning and the function definition is more " "understandable by being explicit with names or you want to prevent users " @@ -1035,7 +1055,7 @@ msgstr "" "當參數名稱有意義,且明確的名稱可讓函式定義更易理解,或是你不希望使用者依賴引" "數被傳遞時的位置時,請使用僅限關鍵字。" -#: ../../tutorial/controlflow.rst:877 +#: ../../tutorial/controlflow.rst:884 msgid "" "For an API, use positional-only to prevent breaking API changes if the " "parameter's name is modified in the future." @@ -1043,11 +1063,11 @@ msgstr "" "對於應用程式介面 (API),使用僅限位置,以防止未來參數名稱被修改時造成 API 的中" "斷性變更。" -#: ../../tutorial/controlflow.rst:883 +#: ../../tutorial/controlflow.rst:890 msgid "Arbitrary Argument Lists" msgstr "任意引數列表 (Arbitrary Argument Lists)" -#: ../../tutorial/controlflow.rst:888 +#: ../../tutorial/controlflow.rst:895 msgid "" "Finally, the least frequently used option is to specify that a function can " "be called with an arbitrary number of arguments. These arguments will be " @@ -1060,7 +1080,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:897 +#: ../../tutorial/controlflow.rst:904 msgid "" "Normally, these *variadic* arguments will be last in the list of formal " "parameters, because they scoop up all remaining input arguments that are " @@ -1074,11 +1094,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:914 +#: ../../tutorial/controlflow.rst:921 msgid "Unpacking Argument Lists" msgstr "拆解引數列表(Unpacking Argument Lists)" -#: ../../tutorial/controlflow.rst:916 +#: ../../tutorial/controlflow.rst:923 msgid "" "The reverse situation occurs when the arguments are already in a list or " "tuple but need to be unpacked for a function call requiring separate " @@ -1094,7 +1114,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:932 +#: ../../tutorial/controlflow.rst:939 msgid "" "In the same fashion, dictionaries can deliver keyword arguments with the " "``**``\\ -operator::" @@ -1103,11 +1123,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:948 +#: ../../tutorial/controlflow.rst:955 msgid "Lambda Expressions" msgstr "Lambda 運算式" -#: ../../tutorial/controlflow.rst:950 +#: ../../tutorial/controlflow.rst:957 msgid "" "Small anonymous functions can be created with the :keyword:`lambda` keyword. " "This function returns the sum of its two arguments: ``lambda a, b: a+b``. " @@ -1124,7 +1144,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:967 +#: ../../tutorial/controlflow.rst:974 msgid "" "The above example uses a lambda expression to return a function. Another " "use is to pass a small function as an argument::" @@ -1134,17 +1154,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:979 +#: ../../tutorial/controlflow.rst:986 msgid "Documentation Strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:986 +#: ../../tutorial/controlflow.rst:993 msgid "" "Here are some conventions about the content and formatting of documentation " "strings." msgstr "以下是關於說明文件字串內容和格式的慣例。" -#: ../../tutorial/controlflow.rst:989 +#: ../../tutorial/controlflow.rst:996 msgid "" "The first line should always be a short, concise summary of the object's " "purpose. For brevity, it should not explicitly state the object's name or " @@ -1156,7 +1176,7 @@ msgstr "" "的名稱或型別,因為有其他方法可以達到相同目的(除非該名稱剛好是一個描述函式運" "算的動詞)。這一行應以大寫字母開頭,以句號結尾。" -#: ../../tutorial/controlflow.rst:995 +#: ../../tutorial/controlflow.rst:1002 msgid "" "If there are more lines in the documentation string, the second line should " "be blank, visually separating the summary from the rest of the description. " @@ -1166,7 +1186,7 @@ msgstr "" "文件字串為多行時,第二行應為空白行,在視覺上將摘要與其餘描述分開。後面幾行可" "包含一或多個段落,描述此物件的呼叫慣例、副作用等。" -#: ../../tutorial/controlflow.rst:1000 +#: ../../tutorial/controlflow.rst:1007 msgid "" "The Python parser does not strip indentation from multi-line string literals " "in Python, so tools that process documentation have to strip indentation if " @@ -1188,18 +1208,18 @@ msgstr "" "出現了,這些行的全部前導空白字元都應被去除。展開 tab 鍵後(通常為八個空格)," "應測試空白字元量是否等價。" -#: ../../tutorial/controlflow.rst:1012 +#: ../../tutorial/controlflow.rst:1019 msgid "Here is an example of a multi-line docstring::" msgstr "" "下面是多行說明字串的一個範例:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:1030 +#: ../../tutorial/controlflow.rst:1037 msgid "Function Annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1038 +#: ../../tutorial/controlflow.rst:1045 msgid "" ":ref:`Function annotations ` are completely optional metadata " "information about the types used by user-defined functions (see :pep:`3107` " @@ -1208,7 +1228,7 @@ msgstr "" ":ref:`函式註釋 `\\ 是選擇性的元資料(metadata)資訊,描述使用者定義" "函式所使用的型別(更多資訊詳見 :pep:`3107` 和 :pep:`484`\\ )。" -#: ../../tutorial/controlflow.rst:1042 +#: ../../tutorial/controlflow.rst:1049 msgid "" ":term:`Annotations ` are stored in the :attr:" "`__annotations__` attribute of the function as a dictionary and have no " @@ -1228,11 +1248,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:1064 +#: ../../tutorial/controlflow.rst:1071 msgid "Intermezzo: Coding Style" msgstr "間奏曲:程式碼風格 (Coding Style)" -#: ../../tutorial/controlflow.rst:1069 +#: ../../tutorial/controlflow.rst:1076 msgid "" "Now that you are about to write longer, more complex pieces of Python, it is " "a good time to talk about *coding style*. Most languages can be written (or " @@ -1245,7 +1265,7 @@ msgstr "" "式比其他的更具可讀性。能讓其他人輕鬆閱讀你的程式碼永遠是一個好主意,而使用優" "良的編碼樣式對此有極大的幫助。" -#: ../../tutorial/controlflow.rst:1075 +#: ../../tutorial/controlflow.rst:1082 msgid "" "For Python, :pep:`8` has emerged as the style guide that most projects " "adhere to; it promotes a very readable and eye-pleasing coding style. Every " @@ -1255,11 +1275,11 @@ msgstr "" "對於 Python,大多數的專案都遵循 :pep:`8` 的樣式指南;它推行的編碼樣式相當可讀" "且賞心悅目。每個 Python 開發者都應該花點時間研讀;這裡是該指南的核心重點:" -#: ../../tutorial/controlflow.rst:1080 +#: ../../tutorial/controlflow.rst:1087 msgid "Use 4-space indentation, and no tabs." msgstr "用 4 個空格縮排,不要用 tab 鍵。" -#: ../../tutorial/controlflow.rst:1082 +#: ../../tutorial/controlflow.rst:1089 msgid "" "4 spaces are a good compromise between small indentation (allows greater " "nesting depth) and large indentation (easier to read). Tabs introduce " @@ -1268,11 +1288,11 @@ msgstr "" "4 個空格是小縮排(容許更大的巢套深度)和大縮排(較易閱讀)之間的折衷方案。" "Tab 鍵會造成混亂,最好別用。" -#: ../../tutorial/controlflow.rst:1086 +#: ../../tutorial/controlflow.rst:1093 msgid "Wrap lines so that they don't exceed 79 characters." msgstr "換行,使一行不超過 79 個字元。" -#: ../../tutorial/controlflow.rst:1088 +#: ../../tutorial/controlflow.rst:1095 msgid "" "This helps users with small displays and makes it possible to have several " "code files side-by-side on larger displays." @@ -1280,21 +1300,21 @@ msgstr "" "換行能讓使用小顯示器的使用者方便閱讀,也可以在較大顯示器上並排陳列多個程式碼" "檔案。" -#: ../../tutorial/controlflow.rst:1091 +#: ../../tutorial/controlflow.rst:1098 msgid "" "Use blank lines to separate functions and classes, and larger blocks of code " "inside functions." msgstr "用空行分隔函式和 class(類別),及函式內較大塊的程式碼。" -#: ../../tutorial/controlflow.rst:1094 +#: ../../tutorial/controlflow.rst:1101 msgid "When possible, put comments on a line of their own." msgstr "如果可以,把註解放在單獨一行。" -#: ../../tutorial/controlflow.rst:1096 +#: ../../tutorial/controlflow.rst:1103 msgid "Use docstrings." msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:1098 +#: ../../tutorial/controlflow.rst:1105 msgid "" "Use spaces around operators and after commas, but not directly inside " "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." @@ -1302,7 +1322,7 @@ msgstr "" "運算子前後、逗號後要加空格,但不要直接放在括號內側:\\ ``a = f(1, 2) + g(3, " "4)``\\ 。" -#: ../../tutorial/controlflow.rst:1101 +#: ../../tutorial/controlflow.rst:1108 msgid "" "Name your classes and functions consistently; the convention is to use " "``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " @@ -1314,7 +1334,7 @@ msgstr "" "底線)。永遠用 ``self`` 作為 method 第一個引數的名稱(關於 class 和 method," "詳見 :ref:`tut-firstclasses`\\ )。" -#: ../../tutorial/controlflow.rst:1106 +#: ../../tutorial/controlflow.rst:1113 msgid "" "Don't use fancy encodings if your code is meant to be used in international " "environments. Python's default, UTF-8, or even plain ASCII work best in any " @@ -1323,7 +1343,7 @@ msgstr "" "若程式碼是為了用於國際環境時,不要用花俏的編碼。Python 預設的 UTF-8 或甚至普" "通的 ASCII,就可以勝任各種情況。" -#: ../../tutorial/controlflow.rst:1110 +#: ../../tutorial/controlflow.rst:1117 msgid "" "Likewise, don't use non-ASCII characters in identifiers if there is only the " "slightest chance people speaking a different language will read or maintain " @@ -1332,11 +1352,11 @@ msgstr "" "同樣地,若不同語言使用者閱讀或維護程式碼的可能性微乎其微,就不要在命名時使用" "非 ASCII 字元。" -#: ../../tutorial/controlflow.rst:1116 +#: ../../tutorial/controlflow.rst:1123 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/controlflow.rst:1117 +#: ../../tutorial/controlflow.rst:1124 msgid "" "Actually, *call by object reference* would be a better description, since if " "a mutable object is passed, the caller will see any changes the callee makes " @@ -1354,60 +1374,74 @@ msgstr "" msgid "for" msgstr "" -#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 +#: ../../tutorial/controlflow.rst:451 ../../tutorial/controlflow.rst:988 #, fuzzy msgid "documentation strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 +#: ../../tutorial/controlflow.rst:451 ../../tutorial/controlflow.rst:988 #, fuzzy msgid "docstrings" msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 +#: ../../tutorial/controlflow.rst:451 ../../tutorial/controlflow.rst:988 msgid "strings, documentation" msgstr "" -#: ../../tutorial/controlflow.rst:885 +#: ../../tutorial/controlflow.rst:892 msgid "* (asterisk)" msgstr "" -#: ../../tutorial/controlflow.rst:885 ../../tutorial/controlflow.rst:929 +#: ../../tutorial/controlflow.rst:892 ../../tutorial/controlflow.rst:936 #, fuzzy msgid "in function calls" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:929 +#: ../../tutorial/controlflow.rst:936 msgid "**" msgstr "" -#: ../../tutorial/controlflow.rst:1033 +#: ../../tutorial/controlflow.rst:1040 #, fuzzy msgid "function" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:1033 +#: ../../tutorial/controlflow.rst:1040 #, fuzzy msgid "annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1033 +#: ../../tutorial/controlflow.rst:1040 msgid "->" msgstr "" -#: ../../tutorial/controlflow.rst:1033 +#: ../../tutorial/controlflow.rst:1040 #, fuzzy msgid "function annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1033 +#: ../../tutorial/controlflow.rst:1040 msgid ": (colon)" msgstr "" -#: ../../tutorial/controlflow.rst:1067 +#: ../../tutorial/controlflow.rst:1074 msgid "coding" msgstr "" -#: ../../tutorial/controlflow.rst:1067 +#: ../../tutorial/controlflow.rst:1074 msgid "style" msgstr "" + +#~ msgid "" +#~ "Loop statements may have an :keyword:`!else` clause; it is executed when " +#~ "the loop terminates through exhaustion of the iterable (with :keyword:" +#~ "`for`) or when the condition becomes false (with :keyword:`while`), but " +#~ "not when the loop is terminated by a :keyword:`break` statement. This is " +#~ "exemplified by the following loop, which searches for prime numbers::" +#~ msgstr "" +#~ "迴圈陳述式可以帶有一個 :keyword:`!else` 子句。當迴圈用盡所有的 iterable " +#~ "(在 :keyword:`for` 中)或條件為假(在 :keyword:`while` 中)時,這個子句會" +#~ "被執行;但迴圈被 :keyword:`break` 陳述式終止時則不會執行。底下尋找質數的迴" +#~ "圈即示範了這個行為:\n" +#~ "\n" +#~ "::" diff --git a/tutorial/errors.po b/tutorial/errors.po index 6dd96e2c27..be9e8f9e1a 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-07 00:39+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-10-24 14:54+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -647,7 +647,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:564 +#: ../../tutorial/errors.rst:573 msgid "" "Note that the exceptions nested in an exception group must be instances, not " "types. This is because in practice the exceptions would typically be ones " @@ -659,11 +659,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:584 +#: ../../tutorial/errors.rst:593 msgid "Enriching Exceptions with Notes" msgstr "用註解使例外更詳細" -#: ../../tutorial/errors.rst:586 +#: ../../tutorial/errors.rst:595 msgid "" "When an exception is created in order to be raised, it is usually " "initialized with information that describes the error that has occurred. " @@ -681,7 +681,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:607 +#: ../../tutorial/errors.rst:616 msgid "" "For example, when collecting exceptions into an exception group, we may want " "to add context information for the individual errors. In the following each " diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 4d4c17307f..ba926df430 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -91,12 +91,12 @@ msgid "Numbers" msgstr "數字 (Number)" #: ../../tutorial/introduction.rst:53 +#, fuzzy msgid "" "The interpreter acts as a simple calculator: you can type an expression at " "it and it will write the value. Expression syntax is straightforward: the " -"operators ``+``, ``-``, ``*`` and ``/`` work just like in most other " -"languages (for example, Pascal or C); parentheses (``()``) can be used for " -"grouping. For example::" +"operators ``+``, ``-``, ``*`` and ``/`` can be used to perform arithmetic; " +"parentheses (``()``) can be used for grouping. For example::" msgstr "" "直譯器如同一台簡單的計算機:你可以輸入一個 expression(運算式),它會寫出該式" "的值。Expression 的語法很使用:運算子 ``+``、``-``、``*`` 和 ``/`` 的行為如同" @@ -198,40 +198,31 @@ msgstr "" "指定虛數的部份(即 ``3+5j``)。" #: ../../tutorial/introduction.rst:142 -msgid "Strings" -msgstr "字串 (String)" +msgid "Text" +msgstr "" #: ../../tutorial/introduction.rst:144 msgid "" -"Besides numbers, Python can also manipulate strings, which can be expressed " -"in several ways. They can be enclosed in single quotes (``'...'``) or " -"double quotes (``\"...\"``) with the same result [#]_. ``\\`` can be used " -"to escape quotes::" +"Python can manipulate text (represented by type :class:`str`, so-called " +"\"strings\") as well as numbers. This includes characters \"``!``\", words " +"\"``rabbit``\", names \"``Paris``\", sentences \"``Got your back.``\", etc. " +"\"``Yay! :)``\". They can be enclosed in single quotes (``'...'``) or double " +"quotes (``\"...\"``) with the same result [#]_." msgstr "" -"除了數字之外,Python 也可以操作字串,而表達字串有數種方式。它們可以用包含在單" -"引號 (``'...'``) 或雙引號 (``\"...\"``) 之中,兩者會得到相同的結果\\ " -"[#]_\\ 。使用 ``\\`` 跳脫出現於字串中的引號:\n" -"\n" -"::" -#: ../../tutorial/introduction.rst:162 +#: ../../tutorial/introduction.rst:157 msgid "" -"In the interactive interpreter, the output string is enclosed in quotes and " -"special characters are escaped with backslashes. While this might sometimes " -"look different from the input (the enclosing quotes could change), the two " -"strings are equivalent. The string is enclosed in double quotes if the " -"string contains a single quote and no double quotes, otherwise it is " -"enclosed in single quotes. The :func:`print` function produces a more " -"readable output, by omitting the enclosing quotes and by printing escaped " -"and special characters::" +"To quote a quote, we need to \"escape\" it, by preceding it with ``\\``. " +"Alternatively, we can use the other type of quotation marks::" +msgstr "" + +#: ../../tutorial/introduction.rst:171 +msgid "" +"In the Python shell, the string definition and output string can look " +"different. The :func:`print` function produces a more readable output, by " +"omitting the enclosing quotes and by printing escaped and special " +"characters::" msgstr "" -"在互動式的直譯器中,輸出的字串會被引號包圍且特殊符號會使用反斜線 (``\\``) 跳" -"脫。雖然這有時會讓它看起來跟輸入的字串不相同(包圍用的引號可能會改變),輸入" -"和輸出兩字串實為相同。一般來說,字串包含單引號而沒有雙引號時,會使用雙引號包" -"圍字串。函式 :func:`print` 會產生更易讀的輸出,它會去除掉包圍的引號,並且直接" -"印出被跳脫的字元和特殊字元:\n" -"\n" -"::" #: ../../tutorial/introduction.rst:182 msgid "" @@ -705,3 +696,36 @@ msgstr "" #: ../../tutorial/introduction.rst:21 msgid "comment" msgstr "" + +#~ msgid "Strings" +#~ msgstr "字串 (String)" + +#~ msgid "" +#~ "Besides numbers, Python can also manipulate strings, which can be " +#~ "expressed in several ways. They can be enclosed in single quotes " +#~ "(``'...'``) or double quotes (``\"...\"``) with the same result [#]_. " +#~ "``\\`` can be used to escape quotes::" +#~ msgstr "" +#~ "除了數字之外,Python 也可以操作字串,而表達字串有數種方式。它們可以用包含" +#~ "在單引號 (``'...'``) 或雙引號 (``\"...\"``) 之中,兩者會得到相同的結果\\ " +#~ "[#]_\\ 。使用 ``\\`` 跳脫出現於字串中的引號:\n" +#~ "\n" +#~ "::" + +#~ msgid "" +#~ "In the interactive interpreter, the output string is enclosed in quotes " +#~ "and special characters are escaped with backslashes. While this might " +#~ "sometimes look different from the input (the enclosing quotes could " +#~ "change), the two strings are equivalent. The string is enclosed in " +#~ "double quotes if the string contains a single quote and no double quotes, " +#~ "otherwise it is enclosed in single quotes. The :func:`print` function " +#~ "produces a more readable output, by omitting the enclosing quotes and by " +#~ "printing escaped and special characters::" +#~ msgstr "" +#~ "在互動式的直譯器中,輸出的字串會被引號包圍且特殊符號會使用反斜線 (``\\``) " +#~ "跳脫。雖然這有時會讓它看起來跟輸入的字串不相同(包圍用的引號可能會改變)," +#~ "輸入和輸出兩字串實為相同。一般來說,字串包含單引號而沒有雙引號時,會使用雙" +#~ "引號包圍字串。函式 :func:`print` 會產生更易讀的輸出,它會去除掉包圍的引" +#~ "號,並且直接印出被跳脫的字元和特殊字元:\n" +#~ "\n" +#~ "::" diff --git a/tutorial/modules.po b/tutorial/modules.po index ddfc0b192c..8b50b187b3 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2022-10-23 20:30+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -702,6 +702,16 @@ msgstr "" #: ../../tutorial/modules.rst:515 msgid "" +"Be aware that submodules might become shadowed by locally defined names. For " +"example, if you added a ``reverse`` function to the :file:`sound/effects/" +"__init__.py` file, the ``from sound.effects import *`` would only import the " +"two submodules ``echo`` and ``surround``, but *not* the ``reverse`` " +"submodule, because it is shadowed by the locally defined ``reverse`` " +"function::" +msgstr "" + +#: ../../tutorial/modules.rst:531 +msgid "" "If ``__all__`` is not defined, the statement ``from sound.effects import *`` " "does *not* import all submodules from the package :mod:`sound.effects` into " "the current namespace; it only ensures that the package :mod:`sound.effects` " @@ -721,7 +731,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:528 +#: ../../tutorial/modules.rst:544 msgid "" "In this example, the :mod:`echo` and :mod:`surround` modules are imported in " "the current namespace because they are defined in the :mod:`sound.effects` " @@ -732,7 +742,7 @@ msgstr "" "`surround` 模組被 import 進當前的命名空間,因為它們是在 :mod:`sound.effects` " "套件裡定義的。(當 ``__all__`` 有被定義時,這規則也有效。)" -#: ../../tutorial/modules.rst:533 +#: ../../tutorial/modules.rst:549 msgid "" "Although certain modules are designed to export only names that follow " "certain patterns when you use ``import *``, it is still considered bad " @@ -741,7 +751,7 @@ msgstr "" "雖然,有些特定模組的設計,讓你使用 ``import *`` 時,該模組只會輸出遵循特定樣" "式的名稱,但在正式環境 (production) 的程式碼中這仍然被視為是不良習慣。" -#: ../../tutorial/modules.rst:537 +#: ../../tutorial/modules.rst:553 msgid "" "Remember, there is nothing wrong with using ``from package import " "specific_submodule``! In fact, this is the recommended notation unless the " @@ -751,11 +761,11 @@ msgstr "" "記住,使用 ``from package import specific_submodule`` 不會有任何問題!實際" "上,這是推薦用法,除非 import 的模組需要用到的子模組和其他套件的子模組同名。" -#: ../../tutorial/modules.rst:546 +#: ../../tutorial/modules.rst:562 msgid "Intra-package References" msgstr "套件內引用" -#: ../../tutorial/modules.rst:548 +#: ../../tutorial/modules.rst:564 msgid "" "When packages are structured into subpackages (as with the :mod:`sound` " "package in the example), you can use absolute imports to refer to submodules " @@ -768,7 +778,7 @@ msgstr "" "filters.vocoder` 模組中使用 :mod:`sound.effects` 中的 :mod:`echo` 模組時,可" "以用 ``from sound.effects import echo``\\ 。" -#: ../../tutorial/modules.rst:554 +#: ../../tutorial/modules.rst:570 msgid "" "You can also write relative imports, with the ``from module import name`` " "form of import statement. These imports use leading dots to indicate the " @@ -781,7 +791,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:563 +#: ../../tutorial/modules.rst:579 msgid "" "Note that relative imports are based on the name of the current module. " "Since the name of the main module is always ``\"__main__\"``, modules " @@ -792,11 +802,11 @@ msgstr "" "``\"__main__\"``\\ ,所以如果一個模組預期被用作 Python 應用程式的主模組,那它" "必須永遠使用絕對 import。" -#: ../../tutorial/modules.rst:569 +#: ../../tutorial/modules.rst:585 msgid "Packages in Multiple Directories" msgstr "多目錄中的套件" -#: ../../tutorial/modules.rst:571 +#: ../../tutorial/modules.rst:587 msgid "" "Packages support one more special attribute, :attr:`__path__`. This is " "initialized to be a list containing the name of the directory holding the " @@ -809,17 +819,17 @@ msgstr "" "執行之前。這個變數可以被修改,但這樣做會影響將來對套件內的模組和子套件的搜" "尋。" -#: ../../tutorial/modules.rst:577 +#: ../../tutorial/modules.rst:593 msgid "" "While this feature is not often needed, it can be used to extend the set of " "modules found in a package." msgstr "雖然這個特色不太常被需要,但它可用於擴充套件中的模組集合。" -#: ../../tutorial/modules.rst:582 +#: ../../tutorial/modules.rst:598 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/modules.rst:583 +#: ../../tutorial/modules.rst:599 msgid "" "In fact function definitions are also 'statements' that are 'executed'; the " "execution of a module-level function definition adds the function name to " diff --git a/using/cmdline.po b/using/cmdline.po index 3979741aa3..73c3c98510 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1093,15 +1093,15 @@ msgstr "" #: ../../using/cmdline.rst:885 msgid "" "``malloc``: use the :c:func:`malloc` function of the C library for all " -"domains (:c:data:`PYMEM_DOMAIN_RAW`, :c:data:`PYMEM_DOMAIN_MEM`, :c:data:" +"domains (:c:macro:`PYMEM_DOMAIN_RAW`, :c:macro:`PYMEM_DOMAIN_MEM`, :c:macro:" "`PYMEM_DOMAIN_OBJ`)." msgstr "" #: ../../using/cmdline.rst:888 msgid "" -"``pymalloc``: use the :ref:`pymalloc allocator ` for :c:data:" -"`PYMEM_DOMAIN_MEM` and :c:data:`PYMEM_DOMAIN_OBJ` domains and use the :c:" -"func:`malloc` function for the :c:data:`PYMEM_DOMAIN_RAW` domain." +"``pymalloc``: use the :ref:`pymalloc allocator ` for :c:macro:" +"`PYMEM_DOMAIN_MEM` and :c:macro:`PYMEM_DOMAIN_OBJ` domains and use the :c:" +"func:`malloc` function for the :c:macro:`PYMEM_DOMAIN_RAW` domain." msgstr "" #: ../../using/cmdline.rst:892 diff --git a/using/configure.po b/using/configure.po index 87bf5fe58a..a117b47bd3 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-16 00:34+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -100,7 +100,7 @@ msgstr "" #: ../../using/configure.rst:65 msgid "" -"Select the default time zone search path for :data:`zoneinfo.TZPATH`. See " +"Select the default time zone search path for :const:`zoneinfo.TZPATH`. See " "the :ref:`Compile-time configuration ` of " "the :mod:`zoneinfo` module." msgstr "" @@ -122,7 +122,7 @@ msgid "" msgstr "" #: ../../using/configure.rst:80 -msgid "See :data:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." +msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." msgstr "" #: ../../using/configure.rst:86 diff --git a/using/windows.po b/using/windows.po index 985d2bb44d..a4aaccd299 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1928,7 +1928,7 @@ msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " "finder is enabled on Windows in 3.6.0 and earlier, but may need to be " -"explicitly added to :attr:`sys.meta_path` in the future." +"explicitly added to :data:`sys.meta_path` in the future." msgstr "" #: ../../using/windows.rst:1194 diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index 833f7f5d56..e8573d931c 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1315,11 +1315,11 @@ msgstr "" #: ../../whatsnew/2.2.rst:1108 msgid "" -"Two new flags :const:`METH_NOARGS` and :const:`METH_O` are available in " +"Two new flags :c:macro:`METH_NOARGS` and :c:macro:`METH_O` are available in " "method definition tables to simplify implementation of methods with no " "arguments or a single untyped argument. Calling such methods is more " -"efficient than calling a corresponding method that uses :const:" -"`METH_VARARGS`. Also, the old :const:`METH_OLDARGS` style of writing C " +"efficient than calling a corresponding method that uses :c:macro:" +"`METH_VARARGS`. Also, the old :c:macro:`METH_OLDARGS` style of writing C " "methods is now officially deprecated." msgstr "" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index a7e7f16c62..8daf767863 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1639,7 +1639,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1477 msgid "" -"The value of the C :const:`PYTHON_API_VERSION` macro is now exposed at the " +"The value of the C :c:macro:`PYTHON_API_VERSION` macro is now exposed at the " "Python level as ``sys.api_version``. The current exception can be cleared " "by calling the new :func:`sys.exc_clear` function." msgstr "" @@ -2085,11 +2085,11 @@ msgstr "" msgid "" "The :c:func:`PyArg_NoArgs` macro is now deprecated, and code that uses it " "should be changed. For Python 2.2 and later, the method definition table " -"can specify the :const:`METH_NOARGS` flag, signalling that there are no " +"can specify the :c:macro:`METH_NOARGS` flag, signalling that there are no " "arguments, and the argument checking can then be removed. If compatibility " "with pre-2.2 versions of Python is important, the code could use " "``PyArg_ParseTuple(args, \"\")`` instead, but this will be slower than " -"using :const:`METH_NOARGS`." +"using :c:macro:`METH_NOARGS`." msgstr "" #: ../../whatsnew/2.3.rst:1907 @@ -2117,8 +2117,8 @@ msgstr "" #: ../../whatsnew/2.3.rst:1920 msgid "" "It's now possible to define class and static methods for a C extension type " -"by setting either the :const:`METH_CLASS` or :const:`METH_STATIC` flags in a " -"method's :c:type:`PyMethodDef` structure." +"by setting either the :c:macro:`METH_CLASS` or :c:macro:`METH_STATIC` flags " +"in a method's :c:type:`PyMethodDef` structure." msgstr "" #: ../../whatsnew/2.3.rst:1924 diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index 686de50a63..5160ed4def 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1682,7 +1682,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:1479 msgid "" -"A new method flag, :const:`METH_COEXISTS`, allows a function defined in " +"A new method flag, :c:macro:`METH_COEXISTS`, allows a function defined in " "slots to co-exist with a :c:type:`PyCFunction` having the same name. This " "can halve the access time for a method such as :meth:`set.__contains__`. " "(Contributed by Raymond Hettinger.)" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index 49a078f50d..aa645aa906 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1692,9 +1692,9 @@ msgstr "" #: ../../whatsnew/2.5.rst:1451 msgid "" -"Constants named :attr:`os.SEEK_SET`, :attr:`os.SEEK_CUR`, and :attr:`os." +"Constants named :const:`os.SEEK_SET`, :const:`os.SEEK_CUR`, and :const:`os." "SEEK_END` have been added; these are the parameters to the :func:`os.lseek` " -"function. Two new constants for locking are :attr:`os.O_SHLOCK` and :attr:" +"function. Two new constants for locking are :const:`os.O_SHLOCK` and :const:" "`os.O_EXLOCK`." msgstr "" @@ -1912,7 +1912,7 @@ msgstr "" msgid "" "The :mod:`unicodedata` module has been updated to use version 4.1.0 of the " "Unicode character database. Version 3.2.0 is required by some " -"specifications, so it's still available as :attr:`unicodedata.ucd_3_2_0`." +"specifications, so it's still available as :data:`unicodedata.ucd_3_2_0`." msgstr "" #: ../../whatsnew/2.5.rst:1607 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index cadadcf7de..a1e9d78f56 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1269,17 +1269,17 @@ msgid "" msgstr "" #: ../../whatsnew/2.6.rst:1141 -msgid ":const:`PyBUF_WRITABLE` indicates that the memory must be writable." +msgid ":c:macro:`PyBUF_WRITABLE` indicates that the memory must be writable." msgstr "" #: ../../whatsnew/2.6.rst:1143 msgid "" -":const:`PyBUF_LOCK` requests a read-only or exclusive lock on the memory." +":c:macro:`PyBUF_LOCK` requests a read-only or exclusive lock on the memory." msgstr "" #: ../../whatsnew/2.6.rst:1145 msgid "" -":const:`PyBUF_C_CONTIGUOUS` and :const:`PyBUF_F_CONTIGUOUS` requests a C-" +":c:macro:`PyBUF_C_CONTIGUOUS` and :c:macro:`PyBUF_F_CONTIGUOUS` requests a C-" "contiguous (last dimension varies the fastest) or Fortran-contiguous (first " "dimension varies the fastest) array layout." msgstr "" @@ -2550,8 +2550,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:2291 msgid "" -"The :mod:`select` module now has wrapper functions for the Linux :c:func:" -"`epoll` and BSD :c:func:`kqueue` system calls. :meth:`modify` method was " +"The :mod:`select` module now has wrapper functions for the Linux :c:func:`!" +"epoll` and BSD :c:func:`!kqueue` system calls. :meth:`modify` method was " "added to the existing :class:`poll` objects; ``pollobj.modify(fd, " "eventmask)`` takes a file descriptor or file object and an event mask, " "modifying the recorded event mask for that file. (Contributed by Christian " @@ -2597,8 +2597,8 @@ msgid "" "Event loops will use this by opening a pipe to create two descriptors, one " "for reading and one for writing. The writable descriptor will be passed to :" "func:`set_wakeup_fd`, and the readable descriptor will be added to the list " -"of descriptors monitored by the event loop via :c:func:`select` or :c:func:" -"`poll`. On receiving a signal, a byte will be written and the main event " +"of descriptors monitored by the event loop via :c:func:`!select` or :c:func:" +"`!poll`. On receiving a signal, a byte will be written and the main event " "loop will be woken up, avoiding the need to poll." msgstr "" @@ -3328,7 +3328,8 @@ msgstr "" msgid "" "Python now must be compiled with C89 compilers (after 19 years!). This " "means that the Python source tree has dropped its own implementations of :c:" -"func:`memmove` and :c:func:`strerror`, which are in the C89 standard library." +"func:`!memmove` and :c:func:`!strerror`, which are in the C89 standard " +"library." msgstr "" #: ../../whatsnew/2.6.rst:2988 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 26c116a784..3734f122dc 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -436,7 +436,7 @@ msgstr "" msgid "" "This means Python now supports three different modules for parsing command-" "line arguments: :mod:`getopt`, :mod:`optparse`, and :mod:`argparse`. The :" -"mod:`getopt` module closely resembles the C library's :c:func:`getopt` " +"mod:`getopt` module closely resembles the C library's :c:func:`!getopt` " "function, so it remains useful if you're writing a Python prototype that " "will eventually be rewritten in C. :mod:`optparse` becomes redundant, but " "there are no plans to remove it because there are many scripts still using " @@ -1739,8 +1739,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:1557 msgid "" "The version of OpenSSL being used is now available as the module attributes :" -"data:`ssl.OPENSSL_VERSION` (a string), :data:`ssl.OPENSSL_VERSION_INFO` (a 5-" -"tuple), and :data:`ssl.OPENSSL_VERSION_NUMBER` (an integer). (Added by " +"const:`ssl.OPENSSL_VERSION` (a string), :const:`ssl.OPENSSL_VERSION_INFO` (a " +"5-tuple), and :const:`ssl.OPENSSL_VERSION_NUMBER` (an integer). (Added by " "Antoine Pitrou; :issue:`8321`.)" msgstr "" @@ -2614,7 +2614,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:2231 msgid "" "When using the :c:type:`PyMemberDef` structure to define attributes of a " -"type, Python will no longer let you try to delete or set a :const:" +"type, Python will no longer let you try to delete or set a :c:macro:" "`T_STRING_INPLACE` attribute." msgstr "" diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 5bc68ac996..4a45f931ed 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-26 00:21+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -438,7 +438,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.1.rst:373 -msgid "The :attr:`sys.version_info` tuple is now a named tuple::" +msgid "The :data:`sys.version_info` tuple is now a named tuple::" msgstr "" #: ../../whatsnew/3.1.rst:378 @@ -613,7 +613,7 @@ msgstr "" msgid "" "Apart from the performance improvements this change should be invisible to " "end users, with one exception: for testing and debugging purposes there's a " -"new :attr:`sys.int_info` that provides information about the internal " +"new :data:`sys.int_info` that provides information about the internal " "format, giving the number of bits per digit and the size in bytes of the C " "type used to store each digit::" msgstr "" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index bdcc7b5361..fc850a4268 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-11 00:15+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -941,7 +941,7 @@ msgid "New Modules" msgstr "" #: ../../whatsnew/3.10.rst:889 -msgid "None yet." +msgid "None." msgstr "" #: ../../whatsnew/3.10.rst:893 @@ -1458,9 +1458,9 @@ msgstr "" #: ../../whatsnew/3.10.rst:1255 msgid "" -"Add :data:`~os.O_EVTONLY`, :data:`~os.O_FSYNC`, :data:`~os.O_SYMLINK` and :" -"data:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Dong-hee Na in :issue:" -"`43106`.)" +"Add :const:`~os.O_EVTONLY`, :const:`~os.O_FSYNC`, :const:`~os.O_SYMLINK` " +"and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Dong-hee Na in :" +"issue:`43106`.)" msgstr "" #: ../../whatsnew/3.10.rst:1260 @@ -1562,9 +1562,9 @@ msgstr "shelve" #: ../../whatsnew/3.10.rst:1321 msgid "" -"The :mod:`shelve` module now uses :data:`pickle.DEFAULT_PROTOCOL` by default " -"instead of :mod:`pickle` protocol ``3`` when creating shelves. (Contributed " -"by Zackery Spytz in :issue:`34204`.)" +"The :mod:`shelve` module now uses :const:`pickle.DEFAULT_PROTOCOL` by " +"default instead of :mod:`pickle` protocol ``3`` when creating shelves. " +"(Contributed by Zackery Spytz in :issue:`34204`.)" msgstr "" #: ../../whatsnew/3.10.rst:1326 @@ -1617,7 +1617,7 @@ msgstr "" #: ../../whatsnew/3.10.rst:1357 msgid "" "The ssl module has preliminary support for OpenSSL 3.0.0 and new option :" -"data:`~ssl.OP_IGNORE_UNEXPECTED_EOF`. (Contributed by Christian Heimes in :" +"const:`~ssl.OP_IGNORE_UNEXPECTED_EOF`. (Contributed by Christian Heimes in :" "issue:`38820`, :issue:`43794`, :issue:`43788`, :issue:`43791`, :issue:" "`43799`, :issue:`43920`, :issue:`43789`, and :issue:`43811`.)" msgstr "" @@ -1664,7 +1664,7 @@ msgstr "" #: ../../whatsnew/3.10.rst:1389 msgid "" -"A new verify flag :data:`~ssl.VERIFY_X509_PARTIAL_CHAIN` has been added. " +"A new verify flag :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN` has been added. " "(Contributed by l0x in :issue:`40849`.)" msgstr "" @@ -1703,7 +1703,7 @@ msgstr "_thread" #: ../../whatsnew/3.10.rst:1414 msgid "" ":func:`_thread.interrupt_main` now takes an optional signal number to " -"simulate (the default is still :data:`signal.SIGINT`). (Contributed by " +"simulate (the default is still :const:`signal.SIGINT`). (Contributed by " "Antoine Pitrou in :issue:`43356`.)" msgstr "" @@ -2201,9 +2201,9 @@ msgstr "" msgid "" ":data:`~ssl.PROTOCOL_SSLv2`, :data:`~ssl.PROTOCOL_SSLv3`, :data:`~ssl." "PROTOCOL_SSLv23`, :data:`~ssl.PROTOCOL_TLSv1`, :data:`~ssl." -"PROTOCOL_TLSv1_1`, :data:`~ssl.PROTOCOL_TLSv1_2`, and :data:`~ssl." -"PROTOCOL_TLS` are deprecated in favor of :data:`~ssl.PROTOCOL_TLS_CLIENT` " -"and :data:`~ssl.PROTOCOL_TLS_SERVER`" +"PROTOCOL_TLSv1_1`, :data:`~ssl.PROTOCOL_TLSv1_2`, and :const:`~ssl." +"PROTOCOL_TLS` are deprecated in favor of :const:`~ssl.PROTOCOL_TLS_CLIENT` " +"and :const:`~ssl.PROTOCOL_TLS_SERVER`" msgstr "" #: ../../whatsnew/3.10.rst:1762 @@ -2743,13 +2743,13 @@ msgstr "" #: ../../whatsnew/3.10.rst:2126 msgid "" -"Add a new :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " +"Add a new :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " "creating type instances. (Contributed by Victor Stinner in :issue:`43916`.)" msgstr "" #: ../../whatsnew/3.10.rst:2130 msgid "" -"Add a new :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating " +"Add a new :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating " "immutable type objects: type attributes cannot be set nor deleted. " "(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)" msgstr "" @@ -2830,9 +2830,9 @@ msgstr "" #: ../../whatsnew/3.10.rst:2189 msgid "" -"Use the :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable " -"type objects. Do not rely on :c:data:`Py_TPFLAGS_HEAPTYPE` to decide if a " -"type object is mutable or not; check if :c:data:`Py_TPFLAGS_IMMUTABLETYPE` " +"Use the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable " +"type objects. Do not rely on :c:macro:`Py_TPFLAGS_HEAPTYPE` to decide if a " +"type object is mutable or not; check if :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` " "is set instead. (Contributed by Victor Stinner and Erlend E. Aasland in :" "issue:`43908`.)" msgstr "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 16c5dab4e0..5b7f594116 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-28 00:33+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,152 +21,136 @@ msgstr "" msgid "What's New In Python 3.11" msgstr "Python 3.11 有什麼新功能" -#: ../../whatsnew/3.11.rst:0 -msgid "Release" -msgstr "發行版本" - -#: ../../whatsnew/3.11.rst:5 -msgid "|release|" -msgstr "|release|" - -#: ../../whatsnew/3.11.rst:0 -msgid "Date" -msgstr "日期" - -#: ../../whatsnew/3.11.rst:6 -msgid "|today|" -msgstr "|today|" - #: ../../whatsnew/3.11.rst:0 msgid "Editor" msgstr "" -#: ../../whatsnew/3.11.rst:7 +#: ../../whatsnew/3.11.rst:5 msgid "Pablo Galindo Salgado" msgstr "" -#: ../../whatsnew/3.11.rst:49 +#: ../../whatsnew/3.11.rst:47 msgid "" "This article explains the new features in Python 3.11, compared to 3.10." msgstr "" -#: ../../whatsnew/3.11.rst:51 +#: ../../whatsnew/3.11.rst:49 msgid "For full details, see the :ref:`changelog `." msgstr "" -#: ../../whatsnew/3.11.rst:57 +#: ../../whatsnew/3.11.rst:55 msgid "Summary -- Release highlights" msgstr "" -#: ../../whatsnew/3.11.rst:62 +#: ../../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." msgstr "" -#: ../../whatsnew/3.11.rst:68 +#: ../../whatsnew/3.11.rst:66 msgid "New syntax features:" msgstr "" -#: ../../whatsnew/3.11.rst:70 +#: ../../whatsnew/3.11.rst:68 msgid ":ref:`whatsnew311-pep654`" msgstr "" -#: ../../whatsnew/3.11.rst:72 +#: ../../whatsnew/3.11.rst:70 msgid "New built-in features:" msgstr "" -#: ../../whatsnew/3.11.rst:74 +#: ../../whatsnew/3.11.rst:72 msgid ":ref:`whatsnew311-pep678`" msgstr "" -#: ../../whatsnew/3.11.rst:76 +#: ../../whatsnew/3.11.rst:74 msgid "New standard library modules:" msgstr "" -#: ../../whatsnew/3.11.rst:78 +#: ../../whatsnew/3.11.rst:76 msgid "" ":pep:`680`: :mod:`tomllib` — Support for parsing `TOML `_ " "in the Standard Library" msgstr "" -#: ../../whatsnew/3.11.rst:81 +#: ../../whatsnew/3.11.rst:79 msgid "Interpreter improvements:" msgstr "" -#: ../../whatsnew/3.11.rst:83 +#: ../../whatsnew/3.11.rst:81 msgid ":ref:`whatsnew311-pep657`" msgstr "" -#: ../../whatsnew/3.11.rst:84 +#: ../../whatsnew/3.11.rst:82 msgid "" "New :option:`-P` command line option and :envvar:`PYTHONSAFEPATH` " "environment variable to :ref:`disable automatically prepending potentially " "unsafe paths ` to :data:`sys.path`" msgstr "" -#: ../../whatsnew/3.11.rst:88 +#: ../../whatsnew/3.11.rst:86 msgid "New typing features:" msgstr "" -#: ../../whatsnew/3.11.rst:90 +#: ../../whatsnew/3.11.rst:88 msgid ":ref:`whatsnew311-pep646`" msgstr "" -#: ../../whatsnew/3.11.rst:91 +#: ../../whatsnew/3.11.rst:89 msgid ":ref:`whatsnew311-pep655`" msgstr "" -#: ../../whatsnew/3.11.rst:92 +#: ../../whatsnew/3.11.rst:90 msgid ":ref:`whatsnew311-pep673`" msgstr "" -#: ../../whatsnew/3.11.rst:93 +#: ../../whatsnew/3.11.rst:91 msgid ":ref:`whatsnew311-pep675`" msgstr "" -#: ../../whatsnew/3.11.rst:94 +#: ../../whatsnew/3.11.rst:92 msgid ":ref:`whatsnew311-pep681`" msgstr "" -#: ../../whatsnew/3.11.rst:96 +#: ../../whatsnew/3.11.rst:94 msgid "Important deprecations, removals and restrictions:" msgstr "" -#: ../../whatsnew/3.11.rst:98 +#: ../../whatsnew/3.11.rst:96 msgid "" ":pep:`594`: :ref:`Many legacy standard library modules have been deprecated " "` and will be removed in Python 3.13" msgstr "" -#: ../../whatsnew/3.11.rst:101 +#: ../../whatsnew/3.11.rst:99 msgid "" ":pep:`624`: :ref:`Py_UNICODE encoder APIs have been removed `" msgstr "" -#: ../../whatsnew/3.11.rst:103 +#: ../../whatsnew/3.11.rst:101 msgid "" ":pep:`670`: :ref:`Macros converted to static inline functions `" msgstr "" -#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2195 +#: ../../whatsnew/3.11.rst:108 ../../whatsnew/3.11.rst:2193 msgid "New Features" msgstr "" -#: ../../whatsnew/3.11.rst:115 +#: ../../whatsnew/3.11.rst:113 msgid "PEP 657: Fine-grained error locations in tracebacks" msgstr "" -#: ../../whatsnew/3.11.rst:117 +#: ../../whatsnew/3.11.rst:115 msgid "" "When printing tracebacks, the interpreter will now point to the exact " "expression that caused the error, instead of just the line. For example:" msgstr "" -#: ../../whatsnew/3.11.rst:131 +#: ../../whatsnew/3.11.rst:129 msgid "" "Previous versions of the interpreter would point to just the line, making it " "ambiguous which object was ``None``. These enhanced errors can also be " @@ -174,11 +158,11 @@ msgid "" "function calls:" msgstr "" -#: ../../whatsnew/3.11.rst:151 +#: ../../whatsnew/3.11.rst:149 msgid "As well as complex arithmetic expressions:" msgstr "" -#: ../../whatsnew/3.11.rst:161 +#: ../../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` :" @@ -186,21 +170,21 @@ msgid "" "can be retrieved using:" msgstr "" -#: ../../whatsnew/3.11.rst:166 +#: ../../whatsnew/3.11.rst:164 msgid "The :meth:`codeobject.co_positions` method in Python." msgstr "" -#: ../../whatsnew/3.11.rst:167 +#: ../../whatsnew/3.11.rst:165 msgid "The :c:func:`PyCode_Addr2Location` function in the C API." msgstr "" -#: ../../whatsnew/3.11.rst:169 +#: ../../whatsnew/3.11.rst:167 msgid "" "See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan " "Taskaya and Ammar Askar in :issue:`43950`.)" msgstr "" -#: ../../whatsnew/3.11.rst:173 +#: ../../whatsnew/3.11.rst:171 msgid "" "This feature requires storing column positions in :ref:`codeobjects`, which " "may result in a small increase in interpreter memory usage and disk usage " @@ -210,11 +194,11 @@ msgid "" "`PYTHONNODEBUGRANGES` environment variable." msgstr "" -#: ../../whatsnew/3.11.rst:185 +#: ../../whatsnew/3.11.rst:183 msgid "PEP 654: Exception Groups and ``except*``" msgstr "" -#: ../../whatsnew/3.11.rst:187 +#: ../../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:" @@ -224,21 +208,21 @@ msgid "" "exception groups." msgstr "" -#: ../../whatsnew/3.11.rst:194 +#: ../../whatsnew/3.11.rst:192 msgid "See :pep:`654` for more details." msgstr "詳情請見 :pep:`654`。" -#: ../../whatsnew/3.11.rst:196 +#: ../../whatsnew/3.11.rst:194 msgid "" "(Contributed by Irit Katriel in :issue:`45292`. PEP written by Irit Katriel, " "Yury Selivanov and Guido van Rossum.)" msgstr "" -#: ../../whatsnew/3.11.rst:203 +#: ../../whatsnew/3.11.rst:201 msgid "PEP 678: Exceptions can be enriched with notes" msgstr "" -#: ../../whatsnew/3.11.rst:205 +#: ../../whatsnew/3.11.rst:203 msgid "" "The :meth:`~BaseException.add_note` method is added to :exc:`BaseException`. " "It can be used to enrich exceptions with context information that is not " @@ -246,21 +230,21 @@ msgid "" "in the default traceback." msgstr "" -#: ../../whatsnew/3.11.rst:210 +#: ../../whatsnew/3.11.rst:208 msgid "See :pep:`678` for more details." msgstr "詳情請見 :pep:`678`。" -#: ../../whatsnew/3.11.rst:212 +#: ../../whatsnew/3.11.rst:210 msgid "" "(Contributed by Irit Katriel in :issue:`45607`. PEP written by Zac Hatfield-" "Dodds.)" msgstr "" -#: ../../whatsnew/3.11.rst:219 +#: ../../whatsnew/3.11.rst:217 msgid "Windows ``py.exe`` launcher improvements" msgstr "" -#: ../../whatsnew/3.11.rst:221 +#: ../../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:" @@ -269,7 +253,7 @@ msgid "" "``PythonCore``, the one hosted on `python.org `_." msgstr "" -#: ../../whatsnew/3.11.rst:227 +#: ../../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 " @@ -277,7 +261,7 @@ msgid "" "V:/3.11`` will select the \"best\" distribution with tag ``3.11``." msgstr "" -#: ../../whatsnew/3.11.rst:232 +#: ../../whatsnew/3.11.rst:230 msgid "" "When using the legacy ``-``, ``-.``, ``--" "`` or ``-.-`` arguments, all existing " @@ -289,21 +273,21 @@ msgid "" "their 32-bit builds." msgstr "" -#: ../../whatsnew/3.11.rst:246 +#: ../../whatsnew/3.11.rst:244 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.11.rst:248 +#: ../../whatsnew/3.11.rst:246 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.11.rst:255 +#: ../../whatsnew/3.11.rst:253 msgid "PEP 646: Variadic generics" msgstr "" -#: ../../whatsnew/3.11.rst:257 +#: ../../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." @@ -312,7 +296,7 @@ msgid "" "variable, enabling *variadic* generics." msgstr "" -#: ../../whatsnew/3.11.rst:264 +#: ../../whatsnew/3.11.rst:262 msgid "" "This enables a wide variety of use cases. In particular, it allows the type " "of array-like structures in numerical computing libraries such as NumPy and " @@ -321,23 +305,23 @@ msgid "" "libraries." msgstr "" -#: ../../whatsnew/3.11.rst:270 +#: ../../whatsnew/3.11.rst:268 msgid "See :pep:`646` for more details." msgstr "詳情請見 :pep:`646`。" -#: ../../whatsnew/3.11.rst:272 +#: ../../whatsnew/3.11.rst:270 msgid "" "(Contributed by Matthew Rahtz in :issue:`43224`, with contributions by " "Serhiy Storchaka and Jelle Zijlstra. PEP written by Mark Mendoza, Matthew " "Rahtz, Pradeep Kumar Srinivasan, and Vincent Siles.)" msgstr "" -#: ../../whatsnew/3.11.rst:280 +#: ../../whatsnew/3.11.rst:278 msgid "" "PEP 655: Marking individual ``TypedDict`` items as required or not-required" msgstr "" -#: ../../whatsnew/3.11.rst:282 +#: ../../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." @@ -345,7 +329,7 @@ msgid "" "inheritance." msgstr "" -#: ../../whatsnew/3.11.rst:287 +#: ../../whatsnew/3.11.rst:285 msgid "" "All fields are still required by default, unless the *total* parameter is " "set to ``False``, in which case all fields are still not-required by " @@ -353,25 +337,25 @@ msgid "" "required and one not-required key::" msgstr "" -#: ../../whatsnew/3.11.rst:301 +#: ../../whatsnew/3.11.rst:299 msgid "The following definition is equivalent::" msgstr "" -#: ../../whatsnew/3.11.rst:307 +#: ../../whatsnew/3.11.rst:305 msgid "See :pep:`655` for more details." msgstr "詳情請見 :pep:`655`。" -#: ../../whatsnew/3.11.rst:309 +#: ../../whatsnew/3.11.rst:307 msgid "" "(Contributed by David Foster and Jelle Zijlstra in :issue:`47087`. PEP " "written by David Foster.)" msgstr "" -#: ../../whatsnew/3.11.rst:316 +#: ../../whatsnew/3.11.rst:314 msgid "PEP 673: ``Self`` type" msgstr "" -#: ../../whatsnew/3.11.rst:318 +#: ../../whatsnew/3.11.rst:316 msgid "" "The new :data:`~typing.Self` annotation provides a simple and intuitive way " "to annotate methods that return an instance of their class. This behaves the " @@ -380,34 +364,34 @@ msgid "" "easier to follow." msgstr "" -#: ../../whatsnew/3.11.rst:324 +#: ../../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``::" msgstr "" -#: ../../whatsnew/3.11.rst:342 +#: ../../whatsnew/3.11.rst:340 msgid "" ":data:`~typing.Self` can also be used to annotate method parameters or " "attributes of the same type as their enclosing class." msgstr "" -#: ../../whatsnew/3.11.rst:345 +#: ../../whatsnew/3.11.rst:343 msgid "See :pep:`673` for more details." msgstr "詳情請見 :pep:`673`。" -#: ../../whatsnew/3.11.rst:347 +#: ../../whatsnew/3.11.rst:345 msgid "" "(Contributed by James Hilton-Balfe in :issue:`46534`. PEP written by Pradeep " "Kumar Srinivasan and James Hilton-Balfe.)" msgstr "" -#: ../../whatsnew/3.11.rst:354 +#: ../../whatsnew/3.11.rst:352 msgid "PEP 675: Arbitrary literal string type" msgstr "" -#: ../../whatsnew/3.11.rst:356 +#: ../../whatsnew/3.11.rst:354 msgid "" "The new :data:`~typing.LiteralString` annotation may be used to indicate " "that a function parameter can be of any literal string type. This allows a " @@ -418,25 +402,25 @@ msgid "" "against injection attacks." msgstr "" -#: ../../whatsnew/3.11.rst:364 +#: ../../whatsnew/3.11.rst:362 msgid "For example, a SQL query function could be annotated as follows::" msgstr "" -#: ../../whatsnew/3.11.rst:382 +#: ../../whatsnew/3.11.rst:380 msgid "See :pep:`675` for more details." msgstr "詳情請見 :pep:`675`。" -#: ../../whatsnew/3.11.rst:384 +#: ../../whatsnew/3.11.rst:382 msgid "" "(Contributed by Jelle Zijlstra in :issue:`47088`. PEP written by Pradeep " "Kumar Srinivasan and Graham Bleaney.)" msgstr "" -#: ../../whatsnew/3.11.rst:391 +#: ../../whatsnew/3.11.rst:389 msgid "PEP 681: Data class transforms" msgstr "" -#: ../../whatsnew/3.11.rst:393 +#: ../../whatsnew/3.11.rst:391 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -445,28 +429,28 @@ msgid "" "`dataclass `-like behaviors." msgstr "" -#: ../../whatsnew/3.11.rst:399 +#: ../../whatsnew/3.11.rst:397 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:417 +#: ../../whatsnew/3.11.rst:415 msgid "See :pep:`681` for more details." msgstr "詳情請見 :pep:`681`。" -#: ../../whatsnew/3.11.rst:419 +#: ../../whatsnew/3.11.rst:417 msgid "" "(Contributed by Jelle Zijlstra in :gh:`91860`. PEP written by Erik De Bonte " "and Eric Traut.)" msgstr "" -#: ../../whatsnew/3.11.rst:426 +#: ../../whatsnew/3.11.rst:424 msgid "PEP 563 may not be the future" msgstr "" -#: ../../whatsnew/3.11.rst:428 +#: ../../whatsnew/3.11.rst:426 msgid "" ":pep:`563` Postponed Evaluation of Annotations (the ``from __future__ import " "annotations`` :ref:`future statement `) that was originally planned " @@ -476,17 +460,17 @@ msgid "" "information." msgstr "" -#: ../../whatsnew/3.11.rst:439 +#: ../../whatsnew/3.11.rst:437 msgid "Other Language Changes" msgstr "" -#: ../../whatsnew/3.11.rst:441 +#: ../../whatsnew/3.11.rst:439 msgid "" "Starred unpacking expressions can now be used in :keyword:`for` statements. " "(See :issue:`46725` for more details.)" msgstr "" -#: ../../whatsnew/3.11.rst:444 +#: ../../whatsnew/3.11.rst:442 msgid "" "Asynchronous :ref:`comprehensions ` are now allowed inside " "comprehensions in :ref:`asynchronous functions `. Outer " @@ -494,7 +478,7 @@ msgid "" "Serhiy Storchaka in :issue:`33346`.)" msgstr "" -#: ../../whatsnew/3.11.rst:449 +#: ../../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 " @@ -505,7 +489,7 @@ msgid "" "`12022` and :issue:`44471`.)" msgstr "" -#: ../../whatsnew/3.11.rst:457 +#: ../../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 " @@ -516,7 +500,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`26579`.)" msgstr "" -#: ../../whatsnew/3.11.rst:468 +#: ../../whatsnew/3.11.rst:466 msgid "" "Added a :option:`-P` command line option and a :envvar:`PYTHONSAFEPATH` " "environment variable, which disable the automatic prepending to :data:`sys." @@ -528,14 +512,14 @@ msgid "" "`57684`.)" msgstr "" -#: ../../whatsnew/3.11.rst:479 +#: ../../whatsnew/3.11.rst:477 msgid "" "A ``\"z\"`` option was added to the :ref:`formatspec` that coerces negative " "to positive zero after rounding to the format precision. See :pep:`682` for " "more details. (Contributed by John Belmonte in :gh:`90153`.)" msgstr "" -#: ../../whatsnew/3.11.rst:484 +#: ../../whatsnew/3.11.rst:482 msgid "" "Bytes are no longer accepted on :data:`sys.path`. Support broke sometime " "between Python 3.2 and 3.6, with no one noticing until after Python 3.10.0 " @@ -545,11 +529,11 @@ msgid "" "Thomas Grainger in :gh:`91181`.)" msgstr "" -#: ../../whatsnew/3.11.rst:495 +#: ../../whatsnew/3.11.rst:493 msgid "Other CPython Implementation Changes" msgstr "" -#: ../../whatsnew/3.11.rst:497 +#: ../../whatsnew/3.11.rst:495 msgid "" "The special methods :meth:`~object.__complex__` for :class:`complex` and :" "meth:`~object.__bytes__` for :class:`bytes` are implemented to support the :" @@ -557,7 +541,7 @@ msgid "" "(Contributed by Mark Dickinson and Dong-hee Na in :issue:`24234`.)" msgstr "" -#: ../../whatsnew/3.11.rst:502 +#: ../../whatsnew/3.11.rst:500 msgid "" "``siphash13`` is added as a new internal hashing algorithm. It has similar " "security properties as ``siphash24``, but it is slightly faster for long " @@ -567,7 +551,7 @@ msgid "" "in :issue:`29410`.)" msgstr "" -#: ../../whatsnew/3.11.rst:511 +#: ../../whatsnew/3.11.rst:509 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." @@ -576,7 +560,7 @@ msgid "" "exception. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:517 +#: ../../whatsnew/3.11.rst:515 msgid "" "The interpreter state's representation of handled exceptions (aka " "``exc_info`` or ``_PyErr_StackItem``) now only has the ``exc_value`` field; " @@ -584,7 +568,7 @@ msgid "" "from ``exc_value``. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:523 +#: ../../whatsnew/3.11.rst:521 msgid "" "A new :ref:`command line option `, ``AppendPath``, has " "been added for the Windows installer. It behaves similarly to " @@ -592,7 +576,7 @@ msgid "" "prepending them. (Contributed by Bastian Neuburger in :issue:`44934`.)" msgstr "" -#: ../../whatsnew/3.11.rst:529 +#: ../../whatsnew/3.11.rst:527 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to " "``1`` for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -600,7 +584,7 @@ msgid "" "path and replace any values added to ``module_search_paths``." msgstr "" -#: ../../whatsnew/3.11.rst:534 +#: ../../whatsnew/3.11.rst:532 msgid "" "The output of the :option:`--help` option now fits in 50 lines/80 columns. " "Information about :ref:`Python environment variables ` " @@ -609,7 +593,7 @@ msgid "" "help-all`. (Contributed by Éric Araujo in :issue:`46142`.)" msgstr "" -#: ../../whatsnew/3.11.rst:541 +#: ../../whatsnew/3.11.rst:539 msgid "" "Converting between :class:`int` and :class:`str` in bases other than 2 " "(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) " @@ -623,31 +607,31 @@ msgid "" "string form." msgstr "" -#: ../../whatsnew/3.11.rst:556 +#: ../../whatsnew/3.11.rst:554 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.11.rst:558 +#: ../../whatsnew/3.11.rst:556 msgid "" ":mod:`tomllib`: For parsing `TOML `_. See :pep:`680` for " "more details. (Contributed by Taneli Hukkinen in :issue:`40059`.)" msgstr "" -#: ../../whatsnew/3.11.rst:562 +#: ../../whatsnew/3.11.rst:560 msgid "" ":mod:`wsgiref.types`: :pep:`WSGI <3333>`-specific types for static type " "checking. (Contributed by Sebastian Rittau in :issue:`42012`.)" msgstr "" -#: ../../whatsnew/3.11.rst:570 +#: ../../whatsnew/3.11.rst:568 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.11.rst:575 +#: ../../whatsnew/3.11.rst:573 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.11.rst:577 +#: ../../whatsnew/3.11.rst:575 msgid "" "Added the :class:`~asyncio.TaskGroup` class, an :ref:`asynchronous context " "manager ` holding a group of tasks that will wait " @@ -656,7 +640,7 @@ msgid "" "Yury Selivanov and others in :gh:`90908`.)" msgstr "" -#: ../../whatsnew/3.11.rst:584 +#: ../../whatsnew/3.11.rst:582 msgid "" "Added :func:`~asyncio.timeout`, an asynchronous context manager for setting " "a timeout on asynchronous operations. For new code this is recommended over " @@ -664,34 +648,34 @@ msgid "" "gh:`90927`.)" msgstr "" -#: ../../whatsnew/3.11.rst:589 +#: ../../whatsnew/3.11.rst:587 msgid "" "Added the :class:`~asyncio.Runner` class, which exposes the machinery used " "by :func:`~asyncio.run`. (Contributed by Andrew Svetlov in :gh:`91218`.)" msgstr "" -#: ../../whatsnew/3.11.rst:593 +#: ../../whatsnew/3.11.rst:591 msgid "" "Added the :class:`~asyncio.Barrier` class to the synchronization primitives " "in the asyncio library, and the related :exc:`~asyncio.BrokenBarrierError` " "exception. (Contributed by Yves Duprat and Andrew Svetlov in :gh:`87518`.)" msgstr "" -#: ../../whatsnew/3.11.rst:598 +#: ../../whatsnew/3.11.rst:596 msgid "" "Added keyword argument *all_errors* to :meth:`asyncio.loop." "create_connection` so that multiple connection errors can be raised as an :" "exc:`ExceptionGroup`." msgstr "" -#: ../../whatsnew/3.11.rst:601 +#: ../../whatsnew/3.11.rst:599 msgid "" "Added the :meth:`asyncio.StreamWriter.start_tls` method for upgrading " "existing stream-based connections to TLS. (Contributed by Ian Good in :issue:" "`34975`.)" msgstr "" -#: ../../whatsnew/3.11.rst:605 +#: ../../whatsnew/3.11.rst:603 msgid "" "Added raw datagram socket functions to the event loop: :meth:`~asyncio.loop." "sock_sendto`, :meth:`~asyncio.loop.sock_recvfrom` and :meth:`~asyncio.loop." @@ -700,29 +684,29 @@ msgid "" "Alex Grönholm in :issue:`46805`.)" msgstr "" -#: ../../whatsnew/3.11.rst:613 +#: ../../whatsnew/3.11.rst:611 msgid "" "Added :meth:`~asyncio.Task.cancelling` and :meth:`~asyncio.Task.uncancel` " "methods to :class:`~asyncio.Task`. These are primarily intended for internal " "use, notably by :class:`~asyncio.TaskGroup`." msgstr "" -#: ../../whatsnew/3.11.rst:622 +#: ../../whatsnew/3.11.rst:620 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.11.rst:624 +#: ../../whatsnew/3.11.rst:622 msgid "" "Added non parallel-safe :func:`~contextlib.chdir` context manager to change " "the current working directory and then restore it on exit. Simple wrapper " "around :func:`~os.chdir`. (Contributed by Filipe Laíns in :issue:`25625`)" msgstr "" -#: ../../whatsnew/3.11.rst:632 +#: ../../whatsnew/3.11.rst:630 msgid "dataclasses" msgstr "dataclasses" -#: ../../whatsnew/3.11.rst:634 +#: ../../whatsnew/3.11.rst:632 msgid "" "Change field default mutability check, allowing only defaults which are :" "term:`hashable` instead of any object which is not an instance of :class:" @@ -730,17 +714,17 @@ msgid "" "issue:`44674`.)" msgstr "" -#: ../../whatsnew/3.11.rst:643 +#: ../../whatsnew/3.11.rst:641 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.11.rst:645 +#: ../../whatsnew/3.11.rst:643 msgid "" -"Add :attr:`datetime.UTC`, a convenience alias for :attr:`datetime.timezone." +"Add :const:`datetime.UTC`, a convenience alias for :attr:`datetime.timezone." "utc`. (Contributed by Kabir Kwatra in :gh:`91973`.)" msgstr "" -#: ../../whatsnew/3.11.rst:648 +#: ../../whatsnew/3.11.rst:646 msgid "" ":meth:`datetime.date.fromisoformat`, :meth:`datetime.time.fromisoformat` " "and :meth:`datetime.datetime.fromisoformat` can now be used to parse most " @@ -748,23 +732,23 @@ msgid "" "minutes). (Contributed by Paul Ganssle in :gh:`80010`.)" msgstr "" -#: ../../whatsnew/3.11.rst:657 +#: ../../whatsnew/3.11.rst:655 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.11.rst:659 +#: ../../whatsnew/3.11.rst:657 msgid "" "Renamed :class:`!EnumMeta` to :class:`~enum.EnumType` (:class:`!EnumMeta` " "kept as an alias)." msgstr "" -#: ../../whatsnew/3.11.rst:662 +#: ../../whatsnew/3.11.rst:660 msgid "" "Added :class:`~enum.StrEnum`, with members that can be used as (and must be) " "strings." msgstr "" -#: ../../whatsnew/3.11.rst:665 +#: ../../whatsnew/3.11.rst:663 msgid "" "Added :class:`~enum.ReprEnum`, which only modifies the :meth:`~object." "__repr__` of members while returning their literal values (rather than " @@ -772,7 +756,7 @@ msgid "" "func:`str`, :func:`format` and :term:`f-string`\\s)." msgstr "" -#: ../../whatsnew/3.11.rst:671 +#: ../../whatsnew/3.11.rst:669 msgid "" "Changed :meth:`Enum.__format__() ` (the default for :" "func:`format`, :meth:`str.format` and :term:`f-string`\\s) to always produce " @@ -781,116 +765,116 @@ msgid "" "be the enum and member name (e.g. ``Color.RED``)." msgstr "" -#: ../../whatsnew/3.11.rst:677 +#: ../../whatsnew/3.11.rst:675 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." msgstr "" -#: ../../whatsnew/3.11.rst:681 +#: ../../whatsnew/3.11.rst:679 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." msgstr "" -#: ../../whatsnew/3.11.rst:685 +#: ../../whatsnew/3.11.rst:683 msgid "" "Added the :func:`~enum.member` and :func:`~enum.nonmember` decorators, to " "ensure the decorated object is/is not converted to an enum member." msgstr "" -#: ../../whatsnew/3.11.rst:688 +#: ../../whatsnew/3.11.rst:686 msgid "" "Added the :func:`~enum.property` decorator, which works like :func:" "`property` except for enums. Use this instead of :func:`types." "DynamicClassAttribute`." msgstr "" -#: ../../whatsnew/3.11.rst:692 +#: ../../whatsnew/3.11.rst:690 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 :data:`~re.ASCII` member of :class:`re.RegexFlag` rather than " +"the :const:`~re.ASCII` member of :class:`re.RegexFlag` rather than " "``'RegexFlag.ASCII'``." msgstr "" -#: ../../whatsnew/3.11.rst:698 +#: ../../whatsnew/3.11.rst:696 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)``" msgstr "" -#: ../../whatsnew/3.11.rst:703 +#: ../../whatsnew/3.11.rst:701 msgid "" "Changed :class:`~enum.Enum` and :class:`~enum.Flag` so that members are now " "defined before :meth:`~object.__init_subclass__` is called; :func:`dir` now " "includes methods, etc., from mixed-in data types." msgstr "" -#: ../../whatsnew/3.11.rst:708 +#: ../../whatsnew/3.11.rst:706 msgid "" "Changed :class:`~enum.Flag` to only consider primary values (power of two) " "canonical while composite values (``3``, ``6``, ``10``, etc.) are considered " "aliases; inverted flags are coerced to their positive equivalent." msgstr "" -#: ../../whatsnew/3.11.rst:717 +#: ../../whatsnew/3.11.rst:715 msgid "fcntl" msgstr "fcntl" -#: ../../whatsnew/3.11.rst:719 +#: ../../whatsnew/3.11.rst:717 msgid "" "On FreeBSD, the :data:`!F_DUP2FD` and :data:`!F_DUP2FD_CLOEXEC` flags " "respectively are supported, the former equals to ``dup2`` usage while the " "latter set the ``FD_CLOEXEC`` flag in addition." msgstr "" -#: ../../whatsnew/3.11.rst:727 +#: ../../whatsnew/3.11.rst:725 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.11.rst:729 +#: ../../whatsnew/3.11.rst:727 msgid "" "Support :PEP:`515`-style initialization of :class:`~fractions.Fraction` from " "string. (Contributed by Sergey B Kirpichev in :issue:`44258`.)" msgstr "" -#: ../../whatsnew/3.11.rst:732 +#: ../../whatsnew/3.11.rst:730 msgid "" ":class:`~fractions.Fraction` now implements an ``__int__`` method, so that " "an ``isinstance(some_fraction, typing.SupportsInt)`` check passes. " "(Contributed by Mark Dickinson in :issue:`44547`.)" msgstr "" -#: ../../whatsnew/3.11.rst:740 +#: ../../whatsnew/3.11.rst:738 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.11.rst:742 +#: ../../whatsnew/3.11.rst:740 msgid "" ":func:`functools.singledispatch` now supports :data:`types.UnionType` and :" "data:`typing.Union` as annotations to the dispatch argument.::" msgstr "" -#: ../../whatsnew/3.11.rst:767 +#: ../../whatsnew/3.11.rst:765 msgid "(Contributed by Yurii Karabas in :issue:`46014`.)" msgstr "" -#: ../../whatsnew/3.11.rst:773 +#: ../../whatsnew/3.11.rst:771 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.11.rst:775 +#: ../../whatsnew/3.11.rst:773 msgid "" ":func:`hashlib.blake2b` and :func:`hashlib.blake2s` now prefer `libb2`_ over " "Python's vendored copy. (Contributed by Christian Heimes in :issue:`47095`.)" msgstr "" -#: ../../whatsnew/3.11.rst:779 +#: ../../whatsnew/3.11.rst:777 msgid "" "The internal ``_sha3`` module with SHA3 and SHAKE algorithms now uses " "*tiny_sha3* instead of the *Keccak Code Package* to reduce code and binary " @@ -899,47 +883,47 @@ msgid "" "OpenSSL support. (Contributed by Christian Heimes in :issue:`47098`.)" msgstr "" -#: ../../whatsnew/3.11.rst:786 +#: ../../whatsnew/3.11.rst:784 msgid "" "Add :func:`hashlib.file_digest`, a helper function for efficient hashing of " "files or file-like objects. (Contributed by Christian Heimes in :gh:`89313`.)" msgstr "" -#: ../../whatsnew/3.11.rst:794 +#: ../../whatsnew/3.11.rst:792 msgid "IDLE and idlelib" msgstr "" -#: ../../whatsnew/3.11.rst:796 +#: ../../whatsnew/3.11.rst:794 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" msgstr "" -#: ../../whatsnew/3.11.rst:799 +#: ../../whatsnew/3.11.rst:797 msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" msgstr "" -#: ../../whatsnew/3.11.rst:806 +#: ../../whatsnew/3.11.rst:804 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.11.rst:808 +#: ../../whatsnew/3.11.rst:806 msgid "" "Add :func:`~inspect.getmembers_static` to return all members without " "triggering dynamic lookup via the descriptor protocol. (Contributed by " "Weipeng Hong in :issue:`30533`.)" msgstr "" -#: ../../whatsnew/3.11.rst:812 +#: ../../whatsnew/3.11.rst:810 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:816 +#: ../../whatsnew/3.11.rst:814 msgid "" "Change the frame-related functions in the :mod:`inspect` module to return " "new :class:`~inspect.FrameInfo` and :class:`~inspect.Traceback` class " @@ -948,46 +932,46 @@ msgid "" "line number, column and end column). The affected functions are:" msgstr "" -#: ../../whatsnew/3.11.rst:822 +#: ../../whatsnew/3.11.rst:820 msgid ":func:`inspect.getframeinfo`" msgstr "" -#: ../../whatsnew/3.11.rst:823 +#: ../../whatsnew/3.11.rst:821 msgid ":func:`inspect.getouterframes`" msgstr "" -#: ../../whatsnew/3.11.rst:824 +#: ../../whatsnew/3.11.rst:822 msgid ":func:`inspect.getinnerframes`," msgstr "" -#: ../../whatsnew/3.11.rst:825 +#: ../../whatsnew/3.11.rst:823 msgid ":func:`inspect.stack`" msgstr "" -#: ../../whatsnew/3.11.rst:826 +#: ../../whatsnew/3.11.rst:824 msgid ":func:`inspect.trace`" msgstr "" -#: ../../whatsnew/3.11.rst:828 +#: ../../whatsnew/3.11.rst:826 msgid "(Contributed by Pablo Galindo in :gh:`88116`.)" msgstr "" -#: ../../whatsnew/3.11.rst:834 +#: ../../whatsnew/3.11.rst:832 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.11.rst:836 +#: ../../whatsnew/3.11.rst:834 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 `." msgstr "" -#: ../../whatsnew/3.11.rst:844 +#: ../../whatsnew/3.11.rst:842 msgid "logging" msgstr "" -#: ../../whatsnew/3.11.rst:846 +#: ../../whatsnew/3.11.rst:844 msgid "" "Added :func:`~logging.getLevelNamesMapping` to return a mapping from logging " "level names (e.g. ``'CRITICAL'``) to the values of their corresponding :ref:" @@ -995,7 +979,7 @@ msgid "" "`88024`.)" msgstr "" -#: ../../whatsnew/3.11.rst:851 +#: ../../whatsnew/3.11.rst:849 msgid "" "Added a :meth:`~logging.handlers.SysLogHandler.createSocket` method to :" "class:`~logging.handlers.SysLogHandler`, to match :meth:`SocketHandler." @@ -1004,23 +988,23 @@ msgid "" "there is no active socket. (Contributed by Kirill Pinchuk in :gh:`88457`.)" msgstr "" -#: ../../whatsnew/3.11.rst:863 +#: ../../whatsnew/3.11.rst:861 msgid "math" msgstr "math" -#: ../../whatsnew/3.11.rst:865 +#: ../../whatsnew/3.11.rst:863 msgid "" "Add :func:`math.exp2`: return 2 raised to the power of x. (Contributed by " "Gideon Mitchell in :issue:`45917`.)" msgstr "" -#: ../../whatsnew/3.11.rst:868 +#: ../../whatsnew/3.11.rst:866 msgid "" "Add :func:`math.cbrt`: return the cube root of x. (Contributed by Ajith " "Ramachandran in :issue:`44357`.)" msgstr "" -#: ../../whatsnew/3.11.rst:871 +#: ../../whatsnew/3.11.rst:869 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, -" @@ -1029,39 +1013,39 @@ msgid "" "`44339`.)" msgstr "" -#: ../../whatsnew/3.11.rst:877 +#: ../../whatsnew/3.11.rst:875 msgid "" "The :data:`math.nan` value is now always available. (Contributed by Victor " "Stinner in :issue:`46917`.)" msgstr "" -#: ../../whatsnew/3.11.rst:884 +#: ../../whatsnew/3.11.rst:882 msgid "operator" msgstr "operator" -#: ../../whatsnew/3.11.rst:886 +#: ../../whatsnew/3.11.rst:884 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:894 +#: ../../whatsnew/3.11.rst:892 msgid "os" msgstr "os" -#: ../../whatsnew/3.11.rst:896 +#: ../../whatsnew/3.11.rst:894 msgid "" "On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``, instead of " "``CryptGenRandom()`` which is deprecated. (Contributed by Dong-hee Na in :" "issue:`44611`.)" msgstr "" -#: ../../whatsnew/3.11.rst:904 +#: ../../whatsnew/3.11.rst:902 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.11.rst:906 +#: ../../whatsnew/3.11.rst:904 msgid "" ":meth:`~pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` return only " "directories if *pattern* ends with a pathname components separator: :data:" @@ -1069,56 +1053,56 @@ msgid "" "`22276` and :issue:`33392`.)" msgstr "" -#: ../../whatsnew/3.11.rst:915 +#: ../../whatsnew/3.11.rst:913 msgid "re" msgstr "re" -#: ../../whatsnew/3.11.rst:917 +#: ../../whatsnew/3.11.rst:915 msgid "" "Atomic grouping (``(?>...)``) and possessive quantifiers (``*+``, ``++``, ``?" "+``, ``{m,n}+``) are now supported in regular expressions. (Contributed by " "Jeffrey C. Jacobs and Serhiy Storchaka in :issue:`433030`.)" msgstr "" -#: ../../whatsnew/3.11.rst:925 +#: ../../whatsnew/3.11.rst:923 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.11.rst:927 +#: ../../whatsnew/3.11.rst:925 msgid "" "Add optional parameter *dir_fd* in :func:`shutil.rmtree`. (Contributed by " "Serhiy Storchaka in :issue:`46245`.)" msgstr "" -#: ../../whatsnew/3.11.rst:934 +#: ../../whatsnew/3.11.rst:932 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.11.rst:936 +#: ../../whatsnew/3.11.rst:934 msgid "" "Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner in :issue:" "`30512`.)" msgstr "" -#: ../../whatsnew/3.11.rst:939 +#: ../../whatsnew/3.11.rst:937 msgid "" ":meth:`~socket.create_connection` has an option to raise, in case of failure " "to connect, an :exc:`ExceptionGroup` containing all errors instead of only " "raising the last error. (Contributed by Irit Katriel in :issue:`29980`.)" msgstr "" -#: ../../whatsnew/3.11.rst:948 +#: ../../whatsnew/3.11.rst:946 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.11.rst:950 +#: ../../whatsnew/3.11.rst:948 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:954 +#: ../../whatsnew/3.11.rst:952 msgid "" "Collation name :meth:`~sqlite3.Connection.create_collation` can now contain " "any Unicode character. Collation names with invalid characters now raise :" @@ -1126,7 +1110,7 @@ msgid "" "(Contributed by Erlend E. Aasland in :issue:`44688`.)" msgstr "" -#: ../../whatsnew/3.11.rst:959 +#: ../../whatsnew/3.11.rst:957 msgid "" ":mod:`sqlite3` exceptions now include the SQLite extended error code as :" "attr:`~sqlite3.Error.sqlite_errorcode` and the SQLite error name as :attr:" @@ -1134,7 +1118,7 @@ msgid "" "Shahaf, and Erlend E. Aasland in :issue:`16379` and :issue:`24139`.)" msgstr "" -#: ../../whatsnew/3.11.rst:965 +#: ../../whatsnew/3.11.rst:963 msgid "" "Add :meth:`~sqlite3.Connection.setlimit` and :meth:`~sqlite3.Connection." "getlimit` to :class:`sqlite3.Connection` for setting and getting SQLite " @@ -1142,14 +1126,14 @@ msgid "" "`45243`.)" msgstr "" -#: ../../whatsnew/3.11.rst:970 +#: ../../whatsnew/3.11.rst:968 msgid "" ":mod:`sqlite3` now sets :attr:`sqlite3.threadsafety` based on the default " "threading mode the underlying SQLite library has been compiled with. " "(Contributed by Erlend E. Aasland in :issue:`45613`.)" msgstr "" -#: ../../whatsnew/3.11.rst:974 +#: ../../whatsnew/3.11.rst:972 msgid "" ":mod:`sqlite3` C callbacks now use unraisable exceptions if callback " "tracebacks are enabled. Users can now register an :func:`unraisable hook " @@ -1157,14 +1141,14 @@ msgid "" "(Contributed by Erlend E. Aasland in :issue:`45828`.)" msgstr "" -#: ../../whatsnew/3.11.rst:980 +#: ../../whatsnew/3.11.rst:978 msgid "" "Fetch across rollback no longer raises :exc:`~sqlite3.InterfaceError`. " "Instead we leave it to the SQLite library to handle these cases. " "(Contributed by Erlend E. Aasland in :issue:`44092`.)" msgstr "" -#: ../../whatsnew/3.11.rst:984 +#: ../../whatsnew/3.11.rst:982 msgid "" "Add :meth:`~sqlite3.Connection.serialize` and :meth:`~sqlite3.Connection." "deserialize` to :class:`sqlite3.Connection` for serializing and " @@ -1172,25 +1156,25 @@ msgid "" "`41930`.)" msgstr "" -#: ../../whatsnew/3.11.rst:989 +#: ../../whatsnew/3.11.rst:987 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:993 +#: ../../whatsnew/3.11.rst:991 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1001 +#: ../../whatsnew/3.11.rst:999 msgid "string" msgstr "" -#: ../../whatsnew/3.11.rst:1003 +#: ../../whatsnew/3.11.rst:1001 msgid "" "Add :meth:`~string.Template.get_identifiers` and :meth:`~string.Template." "is_valid` to :class:`string.Template`, which respectively return all valid " @@ -1198,11 +1182,11 @@ msgid "" "by Ben Kehoe in :gh:`90465`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1013 +#: ../../whatsnew/3.11.rst:1011 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.11.rst:1015 +#: ../../whatsnew/3.11.rst:1013 msgid "" ":func:`sys.exc_info` now derives the ``type`` and ``traceback`` fields from " "the ``value`` (the exception instance), so when an exception is modified " @@ -1211,24 +1195,24 @@ msgid "" "issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1021 +#: ../../whatsnew/3.11.rst:1019 msgid "" "Add :func:`sys.exception` which returns the active exception instance " "(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel in :" "issue:`46328`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1025 +#: ../../whatsnew/3.11.rst:1023 msgid "" "Add the :data:`sys.flags.safe_path ` flag. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1032 +#: ../../whatsnew/3.11.rst:1030 msgid "sysconfig" msgstr "sysconfig" -#: ../../whatsnew/3.11.rst:1034 +#: ../../whatsnew/3.11.rst:1032 msgid "" "Three new :ref:`installation schemes ` (*posix_venv*, " "*nt_venv* and *venv*) were added and are used when Python creates new " @@ -1242,11 +1226,11 @@ msgid "" "(Contributed by Miro Hrončok in :issue:`45413`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1051 +#: ../../whatsnew/3.11.rst:1049 msgid "tempfile" msgstr "" -#: ../../whatsnew/3.11.rst:1053 +#: ../../whatsnew/3.11.rst:1051 msgid "" ":class:`~tempfile.SpooledTemporaryFile` objects now fully implement the " "methods of :class:`io.BufferedIOBase` or :class:`io.TextIOBase` (depending " @@ -1255,25 +1239,25 @@ msgid "" "`70363`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1064 +#: ../../whatsnew/3.11.rst:1062 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.11.rst:1066 +#: ../../whatsnew/3.11.rst:1064 msgid "" "On Unix, if the ``sem_clockwait()`` function is available in the C library " "(glibc 2.30 and newer), the :meth:`threading.Lock.acquire` method now uses " -"the monotonic clock (:data:`time.CLOCK_MONOTONIC`) for the timeout, rather " -"than using the system clock (:data:`time.CLOCK_REALTIME`), to not be " +"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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1077 +#: ../../whatsnew/3.11.rst:1075 msgid "time" msgstr "time" -#: ../../whatsnew/3.11.rst:1079 +#: ../../whatsnew/3.11.rst:1077 msgid "" "On Unix, :func:`time.sleep` now uses the ``clock_nanosleep()`` or " "``nanosleep()`` function, if available, which has a resolution of 1 " @@ -1282,7 +1266,7 @@ msgid "" "Benjamin Szőke and Victor Stinner in :issue:`21302`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1085 +#: ../../whatsnew/3.11.rst:1083 msgid "" "On Windows 8.1 and newer, :func:`time.sleep` now uses a waitable timer based " "on `high-resolution timers `. " "(Contributed by Niklas Rosenstein in :gh:`85542`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1176 +#: ../../whatsnew/3.11.rst:1174 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1180 +#: ../../whatsnew/3.11.rst:1178 msgid "" ":func:`typing.get_type_hints` now supports evaluating bare stringified :data:" "`~typing.ClassVar` annotations. (Contributed by Gregory Beauregard in :gh:" "`90711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1184 +#: ../../whatsnew/3.11.rst:1182 msgid "" ":func:`typing.no_type_check` no longer modifies external classes and " "functions. It also now correctly marks classmethods as not to be type " "checked. (Contributed by Nikita Sobolev in :gh:`90729`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1192 +#: ../../whatsnew/3.11.rst:1190 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.11.rst:1194 +#: ../../whatsnew/3.11.rst:1192 msgid "" "The Unicode database has been updated to version 14.0.0. (Contributed by " "Benjamin Peterson in :issue:`45190`)." msgstr "" -#: ../../whatsnew/3.11.rst:1201 +#: ../../whatsnew/3.11.rst:1199 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.11.rst:1203 +#: ../../whatsnew/3.11.rst:1201 msgid "" "Added methods :meth:`~unittest.TestCase.enterContext` and :meth:`~unittest." "TestCase.enterClassContext` of class :class:`~unittest.TestCase`, method :" @@ -1456,11 +1440,11 @@ msgid "" "enterModuleContext`. (Contributed by Serhiy Storchaka in :issue:`45046`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1215 +#: ../../whatsnew/3.11.rst:1213 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.11.rst:1217 +#: ../../whatsnew/3.11.rst:1215 msgid "" "When new Python virtual environments are created, the *venv* :ref:`sysconfig " "installation scheme ` is used to determine the paths " @@ -1472,11 +1456,11 @@ msgid "" "`45413`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1231 +#: ../../whatsnew/3.11.rst:1229 msgid "warnings" msgstr "warnings" -#: ../../whatsnew/3.11.rst:1233 +#: ../../whatsnew/3.11.rst:1231 msgid "" ":func:`warnings.catch_warnings` now accepts arguments for :func:`warnings." "simplefilter`, providing a more concise way to locally ignore warnings or " @@ -1484,41 +1468,41 @@ msgid "" "`47074`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1241 +#: ../../whatsnew/3.11.rst:1239 msgid "zipfile" msgstr "zipfile" -#: ../../whatsnew/3.11.rst:1243 +#: ../../whatsnew/3.11.rst:1241 msgid "" "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 "" -#: ../../whatsnew/3.11.rst:1247 +#: ../../whatsnew/3.11.rst:1245 msgid "" "Added :meth:`ZipFile.mkdir() ` for creating new " "directories inside ZIP archives. (Contributed by Sam Ezeh in :gh:`49083`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1251 +#: ../../whatsnew/3.11.rst:1249 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1259 +#: ../../whatsnew/3.11.rst:1257 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.11.rst:1261 +#: ../../whatsnew/3.11.rst:1259 msgid "" "This section covers specific optimizations independent of the :ref:" "`whatsnew311-faster-cpython` project, which is covered in its own section." msgstr "" -#: ../../whatsnew/3.11.rst:1264 +#: ../../whatsnew/3.11.rst:1262 msgid "" "The compiler now optimizes simple :ref:`printf-style % formatting ` on string literals containing only the format codes " @@ -1526,7 +1510,7 @@ msgid "" "string` expression. (Contributed by Serhiy Storchaka in :issue:`28307`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1270 +#: ../../whatsnew/3.11.rst:1268 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 " @@ -1534,20 +1518,20 @@ msgid "" "gh:`90564`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1275 +#: ../../whatsnew/3.11.rst:1273 msgid "" ":func:`sum` is now nearly 30% faster for integers smaller than ``2**30``. " "(Contributed by Stefan Behnel in :gh:`68264`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1278 +#: ../../whatsnew/3.11.rst:1276 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1283 +#: ../../whatsnew/3.11.rst:1281 msgid "" "Dictionaries don't store hash values when all keys are Unicode objects, " "decreasing :class:`dict` size. For example, ``sys.getsizeof(dict." @@ -1555,21 +1539,21 @@ msgid "" "smaller) on 64-bit platforms. (Contributed by Inada Naoki in :issue:`46845`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1289 +#: ../../whatsnew/3.11.rst:1287 msgid "" "Using :class:`asyncio.DatagramProtocol` is now orders of magnitude faster " "when transferring large files over UDP, with speeds over 100 times higher " "for a ≈60 MiB file. (Contributed by msoxzw in :gh:`91487`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1294 +#: ../../whatsnew/3.11.rst:1292 msgid "" ":mod:`math` functions :func:`~math.comb` and :func:`~math.perm` are now ≈10 " "times faster for large arguments (with a larger speedup for larger *k*). " "(Contributed by Serhiy Storchaka in :issue:`37295`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1298 +#: ../../whatsnew/3.11.rst:1296 msgid "" "The :mod:`statistics` functions :func:`~statistics.mean`, :func:`~statistics." "variance` and :func:`~statistics.stdev` now consume iterators in one pass " @@ -1578,17 +1562,17 @@ msgid "" "`90415`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1304 +#: ../../whatsnew/3.11.rst:1302 msgid "" ":func:`unicodedata.normalize` now normalizes pure-ASCII strings in constant " "time. (Contributed by Dong-hee Na in :issue:`44987`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1312 +#: ../../whatsnew/3.11.rst:1310 msgid "Faster CPython" msgstr "" -#: ../../whatsnew/3.11.rst:1314 +#: ../../whatsnew/3.11.rst:1312 msgid "" "CPython 3.11 is an average of `25% faster `_ than CPython 3.10 as measured with the " @@ -1597,32 +1581,32 @@ msgid "" "overall speedup could be 10-60%." msgstr "" -#: ../../whatsnew/3.11.rst:1321 +#: ../../whatsnew/3.11.rst:1319 msgid "" "This project focuses on two major areas in Python: :ref:`whatsnew311-faster-" "startup` and :ref:`whatsnew311-faster-runtime`. Optimizations not covered by " "this project are listed separately under :ref:`whatsnew311-optimizations`." msgstr "" -#: ../../whatsnew/3.11.rst:1330 +#: ../../whatsnew/3.11.rst:1328 msgid "Faster Startup" msgstr "" -#: ../../whatsnew/3.11.rst:1335 +#: ../../whatsnew/3.11.rst:1333 msgid "Frozen imports / Static code objects" msgstr "" -#: ../../whatsnew/3.11.rst:1337 +#: ../../whatsnew/3.11.rst:1335 msgid "" "Python caches :term:`bytecode` in the :ref:`__pycache__ ` " "directory to speed up module loading." msgstr "" -#: ../../whatsnew/3.11.rst:1340 +#: ../../whatsnew/3.11.rst:1338 msgid "Previously in 3.10, Python module execution looked like this:" msgstr "" -#: ../../whatsnew/3.11.rst:1346 +#: ../../whatsnew/3.11.rst:1344 msgid "" "In Python 3.11, the core modules essential for Python startup are " "\"frozen\". This means that their :ref:`codeobjects` (and bytecode) are " @@ -1630,47 +1614,47 @@ msgid "" "execution process to:" msgstr "" -#: ../../whatsnew/3.11.rst:1355 +#: ../../whatsnew/3.11.rst:1353 msgid "" "Interpreter startup is now 10-15% faster in Python 3.11. This has a big " "impact for short-running programs using Python." msgstr "" -#: ../../whatsnew/3.11.rst:1358 +#: ../../whatsnew/3.11.rst:1356 msgid "" "(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in many issues.)" msgstr "" -#: ../../whatsnew/3.11.rst:1364 +#: ../../whatsnew/3.11.rst:1362 msgid "Faster Runtime" msgstr "" -#: ../../whatsnew/3.11.rst:1369 +#: ../../whatsnew/3.11.rst:1367 msgid "Cheaper, lazy Python frames" msgstr "" -#: ../../whatsnew/3.11.rst:1371 +#: ../../whatsnew/3.11.rst:1369 msgid "" "Python frames, holding execution information, are created whenever Python " "calls a Python function. The following are new frame optimizations:" msgstr "" -#: ../../whatsnew/3.11.rst:1375 +#: ../../whatsnew/3.11.rst:1373 msgid "Streamlined the frame creation process." msgstr "" -#: ../../whatsnew/3.11.rst:1376 +#: ../../whatsnew/3.11.rst:1374 msgid "" "Avoided memory allocation by generously re-using frame space on the C stack." msgstr "" -#: ../../whatsnew/3.11.rst:1377 +#: ../../whatsnew/3.11.rst:1375 msgid "" "Streamlined the internal frame struct to contain only essential information. " "Frames previously held extra debugging and memory management information." msgstr "" -#: ../../whatsnew/3.11.rst:1380 +#: ../../whatsnew/3.11.rst:1378 msgid "" "Old-style :ref:`frame objects ` are now created only when " "requested by debuggers or by Python introspection functions such as :func:" @@ -1680,29 +1664,29 @@ msgid "" "pyperformance." msgstr "" -#: ../../whatsnew/3.11.rst:1387 +#: ../../whatsnew/3.11.rst:1385 msgid "(Contributed by Mark Shannon in :issue:`44590`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1394 +#: ../../whatsnew/3.11.rst:1392 msgid "Inlined Python function calls" msgstr "" -#: ../../whatsnew/3.11.rst:1396 +#: ../../whatsnew/3.11.rst:1394 msgid "" "During a Python function call, Python will call an evaluating C function to " "interpret that function's code. This effectively limits pure Python " "recursion to what's safe for the C stack." msgstr "" -#: ../../whatsnew/3.11.rst:1400 +#: ../../whatsnew/3.11.rst:1398 msgid "" "In 3.11, when CPython detects Python code calling another Python function, " "it sets up a new frame, and \"jumps\" to the new code inside the new frame. " "This avoids calling the C interpreting function altogether." msgstr "" -#: ../../whatsnew/3.11.rst:1404 +#: ../../whatsnew/3.11.rst:1402 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 " @@ -1711,15 +1695,15 @@ msgid "" "setrecursionlimit`). We measured a 1-3% improvement in pyperformance." msgstr "" -#: ../../whatsnew/3.11.rst:1411 +#: ../../whatsnew/3.11.rst:1409 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1417 +#: ../../whatsnew/3.11.rst:1415 msgid "PEP 659: Specializing Adaptive Interpreter" msgstr "" -#: ../../whatsnew/3.11.rst:1419 +#: ../../whatsnew/3.11.rst:1417 msgid "" ":pep:`659` is one of the key parts of the Faster CPython project. The " "general idea is that while Python is a dynamic language, most code has " @@ -1727,7 +1711,7 @@ msgid "" "*type stability*." msgstr "" -#: ../../whatsnew/3.11.rst:1423 +#: ../../whatsnew/3.11.rst:1421 msgid "" "At runtime, Python will try to look for common patterns and type stability " "in the executing code. Python will then replace the current operation with a " @@ -1738,13 +1722,13 @@ msgid "" "term:`bytecode`." msgstr "" -#: ../../whatsnew/3.11.rst:1431 +#: ../../whatsnew/3.11.rst:1429 msgid "" "The specializer will also combine certain common instruction pairs into one " "superinstruction, reducing the overhead during execution." msgstr "" -#: ../../whatsnew/3.11.rst:1434 +#: ../../whatsnew/3.11.rst:1432 msgid "" "Python will only specialize when it sees code that is \"hot\" (executed " "multiple times). This prevents Python from wasting time on run-once code. " @@ -1754,280 +1738,280 @@ msgid "" "circumstances." msgstr "" -#: ../../whatsnew/3.11.rst:1441 +#: ../../whatsnew/3.11.rst:1439 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.)" msgstr "" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1447 msgid "Operation" msgstr "" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1447 msgid "Form" msgstr "" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1447 msgid "Specialization" msgstr "" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1447 msgid "Operation speedup (up to)" msgstr "" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1447 msgid "Contributor(s)" msgstr "" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1450 msgid "Binary operations" msgstr "" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1450 msgid "``x + x``" msgstr "" -#: ../../whatsnew/3.11.rst:1454 +#: ../../whatsnew/3.11.rst:1452 msgid "``x - x``" msgstr "" -#: ../../whatsnew/3.11.rst:1456 +#: ../../whatsnew/3.11.rst:1454 msgid "``x * x``" msgstr "" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1450 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." msgstr "" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1450 msgid "10%" msgstr "10%" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1450 msgid "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" msgstr "" -#: ../../whatsnew/3.11.rst:1458 +#: ../../whatsnew/3.11.rst:1456 msgid "Subscript" msgstr "" -#: ../../whatsnew/3.11.rst:1458 +#: ../../whatsnew/3.11.rst:1456 msgid "``a[i]``" msgstr "``a[i]``" -#: ../../whatsnew/3.11.rst:1458 +#: ../../whatsnew/3.11.rst:1456 msgid "" "Subscripting container types such as :class:`list`, :class:`tuple` and :" "class:`dict` directly index the underlying data structures." msgstr "" -#: ../../whatsnew/3.11.rst:1462 +#: ../../whatsnew/3.11.rst:1460 msgid "" "Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" "ref:`inline-calls`." msgstr "" -#: ../../whatsnew/3.11.rst:1458 ../../whatsnew/3.11.rst:1465 +#: ../../whatsnew/3.11.rst:1456 ../../whatsnew/3.11.rst:1463 msgid "10-25%" msgstr "10-25%" -#: ../../whatsnew/3.11.rst:1458 +#: ../../whatsnew/3.11.rst:1456 msgid "Irit Katriel, Mark Shannon" msgstr "Irit Katriel, Mark Shannon" -#: ../../whatsnew/3.11.rst:1465 +#: ../../whatsnew/3.11.rst:1463 msgid "Store subscript" msgstr "" -#: ../../whatsnew/3.11.rst:1465 +#: ../../whatsnew/3.11.rst:1463 msgid "``a[i] = z``" msgstr "``a[i] = z``" -#: ../../whatsnew/3.11.rst:1465 +#: ../../whatsnew/3.11.rst:1463 msgid "Similar to subscripting specialization above." msgstr "" -#: ../../whatsnew/3.11.rst:1465 +#: ../../whatsnew/3.11.rst:1463 msgid "Dennis Sweeney" msgstr "Dennis Sweeney" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1466 msgid "Calls" msgstr "" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1466 msgid "``f(arg)``" msgstr "" -#: ../../whatsnew/3.11.rst:1470 +#: ../../whatsnew/3.11.rst:1468 msgid "``C(arg)``" msgstr "" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1466 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 " "through the internal calling convention." msgstr "" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1466 msgid "20%" msgstr "20%" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1466 msgid "Mark Shannon, Ken Jin" msgstr "Mark Shannon, Ken Jin" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1471 msgid "Load global variable" msgstr "" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1471 msgid "``print``" msgstr "" -#: ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1473 msgid "``len``" msgstr "" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1471 msgid "" "The object's index in the globals/builtins namespace is cached. Loading " "globals and builtins require zero namespace lookups." msgstr "" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1471 msgid "[#load-global]_" msgstr "" -#: ../../whatsnew/3.11.rst:1473 ../../whatsnew/3.11.rst:1477 -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1471 ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1484 msgid "Mark Shannon" msgstr "Mark Shannon" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1475 msgid "Load attribute" msgstr "" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1475 msgid "``o.attr``" msgstr "``o.attr``" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1475 msgid "" "Similar to loading global variables. The attribute's index inside the class/" "object's namespace is cached. In most cases, attribute loading will require " "zero namespace lookups." msgstr "" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1475 msgid "[#load-attr]_" msgstr "" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1480 msgid "Load methods for call" msgstr "" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1480 msgid "``o.meth()``" msgstr "``o.meth()``" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1480 msgid "" "The actual address of the method is cached. Method loading now has no " "namespace lookups -- even for classes with long inheritance chains." msgstr "" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1480 msgid "10-20%" msgstr "10-20%" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1480 msgid "Ken Jin, Mark Shannon" msgstr "Ken Jin, Mark Shannon" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1484 msgid "Store attribute" msgstr "" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1484 msgid "``o.attr = z``" msgstr "``o.attr = z``" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1484 msgid "Similar to load attribute optimization." msgstr "" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1484 msgid "2% in pyperformance" msgstr "" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1487 msgid "Unpack Sequence" msgstr "" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1487 msgid "``*seq``" msgstr "``*seq``" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1487 msgid "" "Specialized for common containers such as :class:`list` and :class:`tuple`. " "Avoids internal calling convention." msgstr "" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1487 msgid "8%" msgstr "8%" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1487 msgid "Brandt Bucher" msgstr "" -#: ../../whatsnew/3.11.rst:1494 +#: ../../whatsnew/3.11.rst:1492 msgid "" "A similar optimization already existed since Python 3.8. 3.11 specializes " "for more forms and reduces some overhead." msgstr "" -#: ../../whatsnew/3.11.rst:1497 +#: ../../whatsnew/3.11.rst:1495 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`." msgstr "" -#: ../../whatsnew/3.11.rst:1505 +#: ../../whatsnew/3.11.rst:1503 msgid "Misc" msgstr "" -#: ../../whatsnew/3.11.rst:1507 +#: ../../whatsnew/3.11.rst:1505 msgid "" "Objects now require less memory due to lazily created object namespaces. " "Their namespace dictionaries now also share keys more freely. (Contributed " "Mark Shannon in :issue:`45340` and :issue:`40116`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1511 +#: ../../whatsnew/3.11.rst:1509 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1515 +#: ../../whatsnew/3.11.rst:1513 msgid "" "A more concise representation of exceptions in the interpreter reduced the " "time required for catching an exception by about 10%. (Contributed by Irit " "Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1519 +#: ../../whatsnew/3.11.rst:1517 msgid "" ":mod:`re`'s regular expression matching engine has been partially " "refactored, and now uses computed gotos (or \"threaded code\") on supported " @@ -2037,37 +2021,37 @@ msgid "" "Bucher in :gh:`91404`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1530 +#: ../../whatsnew/3.11.rst:1528 msgid "FAQ" msgstr "" -#: ../../whatsnew/3.11.rst:1535 +#: ../../whatsnew/3.11.rst:1533 msgid "How should I write my code to utilize these speedups?" msgstr "" -#: ../../whatsnew/3.11.rst:1537 +#: ../../whatsnew/3.11.rst:1535 msgid "" "Write Pythonic code that follows common best practices; you don't have to " "change your code. The Faster CPython project optimizes for common code " "patterns we observe." msgstr "" -#: ../../whatsnew/3.11.rst:1545 +#: ../../whatsnew/3.11.rst:1543 msgid "Will CPython 3.11 use more memory?" msgstr "" -#: ../../whatsnew/3.11.rst:1547 +#: ../../whatsnew/3.11.rst:1545 msgid "" "Maybe not; we don't expect memory use to exceed 20% higher than 3.10. This " "is offset by memory optimizations for frame objects and object dictionaries " "as mentioned above." msgstr "" -#: ../../whatsnew/3.11.rst:1555 +#: ../../whatsnew/3.11.rst:1553 msgid "I don't see any speedups in my workload. Why?" msgstr "" -#: ../../whatsnew/3.11.rst:1557 +#: ../../whatsnew/3.11.rst:1555 msgid "" "Certain code won't have noticeable benefits. If your code spends most of its " "time on I/O operations, or already does most of its computation in a C " @@ -2075,26 +2059,26 @@ msgid "" "project currently benefits pure-Python workloads the most." msgstr "" -#: ../../whatsnew/3.11.rst:1562 +#: ../../whatsnew/3.11.rst:1560 msgid "" "Furthermore, the pyperformance figures are a geometric mean. Even within the " "pyperformance benchmarks, certain benchmarks have slowed down slightly, " "while others have sped up by nearly 2x!" msgstr "" -#: ../../whatsnew/3.11.rst:1570 +#: ../../whatsnew/3.11.rst:1568 msgid "Is there a JIT compiler?" msgstr "" -#: ../../whatsnew/3.11.rst:1572 +#: ../../whatsnew/3.11.rst:1570 msgid "No. We're still exploring other optimizations." msgstr "" -#: ../../whatsnew/3.11.rst:1578 +#: ../../whatsnew/3.11.rst:1576 msgid "About" msgstr "" -#: ../../whatsnew/3.11.rst:1580 +#: ../../whatsnew/3.11.rst:1578 msgid "" "Faster CPython explores optimizations for :term:`CPython`. The main team is " "funded by Microsoft to work on this full-time. Pablo Galindo Salgado is also " @@ -2102,11 +2086,11 @@ msgid "" "contributors are volunteers from the community." msgstr "" -#: ../../whatsnew/3.11.rst:1589 +#: ../../whatsnew/3.11.rst:1587 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.11.rst:1591 +#: ../../whatsnew/3.11.rst:1589 msgid "" "The bytecode now contains inline cache entries, which take the form of the " "newly-added :opcode:`CACHE` instructions. Many opcodes expect to be followed " @@ -2116,62 +2100,62 @@ msgid "" "containing quickened data." msgstr "" -#: ../../whatsnew/3.11.rst:1603 +#: ../../whatsnew/3.11.rst:1601 msgid "New opcodes" msgstr "" -#: ../../whatsnew/3.11.rst:1605 +#: ../../whatsnew/3.11.rst:1603 msgid "" ":opcode:`ASYNC_GEN_WRAP`, :opcode:`RETURN_GENERATOR` and :opcode:`SEND`, " "used in generators and co-routines." msgstr "" -#: ../../whatsnew/3.11.rst:1608 +#: ../../whatsnew/3.11.rst:1606 msgid "" ":opcode:`COPY_FREE_VARS`, which avoids needing special caller-side code for " "closures." msgstr "" -#: ../../whatsnew/3.11.rst:1611 +#: ../../whatsnew/3.11.rst:1609 msgid "" ":opcode:`JUMP_BACKWARD_NO_INTERRUPT`, for use in certain loops where " "handling interrupts is undesirable." msgstr "" -#: ../../whatsnew/3.11.rst:1614 +#: ../../whatsnew/3.11.rst:1612 msgid ":opcode:`MAKE_CELL`, to create :ref:`cell-objects`." msgstr "" -#: ../../whatsnew/3.11.rst:1616 +#: ../../whatsnew/3.11.rst:1614 msgid "" ":opcode:`CHECK_EG_MATCH` and :opcode:`PREP_RERAISE_STAR`, to handle the :" "ref:`new exception groups and except* ` added in :pep:" "`654`." msgstr "" -#: ../../whatsnew/3.11.rst:1620 +#: ../../whatsnew/3.11.rst:1618 msgid ":opcode:`PUSH_EXC_INFO`, for use in exception handlers." msgstr "" -#: ../../whatsnew/3.11.rst:1622 +#: ../../whatsnew/3.11.rst:1620 msgid "" ":opcode:`RESUME`, a no-op, for internal tracing, debugging and optimization " "checks." msgstr "" -#: ../../whatsnew/3.11.rst:1629 +#: ../../whatsnew/3.11.rst:1627 msgid "Replaced opcodes" msgstr "" -#: ../../whatsnew/3.11.rst:1632 +#: ../../whatsnew/3.11.rst:1630 msgid "Replaced Opcode(s)" msgstr "" -#: ../../whatsnew/3.11.rst:1632 +#: ../../whatsnew/3.11.rst:1630 msgid "New Opcode(s)" msgstr "" -#: ../../whatsnew/3.11.rst:1632 +#: ../../whatsnew/3.11.rst:1630 msgid "Notes" msgstr "" @@ -2183,11 +2167,11 @@ msgstr "" msgid ":opcode:`!INPLACE_*`" msgstr "" -#: ../../whatsnew/3.11.rst:1634 +#: ../../whatsnew/3.11.rst:1632 msgid ":opcode:`BINARY_OP`" msgstr "" -#: ../../whatsnew/3.11.rst:1634 +#: ../../whatsnew/3.11.rst:1632 msgid "Replaced all numeric binary/in-place opcodes with a single opcode" msgstr "" @@ -2219,7 +2203,7 @@ msgstr "" msgid ":opcode:`PUSH_NULL`" msgstr "" -#: ../../whatsnew/3.11.rst:1637 +#: ../../whatsnew/3.11.rst:1635 msgid "" "Decouples argument shifting for methods from handling of keyword arguments; " "allows better specialization of calls" @@ -2257,7 +2241,7 @@ msgstr "" msgid ":opcode:`SWAP`" msgstr "" -#: ../../whatsnew/3.11.rst:1642 +#: ../../whatsnew/3.11.rst:1640 msgid "Stack manipulation instructions" msgstr "" @@ -2269,7 +2253,7 @@ msgstr "" msgid ":opcode:`CHECK_EXC_MATCH`" msgstr "" -#: ../../whatsnew/3.11.rst:1649 +#: ../../whatsnew/3.11.rst:1647 msgid "Now performs check but doesn't jump" msgstr "" @@ -2297,7 +2281,7 @@ msgstr "" msgid ":opcode:`POP_JUMP_FORWARD_IF_* `" msgstr "" -#: ../../whatsnew/3.11.rst:1651 +#: ../../whatsnew/3.11.rst:1649 msgid "" "See [#bytecode-jump]_; ``TRUE``, ``FALSE``, ``NONE`` and ``NOT_NONE`` " "variants for each direction" @@ -2311,64 +2295,64 @@ msgstr "" msgid ":opcode:`!SETUP_ASYNC_WITH`" msgstr "" -#: ../../whatsnew/3.11.rst:1657 +#: ../../whatsnew/3.11.rst:1655 msgid ":opcode:`BEFORE_WITH`" msgstr "" -#: ../../whatsnew/3.11.rst:1657 +#: ../../whatsnew/3.11.rst:1655 msgid ":keyword:`with` block setup" msgstr "" -#: ../../whatsnew/3.11.rst:1661 +#: ../../whatsnew/3.11.rst:1659 msgid "" "All jump opcodes are now relative, including the existing :opcode:" "`JUMP_IF_TRUE_OR_POP` and :opcode:`JUMP_IF_FALSE_OR_POP`. The argument is " "now an offset from the current instruction rather than an absolute location." msgstr "" -#: ../../whatsnew/3.11.rst:1672 +#: ../../whatsnew/3.11.rst:1670 msgid "Changed/removed opcodes" msgstr "" -#: ../../whatsnew/3.11.rst:1674 +#: ../../whatsnew/3.11.rst:1672 msgid "" "Changed :opcode:`MATCH_CLASS` and :opcode:`MATCH_KEYS` to no longer push an " "additional boolean value to indicate success/failure. Instead, ``None`` is " "pushed on failure in place of the tuple of extracted values." msgstr "" -#: ../../whatsnew/3.11.rst:1679 +#: ../../whatsnew/3.11.rst:1677 msgid "" "Changed opcodes that work with exceptions to reflect them now being " "represented as one item on the stack instead of three (see :gh:`89874`)." msgstr "" -#: ../../whatsnew/3.11.rst:1683 +#: ../../whatsnew/3.11.rst:1681 msgid "" "Removed :opcode:`!COPY_DICT_WITHOUT_KEYS`, :opcode:`!GEN_START`, :opcode:`!" "POP_BLOCK`, :opcode:`!SETUP_FINALLY` and :opcode:`!YIELD_FROM`." msgstr "" -#: ../../whatsnew/3.11.rst:1691 ../../whatsnew/3.11.rst:2563 +#: ../../whatsnew/3.11.rst:1689 ../../whatsnew/3.11.rst:2561 msgid "Deprecated" msgstr "" -#: ../../whatsnew/3.11.rst:1693 +#: ../../whatsnew/3.11.rst:1691 msgid "" "This section lists Python APIs that have been deprecated in Python 3.11." msgstr "" -#: ../../whatsnew/3.11.rst:1695 +#: ../../whatsnew/3.11.rst:1693 msgid "" "Deprecated C APIs are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:1702 +#: ../../whatsnew/3.11.rst:1700 msgid "Language/Builtins" msgstr "" -#: ../../whatsnew/3.11.rst:1704 +#: ../../whatsnew/3.11.rst:1702 msgid "" "Chaining :class:`classmethod` descriptors (introduced in :issue:`19072`) is " "now deprecated. It can no longer be used to wrap other descriptors such as :" @@ -2378,7 +2362,7 @@ msgid "" "3.10. (Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1710 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 " @@ -2386,7 +2370,7 @@ msgid "" "`SyntaxError`. (Contributed by Serhiy Storchaka in :gh:`81548`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1718 +#: ../../whatsnew/3.11.rst:1716 msgid "" "The delegation of :func:`int` to :meth:`~object.__trunc__` is now " "deprecated. Calling ``int(a)`` when ``type(a)`` implements :meth:`!" @@ -2395,99 +2379,99 @@ msgid "" "`44977`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1728 +#: ../../whatsnew/3.11.rst:1726 msgid "Modules" msgstr "" -#: ../../whatsnew/3.11.rst:1732 +#: ../../whatsnew/3.11.rst:1730 msgid "" ":pep:`594` led to the deprecations of the following modules slated for " "removal in Python 3.13:" msgstr "" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1734 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1734 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1734 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1734 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1734 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.11.rst:1742 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.11.rst:1742 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.11.rst:1742 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.11.rst:1742 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.11.rst:1745 +#: ../../whatsnew/3.11.rst:1743 msgid "" "(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:" "`68966`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1748 +#: ../../whatsnew/3.11.rst:1746 msgid "" "The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been " "deprecated since at least Python 3.6. Their documentation and deprecation " @@ -2495,7 +2479,7 @@ msgid "" "(Contributed by Hugo van Kemenade in :issue:`47022`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1753 +#: ../../whatsnew/3.11.rst:1751 msgid "" "The :mod:`lib2to3` package and :ref:`2to3 <2to3-reference>` tool are now " "deprecated and may not be able to parse Python 3.10 or newer. See :pep:" @@ -2503,41 +2487,41 @@ msgid "" "Stinner in :issue:`40360`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1758 +#: ../../whatsnew/3.11.rst:1756 msgid "" "Undocumented modules :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!" "sre_parse` are now deprecated. (Contributed by Serhiy Storchaka in :issue:" "`47152`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1766 +#: ../../whatsnew/3.11.rst:1764 msgid "Standard Library" msgstr "" -#: ../../whatsnew/3.11.rst:1768 +#: ../../whatsnew/3.11.rst:1766 msgid "" "The following have been deprecated in :mod:`configparser` since Python 3.2. " "Their deprecation warnings have now been updated to note they will be " "removed in Python 3.12:" msgstr "" -#: ../../whatsnew/3.11.rst:1772 +#: ../../whatsnew/3.11.rst:1770 msgid "the :class:`!configparser.SafeConfigParser` class" msgstr "" -#: ../../whatsnew/3.11.rst:1773 +#: ../../whatsnew/3.11.rst:1771 msgid "the :attr:`!configparser.ParsingError.filename` property" msgstr "" -#: ../../whatsnew/3.11.rst:1774 +#: ../../whatsnew/3.11.rst:1772 msgid "the :meth:`configparser.RawConfigParser.readfp` method" msgstr ":meth:`configparser.RawConfigParser.readfp` 方法" -#: ../../whatsnew/3.11.rst:1776 +#: ../../whatsnew/3.11.rst:1774 msgid "(Contributed by Hugo van Kemenade in :issue:`45173`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1778 +#: ../../whatsnew/3.11.rst:1776 msgid "" ":class:`!configparser.LegacyInterpolation` has been deprecated in the " "docstring since Python 3.2, and is not listed in the :mod:`configparser` " @@ -2547,7 +2531,7 @@ msgid "" "Kemenade in :issue:`46607`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1785 +#: ../../whatsnew/3.11.rst:1783 msgid "" "The older set of :mod:`importlib.resources` functions were deprecated in " "favor of the replacements added in Python 3.9 and will be removed in a " @@ -2555,35 +2539,35 @@ msgid "" "package subdirectories:" msgstr "" -#: ../../whatsnew/3.11.rst:1790 +#: ../../whatsnew/3.11.rst:1788 msgid ":func:`importlib.resources.contents`" msgstr "" -#: ../../whatsnew/3.11.rst:1791 +#: ../../whatsnew/3.11.rst:1789 msgid ":func:`importlib.resources.is_resource`" msgstr "" -#: ../../whatsnew/3.11.rst:1792 +#: ../../whatsnew/3.11.rst:1790 msgid ":func:`importlib.resources.open_binary`" msgstr "" -#: ../../whatsnew/3.11.rst:1793 +#: ../../whatsnew/3.11.rst:1791 msgid ":func:`importlib.resources.open_text`" msgstr "" -#: ../../whatsnew/3.11.rst:1794 +#: ../../whatsnew/3.11.rst:1792 msgid ":func:`importlib.resources.read_binary`" msgstr "" -#: ../../whatsnew/3.11.rst:1795 +#: ../../whatsnew/3.11.rst:1793 msgid ":func:`importlib.resources.read_text`" msgstr "" -#: ../../whatsnew/3.11.rst:1796 +#: ../../whatsnew/3.11.rst:1794 msgid ":func:`importlib.resources.path`" msgstr "" -#: ../../whatsnew/3.11.rst:1798 +#: ../../whatsnew/3.11.rst:1796 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " "removed in Python 3.13. Use :func:`locale.setlocale`, :func:`locale." @@ -2591,14 +2575,14 @@ msgid "" "getlocale` functions instead. (Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1804 +#: ../../whatsnew/3.11.rst:1802 msgid "" "The :func:`locale.resetlocale` function is deprecated and will be removed in " "Python 3.13. Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. " "(Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1808 +#: ../../whatsnew/3.11.rst:1806 msgid "" "Stricter rules will now be applied for numerical group references and group " "names in :ref:`regular expressions `. Only sequences of ASCII " @@ -2609,16 +2593,16 @@ msgid "" "`91760`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1816 +#: ../../whatsnew/3.11.rst:1814 msgid "" "In the :mod:`re` module, the :func:`!re.template` function and the " -"corresponding :data:`!re.TEMPLATE` and :data:`!re.T` flags are deprecated, " +"corresponding :const:`!re.TEMPLATE` and :const:`!re.T` flags are deprecated, " "as they were undocumented and lacked an obvious purpose. They will be " "removed in Python 3.13. (Contributed by Serhiy Storchaka and Miro Hrončok " "in :gh:`92728`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1822 +#: ../../whatsnew/3.11.rst:1820 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:" @@ -2627,7 +2611,7 @@ msgid "" "issue:`45837`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1828 +#: ../../whatsnew/3.11.rst:1826 msgid "" ":class:`typing.Text`, which exists solely to provide compatibility support " "between Python 2 and Python 3 code, is now deprecated. Its removal is " @@ -2635,351 +2619,351 @@ msgid "" "wherever possible. (Contributed by Alex Waygood in :gh:`92332`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1834 +#: ../../whatsnew/3.11.rst:1832 msgid "" "The keyword argument syntax for constructing :data:`typing.TypedDict` types " "is now deprecated. Support will be removed in Python 3.13. (Contributed by " "Jingchen Ye in :gh:`90224`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1838 +#: ../../whatsnew/3.11.rst:1836 msgid "" ":class:`!webbrowser.MacOSX` is deprecated and will be removed in Python " "3.13. It is untested, undocumented, and not used by :mod:`webbrowser` " "itself. (Contributed by Dong-hee Na in :issue:`42255`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1842 +#: ../../whatsnew/3.11.rst:1840 msgid "" "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 "" -#: ../../whatsnew/3.11.rst:1846 +#: ../../whatsnew/3.11.rst:1844 msgid "" "Deprecated the following not-formally-documented :mod:`unittest` functions, " "scheduled for removal in Python 3.13:" msgstr "" -#: ../../whatsnew/3.11.rst:1849 +#: ../../whatsnew/3.11.rst:1847 msgid ":func:`!unittest.findTestCases`" msgstr "" -#: ../../whatsnew/3.11.rst:1850 +#: ../../whatsnew/3.11.rst:1848 msgid ":func:`!unittest.makeSuite`" msgstr "" -#: ../../whatsnew/3.11.rst:1851 +#: ../../whatsnew/3.11.rst:1849 msgid ":func:`!unittest.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.11.rst:1853 +#: ../../whatsnew/3.11.rst:1851 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.11.rst:1855 +#: ../../whatsnew/3.11.rst:1853 msgid ":meth:`unittest.TestLoader.loadTestsFromModule`" msgstr ":meth:`unittest.TestLoader.loadTestsFromModule`" -#: ../../whatsnew/3.11.rst:1856 +#: ../../whatsnew/3.11.rst:1854 msgid ":meth:`unittest.TestLoader.loadTestsFromTestCase`" msgstr ":meth:`unittest.TestLoader.loadTestsFromTestCase`" -#: ../../whatsnew/3.11.rst:1857 +#: ../../whatsnew/3.11.rst:1855 msgid ":meth:`unittest.TestLoader.getTestCaseNames`" msgstr ":meth:`unittest.TestLoader.getTestCaseNames`" -#: ../../whatsnew/3.11.rst:1859 +#: ../../whatsnew/3.11.rst:1857 msgid "(Contributed by Erlend E. Aasland in :issue:`5846`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1861 +#: ../../whatsnew/3.11.rst:1859 msgid "" ":meth:`~!unittest.TestProgram.usageExit` is marked deprecated, to be removed " "in 3.13. (Contributed by Carlos Damázio in :gh:`67048`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1870 ../../whatsnew/3.11.rst:2591 +#: ../../whatsnew/3.11.rst:1868 ../../whatsnew/3.11.rst:2589 msgid "Pending Removal in Python 3.12" msgstr "" -#: ../../whatsnew/3.11.rst:1872 +#: ../../whatsnew/3.11.rst:1870 msgid "" "The following Python APIs have been deprecated in earlier Python releases, " "and will be removed in Python 3.12." msgstr "" -#: ../../whatsnew/3.11.rst:1875 +#: ../../whatsnew/3.11.rst:1873 msgid "" "C APIs pending removal are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:1878 +#: ../../whatsnew/3.11.rst:1876 msgid "The :mod:`asynchat` module" msgstr "" -#: ../../whatsnew/3.11.rst:1879 +#: ../../whatsnew/3.11.rst:1877 msgid "The :mod:`asyncore` module" msgstr "" -#: ../../whatsnew/3.11.rst:1880 +#: ../../whatsnew/3.11.rst:1878 msgid "The :ref:`entire distutils package `" msgstr "" -#: ../../whatsnew/3.11.rst:1881 +#: ../../whatsnew/3.11.rst:1879 msgid "The :mod:`imp` module" msgstr "" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1880 msgid "The :class:`typing.io ` namespace" msgstr "" -#: ../../whatsnew/3.11.rst:1883 +#: ../../whatsnew/3.11.rst:1881 msgid "The :class:`typing.re ` namespace" msgstr "" -#: ../../whatsnew/3.11.rst:1884 +#: ../../whatsnew/3.11.rst:1882 msgid ":func:`!cgi.log`" msgstr "" -#: ../../whatsnew/3.11.rst:1885 +#: ../../whatsnew/3.11.rst:1883 msgid ":func:`importlib.find_loader`" msgstr ":func:`importlib.find_loader`" -#: ../../whatsnew/3.11.rst:1886 +#: ../../whatsnew/3.11.rst:1884 msgid ":meth:`importlib.abc.Loader.module_repr`" msgstr ":meth:`importlib.abc.Loader.module_repr`" -#: ../../whatsnew/3.11.rst:1887 +#: ../../whatsnew/3.11.rst:1885 msgid ":meth:`importlib.abc.MetaPathFinder.find_module`" msgstr ":meth:`importlib.abc.MetaPathFinder.find_module`" -#: ../../whatsnew/3.11.rst:1888 +#: ../../whatsnew/3.11.rst:1886 msgid ":meth:`importlib.abc.PathEntryFinder.find_loader`" msgstr ":meth:`importlib.abc.PathEntryFinder.find_loader`" -#: ../../whatsnew/3.11.rst:1889 +#: ../../whatsnew/3.11.rst:1887 msgid ":meth:`importlib.abc.PathEntryFinder.find_module`" msgstr ":meth:`importlib.abc.PathEntryFinder.find_module`" -#: ../../whatsnew/3.11.rst:1890 +#: ../../whatsnew/3.11.rst:1888 msgid ":meth:`!importlib.machinery.BuiltinImporter.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1891 +#: ../../whatsnew/3.11.rst:1889 msgid ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" msgstr "" -#: ../../whatsnew/3.11.rst:1892 +#: ../../whatsnew/3.11.rst:1890 msgid ":meth:`!importlib.machinery.FileFinder.find_loader`" msgstr "" -#: ../../whatsnew/3.11.rst:1893 +#: ../../whatsnew/3.11.rst:1891 msgid ":meth:`!importlib.machinery.FileFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1894 +#: ../../whatsnew/3.11.rst:1892 msgid ":meth:`!importlib.machinery.FrozenImporter.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1895 +#: ../../whatsnew/3.11.rst:1893 msgid ":meth:`!importlib.machinery.FrozenLoader.module_repr`" msgstr "" -#: ../../whatsnew/3.11.rst:1896 +#: ../../whatsnew/3.11.rst:1894 msgid ":meth:`importlib.machinery.PathFinder.find_module`" msgstr ":meth:`importlib.machinery.PathFinder.find_module`" -#: ../../whatsnew/3.11.rst:1897 +#: ../../whatsnew/3.11.rst:1895 msgid ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1898 +#: ../../whatsnew/3.11.rst:1896 msgid ":func:`importlib.util.module_for_loader`" msgstr ":func:`importlib.util.module_for_loader`" -#: ../../whatsnew/3.11.rst:1899 +#: ../../whatsnew/3.11.rst:1897 msgid ":func:`!importlib.util.set_loader_wrapper`" msgstr "" -#: ../../whatsnew/3.11.rst:1900 +#: ../../whatsnew/3.11.rst:1898 msgid ":func:`!importlib.util.set_package_wrapper`" msgstr "" -#: ../../whatsnew/3.11.rst:1901 +#: ../../whatsnew/3.11.rst:1899 msgid ":class:`pkgutil.ImpImporter`" msgstr ":class:`pkgutil.ImpImporter`" -#: ../../whatsnew/3.11.rst:1902 +#: ../../whatsnew/3.11.rst:1900 msgid ":class:`pkgutil.ImpLoader`" msgstr ":class:`pkgutil.ImpLoader`" -#: ../../whatsnew/3.11.rst:1903 +#: ../../whatsnew/3.11.rst:1901 msgid ":meth:`pathlib.Path.link_to`" msgstr ":meth:`pathlib.Path.link_to`" -#: ../../whatsnew/3.11.rst:1904 +#: ../../whatsnew/3.11.rst:1902 msgid ":func:`!sqlite3.enable_shared_cache`" msgstr "" -#: ../../whatsnew/3.11.rst:1905 +#: ../../whatsnew/3.11.rst:1903 msgid ":func:`!sqlite3.OptimizedUnicode`" msgstr "" -#: ../../whatsnew/3.11.rst:1906 +#: ../../whatsnew/3.11.rst:1904 msgid ":envvar:`PYTHONTHREADDEBUG` environment variable" msgstr "" -#: ../../whatsnew/3.11.rst:1907 +#: ../../whatsnew/3.11.rst:1905 msgid "The following deprecated aliases in :mod:`unittest`:" msgstr "" -#: ../../whatsnew/3.11.rst:1910 +#: ../../whatsnew/3.11.rst:1908 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.11.rst:1910 +#: ../../whatsnew/3.11.rst:1908 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.11.rst:1910 +#: ../../whatsnew/3.11.rst:1908 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.11.rst:1912 +#: ../../whatsnew/3.11.rst:1910 msgid "``failUnless``" msgstr "" -#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1917 msgid ":meth:`.assertTrue`" msgstr "" +#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1911 #: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1913 #: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1915 -#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1917 -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1916 msgid "3.1" msgstr "" -#: ../../whatsnew/3.11.rst:1913 +#: ../../whatsnew/3.11.rst:1911 msgid "``failIf``" msgstr "" -#: ../../whatsnew/3.11.rst:1913 +#: ../../whatsnew/3.11.rst:1911 msgid ":meth:`.assertFalse`" msgstr "" -#: ../../whatsnew/3.11.rst:1914 +#: ../../whatsnew/3.11.rst:1912 msgid "``failUnlessEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1918 msgid ":meth:`.assertEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1915 +#: ../../whatsnew/3.11.rst:1913 msgid "``failIfEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1915 ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1913 ../../whatsnew/3.11.rst:1919 msgid ":meth:`.assertNotEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1914 msgid "``failUnlessAlmostEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1920 msgid ":meth:`.assertAlmostEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1915 msgid "``failIfAlmostEqual``" msgstr "" -#: ../../whatsnew/3.11.rst:1917 ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1915 ../../whatsnew/3.11.rst:1921 msgid ":meth:`.assertNotAlmostEqual`" msgstr "" -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1916 msgid "``failUnlessRaises``" msgstr "" -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1916 msgid ":meth:`.assertRaises`" msgstr "" -#: ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1917 msgid "``assert_``" msgstr "" +#: ../../whatsnew/3.11.rst:1917 ../../whatsnew/3.11.rst:1918 #: ../../whatsnew/3.11.rst:1919 ../../whatsnew/3.11.rst:1920 #: ../../whatsnew/3.11.rst:1921 ../../whatsnew/3.11.rst:1922 -#: ../../whatsnew/3.11.rst:1923 ../../whatsnew/3.11.rst:1924 -#: ../../whatsnew/3.11.rst:1925 +#: ../../whatsnew/3.11.rst:1923 msgid "3.2" msgstr "" -#: ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1918 msgid "``assertEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1919 msgid "``assertNotEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1920 msgid "``assertAlmostEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1921 msgid "``assertNotAlmostEquals``" msgstr "" -#: ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1922 msgid "``assertRegexpMatches``" msgstr "" -#: ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1922 msgid ":meth:`.assertRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1925 +#: ../../whatsnew/3.11.rst:1923 msgid "``assertRaisesRegexp``" msgstr "" -#: ../../whatsnew/3.11.rst:1925 +#: ../../whatsnew/3.11.rst:1923 msgid ":meth:`.assertRaisesRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1926 +#: ../../whatsnew/3.11.rst:1924 msgid "``assertNotRegexpMatches``" msgstr "" -#: ../../whatsnew/3.11.rst:1926 +#: ../../whatsnew/3.11.rst:1924 msgid ":meth:`.assertNotRegex`" msgstr "" -#: ../../whatsnew/3.11.rst:1926 +#: ../../whatsnew/3.11.rst:1924 msgid "3.5" msgstr "" -#: ../../whatsnew/3.11.rst:1933 ../../whatsnew/3.11.rst:2617 +#: ../../whatsnew/3.11.rst:1931 ../../whatsnew/3.11.rst:2615 msgid "Removed" msgstr "" -#: ../../whatsnew/3.11.rst:1935 +#: ../../whatsnew/3.11.rst:1933 msgid "This section lists Python APIs that have been removed in Python 3.11." msgstr "" -#: ../../whatsnew/3.11.rst:1937 +#: ../../whatsnew/3.11.rst:1935 msgid "" "Removed C APIs are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:1939 +#: ../../whatsnew/3.11.rst:1937 msgid "" "Removed the :func:`!@asyncio.coroutine` :term:`decorator` enabling legacy " "generator-based coroutines to be compatible with :keyword:`async` / :keyword:" @@ -2988,14 +2972,14 @@ msgid "" "instead. (Contributed by Illia Volochii in :issue:`43216`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1946 +#: ../../whatsnew/3.11.rst:1944 msgid "" "Removed :class:`!asyncio.coroutines.CoroWrapper` used for wrapping legacy " "generator-based coroutine objects in the debug mode. (Contributed by Illia " "Volochii in :issue:`43216`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1950 +#: ../../whatsnew/3.11.rst:1948 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is now " @@ -3004,44 +2988,44 @@ msgid "" "`45129`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1956 +#: ../../whatsnew/3.11.rst:1954 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" msgstr "" -#: ../../whatsnew/3.11.rst:1959 +#: ../../whatsnew/3.11.rst:1957 msgid ":func:`!binascii.a2b_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1960 +#: ../../whatsnew/3.11.rst:1958 msgid ":func:`!binascii.b2a_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1961 +#: ../../whatsnew/3.11.rst:1959 msgid ":func:`!binascii.rlecode_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1962 +#: ../../whatsnew/3.11.rst:1960 msgid ":func:`!binascii.rldecode_hqx`" msgstr "" -#: ../../whatsnew/3.11.rst:1964 +#: ../../whatsnew/3.11.rst:1962 msgid "The :func:`binascii.crc_hqx` function remains available." msgstr "" -#: ../../whatsnew/3.11.rst:1966 +#: ../../whatsnew/3.11.rst:1964 msgid "(Contributed by Victor Stinner in :issue:`45085`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1968 +#: ../../whatsnew/3.11.rst:1966 msgid "" "Removed the :mod:`distutils` ``bdist_msi`` command deprecated in Python 3.9. " "Use ``bdist_wheel`` (wheel packages) instead. (Contributed by Hugo van " "Kemenade in :issue:`45124`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1972 +#: ../../whatsnew/3.11.rst:1970 msgid "" "Removed the :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." "DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." @@ -3049,7 +3033,7 @@ msgid "" "in :issue:`45132`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1977 +#: ../../whatsnew/3.11.rst:1975 msgid "" "Removed the deprecated :mod:`gettext` functions :func:`!lgettext`, :func:`!" "ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed the :" @@ -3060,62 +3044,62 @@ msgid "" "by Dong-hee Na and Serhiy Storchaka in :issue:`44235`.)" msgstr "" -#: ../../whatsnew/3.11.rst:1987 +#: ../../whatsnew/3.11.rst:1985 msgid "Removed from the :mod:`inspect` module:" msgstr "" -#: ../../whatsnew/3.11.rst:1989 +#: ../../whatsnew/3.11.rst:1987 msgid "" "The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" "`inspect.signature` or :func:`inspect.getfullargspec` instead." msgstr "" -#: ../../whatsnew/3.11.rst:1992 +#: ../../whatsnew/3.11.rst:1990 msgid "" "The :func:`!formatargspec` function, deprecated since Python 3.5; use the :" "func:`inspect.signature` function or the :class:`inspect.Signature` object " "directly." msgstr "" -#: ../../whatsnew/3.11.rst:1996 +#: ../../whatsnew/3.11.rst:1994 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." msgstr "" -#: ../../whatsnew/3.11.rst:2001 +#: ../../whatsnew/3.11.rst:1999 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2003 +#: ../../whatsnew/3.11.rst:2001 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2008 +#: ../../whatsnew/3.11.rst:2006 msgid "" "Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " "Dong-hee Na in :issue:`35800`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2012 +#: ../../whatsnew/3.11.rst:2010 msgid "" "Removed the deprecated :meth:`!split` method of :class:`!_tkinter." "TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2015 +#: ../../whatsnew/3.11.rst:2013 msgid "" "Removed namespace package support from :mod:`unittest` discovery. It was " "introduced in Python 3.4 but has been broken since Python 3.7. (Contributed " "by Inada Naoki in :issue:`23882`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2019 +#: ../../whatsnew/3.11.rst:2017 msgid "" "Removed the undocumented private :meth:`!float.__set_format__()` method, " "previously known as :meth:`!float.__setformat__()` in Python 3.7. Its " @@ -3124,14 +3108,14 @@ msgid "" "in :issue:`46852`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2025 +#: ../../whatsnew/3.11.rst:2023 msgid "" "The :option:`!--experimental-isolated-subinterpreters` configure flag (and " "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " "been removed." msgstr "" -#: ../../whatsnew/3.11.rst:2029 +#: ../../whatsnew/3.11.rst:2027 msgid "" "`Pynche `_ --- The Pythonically Natural " "Color and Hue Editor --- has been moved out of ``Tools/scripts`` and is " @@ -3139,23 +3123,23 @@ msgid "" "main>`_ from the Python source tree." msgstr "" -#: ../../whatsnew/3.11.rst:2039 ../../whatsnew/3.11.rst:2261 +#: ../../whatsnew/3.11.rst:2037 ../../whatsnew/3.11.rst:2259 msgid "Porting to Python 3.11" msgstr "" -#: ../../whatsnew/3.11.rst:2041 +#: ../../whatsnew/3.11.rst:2039 msgid "" "This section lists previously described changes and other bugfixes in the " "Python API that may require changes to your Python code." msgstr "" -#: ../../whatsnew/3.11.rst:2044 +#: ../../whatsnew/3.11.rst:2042 msgid "" "Porting notes for the C API are :ref:`listed separately `." msgstr "" -#: ../../whatsnew/3.11.rst:2047 +#: ../../whatsnew/3.11.rst:2045 msgid "" ":func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput." "FileInput` no longer accept ``'U'`` (\"universal newline\") in the file " @@ -3166,7 +3150,7 @@ msgid "" "Stinner in :issue:`37330`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2056 +#: ../../whatsnew/3.11.rst:2054 msgid "" ":class:`ast.AST` node positions are now validated when provided to :func:" "`compile` and other related functions. If invalid positions are detected, a :" @@ -3174,14 +3158,14 @@ msgid "" "`93351`)" msgstr "" -#: ../../whatsnew/3.11.rst:2060 +#: ../../whatsnew/3.11.rst:2058 msgid "" "Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor` " "executors to :meth:`asyncio.loop.set_default_executor` following a " "deprecation in Python 3.8. (Contributed by Illia Volochii in :issue:`43234`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2065 +#: ../../whatsnew/3.11.rst:2063 msgid "" ":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:" "`calendar.LocaleHTMLCalendar` classes now use :func:`locale.getlocale`, " @@ -3189,14 +3173,14 @@ msgid "" "(Contributed by Victor Stinner in :issue:`46659`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2071 +#: ../../whatsnew/3.11.rst:2069 msgid "" "The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with " "the ``'UTF-8'`` encoding. (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ " "రెడ్డి తాటిపర్తి) in :issue:`41137`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2075 +#: ../../whatsnew/3.11.rst:2073 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 " @@ -3205,14 +3189,14 @@ msgid "" "`40465`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2081 +#: ../../whatsnew/3.11.rst:2079 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." msgstr "" -#: ../../whatsnew/3.11.rst:2085 +#: ../../whatsnew/3.11.rst:2083 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 " @@ -3220,7 +3204,7 @@ msgid "" "`47066`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2090 +#: ../../whatsnew/3.11.rst:2088 msgid "" "In the :mod:`re` module, several long-standing bugs where fixed that, in " "rare cases, could cause capture groups to get the wrong result. Therefore, " @@ -3228,11 +3212,11 @@ msgid "" "in :issue:`35859`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2099 +#: ../../whatsnew/3.11.rst:2097 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.11.rst:2101 +#: ../../whatsnew/3.11.rst:2099 msgid "" "CPython now has :pep:`11` :pep:`Tier 3 support <11#tier-3>` for cross " "compiling to the `WebAssembly `_ platforms " @@ -3247,11 +3231,11 @@ msgid "" "gh:`90473`; platforms promoted in :gh:`95085`)" msgstr "" -#: ../../whatsnew/3.11.rst:2115 +#: ../../whatsnew/3.11.rst:2113 msgid "Building CPython now requires:" msgstr "" -#: ../../whatsnew/3.11.rst:2117 +#: ../../whatsnew/3.11.rst:2115 msgid "" "A `C11 `_ compiler and standard library. " "`Optional C11 features `_ floating " "point numbers. (Contributed by Victor Stinner in :issue:`46917`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2128 +#: ../../whatsnew/3.11.rst:2126 msgid "" "The :c:macro:`!Py_NO_NAN` macro has been removed. Since CPython now requires " "IEEE 754 floats, NaN values are always available. (Contributed by Victor " "Stinner in :issue:`46656`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2132 +#: ../../whatsnew/3.11.rst:2130 msgid "" "The :mod:`tkinter` package now requires `Tcl/Tk `_ " "version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2136 +#: ../../whatsnew/3.11.rst:2134 msgid "" "Build dependencies, compiler flags, and linker flags for most stdlib " "extension modules are now detected by :program:`configure`. libffi, libnsl, " @@ -3291,13 +3275,13 @@ msgid "" "`45847`, :issue:`45747`, and :issue:`45763`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2146 +#: ../../whatsnew/3.11.rst:2144 msgid "" "libpython is no longer linked against libcrypt. (Contributed by Mike Gilbert " "in :issue:`45433`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2149 +#: ../../whatsnew/3.11.rst:2147 msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " @@ -3305,7 +3289,7 @@ msgid "" "`44340`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2154 +#: ../../whatsnew/3.11.rst:2152 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " "option :option:`!--without-freelists` can be used to disable all freelists " @@ -3313,7 +3297,7 @@ msgid "" "`45522`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2159 +#: ../../whatsnew/3.11.rst:2157 msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " @@ -3322,7 +3306,7 @@ msgid "" "`45570`, :issue:`45571`, and :issue:`43974`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2166 +#: ../../whatsnew/3.11.rst:2164 msgid "" "Use the environment variables :envvar:`!TCLTK_CFLAGS` and :envvar:`!" "TCLTK_LIBS` to manually specify the location of Tcl/Tk headers and " @@ -3330,7 +3314,7 @@ msgid "" "and :option:`!--with-tcltk-libs` have been removed." msgstr "" -#: ../../whatsnew/3.11.rst:2172 +#: ../../whatsnew/3.11.rst:2170 msgid "" "On RHEL 7 and CentOS 7 the development packages do not provide ``tcl.pc`` " "and ``tk.pc``; use ``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``. The " @@ -3338,7 +3322,7 @@ msgid "" "build Python with RHEL 7's and CentOS 7's Tcl/Tk and OpenSSL." msgstr "" -#: ../../whatsnew/3.11.rst:2177 +#: ../../whatsnew/3.11.rst:2175 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 " @@ -3350,23 +3334,23 @@ msgid "" "in :issue:`45569`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2190 +#: ../../whatsnew/3.11.rst:2188 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.11.rst:2197 +#: ../../whatsnew/3.11.rst:2195 msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2200 +#: ../../whatsnew/3.11.rst:2198 msgid "" "Add a new :c:func:`PyType_GetQualName` function to get type's qualified " "name. (Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2203 +#: ../../whatsnew/3.11.rst:2201 msgid "" "Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " @@ -3374,86 +3358,86 @@ msgid "" "`43760`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2208 +#: ../../whatsnew/3.11.rst:2206 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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2212 +#: ../../whatsnew/3.11.rst:2210 msgid "" ":c:type:`Py_buffer` and APIs are now part of the limited API and the stable " "ABI:" msgstr "" -#: ../../whatsnew/3.11.rst:2215 +#: ../../whatsnew/3.11.rst:2213 msgid ":c:func:`PyObject_CheckBuffer`" msgstr ":c:func:`PyObject_CheckBuffer`" -#: ../../whatsnew/3.11.rst:2216 +#: ../../whatsnew/3.11.rst:2214 msgid ":c:func:`PyObject_GetBuffer`" msgstr ":c:func:`PyObject_GetBuffer`" -#: ../../whatsnew/3.11.rst:2217 +#: ../../whatsnew/3.11.rst:2215 msgid ":c:func:`PyBuffer_GetPointer`" msgstr ":c:func:`PyBuffer_GetPointer`" -#: ../../whatsnew/3.11.rst:2218 +#: ../../whatsnew/3.11.rst:2216 msgid ":c:func:`PyBuffer_SizeFromFormat`" msgstr ":c:func:`PyBuffer_SizeFromFormat`" -#: ../../whatsnew/3.11.rst:2219 +#: ../../whatsnew/3.11.rst:2217 msgid ":c:func:`PyBuffer_ToContiguous`" msgstr ":c:func:`PyBuffer_ToContiguous`" -#: ../../whatsnew/3.11.rst:2220 +#: ../../whatsnew/3.11.rst:2218 msgid ":c:func:`PyBuffer_FromContiguous`" msgstr ":c:func:`PyBuffer_FromContiguous`" -#: ../../whatsnew/3.11.rst:2221 +#: ../../whatsnew/3.11.rst:2219 msgid ":c:func:`PyBuffer_CopyData`" msgstr ":c:func:`PyBuffer_CopyData`" -#: ../../whatsnew/3.11.rst:2222 +#: ../../whatsnew/3.11.rst:2220 msgid ":c:func:`PyBuffer_IsContiguous`" msgstr ":c:func:`PyBuffer_IsContiguous`" -#: ../../whatsnew/3.11.rst:2223 +#: ../../whatsnew/3.11.rst:2221 msgid ":c:func:`PyBuffer_FillContiguousStrides`" msgstr ":c:func:`PyBuffer_FillContiguousStrides`" -#: ../../whatsnew/3.11.rst:2224 +#: ../../whatsnew/3.11.rst:2222 msgid ":c:func:`PyBuffer_FillInfo`" msgstr ":c:func:`PyBuffer_FillInfo`" -#: ../../whatsnew/3.11.rst:2225 +#: ../../whatsnew/3.11.rst:2223 msgid ":c:func:`PyBuffer_Release`" msgstr ":c:func:`PyBuffer_Release`" -#: ../../whatsnew/3.11.rst:2226 +#: ../../whatsnew/3.11.rst:2224 msgid ":c:func:`PyMemoryView_FromBuffer`" msgstr ":c:func:`PyMemoryView_FromBuffer`" -#: ../../whatsnew/3.11.rst:2227 +#: ../../whatsnew/3.11.rst:2225 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` type slots" msgstr "" -#: ../../whatsnew/3.11.rst:2230 +#: ../../whatsnew/3.11.rst:2228 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2232 +#: ../../whatsnew/3.11.rst:2230 msgid "" -"Added the :c:data:`PyType_GetModuleByDef` function, used to get the module " +"Added the :c:func:`PyType_GetModuleByDef` function, used to get the module " "in which a method was defined, in cases where this information is not " "available directly (via :c:type:`PyCMethod`). (Contributed by Petr Viktorin " "in :issue:`46613`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2237 +#: ../../whatsnew/3.11.rst:2235 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:" @@ -3461,14 +3445,14 @@ msgid "" "`PyFloat_Unpack8`. (Contributed by Victor Stinner in :issue:`46906`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2243 +#: ../../whatsnew/3.11.rst:2241 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`." msgstr "" -#: ../../whatsnew/3.11.rst:2247 +#: ../../whatsnew/3.11.rst:2245 msgid "" "Added two new functions to get and set the active exception instance: :c:" "func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " @@ -3477,13 +3461,13 @@ msgid "" "exceptions. (Contributed by Irit Katriel in :issue:`46343`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2254 +#: ../../whatsnew/3.11.rst:2252 msgid "" "Added the :c:member:`PyConfig.safe_path` member. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2265 +#: ../../whatsnew/3.11.rst:2263 msgid "" "Some macros have been converted to static inline functions to avoid `macro " "pitfalls `_. The " @@ -3495,7 +3479,7 @@ msgid "" "Stinner and Erlend E. Aasland in :gh:`89653`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2276 +#: ../../whatsnew/3.11.rst:2274 msgid "" ":c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback`` " "arguments, the interpreter now derives those values from the exception " @@ -3503,14 +3487,14 @@ msgid "" "all three arguments. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2282 +#: ../../whatsnew/3.11.rst:2280 msgid "" ":c:func:`PyErr_GetExcInfo()` now derives the ``type`` and ``traceback`` " "fields of the result from the exception instance (the ``value`` field). " "(Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2286 +#: ../../whatsnew/3.11.rst:2284 msgid "" ":c:struct:`_frozen` has a new ``is_package`` field to indicate whether or " "not the frozen module is a package. Previously, a negative value in the " @@ -3518,14 +3502,14 @@ msgid "" "``size``. (Contributed by Kumar Aditya in :issue:`46608`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2292 +#: ../../whatsnew/3.11.rst:2290 msgid "" ":c:func:`_PyFrameEvalFunction` now takes ``_PyInterpreterFrame*`` as its " "second parameter, instead of ``PyFrameObject*``. See :pep:`523` for more " "details of how to use this function pointer type." msgstr "" -#: ../../whatsnew/3.11.rst:2296 +#: ../../whatsnew/3.11.rst:2294 msgid "" ":c:func:`PyCode_New` and :c:func:`PyCode_NewWithPosOnlyArgs` now take an " "additional ``exception_table`` argument. Using these functions should be " @@ -3534,7 +3518,7 @@ msgid "" "method." msgstr "" -#: ../../whatsnew/3.11.rst:2302 +#: ../../whatsnew/3.11.rst:2300 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " "``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" @@ -3544,51 +3528,51 @@ msgid "" "and :gh:`94936`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2310 +#: ../../whatsnew/3.11.rst:2308 msgid "" "The old trashcan macros (``Py_TRASHCAN_SAFE_BEGIN``/" "``Py_TRASHCAN_SAFE_END``) are now deprecated. They should be replaced by the " "new macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.11.rst:2314 +#: ../../whatsnew/3.11.rst:2312 msgid "A tp_dealloc function that has the old macros, such as::" msgstr "" -#: ../../whatsnew/3.11.rst:2325 +#: ../../whatsnew/3.11.rst:2323 msgid "should migrate to the new macros as follows::" msgstr "" -#: ../../whatsnew/3.11.rst:2336 +#: ../../whatsnew/3.11.rst:2334 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in." msgstr "" -#: ../../whatsnew/3.11.rst:2339 +#: ../../whatsnew/3.11.rst:2337 msgid "" "To support older Python versions in the same codebase, you can define the " "following macros and use them throughout the code (credit: these were copied " "from the ``mypy`` codebase)::" msgstr "" -#: ../../whatsnew/3.11.rst:2351 +#: ../../whatsnew/3.11.rst:2349 msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " -"with the :const:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function (:" -"c:member:`PyTypeObject.tp_traverse`). (Contributed by Victor Stinner in :" +"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`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2356 +#: ../../whatsnew/3.11.rst:2354 msgid "" -"Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " +"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`)" msgstr "" -#: ../../whatsnew/3.11.rst:2361 +#: ../../whatsnew/3.11.rst:2359 msgid "" "Since :c:func:`Py_TYPE()` is changed to a inline static function, " "``Py_TYPE(obj) = new_type`` must be replaced with ``Py_SET_TYPE(obj, " @@ -3596,11 +3580,11 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.11.rst:2373 ../../whatsnew/3.11.rst:2387 +#: ../../whatsnew/3.11.rst:2371 ../../whatsnew/3.11.rst:2385 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2375 +#: ../../whatsnew/3.11.rst:2373 msgid "" "Since :c:func:`Py_SIZE()` is changed to a inline static function, " "``Py_SIZE(obj) = new_size`` must be replaced with ``Py_SET_SIZE(obj, " @@ -3608,7 +3592,7 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.11.rst:2389 +#: ../../whatsnew/3.11.rst:2387 msgid "" "```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " @@ -3617,7 +3601,7 @@ msgid "" "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2395 +#: ../../whatsnew/3.11.rst:2393 msgid "" "The non-limited API files ``cellobject.h``, ``classobject.h``, ``code.h``, " "``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have " @@ -3628,7 +3612,7 @@ msgid "" "instead. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2403 +#: ../../whatsnew/3.11.rst:2401 msgid "" "The :c:func:`PyUnicode_CHECK_INTERNED` macro has been excluded from the " "limited C API. It was never usable there, because it used internal " @@ -3636,149 +3620,149 @@ msgid "" "Victor Stinner in :issue:`46007`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2408 +#: ../../whatsnew/3.11.rst:2406 msgid "" "The following frame functions and type are now directly available with " "``#include ``, it's no longer needed to add ``#include " "``:" msgstr "" -#: ../../whatsnew/3.11.rst:2412 +#: ../../whatsnew/3.11.rst:2410 msgid ":c:func:`PyFrame_Check`" msgstr ":c:func:`PyFrame_Check`" -#: ../../whatsnew/3.11.rst:2413 +#: ../../whatsnew/3.11.rst:2411 msgid ":c:func:`PyFrame_GetBack`" msgstr ":c:func:`PyFrame_GetBack`" -#: ../../whatsnew/3.11.rst:2414 +#: ../../whatsnew/3.11.rst:2412 msgid ":c:func:`PyFrame_GetBuiltins`" msgstr ":c:func:`PyFrame_GetBuiltins`" -#: ../../whatsnew/3.11.rst:2415 +#: ../../whatsnew/3.11.rst:2413 msgid ":c:func:`PyFrame_GetGenerator`" msgstr ":c:func:`PyFrame_GetGenerator`" -#: ../../whatsnew/3.11.rst:2416 +#: ../../whatsnew/3.11.rst:2414 msgid ":c:func:`PyFrame_GetGlobals`" msgstr ":c:func:`PyFrame_GetGlobals`" -#: ../../whatsnew/3.11.rst:2417 +#: ../../whatsnew/3.11.rst:2415 msgid ":c:func:`PyFrame_GetLasti`" msgstr ":c:func:`PyFrame_GetLasti`" -#: ../../whatsnew/3.11.rst:2418 +#: ../../whatsnew/3.11.rst:2416 msgid ":c:func:`PyFrame_GetLocals`" msgstr ":c:func:`PyFrame_GetLocals`" -#: ../../whatsnew/3.11.rst:2419 +#: ../../whatsnew/3.11.rst:2417 msgid ":c:type:`PyFrame_Type`" msgstr ":c:type:`PyFrame_Type`" -#: ../../whatsnew/3.11.rst:2421 +#: ../../whatsnew/3.11.rst:2419 msgid "(Contributed by Victor Stinner in :gh:`93937`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2425 +#: ../../whatsnew/3.11.rst:2423 msgid "" "The :c:type:`PyFrameObject` structure members have been removed from the " "public C API." msgstr "" -#: ../../whatsnew/3.11.rst:2428 +#: ../../whatsnew/3.11.rst:2426 msgid "" "While the documentation notes that the :c:type:`PyFrameObject` fields are " "subject to change at any time, they have been stable for a long time and " "were used in several popular extensions." msgstr "" -#: ../../whatsnew/3.11.rst:2432 +#: ../../whatsnew/3.11.rst:2430 msgid "" "In Python 3.11, the frame struct was reorganized to allow performance " "optimizations. Some fields were removed entirely, as they were details of " "the old implementation." msgstr "" -#: ../../whatsnew/3.11.rst:2436 +#: ../../whatsnew/3.11.rst:2434 msgid ":c:type:`PyFrameObject` fields:" msgstr "" -#: ../../whatsnew/3.11.rst:2438 +#: ../../whatsnew/3.11.rst:2436 msgid "``f_back``: use :c:func:`PyFrame_GetBack`." msgstr "" -#: ../../whatsnew/3.11.rst:2439 +#: ../../whatsnew/3.11.rst:2437 msgid "``f_blockstack``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2440 +#: ../../whatsnew/3.11.rst:2438 msgid "``f_builtins``: use :c:func:`PyFrame_GetBuiltins`." msgstr "" -#: ../../whatsnew/3.11.rst:2441 +#: ../../whatsnew/3.11.rst:2439 msgid "``f_code``: use :c:func:`PyFrame_GetCode`." msgstr "" -#: ../../whatsnew/3.11.rst:2442 +#: ../../whatsnew/3.11.rst:2440 msgid "``f_gen``: use :c:func:`PyFrame_GetGenerator`." msgstr "" -#: ../../whatsnew/3.11.rst:2443 +#: ../../whatsnew/3.11.rst:2441 msgid "``f_globals``: use :c:func:`PyFrame_GetGlobals`." msgstr "" -#: ../../whatsnew/3.11.rst:2444 +#: ../../whatsnew/3.11.rst:2442 msgid "``f_iblock``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2445 +#: ../../whatsnew/3.11.rst:2443 msgid "" "``f_lasti``: use :c:func:`PyFrame_GetLasti`. Code using ``f_lasti`` with " "``PyCode_Addr2Line()`` should use :c:func:`PyFrame_GetLineNumber` instead; " "it may be faster." msgstr "" -#: ../../whatsnew/3.11.rst:2448 +#: ../../whatsnew/3.11.rst:2446 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" msgstr "" -#: ../../whatsnew/3.11.rst:2449 +#: ../../whatsnew/3.11.rst:2447 msgid "``f_locals``: use :c:func:`PyFrame_GetLocals`." msgstr "" -#: ../../whatsnew/3.11.rst:2450 +#: ../../whatsnew/3.11.rst:2448 msgid "``f_stackdepth``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2451 +#: ../../whatsnew/3.11.rst:2449 msgid "``f_state``: no public API (renamed to ``f_frame.f_state``)." msgstr "" -#: ../../whatsnew/3.11.rst:2452 +#: ../../whatsnew/3.11.rst:2450 msgid "``f_trace``: no public API." msgstr "" -#: ../../whatsnew/3.11.rst:2453 +#: ../../whatsnew/3.11.rst:2451 msgid "" "``f_trace_lines``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_lines\")``." msgstr "" -#: ../../whatsnew/3.11.rst:2454 +#: ../../whatsnew/3.11.rst:2452 msgid "" "``f_trace_opcodes``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_opcodes\")``." msgstr "" -#: ../../whatsnew/3.11.rst:2455 +#: ../../whatsnew/3.11.rst:2453 msgid "``f_localsplus``: no public API (renamed to ``f_frame.localsplus``)." msgstr "" -#: ../../whatsnew/3.11.rst:2456 +#: ../../whatsnew/3.11.rst:2454 msgid "``f_valuestack``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2458 +#: ../../whatsnew/3.11.rst:2456 msgid "" "The Python frame object is now created lazily. A side effect is that the " "``f_back`` member must not be accessed directly, since its value is now also " @@ -3786,7 +3770,7 @@ msgid "" "instead." msgstr "" -#: ../../whatsnew/3.11.rst:2463 +#: ../../whatsnew/3.11.rst:2461 msgid "" "Debuggers that accessed the ``f_locals`` directly *must* call :c:func:" "`PyFrame_GetLocals` instead. They no longer need to call :c:func:" @@ -3795,71 +3779,71 @@ msgid "" "now managed by the virtual machine." msgstr "" -#: ../../whatsnew/3.11.rst:2469 +#: ../../whatsnew/3.11.rst:2467 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2479 +#: ../../whatsnew/3.11.rst:2477 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2489 +#: ../../whatsnew/3.11.rst:2487 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." msgstr "" -#: ../../whatsnew/3.11.rst:2493 +#: ../../whatsnew/3.11.rst:2491 msgid "Changes of the :c:type:`PyThreadState` structure members:" msgstr "" -#: ../../whatsnew/3.11.rst:2495 +#: ../../whatsnew/3.11.rst:2493 msgid "" "``frame``: removed, use :c:func:`PyThreadState_GetFrame` (function added to " "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " "reference`, need to call :c:func:`Py_XDECREF`." msgstr "" -#: ../../whatsnew/3.11.rst:2499 +#: ../../whatsnew/3.11.rst:2497 msgid "" "``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" "`43760`)." msgstr "" -#: ../../whatsnew/3.11.rst:2502 +#: ../../whatsnew/3.11.rst:2500 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." msgstr "" -#: ../../whatsnew/3.11.rst:2504 +#: ../../whatsnew/3.11.rst:2502 msgid "``stackcheck_counter``: removed." msgstr "" -#: ../../whatsnew/3.11.rst:2506 +#: ../../whatsnew/3.11.rst:2504 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2516 +#: ../../whatsnew/3.11.rst:2514 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" msgstr "" -#: ../../whatsnew/3.11.rst:2542 +#: ../../whatsnew/3.11.rst:2540 msgid "" "Or use `the pythoncapi-compat project `__ to get these functions on old Python functions." msgstr "" -#: ../../whatsnew/3.11.rst:2546 +#: ../../whatsnew/3.11.rst:2544 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." msgstr "" -#: ../../whatsnew/3.11.rst:2549 +#: ../../whatsnew/3.11.rst:2547 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to 1 " "for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -3867,7 +3851,7 @@ msgid "" "path and replace any values added to ``module_search_paths``." msgstr "" -#: ../../whatsnew/3.11.rst:2554 +#: ../../whatsnew/3.11.rst:2552 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 " @@ -3876,177 +3860,177 @@ msgid "" "object and modify it directly." msgstr "" -#: ../../whatsnew/3.11.rst:2565 +#: ../../whatsnew/3.11.rst:2563 msgid "" "Deprecate the following functions to configure the Python initialization:" msgstr "" -#: ../../whatsnew/3.11.rst:2567 +#: ../../whatsnew/3.11.rst:2565 msgid ":c:func:`PySys_AddWarnOptionUnicode`" msgstr ":c:func:`PySys_AddWarnOptionUnicode`" -#: ../../whatsnew/3.11.rst:2568 +#: ../../whatsnew/3.11.rst:2566 msgid ":c:func:`PySys_AddWarnOption`" msgstr ":c:func:`PySys_AddWarnOption`" -#: ../../whatsnew/3.11.rst:2569 +#: ../../whatsnew/3.11.rst:2567 msgid ":c:func:`PySys_AddXOption`" msgstr ":c:func:`PySys_AddXOption`" -#: ../../whatsnew/3.11.rst:2570 +#: ../../whatsnew/3.11.rst:2568 msgid ":c:func:`PySys_HasWarnOptions`" msgstr ":c:func:`PySys_HasWarnOptions`" -#: ../../whatsnew/3.11.rst:2571 +#: ../../whatsnew/3.11.rst:2569 msgid ":c:func:`PySys_SetArgvEx`" msgstr ":c:func:`PySys_SetArgvEx`" -#: ../../whatsnew/3.11.rst:2572 +#: ../../whatsnew/3.11.rst:2570 msgid ":c:func:`PySys_SetArgv`" msgstr ":c:func:`PySys_SetArgv`" -#: ../../whatsnew/3.11.rst:2573 +#: ../../whatsnew/3.11.rst:2571 msgid ":c:func:`PySys_SetPath`" msgstr ":c:func:`PySys_SetPath`" -#: ../../whatsnew/3.11.rst:2574 +#: ../../whatsnew/3.11.rst:2572 msgid ":c:func:`Py_SetPath`" msgstr ":c:func:`Py_SetPath`" -#: ../../whatsnew/3.11.rst:2575 +#: ../../whatsnew/3.11.rst:2573 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../whatsnew/3.11.rst:2576 +#: ../../whatsnew/3.11.rst:2574 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../whatsnew/3.11.rst:2577 +#: ../../whatsnew/3.11.rst:2575 msgid ":c:func:`Py_SetStandardStreamEncoding`" msgstr ":c:func:`Py_SetStandardStreamEncoding`" -#: ../../whatsnew/3.11.rst:2578 +#: ../../whatsnew/3.11.rst:2576 msgid ":c:func:`_Py_SetProgramFullPath`" msgstr ":c:func:`_Py_SetProgramFullPath`" -#: ../../whatsnew/3.11.rst:2580 +#: ../../whatsnew/3.11.rst:2578 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`). (Contributed by Victor " "Stinner in :gh:`88279`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2584 +#: ../../whatsnew/3.11.rst:2582 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2593 +#: ../../whatsnew/3.11.rst:2591 msgid "" "The following C APIs have been deprecated in earlier Python releases, and " "will be removed in Python 3.12." msgstr "" -#: ../../whatsnew/3.11.rst:2596 +#: ../../whatsnew/3.11.rst:2594 msgid ":c:func:`PyUnicode_AS_DATA`" msgstr ":c:func:`PyUnicode_AS_DATA`" -#: ../../whatsnew/3.11.rst:2597 +#: ../../whatsnew/3.11.rst:2595 msgid ":c:func:`PyUnicode_AS_UNICODE`" msgstr ":c:func:`PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.11.rst:2598 +#: ../../whatsnew/3.11.rst:2596 msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.11.rst:2599 +#: ../../whatsnew/3.11.rst:2597 msgid ":c:func:`PyUnicode_AsUnicode`" msgstr ":c:func:`PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2600 +#: ../../whatsnew/3.11.rst:2598 msgid ":c:func:`PyUnicode_FromUnicode`" msgstr ":c:func:`PyUnicode_FromUnicode`" -#: ../../whatsnew/3.11.rst:2601 +#: ../../whatsnew/3.11.rst:2599 msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.11.rst:2602 +#: ../../whatsnew/3.11.rst:2600 msgid ":c:func:`PyUnicode_GET_SIZE`" msgstr ":c:func:`PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.11.rst:2603 +#: ../../whatsnew/3.11.rst:2601 msgid ":c:func:`PyUnicode_GetSize`" msgstr ":c:func:`PyUnicode_GetSize`" -#: ../../whatsnew/3.11.rst:2604 +#: ../../whatsnew/3.11.rst:2602 msgid ":c:func:`PyUnicode_IS_COMPACT`" msgstr ":c:func:`PyUnicode_IS_COMPACT`" -#: ../../whatsnew/3.11.rst:2605 +#: ../../whatsnew/3.11.rst:2603 msgid ":c:func:`PyUnicode_IS_READY`" msgstr ":c:func:`PyUnicode_IS_READY`" -#: ../../whatsnew/3.11.rst:2606 +#: ../../whatsnew/3.11.rst:2604 msgid ":c:func:`PyUnicode_READY`" msgstr ":c:func:`PyUnicode_READY`" -#: ../../whatsnew/3.11.rst:2607 +#: ../../whatsnew/3.11.rst:2605 msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" -#: ../../whatsnew/3.11.rst:2608 +#: ../../whatsnew/3.11.rst:2606 msgid ":c:func:`_PyUnicode_AsUnicode`" msgstr ":c:func:`_PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2609 +#: ../../whatsnew/3.11.rst:2607 msgid ":c:macro:`PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.11.rst:2610 +#: ../../whatsnew/3.11.rst:2608 msgid ":c:type:`PyUnicodeObject`" msgstr ":c:type:`PyUnicodeObject`" -#: ../../whatsnew/3.11.rst:2611 +#: ../../whatsnew/3.11.rst:2609 msgid ":c:func:`PyUnicode_InternImmortal()`" msgstr ":c:func:`PyUnicode_InternImmortal()`" -#: ../../whatsnew/3.11.rst:2619 +#: ../../whatsnew/3.11.rst:2617 msgid "" ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2623 +#: ../../whatsnew/3.11.rst:2621 msgid "Remove the following math macros using the ``errno`` variable:" msgstr "" -#: ../../whatsnew/3.11.rst:2625 +#: ../../whatsnew/3.11.rst:2623 msgid "``Py_ADJUST_ERANGE1()``" msgstr "``Py_ADJUST_ERANGE1()``" -#: ../../whatsnew/3.11.rst:2626 +#: ../../whatsnew/3.11.rst:2624 msgid "``Py_ADJUST_ERANGE2()``" msgstr "``Py_ADJUST_ERANGE2()``" -#: ../../whatsnew/3.11.rst:2627 +#: ../../whatsnew/3.11.rst:2625 msgid "``Py_OVERFLOWED()``" msgstr "``Py_OVERFLOWED()``" -#: ../../whatsnew/3.11.rst:2628 +#: ../../whatsnew/3.11.rst:2626 msgid "``Py_SET_ERANGE_IF_OVERFLOW()``" msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" -#: ../../whatsnew/3.11.rst:2629 +#: ../../whatsnew/3.11.rst:2627 msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2631 +#: ../../whatsnew/3.11.rst:2629 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2633 +#: ../../whatsnew/3.11.rst:2631 msgid "" "Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated " "since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()`` " @@ -4054,62 +4038,62 @@ msgid "" "(Contributed by Victor Stinner in :issue:`41123`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2638 +#: ../../whatsnew/3.11.rst:2636 msgid "" "Remove the ``pystrhex.h`` header file. It only contains private functions. C " "extensions should only include the main ```` header file. " "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2642 +#: ../../whatsnew/3.11.rst:2640 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" "`45440`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2646 +#: ../../whatsnew/3.11.rst:2644 msgid "" "The following items are no longer available when :c:macro:`Py_LIMITED_API` " "is defined:" msgstr "" -#: ../../whatsnew/3.11.rst:2649 +#: ../../whatsnew/3.11.rst:2647 msgid ":c:func:`PyMarshal_WriteLongToFile`" msgstr ":c:func:`PyMarshal_WriteLongToFile`" -#: ../../whatsnew/3.11.rst:2650 +#: ../../whatsnew/3.11.rst:2648 msgid ":c:func:`PyMarshal_WriteObjectToFile`" msgstr ":c:func:`PyMarshal_WriteObjectToFile`" -#: ../../whatsnew/3.11.rst:2651 +#: ../../whatsnew/3.11.rst:2649 msgid ":c:func:`PyMarshal_ReadObjectFromString`" msgstr ":c:func:`PyMarshal_ReadObjectFromString`" -#: ../../whatsnew/3.11.rst:2652 +#: ../../whatsnew/3.11.rst:2650 msgid ":c:func:`PyMarshal_WriteObjectToString`" msgstr ":c:func:`PyMarshal_WriteObjectToString`" -#: ../../whatsnew/3.11.rst:2653 +#: ../../whatsnew/3.11.rst:2651 msgid "the ``Py_MARSHAL_VERSION`` macro" msgstr "``Py_MARSHAL_VERSION`` 巨集" -#: ../../whatsnew/3.11.rst:2655 +#: ../../whatsnew/3.11.rst:2653 msgid "These are not part of the :ref:`limited API `." msgstr "" -#: ../../whatsnew/3.11.rst:2657 +#: ../../whatsnew/3.11.rst:2655 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2659 +#: ../../whatsnew/3.11.rst:2657 msgid "" "Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API. It never " "worked since the :c:type:`PyWeakReference` structure is opaque in the " "limited C API. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2664 +#: ../../whatsnew/3.11.rst:2662 msgid "" "Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed in the public " "C API by mistake, it must only be used by Python internally. Use the " @@ -4117,90 +4101,90 @@ msgid "" "in :issue:`40170`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2669 +#: ../../whatsnew/3.11.rst:2667 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2675 +#: ../../whatsnew/3.11.rst:2673 msgid "" "Remove the :c:type:`Py_UNICODE` encoder APIs, as they have been deprecated " "since Python 3.3, are little used and are inefficient relative to the " "recommended alternatives." msgstr "" -#: ../../whatsnew/3.11.rst:2680 +#: ../../whatsnew/3.11.rst:2678 msgid "The removed functions are:" msgstr "" -#: ../../whatsnew/3.11.rst:2682 +#: ../../whatsnew/3.11.rst:2680 msgid ":func:`!PyUnicode_Encode`" msgstr ":func:`!PyUnicode_Encode`" -#: ../../whatsnew/3.11.rst:2683 +#: ../../whatsnew/3.11.rst:2681 msgid ":func:`!PyUnicode_EncodeASCII`" msgstr ":func:`!PyUnicode_EncodeASCII`" -#: ../../whatsnew/3.11.rst:2684 +#: ../../whatsnew/3.11.rst:2682 msgid ":func:`!PyUnicode_EncodeLatin1`" msgstr ":func:`!PyUnicode_EncodeLatin1`" -#: ../../whatsnew/3.11.rst:2685 +#: ../../whatsnew/3.11.rst:2683 msgid ":func:`!PyUnicode_EncodeUTF7`" msgstr ":func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.11.rst:2686 +#: ../../whatsnew/3.11.rst:2684 msgid ":func:`!PyUnicode_EncodeUTF8`" msgstr ":func:`!PyUnicode_EncodeUTF8`" -#: ../../whatsnew/3.11.rst:2687 +#: ../../whatsnew/3.11.rst:2685 msgid ":func:`!PyUnicode_EncodeUTF16`" msgstr ":func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.11.rst:2688 +#: ../../whatsnew/3.11.rst:2686 msgid ":func:`!PyUnicode_EncodeUTF32`" msgstr ":func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.11.rst:2689 +#: ../../whatsnew/3.11.rst:2687 msgid ":func:`!PyUnicode_EncodeUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2690 +#: ../../whatsnew/3.11.rst:2688 msgid ":func:`!PyUnicode_EncodeRawUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeRawUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2691 +#: ../../whatsnew/3.11.rst:2689 msgid ":func:`!PyUnicode_EncodeCharmap`" msgstr ":func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.11.rst:2692 +#: ../../whatsnew/3.11.rst:2690 msgid ":func:`!PyUnicode_TranslateCharmap`" msgstr ":func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.11.rst:2693 +#: ../../whatsnew/3.11.rst:2691 msgid ":func:`!PyUnicode_EncodeDecimal`" msgstr ":func:`!PyUnicode_EncodeDecimal`" -#: ../../whatsnew/3.11.rst:2694 +#: ../../whatsnew/3.11.rst:2692 msgid ":func:`!PyUnicode_TransformDecimalToASCII`" msgstr ":func:`!PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.11.rst:2696 +#: ../../whatsnew/3.11.rst:2694 msgid "" "See :pep:`624` for details and :pep:`migration guidance <624#alternative-" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2702 +#: ../../whatsnew/3.11.rst:2700 msgid "Notable Changes in 3.11.4" msgstr "" -#: ../../whatsnew/3.11.rst:2705 +#: ../../whatsnew/3.11.rst:2703 msgid "tarfile" msgstr "" -#: ../../whatsnew/3.11.rst:2707 +#: ../../whatsnew/3.11.rst:2705 msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " @@ -4211,6 +4195,18 @@ msgid "" "Viktorin in :pep:`706`.)" msgstr "" +#~ msgid "Release" +#~ msgstr "發行版本" + +#~ msgid "|release|" +#~ msgstr "|release|" + +#~ msgid "Date" +#~ msgstr "日期" + +#~ msgid "|today|" +#~ msgstr "|today|" + #~ msgid "``x+x; x*x; x-x;``" #~ msgstr "``x+x; x*x; x-x;``" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 4da847bdcc..6eb53cbb34 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -425,7 +425,7 @@ msgid "" "strings even though the underlying platform may have a different " "convention. To bridge this gap, the :mod:`wsgiref` module has a new " "function, :func:`wsgiref.handlers.read_environ` for transcoding CGI " -"variables from :attr:`os.environ` into native strings and returning a new " +"variables from :data:`os.environ` into native strings and returning a new " "dictionary." msgstr "" @@ -482,7 +482,7 @@ msgstr "" msgid "" "The interpreter can now be started with a quiet option, ``-q``, to prevent " "the copyright and version information from being displayed in the " -"interactive mode. The option can be introspected using the :attr:`sys." +"interactive mode. The option can be introspected using the :data:`sys." "flags` attribute:" msgstr "" @@ -551,7 +551,7 @@ msgstr "(請見 :issue:`4617`\\ 。)" msgid "" "The internal :c:type:`structsequence` tool now creates subclasses of tuple. " "This means that C structures like those returned by :func:`os.stat`, :func:" -"`time.gmtime`, and :attr:`sys.version_info` now work like a :term:`named " +"`time.gmtime`, and :data:`sys.version_info` now work like a :term:`named " "tuple` and now work with functions and methods that expect a tuple as an " "argument. This is a big step forward in making the C structures as flexible " "as their pure Python counterparts:" @@ -587,8 +587,8 @@ msgstr "" #: ../../whatsnew/3.2.rst:598 msgid "" "A :exc:`ResourceWarning` is issued at interpreter shutdown if the :data:`gc." -"garbage` list isn't empty, and if :attr:`gc.DEBUG_UNCOLLECTABLE` is set, all " -"uncollectable objects are printed. This is meant to make the programmer " +"garbage` list isn't empty, and if :const:`gc.DEBUG_UNCOLLECTABLE` is set, " +"all uncollectable objects are printed. This is meant to make the programmer " "aware that their code contains object finalization issues." msgstr "" @@ -614,7 +614,7 @@ msgid "" "of an effort to make more objects fully implement the :class:`collections." "Sequence` :term:`abstract base class`. As a result, the language will have " "a more uniform API. In addition, :class:`range` objects now support slicing " -"and negative indices, even with values larger than :attr:`sys.maxsize`. " +"and negative indices, even with values larger than :data:`sys.maxsize`. " "This makes *range* more interoperable with lists::" msgstr "" @@ -1097,7 +1097,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1007 msgid "" "Whenever a two-digit year is used in a time tuple, the interpretation has " -"been governed by :attr:`time.accept2dyear`. The default is ``True`` which " +"been governed by :data:`time.accept2dyear`. The default is ``True`` which " "means that for a two-digit year, the century is guessed according to the " "POSIX rules governing the ``%y`` strptime format." msgstr "" @@ -1105,14 +1105,14 @@ msgstr "" #: ../../whatsnew/3.2.rst:1012 msgid "" "Starting with Py3.2, use of the century guessing heuristic will emit a :exc:" -"`DeprecationWarning`. Instead, it is recommended that :attr:`time." +"`DeprecationWarning`. Instead, it is recommended that :data:`time." "accept2dyear` be set to ``False`` so that large date ranges can be used " "without guesswork::" msgstr "" #: ../../whatsnew/3.2.rst:1031 msgid "" -"Several functions now have significantly expanded date ranges. When :attr:" +"Several functions now have significantly expanded date ranges. When :data:" "`time.accept2dyear` is false, the :func:`time.asctime` function will accept " "any year that fits in a C int, while the :func:`time.mktime` and :func:`time." "strftime` functions will accept the full range supported by the " @@ -1263,10 +1263,10 @@ msgstr "" msgid "" "If no configuration is set-up before a logging event occurs, there is now a " "default configuration using a :class:`~logging.StreamHandler` directed to :" -"attr:`sys.stderr` for events of ``WARNING`` level or higher. Formerly, an " +"data:`sys.stderr` for events of ``WARNING`` level or higher. Formerly, an " "event occurring before a configuration was set-up would either raise an " -"exception or silently drop the event depending on the value of :attr:" -"`logging.raiseExceptions`. The new default handler is stored in :attr:" +"exception or silently drop the event depending on the value of :data:" +"`logging.raiseExceptions`. The new default handler is stored in :data:" "`logging.lastResort`." msgstr "" @@ -1384,7 +1384,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1300 msgid "" -"Some of the hashing details are exposed through a new attribute, :attr:`sys." +"Some of the hashing details are exposed through a new attribute, :data:`sys." "hash_info`, which describes the bit width of the hash value, the prime " "modulus, the hash values for *infinity* and *nan*, and the multiplier used " "for the imaginary part of a number:" @@ -1492,7 +1492,7 @@ msgstr "select" #: ../../whatsnew/3.2.rst:1388 msgid "" -"The :mod:`select` module now exposes a new, constant attribute, :attr:" +"The :mod:`select` module now exposes a new, constant attribute, :const:" "`~select.PIPE_BUF`, which gives the minimum number of bytes which are " "guaranteed not to block when :func:`select.select` says a pipe is ready for " "writing." @@ -1617,7 +1617,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1529 msgid "" "Some operating systems allow direct access to encoded bytes in the " -"environment. If so, the :attr:`os.supports_bytes_environ` constant will be " +"environment. If so, the :const:`os.supports_bytes_environ` constant will be " "true." msgstr "" @@ -1795,8 +1795,8 @@ msgstr "" #: ../../whatsnew/3.2.rst:1666 msgid "" "The version of OpenSSL being used is now accessible using the module " -"attributes :data:`ssl.OPENSSL_VERSION` (a string), :data:`ssl." -"OPENSSL_VERSION_INFO` (a 5-tuple), and :data:`ssl.OPENSSL_VERSION_NUMBER` " +"attributes :const:`ssl.OPENSSL_VERSION` (a string), :const:`ssl." +"OPENSSL_VERSION_INFO` (a 5-tuple), and :const:`ssl.OPENSSL_VERSION_NUMBER` " "(an integer)." msgstr "" @@ -2529,7 +2529,7 @@ msgstr "turtledemo" msgid "" "The demonstration code for the :mod:`turtle` module was moved from the " "*Demo* directory to main library. It includes over a dozen sample scripts " -"with lively displays. Being on :attr:`sys.path`, it can now be run directly " +"with lively displays. Being on :data:`sys.path`, it can now be run directly " "from the command-line:" msgstr "" @@ -2952,7 +2952,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2566 msgid "" "A new C API function :c:func:`PySys_SetArgvEx` allows an embedded " -"interpreter to set :attr:`sys.argv` without also modifying :attr:`sys.path` " +"interpreter to set :data:`sys.argv` without also modifying :data:`sys.path` " "(:issue:`5753`)." msgstr "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 4e5a1a96a2..5a05064b53 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:30+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -801,7 +801,7 @@ msgstr "" msgid "" "A new attribute on the :mod:`sys` module exposes details specific to the " "implementation of the currently running interpreter. The initial set of " -"attributes on :attr:`sys.implementation` are ``name``, ``version``, " +"attributes on :data:`sys.implementation` are ``name``, ``version``, " "``hexversion``, and ``cache_tag``." msgstr "" @@ -904,7 +904,7 @@ msgstr "" msgid "" "In terms of finders, :class:`importlib.machinery.FileFinder` exposes the " "mechanism used to search for source and bytecode files of a module. " -"Previously this class was an implicit member of :attr:`sys.path_hooks`." +"Previously this class was an implicit member of :data:`sys.path_hooks`." msgstr "" #: ../../whatsnew/3.3.rst:723 @@ -928,7 +928,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:736 msgid "" "The :func:`importlib.invalidate_caches` function will now call the method " -"with the same name on all finders cached in :attr:`sys.path_importer_cache` " +"with the same name on all finders cached in :data:`sys.path_importer_cache` " "to help clean up any stored state as necessary." msgstr "" @@ -945,8 +945,8 @@ msgstr "" #: ../../whatsnew/3.3.rst:746 msgid "" "Beyond the expanse of what :mod:`importlib` now exposes, there are other " -"visible changes to import. The biggest is that :attr:`sys.meta_path` and :" -"attr:`sys.path_hooks` now store all of the meta path finders and path entry " +"visible changes to import. The biggest is that :data:`sys.meta_path` and :" +"data:`sys.path_hooks` now store all of the meta path finders and path entry " "hooks used by import. Previously the finders were implicit and hidden " "within the C code of import instead of being directly exposed. This means " "that one can now easily remove or change the order of the various finders to " @@ -972,9 +972,9 @@ msgstr "" #: ../../whatsnew/3.3.rst:763 msgid "" -"``None`` is now inserted into :attr:`sys.path_importer_cache` when no finder " -"can be found on :attr:`sys.path_hooks`. Since :class:`imp.NullImporter` is " -"not directly exposed on :attr:`sys.path_hooks` it could no longer be relied " +"``None`` is now inserted into :data:`sys.path_importer_cache` when no finder " +"can be found on :data:`sys.path_hooks`. Since :class:`imp.NullImporter` is " +"not directly exposed on :data:`sys.path_hooks` it could no longer be relied " "upon to always be available to use as a value representing no finder found." msgstr "" @@ -1107,7 +1107,7 @@ msgstr "" msgid "" ":func:`open` gets a new *opener* parameter: the underlying file descriptor " "for the file object is then obtained by calling *opener* with (*file*, " -"*flags*). It can be used to use custom flags like :data:`os.O_CLOEXEC` for " +"*flags*). It can be used to use custom flags like :const:`os.O_CLOEXEC` for " "example. The ``'x'`` mode was added: open for exclusive creation, failing if " "the file already exists." msgstr "" @@ -1600,7 +1600,7 @@ msgstr "" msgid "" "If Python is compiled without threads, the C version automatically disables " "the expensive thread local context machinery. In this case, the variable :" -"data:`~decimal.HAVE_THREADS` is set to ``False``." +"const:`~decimal.HAVE_THREADS` is set to ``False``." msgstr "" #: ../../whatsnew/3.3.rst:1134 @@ -2217,7 +2217,7 @@ msgstr "os" #: ../../whatsnew/3.3.rst:1577 msgid "" "The :mod:`os` module has a new :func:`~os.pipe2` function that makes it " -"possible to create a pipe with :data:`~os.O_CLOEXEC` or :data:`~os." +"possible to create a pipe with :const:`~os.O_CLOEXEC` or :const:`~os." "O_NONBLOCK` flags set atomically. This is especially useful to avoid race " "conditions in multi-threaded programs." msgstr "" @@ -2425,10 +2425,10 @@ msgstr "" #: ../../whatsnew/3.3.rst:1693 msgid "" -"New constants :data:`~os.RTLD_LAZY`, :data:`~os.RTLD_NOW`, :data:`~os." -"RTLD_GLOBAL`, :data:`~os.RTLD_LOCAL`, :data:`~os.RTLD_NODELETE`, :data:`~os." -"RTLD_NOLOAD`, and :data:`~os.RTLD_DEEPBIND` are available on platforms that " -"support them. These are for use with the :func:`sys.setdlopenflags` " +"New constants :const:`~os.RTLD_LAZY`, :const:`~os.RTLD_NOW`, :const:`~os." +"RTLD_GLOBAL`, :const:`~os.RTLD_LOCAL`, :const:`~os.RTLD_NODELETE`, :const:" +"`~os.RTLD_NOLOAD`, and :const:`~os.RTLD_DEEPBIND` are available on platforms " +"that support them. These are for use with the :func:`sys.setdlopenflags` " "function, and supersede the similar constants defined in :mod:`ctypes` and :" "mod:`DLFCN`. (Contributed by Victor Stinner in :issue:`13226`.)" msgstr "" @@ -2852,7 +2852,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1952 msgid "" "You can query the SSL compression algorithm used by an SSL socket, thanks to " -"its new :meth:`~ssl.SSLSocket.compression` method. The new attribute :attr:" +"its new :meth:`~ssl.SSLSocket.compression` method. The new attribute :const:" "`~ssl.OP_NO_COMPRESSION` can be used to disable compression. (Contributed by " "Antoine Pitrou in :issue:`13634`.)" msgstr "" @@ -2879,7 +2879,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1968 msgid "" -"New attribute :attr:`~ssl.OP_CIPHER_SERVER_PREFERENCE` allows setting SSLv3 " +"New attribute :const:`~ssl.OP_CIPHER_SERVER_PREFERENCE` allows setting SSLv3 " "server sockets to use the server's cipher ordering preference rather than " "the client's (:issue:`13635`)." msgstr "" @@ -2905,9 +2905,9 @@ msgstr "struct" #: ../../whatsnew/3.3.rst:1986 msgid "" -"The :mod:`struct` module now supports ``ssize_t`` and ``size_t`` via the new " -"codes ``n`` and ``N``, respectively. (Contributed by Antoine Pitrou in :" -"issue:`3163`.)" +"The :mod:`struct` module now supports :c:type:`ssize_t` and :c:type:`size_t` " +"via the new codes ``n`` and ``N``, respectively. (Contributed by Antoine " +"Pitrou in :issue:`3163`.)" msgstr "" #: ../../whatsnew/3.3.rst:1992 @@ -2922,7 +2922,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1997 msgid "" -"A new constant :data:`~subprocess.DEVNULL` allows suppressing output in a " +"A new constant :const:`~subprocess.DEVNULL` allows suppressing output in a " "platform-independent fashion. (Contributed by Ross Lagerwall in :issue:" "`5870`.)" msgstr "" @@ -3139,7 +3139,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2143 msgid "" -"New attribute :attr:`zlib.ZLIB_RUNTIME_VERSION` reports the version string " +"New attribute :const:`zlib.ZLIB_RUNTIME_VERSION` reports the version string " "of the underlying ``zlib`` library that is loaded at runtime. (Contributed " "by Torsten Landschoff in :issue:`12306`.)" msgstr "" @@ -3638,18 +3638,18 @@ msgstr "" #: ../../whatsnew/3.3.rst:2380 msgid "" -"Because :attr:`sys.meta_path` and :attr:`sys.path_hooks` now have finders on " +"Because :data:`sys.meta_path` and :data:`sys.path_hooks` now have finders on " "them by default, you will most likely want to use :meth:`list.insert` " "instead of :meth:`list.append` to add to those lists." msgstr "" #: ../../whatsnew/3.3.rst:2384 msgid "" -"Because ``None`` is now inserted into :attr:`sys.path_importer_cache`, if " +"Because ``None`` is now inserted into :data:`sys.path_importer_cache`, if " "you are clearing out entries in the dictionary of paths that do not have a " "finder, you will need to remove keys paired with values of ``None`` **and** :" "class:`imp.NullImporter` to be backwards-compatible. This will lead to extra " -"overhead on older versions of Python that re-insert ``None`` into :attr:`sys." +"overhead on older versions of Python that re-insert ``None`` into :data:`sys." "path_importer_cache` where it represents the use of implicit finders, but " "semantically it should not change anything." msgstr "" @@ -3743,7 +3743,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2446 msgid "" "The ``ast.__version__`` constant has been removed. If you need to make " -"decisions affected by the AST version, use :attr:`sys.version_info` to make " +"decisions affected by the AST version, use :data:`sys.version_info` to make " "the decision." msgstr "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index a767afbf0a..32aaa0f46c 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1031,7 +1031,7 @@ msgstr "doctest" #: ../../whatsnew/3.4.rst:778 msgid "" -"A new :ref:`option flag `, :data:`~doctest.FAIL_FAST`, " +"A new :ref:`option flag `, :const:`~doctest.FAIL_FAST`, " "halts test running as soon as the first failure is detected. (Contributed " "by R. David Murray and Daniel Urban in :issue:`16522`.)" msgstr "" @@ -1120,7 +1120,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:844 msgid "" -"New module attribute :data:`~filecmp.DEFAULT_IGNORES` provides the list of " +"New module attribute :const:`~filecmp.DEFAULT_IGNORES` provides the list of " "directories that are used as the default value for the *ignore* parameter of " "the :func:`~filecmp.dircmp` function. (Contributed by Eli Bendersky in :" "issue:`15442`.)" @@ -1609,11 +1609,12 @@ msgstr "" #: ../../whatsnew/3.4.rst:1191 msgid "" -":func:`os.open` supports two new flags on platforms that provide them, :data:" -"`~os.O_PATH` (un-opened file descriptor), and :data:`~os.O_TMPFILE` (unnamed " -"temporary file; as of 3.4.0 release available only on Linux systems with a " -"kernel version of 3.11 or newer that have uapi headers). (Contributed by " -"Christian Heimes in :issue:`18673` and Benjamin Peterson, respectively.)" +":func:`os.open` supports two new flags on platforms that provide them, :" +"const:`~os.O_PATH` (un-opened file descriptor), and :const:`~os.O_TMPFILE` " +"(unnamed temporary file; as of 3.4.0 release available only on Linux systems " +"with a kernel version of 3.11 or newer that have uapi headers). " +"(Contributed by Christian Heimes in :issue:`18673` and Benjamin Peterson, " +"respectively.)" msgstr "" #: ../../whatsnew/3.4.rst:1199 @@ -1673,9 +1674,9 @@ msgid "" "stdlib serialization protocols, with new :func:`~plistlib.load`, :func:" "`~plistlib.dump`, :func:`~plistlib.loads`, and :func:`~plistlib.dumps` " "functions. (The older API is now deprecated.) In addition to the already " -"supported XML plist format (:data:`~plistlib.FMT_XML`), it also now supports " -"the binary plist format (:data:`~plistlib.FMT_BINARY`). (Contributed by " -"Ronald Oussoren and others in :issue:`14455`.)" +"supported XML plist format (:const:`~plistlib.FMT_XML`), it also now " +"supports the binary plist format (:const:`~plistlib.FMT_BINARY`). " +"(Contributed by Ronald Oussoren and others in :issue:`14455`.)" msgstr "" #: ../../whatsnew/3.4.rst:1247 @@ -1793,16 +1794,16 @@ msgstr "" #: ../../whatsnew/3.4.rst:1325 msgid "" "On Linux kernel version 2.6.36 or later, there are also some new Linux " -"specific constants: :attr:`~resource.RLIMIT_MSGQUEUE`, :attr:`~resource." -"RLIMIT_NICE`, :attr:`~resource.RLIMIT_RTPRIO`, :attr:`~resource." -"RLIMIT_RTTIME`, and :attr:`~resource.RLIMIT_SIGPENDING`. (Contributed by " +"specific constants: :const:`~resource.RLIMIT_MSGQUEUE`, :const:`~resource." +"RLIMIT_NICE`, :const:`~resource.RLIMIT_RTPRIO`, :const:`~resource." +"RLIMIT_RTTIME`, and :const:`~resource.RLIMIT_SIGPENDING`. (Contributed by " "Christian Heimes in :issue:`19324`.)" msgstr "" #: ../../whatsnew/3.4.rst:1331 msgid "" "On FreeBSD version 9 and later, there some new FreeBSD specific constants: :" -"attr:`~resource.RLIMIT_SBSIZE`, :attr:`~resource.RLIMIT_SWAP`, and :attr:" +"const:`~resource.RLIMIT_SBSIZE`, :const:`~resource.RLIMIT_SWAP`, and :const:" "`~resource.RLIMIT_NPTS`. (Contributed by Claudiu Popa in :issue:`19343`.)" msgstr "" @@ -1880,7 +1881,7 @@ msgstr "socket" #: ../../whatsnew/3.4.rst:1391 msgid "" -"The socket module now supports the :data:`~socket.CAN_BCM` protocol on " +"The socket module now supports the :const:`~socket.CAN_BCM` protocol on " "platforms that support it. (Contributed by Brian Thorne in :issue:`15359`.)" msgstr "" @@ -1899,7 +1900,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.4.rst:1402 -msgid "The :data:`~socket.AF_LINK` constant is now available on BSD and OSX." +msgid "The :const:`~socket.AF_LINK` constant is now available on BSD and OSX." msgstr "" #: ../../whatsnew/3.4.rst:1404 @@ -1978,10 +1979,10 @@ msgid "" "If OpenSSL 0.9.8 or later is available, :class:`~ssl.SSLContext` has a new " "attribute :attr:`~ssl.SSLContext.verify_flags` that can be used to control " "the certificate verification process by setting it to some combination of " -"the new constants :data:`~ssl.VERIFY_DEFAULT`, :data:`~ssl." -"VERIFY_CRL_CHECK_LEAF`, :data:`~ssl.VERIFY_CRL_CHECK_CHAIN`, or :data:`~ssl." -"VERIFY_X509_STRICT`. OpenSSL does not do any CRL verification by default. " -"(Contributed by Christien Heimes in :issue:`8813`.)" +"the new constants :const:`~ssl.VERIFY_DEFAULT`, :const:`~ssl." +"VERIFY_CRL_CHECK_LEAF`, :const:`~ssl.VERIFY_CRL_CHECK_CHAIN`, or :const:" +"`~ssl.VERIFY_X509_STRICT`. OpenSSL does not do any CRL verification by " +"default. (Contributed by Christien Heimes in :issue:`8813`.)" msgstr "" #: ../../whatsnew/3.4.rst:1468 @@ -2033,8 +2034,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:1502 msgid "" "The module supports new :mod:`~stat.ST_MODE` flags, :mod:`~stat.S_IFDOOR`, :" -"attr:`~stat.S_IFPORT`, and :attr:`~stat.S_IFWHT`. (Contributed by Christian " -"Hiemes in :issue:`11016`.)" +"const:`~stat.S_IFPORT`, and :const:`~stat.S_IFWHT`. (Contributed by " +"Christian Hiemes in :issue:`11016`.)" msgstr "" #: ../../whatsnew/3.4.rst:1508 @@ -2505,7 +2506,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:1852 msgid "" -"The PEP adds additional fields to the :attr:`sys.hash_info` named tuple to " +"The PEP adds additional fields to the :data:`sys.hash_info` named tuple to " "describe the hash algorithm in use by the currently executing binary. " "Otherwise, the PEP does not alter any existing CPython APIs." msgstr "" @@ -3270,9 +3271,9 @@ msgstr "" msgid "" ":func:`base64.b32decode` now raises a :exc:`binascii.Error` when the input " "string contains non-b32-alphabet characters, instead of a :exc:`TypeError`. " -"This particular :exc:`TypeError` was missed when the other :exc:`TypeError`" -"\\ s were converted. (Contributed by Serhiy Storchaka in :issue:`18011`.) " -"Note: this change was also inadvertently applied in Python 3.3.3." +"This particular :exc:`TypeError` was missed when the other :exc:" +"`TypeError`\\ s were converted. (Contributed by Serhiy Storchaka in :issue:" +"`18011`.) Note: this change was also inadvertently applied in Python 3.3.3." msgstr "" #: ../../whatsnew/3.4.rst:2373 diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 9b1d89f28e..527a0bf6f3 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -531,7 +531,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:481 msgid "" -"An :py:data:`errno.EINTR` error code is returned whenever a system call, " +"An :py:const:`errno.EINTR` error code is returned whenever a system call, " "that is waiting for I/O, is interrupted by a signal. Previously, Python " "would raise :exc:`InterruptedError` in such cases. This meant that, when " "writing a Python application, the developer had two choices:" @@ -598,7 +598,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:529 msgid "" -"special cases: :func:`os.close` and :func:`os.dup2` now ignore :py:data:" +"special cases: :func:`os.close` and :func:`os.dup2` now ignore :py:const:" "`~errno.EINTR` errors; the syscall is not retried (see the PEP for the " "rationale);" msgstr "" @@ -1261,10 +1261,9 @@ msgstr "curses" #: ../../whatsnew/3.5.rst:1048 msgid "" -"The new :func:`~curses.update_lines_cols` function updates the :envvar:" -"`LINES` and :envvar:`COLS` environment variables. This is useful for " -"detecting manual screen resizing. (Contributed by Arnon Yaari in :issue:" -"`4254`.)" +"The new :func:`~curses.update_lines_cols` function updates the :data:`LINES` " +"and :data:`COLS` module variables. This is useful for detecting manual " +"screen resizing. (Contributed by Arnon Yaari in :issue:`4254`.)" msgstr "" #: ../../whatsnew/3.5.rst:1054 @@ -1822,7 +1821,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1500 msgid "" "New :func:`~os.get_blocking` and :func:`~os.set_blocking` functions allow " -"getting and setting a file descriptor's blocking mode (:data:`~os." +"getting and setting a file descriptor's blocking mode (:const:`~os." "O_NONBLOCK`.) (Contributed by Victor Stinner in :issue:`22054`.)" msgstr "" @@ -2196,8 +2195,8 @@ msgstr "" msgid "" "The new :meth:`SSLSocket.selected_alpn_protocol() ` returns the protocol that was selected during the " -"TLS handshake. The :data:`~ssl.HAS_ALPN` flag indicates whether ALPN support " -"is present." +"TLS handshake. The :const:`~ssl.HAS_ALPN` flag indicates whether ALPN " +"support is present." msgstr "" #: ../../whatsnew/3.5.rst:1790 @@ -2791,8 +2790,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:2194 msgid "" "A new :c:func:`PyErr_FormatV` function similar to :c:func:`PyErr_Format`, " -"but accepts a ``va_list`` argument. (Contributed by Antoine Pitrou in :issue:" -"`18711`.)" +"but accepts a :c:type:`va_list` argument. (Contributed by Antoine Pitrou in :" +"issue:`18711`.)" msgstr "" #: ../../whatsnew/3.5.rst:2198 @@ -3224,7 +3223,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2479 msgid "" -"The :mod:`socket` module now exports the :data:`~socket.CAN_RAW_FD_FRAMES` " +"The :mod:`socket` module now exports the :const:`~socket.CAN_RAW_FD_FRAMES` " "constant on linux 3.6 and greater." msgstr "" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 4dfba6697f..ff3779352e 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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" @@ -754,8 +754,9 @@ msgstr "" #: ../../whatsnew/3.6.rst:652 msgid "" "Check that the :term:`GIL ` is held when allocator " -"functions of :c:data:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) and :" -"c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are called." +"functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " +"and :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are " +"called." msgstr "" #: ../../whatsnew/3.6.rst:656 @@ -1767,7 +1768,7 @@ msgstr "site" #: ../../whatsnew/3.6.rst:1391 msgid "" -"When specifying paths to add to :attr:`sys.path` in a ``.pth`` file, you may " +"When specifying paths to add to :data:`sys.path` in a ``.pth`` file, you may " "now specify file paths on top of directories (e.g. zip files). (Contributed " "by Wolfgang Langner in :issue:`26587`)." msgstr "" @@ -1788,7 +1789,7 @@ msgstr "socket" #: ../../whatsnew/3.6.rst:1406 msgid "" -"The :func:`~socket.socket.ioctl` function now supports the :data:`~socket." +"The :func:`~socket.socket.ioctl` function now supports the :const:`~socket." "SIO_LOOPBACK_FAST_PATH` control code. (Contributed by Daniel Stokes in :" "issue:`26536`.)" msgstr "" @@ -1809,7 +1810,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1418 msgid "" -"The socket module now supports the address family :data:`~socket.AF_ALG` to " +"The socket module now supports the address family :const:`~socket.AF_ALG` to " "interface with Linux Kernel crypto API. ``ALG_*``, ``SOL_ALG`` and :meth:" "`~socket.socket.sendmsg_afalg` were added. (Contributed by Christian Heimes " "in :issue:`27744` with support from Victor Stinner.)" @@ -2355,7 +2356,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1824 msgid "" -"Allocator functions of the :c:func:`PyMem_Malloc` domain (:c:data:" +"Allocator functions of the :c:func:`PyMem_Malloc` domain (:c:macro:" "`PYMEM_DOMAIN_MEM`) now use the :ref:`pymalloc memory allocator ` " "instead of :c:func:`malloc` function of the C library. The pymalloc " "allocator is optimized for objects smaller or equal to 512 bytes with a " @@ -2438,8 +2439,9 @@ msgstr "" #: ../../whatsnew/3.6.rst:1876 msgid "" "The :term:`GIL ` must now be held when allocator " -"functions of :c:data:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) and :" -"c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are called." +"functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " +"and :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are " +"called." msgstr "" #: ../../whatsnew/3.6.rst:1880 @@ -2618,7 +2620,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2012 msgid "" "The :class:`importlib.machinery.WindowsRegistryFinder` class is now " -"deprecated. As of 3.6.0, it is still added to :attr:`sys.meta_path` by " +"deprecated. As of 3.6.0, it is still added to :data:`sys.meta_path` by " "default (on Windows), but this may change in future releases." msgstr "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index e811b6763c..ad5b32706f 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1740,8 +1740,8 @@ msgstr "" #: ../../whatsnew/3.7.rst:1243 msgid "" -":func:`re.split` now supports splitting on a pattern like ``r'\\b'``, ``'^" -"$'`` or ``(?=-)`` that matches an empty string. (Contributed by Serhiy " +":func:`re.split` now supports splitting on a pattern like ``r'\\b'``, " +"``'^$'`` or ``(?=-)`` that matches an empty string. (Contributed by Serhiy " "Storchaka in :issue:`25054`.)" msgstr "" @@ -1801,15 +1801,15 @@ msgstr "" #: ../../whatsnew/3.7.rst:1283 msgid "" -"The :mod:`socket` module now exposes the :data:`socket.TCP_CONGESTION` " -"(Linux 2.6.13), :data:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37), and :data:" +"The :mod:`socket` module now exposes the :const:`socket.TCP_CONGESTION` " +"(Linux 2.6.13), :const:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37), and :const:" "`socket.TCP_NOTSENT_LOWAT` (Linux 3.12) constants. (Contributed by Omar " "Sandoval in :issue:`26273` and Nathaniel J. Smith in :issue:`29728`.)" msgstr "" #: ../../whatsnew/3.7.rst:1289 msgid "" -"Support for :data:`socket.AF_VSOCK` sockets has been added to allow " +"Support for :const:`socket.AF_VSOCK` sockets has been added to allow " "communication between virtual machines and their hosts. (Contributed by " "Cathy Avery in :issue:`27584`.)" msgstr "" @@ -1962,7 +1962,7 @@ msgstr "subprocess" msgid "" "The :func:`subprocess.run` function accepts the new *capture_output* keyword " "argument. When true, stdout and stderr will be captured. This is equivalent " -"to passing :data:`subprocess.PIPE` as *stdout* and *stderr* arguments. " +"to passing :const:`subprocess.PIPE` as *stdout* and *stderr* arguments. " "(Contributed by Bo Bayles in :issue:`32102`.)" msgstr "" @@ -2034,20 +2034,20 @@ msgstr "" #: ../../whatsnew/3.7.rst:1456 msgid "" -":data:`time.CLOCK_BOOTTIME` (Linux): Identical to :data:`time." +":const:`time.CLOCK_BOOTTIME` (Linux): Identical to :const:`time." "CLOCK_MONOTONIC`, except it also includes any time that the system is " "suspended." msgstr "" #: ../../whatsnew/3.7.rst:1459 msgid "" -":data:`time.CLOCK_PROF` (FreeBSD, NetBSD and OpenBSD): High-resolution per-" +":const:`time.CLOCK_PROF` (FreeBSD, NetBSD and OpenBSD): High-resolution per-" "process CPU timer." msgstr "" #: ../../whatsnew/3.7.rst:1461 msgid "" -":data:`time.CLOCK_UPTIME` (FreeBSD, OpenBSD): Time whose absolute value is " +":const:`time.CLOCK_UPTIME` (FreeBSD, OpenBSD): Time whose absolute value is " "the time the system has been running and not suspended, providing accurate " "uptime measurement." msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 939ba69ba3..efa8b921d2 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -1593,8 +1593,8 @@ msgstr "time" #: ../../whatsnew/3.8.rst:1305 msgid "" -"Added new clock :data:`~time.CLOCK_UPTIME_RAW` for macOS 10.12. (Contributed " -"by Joannah Nanjekye in :issue:`35702`.)" +"Added new clock :const:`~time.CLOCK_UPTIME_RAW` for macOS 10.12. " +"(Contributed by Joannah Nanjekye in :issue:`35702`.)" msgstr "" #: ../../whatsnew/3.8.rst:1310 @@ -2390,7 +2390,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1839 msgid "" -"On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " +"On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. Since older " "Python versions include the version number, so it is recommended to always " "use ``sys.platform.startswith('aix')``. (Contributed by M. Felt in :issue:" @@ -2727,7 +2727,7 @@ msgid "" "extension types across feature releases, anymore. A :c:type:`PyTypeObject` " "exported by a third-party extension module is supposed to have all the slots " "expected in the current Python version, including :c:member:`~PyTypeObject." -"tp_finalize` (:const:`Py_TPFLAGS_HAVE_FINALIZE` is not checked anymore " +"tp_finalize` (:c:macro:`Py_TPFLAGS_HAVE_FINALIZE` is not checked anymore " "before reading :c:member:`~PyTypeObject.tp_finalize`)." msgstr "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index cfe262469f..e7e73ce213 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:29+0000\n" +"POT-Creation-Date: 2023-07-26 18:59+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-" @@ -599,8 +599,9 @@ msgstr "fcntl" #: ../../whatsnew/3.9.rst:430 msgid "" -"Added constants :data:`~fcntl.F_OFD_GETLK`, :data:`~fcntl.F_OFD_SETLK` and :" -"data:`~fcntl.F_OFD_SETLKW`. (Contributed by Dong-hee Na in :issue:`38602`.)" +"Added constants :const:`~fcntl.F_OFD_GETLK`, :const:`~fcntl.F_OFD_SETLK` " +"and :const:`~fcntl.F_OFD_SETLKW`. (Contributed by Dong-hee Na in :issue:" +"`38602`.)" msgstr "" #: ../../whatsnew/3.9.rst:435 @@ -868,13 +869,13 @@ msgstr "os" #: ../../whatsnew/3.9.rst:596 msgid "" -"Added :data:`~os.CLD_KILLED` and :data:`~os.CLD_STOPPED` for :attr:" +"Added :const:`~os.CLD_KILLED` and :const:`~os.CLD_STOPPED` for :attr:" "`si_code`. (Contributed by Dong-hee Na in :issue:`38493`.)" msgstr "" #: ../../whatsnew/3.9.rst:599 msgid "" -"Exposed the Linux-specific :func:`os.pidfd_open` (:issue:`38692`) and :data:" +"Exposed the Linux-specific :func:`os.pidfd_open` (:issue:`38692`) and :const:" "`os.P_PIDFD` (:issue:`38713`) for process management with file descriptors." msgstr "" @@ -994,14 +995,14 @@ msgstr "socket" #: ../../whatsnew/3.9.rst:672 msgid "" -"The :mod:`socket` module now exports the :data:`~socket." +"The :mod:`socket` module now exports the :const:`~socket." "CAN_RAW_JOIN_FILTERS` constant on Linux 4.1 and greater. (Contributed by " "Stefan Tatschner and Zackery Spytz in :issue:`25780`.)" msgstr "" #: ../../whatsnew/3.9.rst:676 msgid "" -"The socket module now supports the :data:`~socket.CAN_J1939` protocol on " +"The socket module now supports the :const:`~socket.CAN_J1939` protocol on " "platforms that support it. (Contributed by Karl Ding in :issue:`40291`.)" msgstr "" @@ -1030,7 +1031,7 @@ msgstr "sys" #: ../../whatsnew/3.9.rst:695 msgid "" -"Added a new :attr:`sys.platlibdir` attribute: name of the platform-specific " +"Added a new :data:`sys.platlibdir` attribute: name of the platform-specific " "library directory. It is used to build the path of standard library and the " "paths of installed extension modules. It is equal to ``\"lib\"`` on most " "platforms. On Fedora and SuSE, it is equal to ``\"lib64\"`` on 64-bit " @@ -1040,7 +1041,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:701 msgid "" -"Previously, :attr:`sys.stderr` was block-buffered when non-interactive. Now " +"Previously, :data:`sys.stderr` was block-buffered when non-interactive. Now " "``stderr`` defaults to always being line-buffered. (Contributed by Jendrik " "Seipp in :issue:`13601`.)" msgstr "" @@ -1568,7 +1569,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1086 msgid "" -"The :meth:`select.epoll.unregister` method no longer ignores the :data:" +"The :meth:`select.epoll.unregister` method no longer ignores the :const:" "`~errno.EBADF` error. (Contributed by Victor Stinner in :issue:`39239`.)" msgstr "" @@ -1619,10 +1620,10 @@ msgstr "" #: ../../whatsnew/3.9.rst:1118 msgid "" -"``array('u')`` now uses ``wchar_t`` as C type instead of ``Py_UNICODE``. " -"This change doesn't affect to its behavior because ``Py_UNICODE`` is alias " -"of ``wchar_t`` since Python 3.3. (Contributed by Inada Naoki in :issue:" -"`34538`.)" +"``array('u')`` now uses :c:type:`wchar_t` as C type instead of " +"``Py_UNICODE``. This change doesn't affect to its behavior because " +"``Py_UNICODE`` is alias of :c:type:`wchar_t` since Python 3.3. (Contributed " +"by Inada Naoki in :issue:`34538`.)" msgstr "" #: ../../whatsnew/3.9.rst:1123 @@ -1751,8 +1752,8 @@ msgstr "" #: ../../whatsnew/3.9.rst:1228 msgid "" "Added ``--with-platlibdir`` option to the ``configure`` script: name of the " -"platform-specific library directory, stored in the new :attr:`sys." -"platlibdir` attribute. See :attr:`sys.platlibdir` attribute for more " +"platform-specific library directory, stored in the new :data:`sys." +"platlibdir` attribute. See :data:`sys.platlibdir` attribute for more " "information. (Contributed by Jan Matějek, Matěj Cepl, Charalampos Stratakis " "and Victor Stinner in :issue:`1294959`.)" msgstr "" @@ -1817,7 +1818,7 @@ msgstr "" msgid "" ":pep:`573`: Added :c:func:`PyType_FromModuleAndSpec` to associate a module " "with a class; :c:func:`PyType_GetModule` and :c:func:`PyType_GetModuleState` " -"to retrieve the module and its state; and :c:data:`PyCMethod` and :c:data:" +"to retrieve the module and its state; and :c:type:`PyCMethod` and :c:macro:" "`METH_METHOD` to allow a method to access the class it was defined in. " "(Contributed by Marcel Plch and Petr Viktorin in :issue:`38787`.)" msgstr ""